Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 19312c1

Browse files
committed
Add script for removing flywheel
1 parent 1062af4 commit 19312c1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { task } from "hardhat/config";
2+
import { Address, formatEther, parseEther } from "viem";
3+
import { COMPTROLLER } from ".";
4+
5+
task("market:base:remove-flywheel", "Deploys flywheel and adds rewards").setAction(
6+
async (_, { viem, run, deployments, getNamedAccounts }) => {
7+
const { deployer } = await getNamedAccounts();
8+
const publicClient = await viem.getPublicClient();
9+
10+
const flywheel = await viem.getContractAt(
11+
"IonicFlywheel",
12+
(await deployments.get("IonicFlywheel_ION_v2")).address as Address
13+
);
14+
15+
const comptroller = await viem.getContractAt("IonicComptroller", COMPTROLLER);
16+
const addTx = await comptroller.write._removeFlywheel([flywheel.address]);
17+
await publicClient.waitForTransactionReceipt({ hash: addTx });
18+
console.log({ addTx });
19+
console.log(`Remove IonicFlywheel_ION_v2 ${flywheel.address} from comptroller`);
20+
}
21+
);

0 commit comments

Comments
 (0)