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

Commit

Permalink
Add script for disabling flywheel
Browse files Browse the repository at this point in the history
  • Loading branch information
antisaa committed Aug 19, 2024
1 parent c2920d3 commit 51a6d3a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tasks/chain-specific/base/disableFlywheel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { task } from "hardhat/config";
import { Address, formatEther, parseEther } from "viem";
import { COMPTROLLER } from ".";

task("market:base:disable-flywheel", "Deploys flywheel and adds rewards").setAction(
async (_, { viem, run, deployments, getNamedAccounts }) => {
const { deployer } = await getNamedAccounts();
const publicClient = await viem.getPublicClient();

const flywheel = await viem.getContractAt(
"IonicFlywheel",
(await deployments.get("IonicFlywheel_ION_v2")).address as Address
);

const comptroller = await viem.getContractAt("IonicComptroller", COMPTROLLER);
const addTx = await comptroller.write.addNonAccruingFlywheel([flywheel.address]);
await publicClient.waitForTransactionReceipt({ hash: addTx });
console.log({ addTx });
console.log("Remove IonicFlywheel_ION_v2 from comptroller");
}
);

0 comments on commit 51a6d3a

Please sign in to comment.