Skip to content

Commit 247ad58

Browse files
committed
feat: add new asset
1 parent a2698ce commit 247ad58

File tree

4 files changed

+147
-140
lines changed

4 files changed

+147
-140
lines changed

README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,12 @@ $ forge coverage
5252
source .env
5353
forge script script/foundry-scripts/holesky/DeployAll.s.sol:DeployAll --rpc-url $HOLESKY_RPC_URL --broadcast --verify -vvvv
5454
```
55-
56-
## Verify Contracts
57-
58-
Follow this pattern
59-
`contractAddress=<contractAddress> contractPath=<contract-path> make verify-lrt-proxy-testnet`
60-
61-
Example:
55+
# Add assets to Holesky:
6256
```bash
63-
contractAddress=0xE7b647ab9e0F49093926f06E457fa65d56cb456e contractPath=contracts/LRTConfig.sol:LRTConfig make verify-lrt-proxy-testnet
57+
source .env
58+
forge script script/foundry-scripts/holesky/AddAsset.s.sol:AddAsset --rpc-url $HOLESKY_RPC_URL --broadcast
6459
```
6560

66-
6761
### Format
6862

6963
Format the contracts:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
3+
pragma solidity 0.8.21;
4+
5+
import "forge-std/Script.sol";
6+
import { AddAssetsLib } from "../libraries/AddAssetsLib.sol";
7+
8+
contract AddAsset is Script {
9+
function run() external {
10+
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
11+
address deployer = vm.rememberKey(deployerPrivateKey);
12+
vm.startBroadcast(deployer);
13+
AddAssetsLib.addCbETH();
14+
AddAssetsLib.addRETH();
15+
vm.stopBroadcast();
16+
}
17+
}

script/foundry-scripts/libraries/AddAssetsLib.sol

+113-126
Original file line numberDiff line numberDiff line change
@@ -14,130 +14,117 @@ import { Addresses, AddressesHolesky } from "../utils/Addresses.sol";
1414
uint256 constant maxDeposits = 100_000 ether;
1515

1616
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+
}
143130
}

script/foundry-scripts/utils/Addresses.sol

+14-5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ library Addresses {
4747
address public constant RETH_EIGEN_STRATEGY = 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2;
4848
address public constant RETH_ORACLE = 0x536218f9E9Eb48863970252233c8F271f554C2d0;
4949

50+
address public constant CBETH_TOKEN = 0xBe9895146f7AF43049ca1c1AE358B0541Ea49704;
51+
address public constant CBETH_EIGEN_STRATEGY = 0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc;
52+
address public constant CBETH_ORACLE = 0xF017fcB346A1885194689bA23Eff2fE6fA5C483b;
53+
5054
address public constant SWETH_TOKEN = 0xf951E335afb289353dc249e82926178EaC7DEd78;
5155
address public constant SWETH_EIGEN_STRATEGY = 0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6;
5256
address public constant SWETH_ORACLE = 0x061bB36F8b67bB922937C102092498dcF4619F86;
@@ -88,24 +92,29 @@ library AddressesHolesky {
8892
address public constant LRT_CONFIG = 0xFB937D04dc68609e0385A7496fdEc62d5f23eC14;
8993
address public constant LRT_ORACLE = 0x969f3D5e7505b38a03Dd5c68f46016601Eea935a;
9094
address public constant LRT_DEPOSIT_POOL = 0xb418BDB514A7E0563469c16aAa8288C5A2bB8123;
91-
// address public constant NODE_DELEGATOR = 0x134ed22982EDE4ED69aC8c3ee5B29874bC0492F9;
95+
address public constant NODE_DELEGATOR = 0xafC71751B714d999b7037edc9F0012D1A741d3D6;
9296
address public constant NODE_DELEGATOR_NATIVE_STAKING = 0xafC71751B714d999b7037edc9F0012D1A741d3D6;
9397
address public constant EIGEN_POD = 0x1a0c64a5fc98d0Af6633AE3892B2bf0eD5f457bb;
9498

9599
address public constant CHAINLINK_ORACLE_PROXY = 0xF5a7778dA5d0F1e65D5aE0256497a5304252eCCd;
96100

97101
address public constant STETH_TOKEN = 0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034;
98102
address public constant STETH_EIGEN_STRATEGY = 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3;
99-
address public constant STETH_ORACLE = 0xF5a7778dA5d0F1e65D5aE0256497a5304252eCCd;
103+
address public constant STETH_ORACLE = 0xdE7Cf99eE1191D444ca1D5e8145d8D98D9B1EeB6;
104+
105+
address public constant RETH_TOKEN = 0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1;
106+
address public constant RETH_EIGEN_STRATEGY = 0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0;
107+
address public constant RETH_ORACLE = 0xdE7Cf99eE1191D444ca1D5e8145d8D98D9B1EeB6;
108+
109+
address public constant CBETH_TOKEN = 0x8720095Fa5739Ab051799211B146a2EEE4Dd8B37;
110+
address public constant CBETH_EIGEN_STRATEGY = 0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6;
111+
address public constant CBETH_ORACLE = 0xdE7Cf99eE1191D444ca1D5e8145d8D98D9B1EeB6;
100112

101113
address public constant ETHX_TOKEN = 0xB4F5fc289a778B80392b86fa70A7111E5bE0F859;
102114
address public constant ETHX_EIGEN_STRATEGY = 0x31B6F59e1627cEfC9fA174aD03859fC337666af7;
103115
address public constant ETHX_ORACLE_PROXY = 0x6e07dAfc75cb74B192cD8F6FBf215BAe5DeAB389;
104116
address public constant STADER_STAKING_POOL_MANAGER = 0x7F09ceb3874F5E35Cd2135F56fd4329b88c5d119;
105117

106-
// address public constant WETH_TOKEN = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6;
107-
// address public constant WETH_ORACLE_PROXY = 0xA7692950974da5ff3dF37e54Fa1cfb7348a39fAb;
108-
109118
// address public constant EIGEN_UNPAUSER = 0x3d9C2c2B40d890ad53E27947402e977155CD2808;
110119
address public constant EIGEN_STRATEGY_MANAGER = 0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6;
111120
address public constant EIGEN_POD_MANAGER = 0x30770d7E3e71112d7A6b7259542D1f680a70e315;

0 commit comments

Comments
 (0)