Skip to content
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
10 changes: 7 additions & 3 deletions script/Deployments.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ contract Deploy is Script, Test {
DeployFromScratch deployFromScratch = new DeployFromScratch();
deployFromScratch.run(configFileName);

string memory outputFile =
string(bytes("script/output/devnet/M2_from_scratch_deployment_data.json"));
string memory outputFile = string(
bytes(
"script/output/devnet/SLASHING_deploy_from_scratch_deployment_data.json"
)
);
string memory output_data = vm.readFile(outputFile);

// whitelist weth
Expand Down Expand Up @@ -209,6 +212,7 @@ contract Deploy is Script, Test {
implOwner,
0,
allocationManager,
address(deployedContracts.eigenLayerMiddleware),
eigenPauserReg
)
);
Expand Down Expand Up @@ -420,7 +424,7 @@ contract Deploy is Script, Test {
}

function getPrivateKeys()
internal
public
returns (uint256 proxyDeployerPrivateKey, uint256 implPrivateKey)
{
string memory pkString = vm.envString("PROXY_OWNER_PRIVATE_KEY");
Expand Down
28 changes: 23 additions & 5 deletions script/SetRegistry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ contract SetRegistry is Script, Test {
uint256 proxyDeployerPrivateKey = vm.parseUint(pkString); // Parse as hex
uint256 implPrivateKey = vm.parseUint(implPkString); // Parse as hex
address proxyDeployer = vm.addr(proxyDeployerPrivateKey);
address implDeployer = vm.addr(implPrivateKey);

string memory outputFile =
string(bytes("script/output/devnet/taiyiAddresses.json"));
Expand All @@ -85,8 +86,11 @@ contract SetRegistry is Script, Test {
stdJson.readAddress(output_data, ".taiyiAddresses.eigenLayerMiddleware")
);

string memory eigenLayerOutputFile =
string(bytes("script/output/devnet/M2_from_scratch_deployment_data.json"));
string memory eigenLayerOutputFile = string(
bytes(
"script/output/devnet/SLASHING_deploy_from_scratch_deployment_data.json"
)
);

string memory eigenLayerOutput_data = vm.readFile(eigenLayerOutputFile);
// address wethStrategyAddr =
Expand All @@ -97,22 +101,36 @@ contract SetRegistry is Script, Test {
stdJson.readAddress(eigenLayerOutput_data, ".addresses.permissionController");

AllocationManager allocationManager = AllocationManager(allocationManagerAddr);
PermissionController controller = PermissionController(permissionController);

vm.startBroadcast(implPrivateKey);

// Update registry coordinator with new registries
eigenLayerMiddleware.addAdminToPermissionController(
proxyDeployer, permissionController
);
eigenLayerMiddleware.addAdminToPermissionController(
implDeployer, permissionController
);

vm.stopBroadcast();
vm.startBroadcast(proxyDeployerPrivateKey);
PermissionController controller = PermissionController(permissionController);

controller.acceptAdmin(address(eigenLayerMiddleware));

AllocationManager manager = AllocationManager(allocationManager);
manager.setAVSRegistrar(
controller.setAppointee(
address(eigenLayerMiddleware),
address(eigenLayerMiddleware),
address(allocationManager),
allocationManager.createOperatorSets.selector
);

allocationManager.setAVSRegistrar(
address(eigenLayerMiddleware), IAVSRegistrar(taiyiRegistryCoordinator)
);
allocationManager.updateAVSMetadataURI(
address(eigenLayerMiddleware), "luban-local-test"
);
vm.stopBroadcast();
}
}
7 changes: 5 additions & 2 deletions script/SetupContract.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ contract SetupContract is Script, Test {
LinglongSlasher linglongSlasher = LinglongSlasher(
stdJson.readAddress(output_data, ".taiyiAddresses.linglongSlasher")
);
string memory eigenLayerOutputFile =
string(bytes("script/output/devnet/M2_from_scratch_deployment_data.json"));
string memory eigenLayerOutputFile = string(
bytes(
"script/output/devnet/SLASHING_deploy_from_scratch_deployment_data.json"
)
);

string memory eigenLayerOutput_data = vm.readFile(eigenLayerOutputFile);
address wethStrategyAddr =
Expand Down
62 changes: 62 additions & 0 deletions script/configs/deploy-test-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"maintainer": "samlaf@eigenlabs.org",
"multisig_addresses": {
"operationsMultisig": "0xD8F3183DEF51A987222D845be228e0Bbb932C222",
"communityMultisig": "0xD8F3183DEF51A987222D845be228e0Bbb932C222",
"pauserMultisig": "0xD8F3183DEF51A987222D845be228e0Bbb932C222",
"executorMultisig": "0xD8F3183DEF51A987222D845be228e0Bbb932C222",
"timelock": "0xD8F3183DEF51A987222D845be228e0Bbb932C222"
},
"strategies": [
{
"token_address": "0x86A4F08103eade88adE0be164d7BDa8Fe166680d",
"token_symbol": "WETH",
"max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935,
"max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935
}
],
"strategyManager": {
"init_paused_status": 0,
"init_withdrawal_delay_blocks": 1
},
"eigenPod": {
"PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS": 1,
"MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": "32000000000"
},
"eigenPodManager": {
"init_paused_status": 30
},
"delayedWithdrawalRouter": {
"init_paused_status": 0,
"init_withdrawal_delay_blocks": 1
},
"slasher": {
"init_paused_status": 0
},
"delegation": {
"withdrawal_delay_blocks": 900,
"init_paused_status": 0,
"init_withdrawal_delay_blocks": 1
},
"rewardsCoordinator": {
"init_paused_status": 0,
"CALCULATION_INTERVAL_SECONDS": 604800,
"MAX_REWARDS_DURATION": 6048000,
"MAX_RETROACTIVE_LENGTH": 7776000,
"MAX_FUTURE_LENGTH": 2592000,
"GENESIS_REWARDS_TIMESTAMP": 1710979200,
"rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4",
"activation_delay": 7200,
"calculation_interval_seconds": 604800,
"global_operator_commission_bips": 1000,
"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000,
"OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000
},
"allocationManager": {
"init_paused_status": 0,
"DEALLOCATION_DELAY": 900,
"ALLOCATION_CONFIGURATION_DELAY": 1
},
"ethPOSDepositAddress": "0x4242424242424242424242424242424242424242",
"semver": "v0.0.0"
}
6 changes: 4 additions & 2 deletions script/configs/eigenlayer-deploy-config-devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"init_paused_status": 0
},
"delegation": {
"withdrawal_delay_blocks": 900,
"init_paused_status": 0,
"init_withdrawal_delay_blocks": 1
},
Expand All @@ -47,7 +48,7 @@
"rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4",
"activation_delay": 7200,
"calculation_interval_seconds": 604800,
"default_operator_split_bips": 1000,
"global_operator_commission_bips": 1000,
"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000,
"OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000
},
Expand All @@ -56,5 +57,6 @@
"DEALLOCATION_DELAY": 900,
"ALLOCATION_CONFIGURATION_DELAY": 1
},
"ethPOSDepositAddress": "0x4242424242424242424242424242424242424242"
"ethPOSDepositAddress": "0x4242424242424242424242424242424242424242",
"semver": "v0.0.0"
}
9 changes: 5 additions & 4 deletions script/setup-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ if [ -z "$NETWORK" ]; then
export NETWORK="devnet"
fi
export FOUNDRY_PROFILE=ci
forge script --rpc-url $EXECUTION_URL \
-vvvv --broadcast ./script/SetupContract.s.sol:SetupContract \
--sig "run()" \

forge script --rpc-url $EXECUTION_URL \
-vvvv --broadcast ./script/SetRegistry.s.sol:SetRegistry \
--sig "run()" \
--sig "run()"

forge script --rpc-url $EXECUTION_URL \
-vvvv --broadcast ./script/SetupContract.s.sol:SetupContract \
--sig "run()"
5 changes: 5 additions & 0 deletions src/operator-registries/TaiyiRegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ contract TaiyiRegistryCoordinator is
address initialOwner,
uint256 initialPausedStatus,
address _allocationManager,
address _eigenLayerMiddleware,
address /* _pauserRegistry */
)
external
Expand All @@ -125,6 +126,10 @@ contract TaiyiRegistryCoordinator is
if (_allocationManager != address(0)) {
allocationManager = IAllocationManager(_allocationManager);
}

if (_eigenLayerMiddleware != address(0)) {
eigenLayerMiddleware = _eigenLayerMiddleware;
}
}

// ==============================================================================================
Expand Down
41 changes: 41 additions & 0 deletions test/DeployTest.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import { Deploy } from "../script/Deployments.s.sol";
import { SetRegistry } from "../script/SetRegistry.s.sol";
import { SetupContract } from "../script/SetupContract.s.sol";
import "forge-std/Test.sol";

contract DeployTest is Test {
Deploy deploy;
SetRegistry setRegistry;
SetupContract setupContract;

function setUp() public {
deploy = new Deploy();
setRegistry = new SetRegistry();
setupContract = new SetupContract();
}

function testRunDeployScript() public {
vm.setEnv(
"PROXY_OWNER_PRIVATE_KEY",
"c5114526e042343c6d1899cad05e1c00ba588314de9b96929914ee0df18d46b2"
);
vm.setEnv(
"IMPL_OWNER_PRIVATE_KEY",
"a492823c3e193d6c595f37a18e3c06650cf4c74558cc818b16130b293716106f"
);
vm.setEnv("NETWORK", "devnet");
(uint256 proxyDeployerPrivateKey, uint256 implPrivateKey) =
deploy.getPrivateKeys();
address deployer = vm.addr(proxyDeployerPrivateKey);
address implOwner = vm.addr(implPrivateKey);
vm.deal(deployer, 1000 ether);
vm.deal(implOwner, 1000 ether);

deploy.run("deploy-test-config.json");
setRegistry.run();
setupContract.run();
}
}
1 change: 1 addition & 0 deletions test/EigenLayerMiddleware.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ contract EigenlayerMiddlewareTest is Test, G2Operations {
owner, // initialOwner
0, // initialPausedStatus
address(eigenLayerDeployer.allocationManager()), // _allocationManager
address(middleware),
address(eigenLayerDeployer.eigenLayerPauserReg()) // _pauserRegistry
);

Expand Down
2 changes: 2 additions & 0 deletions test/SymbioticMiddleware.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ contract SymbioticMiddlewareTest is POCBaseTest {
owner, // initialOwner
0, // initialPausedStatus
address(eigenLayerDeployer.allocationManager()), // _allocationManager
// require eigenlayer Middleware address, not useful in symbiotic so use any address but 0 for test to pass
address(eigenLayerDeployer.eigenLayerPauserReg()),
address(eigenLayerDeployer.eigenLayerPauserReg()) // _pauserRegistry
);

Expand Down