From e648616241174cc458fedab270cb1b427fd30378 Mon Sep 17 00:00:00 2001 From: antisaa Date: Sun, 18 Aug 2024 12:45:06 +0200 Subject: [PATCH] Update script with new version of ION flywheel --- tasks/chain-specific/base/rewards.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/chain-specific/base/rewards.ts b/tasks/chain-specific/base/rewards.ts index 5d15ff5a..273100fb 100644 --- a/tasks/chain-specific/base/rewards.ts +++ b/tasks/chain-specific/base/rewards.ts @@ -72,7 +72,7 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f // Approving token sepening for fwRewards contract const flywheel = await viem.getContractAt( "IonicFlywheel", - (await deployments.get("IonicFlywheel_ION")).address as Address + (await deployments.get("IonicFlywheel_ION_v2")).address as Address ); const _market = await viem.getContractAt("CErc20RewardsDelegate", market); @@ -179,9 +179,9 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market") flywheelBoosterAddress = (await deployments.get(booster)).address as Address; } else flywheelBoosterAddress = zeroAddress; - let _flywheel = await deployments.getOrNull(`${contractName}_${name}`); + let _flywheel = await deployments.getOrNull(`${contractName}_${name}_v2`); if (!_flywheel) { - _flywheel = await deployments.deploy(`${contractName}_${name}`, { + _flywheel = await deployments.deploy(`${contractName}_${name}_v2`, { contract: contractName, from: deployer, log: true, @@ -205,7 +205,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market") // Deploying flywheel rewards const flywheel = await viem.getContractAt( `${contractName}`, - (await deployments.get(`${contractName}_${name}`)).address as Address + (await deployments.get(`${contractName}_${name}_v2`)).address as Address ); let flywheelRewards = await deployments.getOrNull(`IonicFlywheelDynamicRewards_${name}`); @@ -264,7 +264,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market") task("market:base:add-flywheel-ION-rewards-to-ionbsdETH", "Adds rewards to existing flywheel").setAction( async (_, { viem, run, deployments, getNamedAccounts }) => { const market = "0x3d9669de9e3e98db41a1cbf6dc23446109945e3c"; // ionbsdETH - const rewardAmount = "1666"; // epoch will start 2 days so 25000 / 30 * 2 + const rewardAmount = "23334"; // epoch will start 2 days so 25000 / 30 * 2 const ion = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5"; await run("market:base:add-rewards-to-existing-flywheel", { market, @@ -277,7 +277,7 @@ task("market:base:add-flywheel-ION-rewards-to-ionbsdETH", "Adds rewards to exist task("market:base:deploy-flywheel-and-add-ION-rewards-to-ionhyUSD", "Deploys flywheel and adds rewards").setAction( async (_, { viem, run, deployments, getNamedAccounts }) => { const market = "0x751911bDa88eFcF412326ABE649B7A3b28c4dEDe"; // ionhyUSD - const rewardAmount = "1000"; // epoch will start 2 days so 15000 / 30 * 2 + const rewardAmount = "14000"; // epoch will start 2 days so 15000 / 30 * 2 const ion = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5"; const name = "ION"; // For borrow flywheel use Borrow_ION for supply flywheel just ION // NOTE: Make sure that epoch duration for supply and borrow are not the same