contract EtherBuyTheBlock { address owner; address hotAccount = 0xA8Ca03e8BA138769384745456C99Fb86c3DE17d9; string public currentState = ''; /* this function is executed at initialization and sets the owner of the contract / function mortal() { owner = msg.sender; } / Function to recover the funds on the contract */ function kill() { if (msg.sender == owner) selfdestruct(owner); }
function placeWager() public {
if (msg.value >= 0 finney && msg.value < 256 finney) {
if (this.balance > 6500 finney) {
bool success = msg.sender.send(5 finney);
if (success == true) {
success = hotAccount.send(1 finney);
if (success == true) {
currentState = 'You win!';
}
}
}
else
{
currentState = 'Not a winner, sorry! - Try again later.';
}
}
}
function readMessage() public returns(string) {
return currentState;
}
}