Created
April 29, 2017 06:12
-
-
Save danielyaa5/9c372a1b7dd9b542ba6c23f87d7475b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint private accept_payment; | |
function accept(string buyer_email) external payable { | |
accept_payment = msg.value; | |
buyer = msg.sender; | |
buyer_contact_information = buyer_email; | |
_setConversionRate(); | |
_changeState(ContractStates.Accepting); | |
} | |
function cancelAccept() external onlyBuyer { | |
_cancelAccept(); | |
} | |
function _cancelAccept() private { | |
asyncSend(buyer, accept_payment); | |
accept_payment = 0; | |
buyer = address(0); | |
buyer_contact_information = ''; | |
_changeState(ContractStates.Offered); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment