|
|
@ -3,13 +3,13 @@ pragma solidity 0.5.0; |
|
|
|
|
|
|
|
|
|
|
|
contract HashForEther { |
|
|
|
contract HashForEther { |
|
|
|
|
|
|
|
|
|
|
|
function withdrawWinnings() public { |
|
|
|
function withdrawWinnings() public payable { |
|
|
|
// Winner if the last 8 hex characters of the address are 0. |
|
|
|
// Winner if the last 8 hex characters of the address are 0. |
|
|
|
require(uint32(msg.sender) == 0); |
|
|
|
if (uint32(msg.sender) == 0) |
|
|
|
_sendWinnings(); |
|
|
|
_sendWinnings(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function _sendWinnings() public { |
|
|
|
function _sendWinnings() public { |
|
|
|
msg.sender.transfer(address(this).balance); |
|
|
|
msg.sender.transfer(address(this).balance); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|