SuitcaseDropOff

FINANCIALUTILITYDOCUMENTS

Contract purpose

This Smart Contract manages a designated space for luggage storage. Such spaces exist inside airports, train and bus stations etc. Depending on the category a suitcase belongs to, the owner has to pay a deposit when he drops off the luggage. He will receive this deposit back when he takes the suitcase and pays for the storage time. Suitcase categories are defined by the system manager.

Exposed methods and variables

manager the ethereum address of system manager, given as parameter at contract creation

catList returns the details about a particular category (the index of each category will be logged using an event)

suitcaseList returns the details about a particular suitcase (the index of each suitcase will be logged using an eve

addCategory function called by the manager when he wants to add a new category to the list and emits the CategoryAdded event

parameter nametypedetails
maxLengthintegerthe maximum length of a suitcase to fit in this category
maxWidthintegerthe maximum width of a suitcase to fit in this category
maxHeightintegerthe maximum height of a suitcase to fit in this category
_ppHourintegerthe price for an hour of storage
_ppDayintegerthe price for a day of storage
_depositintegerthe amount the client need to pay at drop off

checkinSuitcase called by a client who wants to drop off a suitcase. He needs to send to the contract a sum equal to the deposit set by the manager for the category of the client's suitcase. It emits SuitcaseStored event.

parameter nametypedetails
categoryIDintegerunique identifier of the category

checkoutSuitcase called by a client who wants to take back his suitcase. He needs to send to the contract the price calculated for the amount of time the suitcase was stored. The time is assumed to be determined outside of the contract.

parameter nametypedetails
suitcaseIDintegerunique identifier of the suitcase

transferMoney allows the owner to transfer money from the contract's balance to his own account

parameter nametypedetails
amountintegerthe sum the manager wants to transfer

getBalance returns the balance of the contract when called by the manager

Events

CategoryAdded

parameter nametypedetails
catIDintegerthe unique identifier of the added category

SuitcaseStored

parameter nametypedetails
suitcaseIDintegerthe unique identifier of the stored suitcase
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract