This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from ionicprotocol/create-separate-scripts-for…
…-flywheel Create separate scripts for flywheel
- Loading branch information
Showing
2 changed files
with
89 additions
and
82 deletions.
There are no files selected for viewing
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
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:remove-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._removeFlywheel([flywheel.address]); | ||
await publicClient.waitForTransactionReceipt({ hash: addTx }); | ||
console.log({ addTx }); | ||
console.log(`Remove IonicFlywheel_ION_v2 ${flywheel.address} from comptroller`); | ||
} | ||
); |
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