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

Commit c2920d3

Browse files
committed
Update script
1 parent a1f5e2f commit c2920d3

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tasks/chain-specific/base/rewards.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f
6161
`Implementation successfully set to ${implementationAddress}: ${setImplementationTx}`
6262
);
6363
*/
64-
64+
/*
6565
// Sending tokens
6666
const ionToken = await viem.getContractAt("EIP20Interface", reward);
6767
const balance = await ionToken.read.balanceOf([market]);
6868
if (balance < parseEther(rewardAmount)) {
6969
await ionToken.write.transfer([market, parseEther(rewardAmount)]);
7070
}
71-
71+
*/
7272
// Approving token sepening for fwRewards contract
7373
const flywheel = await viem.getContractAt(
7474
"IonicFlywheel",
75-
(await deployments.get("IonicFlywheel_ION_v2")).address as Address
75+
(await deployments.get("IonicFlywheel_ION_v3")).address as Address
7676
);
7777

7878
const _market = await viem.getContractAt("CErc20RewardsDelegate", market);
@@ -82,7 +82,7 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f
8282
console.log(`mining tx ${tx}`);
8383
await publicClient.waitForTransactionReceipt({ hash: tx });
8484
console.log(`approved flywheel ${flywheel.address} to pull reward tokens from market ${market}`);
85-
/*
85+
8686
// Adding strategies to flywheel
8787
const allFlywheelStrategies = (await flywheel.read.getAllStrategies()) as Address[];
8888
if (!allFlywheelStrategies.map((s) => s.toLowerCase()).includes(market.toLowerCase())) {
@@ -91,7 +91,6 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f
9191
await publicClient.waitForTransactionReceipt({ hash: addTx });
9292
console.log(`Added strategy (${market}) to flywheel (${flywheel.address})`);
9393
} else console.log(`Strategy (${market}) was already added to flywheel (${flywheel.address})`);
94-
*/
9594
});
9695

9796
task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
@@ -175,14 +174,14 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
175174
} else {
176175
contractName = "IonicFlywheel";
177176
}
178-
/*
177+
179178
if (booster != "") {
180179
flywheelBoosterAddress = (await deployments.get(booster)).address as Address;
181180
} else flywheelBoosterAddress = zeroAddress;
182181

183-
let _flywheel = await deployments.getOrNull(`${contractName}_${name}_v2`);
182+
let _flywheel = await deployments.getOrNull(`${contractName}_${name}_v3`);
184183
if (!_flywheel) {
185-
_flywheel = await deployments.deploy(`${contractName}_${name}_v2`, {
184+
_flywheel = await deployments.deploy(`${contractName}_${name}_v3`, {
186185
contract: contractName,
187186
from: deployer,
188187
log: true,
@@ -202,18 +201,18 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
202201
} else {
203202
console.log(`Flywheel ${name} already deployed at ${_flywheel.address}`);
204203
}
205-
*/
204+
206205
// Deploying flywheel rewards
207206
const flywheel = await viem.getContractAt(
208207
`${contractName}`,
209-
(await deployments.get(`${contractName}_${name}_v2`)).address as Address
208+
(await deployments.get(`${contractName}_${name}_v3`)).address as Address
210209
);
211210

212-
let flywheelRewards = await deployments.getOrNull(`IonicFlywheelDynamicRewards_${name}_v2`);
211+
let flywheelRewards = await deployments.getOrNull(`IonicFlywheelDynamicRewards_${name}_v3`);
213212
if (flywheelRewards) {
214213
console.log(`Flywheel rewards ${name} already deployed at ${flywheelRewards.address}`);
215214
} else {
216-
flywheelRewards = await deployments.deploy(`IonicFlywheelDynamicRewards_${name}_v2`, {
215+
flywheelRewards = await deployments.deploy(`IonicFlywheelDynamicRewards_${name}_v3`, {
217216
contract: "IonicFlywheelDynamicRewards",
218217
from: deployer,
219218
log: true,
@@ -229,7 +228,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
229228
const txFlywheel = await flywheel.write.setFlywheelRewards([flywheelRewards.address as Address]);
230229
await publicClient.waitForTransactionReceipt({ hash: txFlywheel });
231230
console.log(`Set rewards (${flywheelRewards.address}) to flywheel (${flywheel.address})`);
232-
/*
231+
233232
// Adding strategies to flywheel
234233
const allFlywheelStrategies = (await flywheel.read.getAllStrategies()) as Address[];
235234
if (!allFlywheelStrategies.map((s) => s.toLowerCase()).includes(market.toLowerCase())) {
@@ -250,7 +249,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
250249
console.log(`Flywheel ${flywheel.address} already added to pool ${COMPTROLLER}`);
251250
}
252251
console.log(`Added flywheel (${flywheel.address}) to pool (${COMPTROLLER})`);
253-
*/
252+
254253
// Approving token sepening for fwRewards contract
255254
const _market = await viem.getContractAt("CErc20RewardsDelegate", market);
256255
const fwRewards = await flywheel.read.flywheelRewards();

0 commit comments

Comments
 (0)