@@ -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 " ) ) . 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 ( ) ) ) {
@@ -156,14 +156,14 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
156
156
`Implementation successfully set to ${implementationAddress}: ${setImplementationTx}`
157
157
);
158
158
*/
159
-
159
+ /*
160
160
// Sending tokens
161
161
const ionToken = await viem.getContractAt("EIP20Interface", reward);
162
162
const balance = await ionToken.read.balanceOf([market]);
163
163
if (balance < parseEther(rewardAmount)) {
164
164
await ionToken.write.transfer([market, parseEther(rewardAmount)]);
165
165
}
166
-
166
+ */
167
167
// Deploying flywheel
168
168
let booster = "" ;
169
169
let flywheelBoosterAddress ;
@@ -174,14 +174,14 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
174
174
} else {
175
175
contractName = "IonicFlywheel" ;
176
176
}
177
-
177
+
178
178
if ( booster != "" ) {
179
179
flywheelBoosterAddress = ( await deployments . get ( booster ) ) . address as Address ;
180
180
} else flywheelBoosterAddress = zeroAddress ;
181
181
182
- let _flywheel = await deployments . getOrNull ( `${ contractName } _${ name } ` ) ;
182
+ let _flywheel = await deployments . getOrNull ( `${ contractName } _${ name } _v3 ` ) ;
183
183
if ( ! _flywheel ) {
184
- _flywheel = await deployments . deploy ( `${ contractName } _${ name } ` , {
184
+ _flywheel = await deployments . deploy ( `${ contractName } _${ name } _v3 ` , {
185
185
contract : contractName ,
186
186
from : deployer ,
187
187
log : true ,
@@ -201,18 +201,18 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
201
201
} else {
202
202
console . log ( `Flywheel ${ name } already deployed at ${ _flywheel . address } ` ) ;
203
203
}
204
-
204
+
205
205
// Deploying flywheel rewards
206
206
const flywheel = await viem . getContractAt (
207
207
`${ contractName } ` ,
208
- ( await deployments . get ( `${ contractName } _${ name } ` ) ) . address as Address
208
+ ( await deployments . get ( `${ contractName } _${ name } _v3 ` ) ) . address as Address
209
209
) ;
210
210
211
- let flywheelRewards = await deployments . getOrNull ( `IonicFlywheelDynamicRewards_${ name } ` ) ;
211
+ let flywheelRewards = await deployments . getOrNull ( `IonicFlywheelDynamicRewards_${ name } _v3 ` ) ;
212
212
if ( flywheelRewards ) {
213
213
console . log ( `Flywheel rewards ${ name } already deployed at ${ flywheelRewards . address } ` ) ;
214
214
} else {
215
- flywheelRewards = await deployments . deploy ( `IonicFlywheelDynamicRewards_${ name } ` , {
215
+ flywheelRewards = await deployments . deploy ( `IonicFlywheelDynamicRewards_${ name } _v3 ` , {
216
216
contract : "IonicFlywheelDynamicRewards" ,
217
217
from : deployer ,
218
218
log : true ,
@@ -228,7 +228,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
228
228
const txFlywheel = await flywheel . write . setFlywheelRewards ( [ flywheelRewards . address as Address ] ) ;
229
229
await publicClient . waitForTransactionReceipt ( { hash : txFlywheel } ) ;
230
230
console . log ( `Set rewards (${ flywheelRewards . address } ) to flywheel (${ flywheel . address } )` ) ;
231
-
231
+
232
232
// Adding strategies to flywheel
233
233
const allFlywheelStrategies = ( await flywheel . read . getAllStrategies ( ) ) as Address [ ] ;
234
234
if ( ! allFlywheelStrategies . map ( ( s ) => s . toLowerCase ( ) ) . includes ( market . toLowerCase ( ) ) ) {
@@ -249,7 +249,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
249
249
console . log ( `Flywheel ${ flywheel . address } already added to pool ${ COMPTROLLER } ` ) ;
250
250
}
251
251
console . log ( `Added flywheel (${ flywheel . address } ) to pool (${ COMPTROLLER } )` ) ;
252
-
252
+
253
253
// Approving token sepening for fwRewards contract
254
254
const _market = await viem . getContractAt ( "CErc20RewardsDelegate" , market ) ;
255
255
const fwRewards = await flywheel . read . flywheelRewards ( ) ;
@@ -264,7 +264,7 @@ task("market:base:deploy-flywheel-and-add-rewards", "Sets caps on a market")
264
264
task ( "market:base:add-flywheel-ION-rewards-to-ionbsdETH" , "Adds rewards to existing flywheel" ) . setAction (
265
265
async ( _ , { viem, run, deployments, getNamedAccounts } ) => {
266
266
const market = "0x3d9669de9e3e98db41a1cbf6dc23446109945e3c" ; // ionbsdETH
267
- const rewardAmount = "1666 " ; // epoch will start 2 days so 25000 / 30 * 2
267
+ const rewardAmount = "23334 " ; // epoch will start 2 days so 25000 / 30 * 2
268
268
const ion = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5" ;
269
269
await run ( "market:base:add-rewards-to-existing-flywheel" , {
270
270
market,
@@ -277,7 +277,7 @@ task("market:base:add-flywheel-ION-rewards-to-ionbsdETH", "Adds rewards to exist
277
277
task ( "market:base:deploy-flywheel-and-add-ION-rewards-to-ionhyUSD" , "Deploys flywheel and adds rewards" ) . setAction (
278
278
async ( _ , { viem, run, deployments, getNamedAccounts } ) => {
279
279
const market = "0x751911bDa88eFcF412326ABE649B7A3b28c4dEDe" ; // ionhyUSD
280
- const rewardAmount = "1000 " ; // epoch will start 2 days so 15000 / 30 * 2
280
+ const rewardAmount = "14000 " ; // epoch will start 2 days so 15000 / 30 * 2
281
281
const ion = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5" ;
282
282
const name = "ION" ; // For borrow flywheel use Borrow_ION for supply flywheel just ION
283
283
// NOTE: Make sure that epoch duration for supply and borrow are not the same
0 commit comments