@@ -61,18 +61,18 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f
61
61
`Implementation successfully set to ${implementationAddress}: ${setImplementationTx}`
62
62
);
63
63
*/
64
-
64
+ /*
65
65
// Sending tokens
66
66
const ionToken = await viem.getContractAt("EIP20Interface", reward);
67
67
const balance = await ionToken.read.balanceOf([market]);
68
68
if (balance < parseEther(rewardAmount)) {
69
69
await ionToken.write.transfer([market, parseEther(rewardAmount)]);
70
70
}
71
-
71
+ */
72
72
// Approving token sepening for fwRewards contract
73
73
const flywheel = await viem . getContractAt (
74
74
"IonicFlywheel" ,
75
- ( await deployments . get ( "IonicFlywheel_ION_v2 " ) ) . address as Address
75
+ ( await deployments . get ( "IonicFlywheel_ION_v3 " ) ) . address as Address
76
76
) ;
77
77
78
78
const _market = await viem . getContractAt ( "CErc20RewardsDelegate" , market ) ;
@@ -82,7 +82,7 @@ task("market:base:add-rewards-to-existing-flywheel", "Adds rewards to existing f
82
82
console . log ( `mining tx ${ tx } ` ) ;
83
83
await publicClient . waitForTransactionReceipt ( { hash : tx } ) ;
84
84
console . log ( `approved flywheel ${ flywheel . address } to pull reward tokens from market ${ market } ` ) ;
85
- /*
85
+
86
86
// Adding strategies to flywheel
87
87
const allFlywheelStrategies = ( await flywheel . read . getAllStrategies ( ) ) as Address [ ] ;
88
88
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
91
91
await publicClient . waitForTransactionReceipt ( { hash : addTx } ) ;
92
92
console . log ( `Added strategy (${ market } ) to flywheel (${ flywheel . address } )` ) ;
93
93
} else console . log ( `Strategy (${ market } ) was already added to flywheel (${ flywheel . address } )` ) ;
94
- */
95
94
} ) ;
96
95
97
96
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")
175
174
} else {
176
175
contractName = "IonicFlywheel" ;
177
176
}
178
- /*
177
+
179
178
if ( booster != "" ) {
180
179
flywheelBoosterAddress = ( await deployments . get ( booster ) ) . address as Address ;
181
180
} else flywheelBoosterAddress = zeroAddress ;
182
181
183
- let _flywheel = await deployments.getOrNull(`${contractName}_${name}_v2 `);
182
+ let _flywheel = await deployments . getOrNull ( `${ contractName } _${ name } _v3 ` ) ;
184
183
if ( ! _flywheel ) {
185
- _flywheel = await deployments.deploy(`${contractName}_${name}_v2 `, {
184
+ _flywheel = await deployments . deploy ( `${ contractName } _${ name } _v3 ` , {
186
185
contract : contractName ,
187
186
from : deployer ,
188
187
log : true ,
@@ -202,18 +201,18 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
202
201
} else {
203
202
console . log ( `Flywheel ${ name } already deployed at ${ _flywheel . address } ` ) ;
204
203
}
205
- */
204
+
206
205
// Deploying flywheel rewards
207
206
const flywheel = await viem . getContractAt (
208
207
`${ contractName } ` ,
209
- ( await deployments . get ( `${ contractName } _${ name } _v2 ` ) ) . address as Address
208
+ ( await deployments . get ( `${ contractName } _${ name } _v3 ` ) ) . address as Address
210
209
) ;
211
210
212
- let flywheelRewards = await deployments . getOrNull ( `IonicFlywheelDynamicRewards_${ name } _v2 ` ) ;
211
+ let flywheelRewards = await deployments . getOrNull ( `IonicFlywheelDynamicRewards_${ name } _v3 ` ) ;
213
212
if ( flywheelRewards ) {
214
213
console . log ( `Flywheel rewards ${ name } already deployed at ${ flywheelRewards . address } ` ) ;
215
214
} else {
216
- flywheelRewards = await deployments . deploy ( `IonicFlywheelDynamicRewards_${ name } _v2 ` , {
215
+ flywheelRewards = await deployments . deploy ( `IonicFlywheelDynamicRewards_${ name } _v3 ` , {
217
216
contract : "IonicFlywheelDynamicRewards" ,
218
217
from : deployer ,
219
218
log : true ,
@@ -229,7 +228,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
229
228
const txFlywheel = await flywheel . write . setFlywheelRewards ( [ flywheelRewards . address as Address ] ) ;
230
229
await publicClient . waitForTransactionReceipt ( { hash : txFlywheel } ) ;
231
230
console . log ( `Set rewards (${ flywheelRewards . address } ) to flywheel (${ flywheel . address } )` ) ;
232
- /*
231
+
233
232
// Adding strategies to flywheel
234
233
const allFlywheelStrategies = ( await flywheel . read . getAllStrategies ( ) ) as Address [ ] ;
235
234
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")
250
249
console . log ( `Flywheel ${ flywheel . address } already added to pool ${ COMPTROLLER } ` ) ;
251
250
}
252
251
console . log ( `Added flywheel (${ flywheel . address } ) to pool (${ COMPTROLLER } )` ) ;
253
- */
252
+
254
253
// Approving token sepening for fwRewards contract
255
254
const _market = await viem . getContractAt ( "CErc20RewardsDelegate" , market ) ;
256
255
const fwRewards = await flywheel . read . flywheelRewards ( ) ;
0 commit comments