@@ -14,130 +14,117 @@ import { Addresses, AddressesHolesky } from "../utils/Addresses.sol";
14
14
uint256 constant maxDeposits = 100_000 ether ;
15
15
16
16
library AddAssetsLib {
17
- // function getConfig() internal view returns (LRTConfig) {
18
- // address configAddress = block.chainid == 1 ? Addresses.LRT_CONFIG : AddressesHolesky.LRT_CONFIG;
19
- // return LRTConfig(configAddress);
20
- // }
21
-
22
- // function getOracle() internal view returns (LRTOracle) {
23
- // address oracleAddress = block.chainid == 1 ? Addresses.LRT_ORACLE : AddressesHolesky.LRT_ORACLE;
24
- // return LRTOracle(oracleAddress);
25
- // }
26
-
27
- // function addWETHAdmin(address wethOracleProxy) internal {
28
- // LRTConfig lrtConfig = getConfig();
29
- // lrtConfig.setToken(LRTConstants.WETH_TOKEN, Addresses.WETH_TOKEN);
30
-
31
- // LRTOracle lrtOracle = getOracle();
32
- // lrtOracle.updatePriceOracleFor(Addresses.WETH_TOKEN, wethOracleProxy);
33
- // }
34
-
35
- // function addWETHManager() internal {
36
- // LRTConfig lrtConfig = getConfig();
37
- // lrtConfig.addNewSupportedAsset(Addresses.WETH_TOKEN, maxDeposits);
38
- // }
39
-
40
- // function addOETH() internal {
41
- // configureAsset(
42
- // LRTConstants.OETH_TOKEN, Addresses.OETH_TOKEN, Addresses.OETH_EIGEN_STRATEGY, Addresses.OETH_ORACLE_PROXY
43
- // );
44
-
45
- // console.log("Configured OETH");
46
- // }
47
-
48
- // function addSfrxETH() internal {
49
- // configureAsset(
50
- // LRTConstants.SFRXETH_TOKEN,
51
- // Addresses.SFRXETH_TOKEN,
52
- // Addresses.SFRXETH_EIGEN_STRATEGY,
53
- // Addresses.SFRXETH_ORACLE_PROXY
54
- // );
55
-
56
- // console.log("Configured sfrxETH");
57
- // }
58
-
59
- // function addMEth() internal {
60
- // configureAsset(
61
- // LRTConstants.M_ETH_TOKEN, Addresses.METH_TOKEN, Addresses.METH_EIGEN_STRATEGY,
62
- // Addresses.METH_ORACLE_PROXY
63
- // );
64
-
65
- // console.log("Configured mETH");
66
- // }
67
-
68
- // function addStETH() internal {
69
- // // NOTE: stETH is already supported so just need to add Oracle
70
- // ChainlinkPriceOracle chainlinkOracleProxy = ChainlinkPriceOracle(Addresses.CHAINLINK_ORACLE_PROXY);
71
- // chainlinkOracleProxy.updatePriceFeedFor(Addresses.STETH_TOKEN, Addresses.STETH_ORACLE);
72
-
73
- // LRTOracle lrtOracle = getOracle();
74
- // lrtOracle.updatePriceOracleFor(Addresses.STETH_TOKEN, address(chainlinkOracleProxy));
75
-
76
- // console.log("Configured stETH");
77
- // }
78
-
79
- // function addRETH() internal {
80
- // addAssetWithChainlinkOracle(
81
- // LRTConstants.R_ETH_TOKEN, Addresses.RETH_TOKEN, Addresses.RETH_EIGEN_STRATEGY, Addresses.RETH_ORACLE
82
- // );
83
-
84
- // console.log("Configured RETH");
85
- // }
86
-
87
- // function addSwETH() internal {
88
- // addAssetWithChainlinkOracle(
89
- // LRTConstants.SWETH_TOKEN, Addresses.SWETH_TOKEN, Addresses.SWETH_EIGEN_STRATEGY, Addresses.SWETH_ORACLE
90
- // );
91
-
92
- // console.log("Configured swETH");
93
- // }
94
-
95
- // function addETHx() internal {
96
- // LRTOracle lrtOracle = getOracle();
97
- // // NOTE: ETHx is already supported so just need to add Oracle
98
- // lrtOracle.updatePriceOracleFor(Addresses.ETHX_TOKEN, Addresses.ETHX_ORACLE_PROXY);
99
-
100
- // console.log("Configured ETHx");
101
- // }
102
-
103
- // function addAssetWithChainlinkOracle(
104
- // bytes32 tokenId,
105
- // address asset,
106
- // address strategy,
107
- // address assetOracle
108
- // )
109
- // internal
110
- // {
111
- // LRTConfig lrtConfig = getConfig();
112
- // LRTOracle lrtOracle = getOracle();
113
-
114
- // ChainlinkPriceOracle chainlinkOracleProxy = ChainlinkPriceOracle(Addresses.CHAINLINK_ORACLE_PROXY);
115
-
116
- // lrtConfig.setToken(tokenId, asset);
117
-
118
- // lrtConfig.addNewSupportedAsset(asset, maxDeposits);
119
-
120
- // chainlinkOracleProxy.updatePriceFeedFor(asset, assetOracle);
121
- // lrtConfig.updateAssetStrategy(asset, strategy);
122
-
123
- // lrtOracle.updatePriceOracleFor(asset, address(chainlinkOracleProxy));
124
-
125
- // // TODO this needs to handle multiple Node Delegators
126
- // NodeDelegator(payable(Addresses.NODE_DELEGATOR)).maxApproveToEigenStrategyManager(asset);
127
- // }
128
-
129
- // function configureAsset(bytes32 tokenId, address asset, address strategy, address assetOracle) internal {
130
- // LRTConfig lrtConfig = getConfig();
131
- // LRTOracle lrtOracle = getOracle();
132
-
133
- // lrtConfig.setToken(tokenId, asset);
134
-
135
- // lrtConfig.addNewSupportedAsset(asset, maxDeposits);
136
- // lrtConfig.updateAssetStrategy(asset, strategy);
137
-
138
- // lrtOracle.updatePriceOracleFor(asset, assetOracle);
139
-
140
- // // TODO this needs to handle multiple Node Delegators
141
- // NodeDelegator(payable(Addresses.NODE_DELEGATOR)).maxApproveToEigenStrategyManager(asset);
142
- // }
17
+ function getConfig () internal view returns (LRTConfig) {
18
+ address configAddress = block .chainid == 1 ? Addresses.LRT_CONFIG : AddressesHolesky.LRT_CONFIG;
19
+ return LRTConfig (configAddress);
20
+ }
21
+
22
+ function getOracle () internal view returns (LRTOracle) {
23
+ address oracleAddress = block .chainid == 1 ? Addresses.LRT_ORACLE : AddressesHolesky.LRT_ORACLE;
24
+ return LRTOracle (oracleAddress);
25
+ }
26
+
27
+ // function addWETHAdmin(address wethOracleProxy) internal {
28
+ // LRTConfig lrtConfig = getConfig();
29
+ // lrtConfig.setToken(LRTConstants.WETH_TOKEN, Addresses.WETH_TOKEN);
30
+
31
+ // LRTOracle lrtOracle = getOracle();
32
+ // lrtOracle.updatePriceOracleFor(Addresses.WETH_TOKEN, wethOracleProxy);
33
+ // }
34
+
35
+ // function addWETHManager() internal {
36
+ // LRTConfig lrtConfig = getConfig();
37
+ // lrtConfig.addNewSupportedAsset(Addresses.WETH_TOKEN, maxDeposits);
38
+ // }
39
+
40
+ // function addOETH() internal {
41
+ // configureAsset(
42
+ // LRTConstants.OETH_TOKEN, Addresses.OETH_TOKEN, Addresses.OETH_EIGEN_STRATEGY, Addresses.OETH_ORACLE_PROXY
43
+ // );
44
+
45
+ // console.log("Configured OETH");
46
+ // }
47
+
48
+ // function addSfrxETH() internal {
49
+ // configureAsset(
50
+ // LRTConstants.SFRXETH_TOKEN,
51
+ // Addresses.SFRXETH_TOKEN,
52
+ // Addresses.SFRXETH_EIGEN_STRATEGY,
53
+ // Addresses.SFRXETH_ORACLE_PROXY
54
+ // );
55
+
56
+ // console.log("Configured sfrxETH");
57
+ // }
58
+
59
+ // function addMEth() internal {
60
+ // configureAsset(
61
+ // LRTConstants.M_ETH_TOKEN, Addresses.METH_TOKEN, Addresses.METH_EIGEN_STRATEGY,
62
+ // Addresses.METH_ORACLE_PROXY
63
+ // );
64
+
65
+ // console.log("Configured mETH");
66
+ // }
67
+
68
+ // function addSwETH() internal {
69
+ // addAssetWithChainlinkOracle(
70
+ // LRTConstants.SWETH_TOKEN, Addresses.SWETH_TOKEN, Addresses.SWETH_EIGEN_STRATEGY, Addresses.SWETH_ORACLE
71
+ // );
72
+
73
+ // console.log("Configured swETH");
74
+ // }
75
+
76
+ // function addETHx() internal {
77
+ // LRTOracle lrtOracle = getOracle();
78
+ // // NOTE: ETHx is already supported so just need to add Oracle
79
+ // lrtOracle.updatePriceOracleFor(Addresses.ETHX_TOKEN, Addresses.ETHX_ORACLE_PROXY);
80
+
81
+ // console.log("Configured ETHx");
82
+ // }
83
+
84
+ function addCbETH () internal {
85
+ address asset = block .chainid == 1 ? Addresses.CBETH_TOKEN : AddressesHolesky.CBETH_TOKEN;
86
+ address strategy = block .chainid == 1 ? Addresses.CBETH_EIGEN_STRATEGY : AddressesHolesky.CBETH_EIGEN_STRATEGY;
87
+ address assetOracle = block .chainid == 1 ? Addresses.CBETH_ORACLE : AddressesHolesky.CBETH_ORACLE;
88
+ addAssetWithChainlinkOracle (asset, strategy, assetOracle);
89
+ console.log ("Configured cbETH " );
90
+ }
91
+
92
+ function addRETH () internal {
93
+ address asset = block .chainid == 1 ? Addresses.RETH_TOKEN : AddressesHolesky.RETH_TOKEN;
94
+ address strategy = block .chainid == 1 ? Addresses.RETH_EIGEN_STRATEGY : AddressesHolesky.RETH_EIGEN_STRATEGY;
95
+ address assetOracle = block .chainid == 1 ? Addresses.RETH_ORACLE : AddressesHolesky.RETH_ORACLE;
96
+ addAssetWithChainlinkOracle (asset, strategy, assetOracle);
97
+ console.log ("Configured RETH " );
98
+ }
99
+
100
+ function addAssetWithChainlinkOracle (address asset , address strategy , address assetOracle ) internal {
101
+ LRTConfig lrtConfig = getConfig ();
102
+ LRTOracle lrtOracle = getOracle ();
103
+ address chainlinkOracle =
104
+ block .chainid == 1 ? Addresses.CHAINLINK_ORACLE_PROXY : AddressesHolesky.CHAINLINK_ORACLE_PROXY;
105
+ ChainlinkPriceOracle chainlinkOracleProxy = ChainlinkPriceOracle (chainlinkOracle);
106
+
107
+ lrtConfig.addNewSupportedAsset (asset, maxDeposits);
108
+
109
+ chainlinkOracleProxy.updatePriceFeedFor (asset, assetOracle);
110
+ lrtConfig.updateAssetStrategy (asset, strategy);
111
+
112
+ lrtOracle.updatePriceOracleFor (asset, address (chainlinkOracleProxy));
113
+ address delegator = block .chainid == 1 ? Addresses.NODE_DELEGATOR : AddressesHolesky.NODE_DELEGATOR;
114
+ // TODO this needs to handle multiple Node Delegators
115
+ NodeDelegator (payable (delegator)).maxApproveToEigenStrategyManager (asset);
116
+ }
117
+
118
+ function configureAsset (address asset , address strategy , address assetOracle ) internal {
119
+ LRTConfig lrtConfig = getConfig ();
120
+ LRTOracle lrtOracle = getOracle ();
121
+
122
+ lrtConfig.addNewSupportedAsset (asset, maxDeposits);
123
+ lrtConfig.updateAssetStrategy (asset, strategy);
124
+
125
+ lrtOracle.updatePriceOracleFor (asset, assetOracle);
126
+ address delegator = block .chainid == 1 ? Addresses.NODE_DELEGATOR : AddressesHolesky.NODE_DELEGATOR;
127
+ // TODO this needs to handle multiple Node Delegators
128
+ NodeDelegator (payable (delegator)).maxApproveToEigenStrategyManager (asset);
129
+ }
143
130
}
0 commit comments