Last active
March 30, 2018 09:02
-
-
Save igroomgrim/ba780bacdcedfe9a2051906dc721a0bb to your computer and use it in GitHub Desktop.
Funny example for Thailand 0.4 Election system
This file contains hidden or 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; | |
import './Thailand.sol'; | |
contract ThailandMilitaryPower is Thailand { | |
uint256 public curfewStartTime; | |
uint256 public curfewEndTime; | |
// Modifier | |
modifier whoHasATank() { | |
require(msg.sender == commanderInChief); | |
_; | |
} | |
function declareCoup() public whoHasATank { | |
_transformToPrimeMinister(commanderInChief); | |
address _goverment = this; | |
commanderInChief.transfer(_goverment.balance); | |
// In the real world case, it should be call selfdestruct :p | |
// suicide(commanderInChief); | |
} | |
function imposeCurfew(uint256 _startTime, uint256 _endTime) public whoHasATank { | |
curfewStartTime = _startTime; | |
curfewEndTime = _endTime; | |
} | |
function arrest(address _victim) public whoHasATank { | |
prisoners[_victim] = true; | |
} | |
function _transformToPrimeMinister(address _theChoosenOne) internal { | |
primeMinister = _theChoosenOne; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment