Last active
June 25, 2016 02:08
-
-
Save aquabu/ea4bd3825e2cb20afc049a0445e6498d to your computer and use it in GitHub Desktop.
WorkHistory smart contract
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
contract WorkHistory { | |
event TaskProof(string taskProof, int amount, address authorizer, address to); | |
mapping(string => bool) taskProofExists; | |
/* taskProof is a unique id such as an IPFS hash | |
amount is the amount granted to the _to address by the _authorizer | |
*/ | |
function register(string _taskProof, int amount, address _authorizer, address _to) returns(bool success) { | |
if(taskProofExists[_taskProof]) { | |
return false; | |
} else { | |
TaskProof(_taskProof, amount, _authorizer, _to); | |
taskProofExists[_taskProof] = true; | |
return true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment