Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add addresses of deployments #106

Merged
merged 2 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions script/ContractAddresses.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ pragma solidity ^0.8.24;

contract ContractAddresses {

struct YieldNestAddresses {
address YNETH_ADDRESS;
address STAKING_NODES_MANAGER_ADDRESS;
address REWARDS_DISTRIBUTOR_ADDRESS;
address EXECUTION_LAYER_RECEIVER_ADDRESS;
address CONSENSUS_LAYER_RECEIVER_ADDRESS;
}

struct EigenlayerAddresses {
address EIGENPOD_MANAGER_ADDRESS;
address DELEGATION_MANAGER_ADDRESS;
Expand Down Expand Up @@ -32,6 +40,7 @@ contract ContractAddresses {
EthereumAddresses ethereum;
EigenlayerAddresses eigenlayer;
LSDAddresses lsd;
YieldNestAddresses yn;
}

struct ChainIds {
Expand Down Expand Up @@ -67,6 +76,13 @@ contract ContractAddresses {
STETH_FEED_ADDRESS: 0x86392dC19c0b719886221c78AB11eb8Cf5c52812,
RETH_STRATEGY_ADDRESS: 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2,
STETH_STRATEGY_ADDRESS: 0x93c4b944D05dfe6df7645A86cd2206016c51564D
}),
yn: YieldNestAddresses({
YNETH_ADDRESS: address(0),
STAKING_NODES_MANAGER_ADDRESS: address(0),
REWARDS_DISTRIBUTOR_ADDRESS: address(0),
EXECUTION_LAYER_RECEIVER_ADDRESS: address(0),
CONSENSUS_LAYER_RECEIVER_ADDRESS: address(0)
})
});

Expand Down Expand Up @@ -94,6 +110,13 @@ contract ContractAddresses {
STETH_FEED_ADDRESS: 0xC028a945D4Ac8593F84F8dE3784F83143a165F1A, // Self-created aggregator TODO: Update
RETH_STRATEGY_ADDRESS: 0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0, // Placeholder address, replaced with address(1) for holesky
STETH_STRATEGY_ADDRESS: 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3 // Placeholder address, replaced with address(1) for holesky
}),
yn: YieldNestAddresses({
YNETH_ADDRESS: 0xd9029669BC74878BCB5BE58c259ed0A277C5c16E,
STAKING_NODES_MANAGER_ADDRESS: 0xc2387EBb4Ea66627E3543a771e260Bd84218d6a1,
REWARDS_DISTRIBUTOR_ADDRESS: 0x82915efF62af9FCC0d0735b8681959e069E3f2D8,
EXECUTION_LAYER_RECEIVER_ADDRESS: 0xA5E9E1ceb4cC1854d0e186a9B3E67158b84AD072,
CONSENSUS_LAYER_RECEIVER_ADDRESS: 0x706EED02702fFE9CBefD6A65E63f3C2b59B7eF2d
})
});
}
Expand Down
30 changes: 18 additions & 12 deletions test/integration/IntegrationBaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ contract IntegrationBaseTest is Test, Utils {

// Setup Protocol
setupUtils();
setupProxies();
setupYnETHPoxies();
setupYnLSDProxies();
setupEthereum();
setupEigenLayer();
setupRewardsDistributor();
Expand All @@ -90,22 +91,17 @@ contract IntegrationBaseTest is Test, Utils {
setupYieldNestOracleAndYnLSD();
}

function setupProxies() public {

function setupYnETHPoxies() public {
TransparentUpgradeableProxy ynethProxy;
TransparentUpgradeableProxy ynLSDProxy;
TransparentUpgradeableProxy rewardsDistributorProxy;
TransparentUpgradeableProxy stakingNodesManagerProxy;
TransparentUpgradeableProxy yieldNestOracleProxy;
TransparentUpgradeableProxy executionLayerReceiverProxy;
TransparentUpgradeableProxy consensusLayerReceiverProxy;

// Initializing RewardsDistributor contract and creating its proxy
// Initializing RewardsDistributor contract and creating its proxy
rewardsDistributor = new RewardsDistributor();
yneth = new ynETH();
stakingNodesManager = new StakingNodesManager();
yieldNestOracle = new YieldNestOracle();
ynlsd = new ynLSD();

executionLayerReceiver = new RewardsReceiver();
consensusLayerReceiver = new RewardsReceiver();
Expand All @@ -115,8 +111,6 @@ contract IntegrationBaseTest is Test, Utils {

ynethProxy = new TransparentUpgradeableProxy(address(yneth), actors.admin.PROXY_ADMIN_OWNER, "");
stakingNodesManagerProxy = new TransparentUpgradeableProxy(address(stakingNodesManager), actors.admin.PROXY_ADMIN_OWNER, "");
yieldNestOracleProxy = new TransparentUpgradeableProxy(address(yieldNestOracle), actors.admin.PROXY_ADMIN_OWNER, "");
ynLSDProxy = new TransparentUpgradeableProxy(address(ynlsd), actors.admin.PROXY_ADMIN_OWNER, "");

executionLayerReceiverProxy = new TransparentUpgradeableProxy(address(executionLayerReceiver), actors.admin.PROXY_ADMIN_OWNER, "");
consensusLayerReceiverProxy = new TransparentUpgradeableProxy(address(consensusLayerReceiver), actors.admin.PROXY_ADMIN_OWNER, "");
Expand All @@ -127,8 +121,6 @@ contract IntegrationBaseTest is Test, Utils {
// Wrapping proxies with their respective interfaces
yneth = ynETH(payable(ynethProxy));
stakingNodesManager = StakingNodesManager(payable(stakingNodesManagerProxy));
yieldNestOracle = YieldNestOracle(address(yieldNestOracleProxy));
ynlsd = ynLSD(address(ynLSDProxy));

// Re-deploying ynETH and creating its proxy again
yneth = new ynETH();
Expand All @@ -141,6 +133,20 @@ contract IntegrationBaseTest is Test, Utils {
stakingNodesManager = StakingNodesManager(payable(stakingNodesManagerProxy));
}

function setupYnLSDProxies() public {
TransparentUpgradeableProxy ynLSDProxy;
TransparentUpgradeableProxy yieldNestOracleProxy;

yieldNestOracle = new YieldNestOracle();
ynlsd = new ynLSD();

yieldNestOracleProxy = new TransparentUpgradeableProxy(address(yieldNestOracle), actors.admin.PROXY_ADMIN_OWNER, "");
ynLSDProxy = new TransparentUpgradeableProxy(address(ynlsd), actors.admin.PROXY_ADMIN_OWNER, "");

yieldNestOracle = YieldNestOracle(address(yieldNestOracleProxy));
ynlsd = ynLSD(address(ynLSDProxy));
}

function setupUtils() public {
viewer = new ynViewer(yneth, stakingNodesManager);
chainAddresses = contractAddresses.getChainAddresses(block.chainid);
Expand Down
Loading