Skip to content

Instantly share code, notes, and snippets.

@bergutman
Created July 14, 2017 19:29
Show Gist options
  • Save bergutman/1c66c3a693187369e430147c2e2b6dcf to your computer and use it in GitHub Desktop.
Save bergutman/1c66c3a693187369e430147c2e2b6dcf to your computer and use it in GitHub Desktop.
contract Audits {
address owner;
mapping(address => uint) audits;
function Audits() {
owner = msg.sender;
}
function Approve(address addr) {
if (owner != msg.sender) throw;
audits[addr] = block.timestamp + 7 days;
}
function Revoke(address addr) {
if (owner != msg.sender) throw;
audits[addr] = 0;
}
function IsApproved(address addr) returns(bool) {
if (msg.value < 10) throw;
return block.timestamp < audits[addr];
}
function Withdraw() {
if (owner != msg.sender) throw;
owner.send(this.balance);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment