@@ -34,11 +34,13 @@ task("market:base:rsr-ion-rewards", "Sets caps on a market").setAction(
34
34
const bsdETH = "0xCb327b99fF831bF8223cCEd12B1338FF3aA322Ff" ;
35
35
const ioneUSD = "0x9c2a4f9c5471fd36be3bbd8437a33935107215a1" ;
36
36
const eUSD = "0xCfA3Ef56d303AE4fAabA0592388F19d7C3399FB4" ;
37
+ const hyUSD = "0xCc7FF230365bD730eE4B352cC2492CEdAC49383e"
38
+ const ionhyUSD = "0x751911bDa88eFcF412326ABE649B7A3b28c4dEDe"
37
39
const IONIC = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5" ;
38
40
const RSR = "0xab36452dbac151be02b16ca17d8919826072f64a" ;
39
41
const pool = "0x05c9C6417F246600f8f5f49fcA9Ee991bfF73D13" ;
40
42
const comptroller = "0x05c9C6417F246600f8f5f49fcA9Ee991bfF73D13" ;
41
- const markets = `${ ionbsdETH } , ${ ioneUSD } ` ;
43
+ const markets = `${ ionhyUSD } ` ;
42
44
43
45
/*
44
46
const comptrollerContract = await viem.getContractAt("IonicComptroller", comptroller as Address);
@@ -56,15 +58,15 @@ task("market:base:rsr-ion-rewards", "Sets caps on a market").setAction(
56
58
// await publicClient.waitForTransactionReceipt({ hash: tx });
57
59
58
60
// STEP 1: upgrade markets to the new implementation
59
- /*
60
- console.log(`Upgrading market: ${ionbsdETH } to CErc20RewardsDelegate`);
61
+
62
+ console . log ( `Upgrading market: ${ ionhyUSD } to CErc20RewardsDelegate` ) ;
61
63
await run ( "market:upgrade" , {
62
64
comptroller,
63
- underlying: bsdETH ,
65
+ underlying : hyUSD ,
64
66
implementationAddress : ( await deployments . get ( "CErc20RewardsDelegate" ) ) . address ,
65
67
signer : deployer
66
68
} ) ;
67
-
69
+ /*
68
70
console.log(`Upgrading market: ${ioneUSD} to CErc20RewardsDelegate`);
69
71
await run("market:upgrade", {
70
72
comptroller,
@@ -76,10 +78,11 @@ task("market:base:rsr-ion-rewards", "Sets caps on a market").setAction(
76
78
*/
77
79
// STEP 2: send reward tokens to strategies
78
80
const rsrToken = await viem . getContractAt ( "EIP20Interface" , RSR ) ;
79
- const balance = await rsrToken . read . balanceOf ( [ ionbsdETH ] ) ;
80
- if ( balance < parseEther ( "127863.019791 " ) ) {
81
- await rsrToken . write . transfer ( [ ionbsdETH , parseEther ( "127863.019791 " ) ] ) ;
81
+ const balance = await rsrToken . read . balanceOf ( [ ionhyUSD ] ) ;
82
+ if ( balance < parseEther ( "45000 " ) ) {
83
+ await rsrToken . write . transfer ( [ ionhyUSD , parseEther ( "45000 " ) ] ) ;
82
84
}
85
+ /*
83
86
const balanceUSD = await rsrToken.read.balanceOf([ioneUSD]);
84
87
if (balanceUSD < parseEther("138981.543251")) {
85
88
await rsrToken.write.transfer([ioneUSD, parseEther("138981.543251")]);
@@ -93,18 +96,29 @@ task("market:base:rsr-ion-rewards", "Sets caps on a market").setAction(
93
96
strategies: markets,
94
97
pool
95
98
});
96
-
99
+ */
97
100
const flywheel = await viem . getContractAt (
98
101
"IonicFlywheelBorrow" ,
99
- ( await deployments . get ( "IonicFlywheelBorrow_Borrow_RSR " ) ) . address as Address
102
+ ( await deployments . get ( "IonicFlywheel_RSR " ) ) . address as Address
100
103
) ;
101
104
await run ( "approve-market-flywheel" , {
102
105
fwAddress : flywheel . address ,
103
106
markets : markets
104
107
} ) ;
105
108
106
- const tx = await flywheel . write . updateFeeSettings ( [ 0n , deployer as Address ] ) ;
107
- await publicClient . waitForTransactionReceipt ( { hash : tx } ) ;
109
+ const strategyAddresses = markets . split ( "," ) ;
110
+ const allFlywheelStrategies = ( await flywheel . read . getAllStrategies ( ) ) as Address [ ] ;
111
+ for ( const strategy of strategyAddresses ) {
112
+ if ( ! allFlywheelStrategies . map ( ( s ) => s . toLowerCase ( ) ) . includes ( strategy . toLowerCase ( ) ) ) {
113
+ console . log ( `Adding strategy ${ strategy } to flywheel ${ flywheel . address } ` ) ;
114
+ const addTx = await flywheel . write . addStrategyForRewards ( [ strategy ] ) ;
115
+ await publicClient . waitForTransactionReceipt ( { hash : addTx } ) ;
116
+ console . log ( `Added strategy (${ strategy } ) to flywheel (${ flywheel . address } )` ) ;
117
+ } else console . log ( `Strategy (${ strategy } ) was already added to flywheel (${ flywheel . address } )` ) ;
118
+ }
119
+
120
+ //const tx = await flywheel.write.updateFeeSettings([0n, deployer as Address]);
121
+ //await publicClient.waitForTransactionReceipt({ hash: tx });
108
122
109
123
/*
110
124
await run("flywheel:deploy-borrow-booster", { name: "ION" });
0 commit comments