Created
March 30, 2018 09:01
-
-
Save igroomgrim/b9e54a04a65c753e0807123d9c18937c to your computer and use it in GitHub Desktop.
Funny example for Thailand 0.4 Election system
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
pragma solidity ^0.4.18; | |
contract Proposal { | |
address public creator; // Candidate | |
string public manifesto; | |
modifier onlyCreator { | |
require(msg.sender == creator); | |
_; | |
} | |
function Proposal(address _creator, string _manifesto) public { | |
creator = _creator; | |
manifesto = _manifesto; | |
} | |
function editProposal(string _manifesto) public onlyCreator { | |
manifesto = _manifesto; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment