remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/remix-analyzer/test/analysis/test-contracts/solidity-v0.5/KingOfTheEtherThrone.sol

23 lines
594 B

// return value send
contract KingOfTheEtherThrone{
struct Monarch {
// address of the king .
address payable ethAddr ;
string name ;
// how much he pays to previous king
uint claimPrice ;
uint coronationTimestamp;
}
Monarch public currentMonarch ;
function claimThrone ( string memory name ) public {
address wizardAddress;
uint compensation = 100;
uint valuePaid = 10;
if ( currentMonarch.ethAddr != wizardAddress )
if (currentMonarch.ethAddr.send( compensation )) revert();
currentMonarch = Monarch(msg.sender,name,valuePaid,block.timestamp);
}
}