Skip to content

Instantly share code, notes, and snippets.

@VoR0220
Created June 12, 2016 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VoR0220/240fd3aa7e94a565633e87c91ee40377 to your computer and use it in GitHub Desktop.
Save VoR0220/240fd3aa7e94a565633e87c91ee40377 to your computer and use it in GitHub Desktop.
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