November 2018
Intermediate to advanced
528 pages
13h 21m
English
Wouldn't it be logical to enable the auction owner to cancel the auction?
Such a function should be executed exclusively by the auction owner, while the auction is still open; thus, we use the modifiers only_owner and an_ongoing_auction:
function cancel_auction() only_owner an_ongoing_auction returns (bool) { STATE = auction_state.CANCELLED; CanceledEvent("Auction Cancelled", now); return true;}
This function will change the state of the auction status to Cancelled, using the enum value auction_state.CANCELLED we defined earlier, and the event CanceledEvent will be fired announcing the auction cancellation.
Read now
Unlock full access