diff --git a/tasks/chain-specific/base/disableFlywheel.ts b/tasks/chain-specific/base/disableFlywheel.ts new file mode 100644 index 00000000..c1142f46 --- /dev/null +++ b/tasks/chain-specific/base/disableFlywheel.ts @@ -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"); + } +);