From 5b6211a3be1cc314b6a824704b18336b06323f0f Mon Sep 17 00:00:00 2001 From: hopeyen Date: Fri, 13 Dec 2024 12:17:32 -0800 Subject: [PATCH] fix: deploy and setup contracts scripts --- contracts/script/SetUpEigenDA.s.sol | 50 +++++++++++++++-------------- inabox/deploy/deploy.go | 14 ++++---- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/contracts/script/SetUpEigenDA.s.sol b/contracts/script/SetUpEigenDA.s.sol index 82d63ea130..9ef6ae2c56 100644 --- a/contracts/script/SetUpEigenDA.s.sol +++ b/contracts/script/SetUpEigenDA.s.sol @@ -113,16 +113,25 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils { operatorETHAmounts[i] = 5 ether; } - uint256[] memory clientPrivateKeys = stdJson.readUintArray(config_data, ".clientPrivateKeys"); - address[] memory clients = new address[](clientPrivateKeys.length); + uint256 clientPrivateKey = 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcded; + + // uint256[] memory clientPrivateKeys = stdJson.readUintArray(config_data, ".clientPrivateKeys"); + // uint256[] memory clientPrivateKeys = new uint256[](1); + // clientPrivateKeys[0] = clientPrivateKey; + address[] memory clients = new address[](1); for (uint i = 0; i < clients.length; i++) { - clients[i] = vm.addr(clientPrivateKeys[i]); + clients[i] = vm.addr(clientPrivateKey); } uint256[] memory clientETHAmounts = new uint256[](clients.length); // 0.5 eth each for (uint i = 0; i < clientETHAmounts.length; i++) { clientETHAmounts[i] = 0.5 ether; } + _allocate( + IERC20(address(0)), + clients, + clientETHAmounts + ); vm.startBroadcast(); @@ -139,11 +148,11 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils { operatorETHAmounts ); - _allocate( - IERC20(address(0)), - clients, - clientETHAmounts - ); + // _allocate( + // IERC20(address(0)), + // clients, + // clientETHAmounts + // ); // Allocate tokens to stakers for (uint8 i = 0; i < numStrategies; i++) { @@ -176,9 +185,7 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils { } - // Register Reservations for client 0 and 1 as the eigenDACommunityMultisig - clientPrivateKeys[0] = 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcded; IPaymentVault.Reservation memory reservation = IPaymentVault.Reservation({ symbolsPerSecond: 452198, startTimestamp: uint64(block.timestamp), @@ -186,25 +193,20 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils { quorumNumbers: hex"0001", quorumSplits: hex"3232" }); - vm.broadcast(clientPrivateKeys[0]); - address reservedClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKeys[0]))))); - // vm.prank(eigenDACommunityMultisig); + address reservedClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey))))); + // vm.prank(msg.sender); + vm.broadcast(msg.sender); paymentVault.setReservation(reservedClient, reservation); - vm.broadcast(clientPrivateKeys[1]); - address reservedClient1 = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKeys[1]))))); - // vm.prank(eigenDACommunityMultisig); - paymentVault.setReservation(reservedClient1, reservation); + // vm.broadcast(clientPrivateKey); + // address reservedClient1 = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey))))); + // paymentVault.setReservation(reservedClient1, reservation); // Deposit OnDemand for client 0 and 2 - vm.broadcast(operatorPrivateKeys[0]); - address ondemandClient = address(uint160(uint256(keccak256(abi.encodePacked(operatorPrivateKeys[0]))))); - vm.prank(ondemandClient); + vm.broadcast(clientPrivateKey); + address ondemandClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey))))); + // vm.prank(ondemandClient); paymentVault.depositOnDemand{value: 0.1 ether}(ondemandClient); - // vm.broadcast(operatorPrivateKeys[2]); - // address ondemandClient2 = address(uint160(uint256(keccak256(abi.encodePacked(operatorPrivateKeys[2]))))); - // vm.prank(ondemandClient2); - // PaymentVault.depositOnDemand{value: 1 ether}(ondemandClient2); // Deposit stakers into EigenLayer and delegate to operators for (uint256 i = 0; i < stakerPrivateKeys.length; i++) { diff --git a/inabox/deploy/deploy.go b/inabox/deploy/deploy.go index c7e132162d..cd252ce50a 100644 --- a/inabox/deploy/deploy.go +++ b/inabox/deploy/deploy.go @@ -44,7 +44,7 @@ func (env *Config) generateEigenDADeployConfig() EigenDADeployConfig { operators := make([]string, 0) stakers := make([]string, 0) - clients := make([]string, 0) + // clients := make([]string, 0) maxOperatorCount := env.Services.Counts.NumMaxOperatorCount numStrategies := len(env.Services.Stakes) @@ -72,11 +72,11 @@ func (env *Config) generateEigenDADeployConfig() EigenDADeployConfig { operators = append(operators, env.getKeyString(operatorName)) } - // 4 clients: with both, with reservations, with on-demand payments, without payments - for i := 0; i < 4; i++ { - clientName := fmt.Sprintf("client%d", i) - clients = append(clients, env.getKeyString(clientName)) - } + // // 4 clients: with both, with reservations, with on-demand payments, without payments + // for i := 0; i < 4; i++ { + // clientName := fmt.Sprintf("client%d", i) + // clients = append(clients, env.getKeyString(clientName)) + // } config := EigenDADeployConfig{ UseDefaults: true, @@ -85,7 +85,7 @@ func (env *Config) generateEigenDADeployConfig() EigenDADeployConfig { StakerPrivateKeys: stakers, StakerTokenAmounts: stakes, OperatorPrivateKeys: operators, - ClientPrivateKeys: clients, + // ClientPrivateKeys: clients, ConfirmerPrivateKey: env.getKeyString("batcher0"), }