Skip to content

Instantly share code, notes, and snippets.

@igroomgrim
Last active March 30, 2018 08:58
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 igroomgrim/b9552c0677fc4f659a7b7eacb8f06d69 to your computer and use it in GitHub Desktop.
Save igroomgrim/b9552c0677fc4f659a7b7eacb8f06d69 to your computer and use it in GitHub Desktop.
Funny example for Thailand 0.4 Election system
pragma solidity ^0.4.18;
import "zeppelin-solidity/contracts/math/SafeMath.sol";
contract Thailand {
using SafeMath for uint256;
address public owner;
address public primeMinister;
address public commanderInChief;
address public chairperson;
mapping (address => bool) public prisoners;
// Modifier
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Thailand() public {
owner = msg.sender;
}
function nominatePrimeMinister(address _someOneElse) public onlyOwner {
primeMinister = _someOneElse;
}
function nominateCommanderInChief(address _militaryMan) public onlyOwner {
commanderInChief = _militaryMan;
}
function nominateChairperson(address _lazyBoy) public onlyOwner {
chairperson = _lazyBoy;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment