Created
June 12, 2016 23:48
-
-
Save VoR0220/240fd3aa7e94a565633e87c91ee40377 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
contract C { | |
address person1; | |
address person2; | |
bool person1Agreement = false; | |
bool person2Agreement = false; | |
function doWeAgree() constant returns (bool) { | |
if (person1Agreement == true && person2Agreement == true) | |
return true; | |
else | |
return false; | |
} | |
event agreement(bool, bool); | |
modifier person1Mod { | |
if (msg.sender != person1) | |
throw; | |
else | |
_ | |
} | |
modifier person2Mod { | |
if (msg.sender != person2) | |
throw; | |
else | |
_ | |
} | |
function person1Agrees(bool agree) person1Mod { | |
agreement(agree, person2Agreement); | |
} | |
function person2Agrees(bool agree) person2Mod { | |
agreement(person1Agreement, agree); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment