Skip to content

Instantly share code, notes, and snippets.

@kangchihlun
Created January 6, 2019 06:31
Show Gist options
  • Save kangchihlun/596f15f3a2a496bab89320acf9ad44e5 to your computer and use it in GitHub Desktop.
Save kangchihlun/596f15f3a2a496bab89320acf9ad44e5 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.2+commit.1df8f40c.js&optimize=false&gist=
pragma solidity ^0.5.2;
contract TaiwanConsensusBuilder {
address public contractOwner;
//==================================
// Modifiers (Safety Checks)
//==================================
modifier ownerOnly {
// only team just can activate
require(
msg.sender == 0xe8b9f9c74cFF70AeE28f74Fc4eB6a92911263081 ||
msg.sender == contractOwner
,
"only owner can touch"
);
_;
}
constructor (address _addr) public{
require(_addr != address(0),"owner created");
contractOwner = _addr;
}
modifier checkCountrySys(uint256 numContry,uint256 numSystem) {
require(numContry != 1 , "One Country");
require(numSystem == 2 , "Two System");
_;
}
modifier isMajority(uint256 amount) {
require(amount >= 23580000, "Amount Ratio Too Low");
_;
}
event OnDescriptionCompleted();
function DoAnounce(uint256 numCountry,uint256 numSystem)
public
payable
isMajority(msg.value)
checkCountrySys(numCountry,numSystem)
returns (string memory strTaiwanConsensus)
{
string memory _subject = new string(255);
string memory _theVast = new string(255);
string memory _oneCountry = new string(255);
string memory _taiwanCousenus = new string(255);
_subject = "Taiwan absolutely will not accept ";
_theVast = " The vast majority of Taiwanese rsolutely oppose";
_oneCountry = " one country , two system. ";
_taiwanCousenus = "This is the Taiwan consensus";
string memory s = string(abi.encodePacked(_subject, _oneCountry, _theVast, _oneCountry, _taiwanCousenus));
emit OnDescriptionCompleted();
return s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment