Skip to content

Commit

Permalink
fix: contract deploy script stack too deep
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 13, 2024
1 parent bde1bf7 commit 978cc3a
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions contracts/script/SetUpEigenDA.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,18 @@ contract SetupEigenDA is EigenDADeployer, EigenLayerUtils {
operatorETHAmounts[i] = 5 ether;
}

uint256[] memory clientPrivateKeys = stdJson.readUintArray(config_data, ".clientPrivateKeys");
address[] memory clients = new address[](clientPrivateKeys.length);
for (uint i = 0; i < clients.length; i++) {
clients[i] = vm.addr(clientPrivateKeys[i]);
}
uint256[] memory clientETHAmounts = new uint256[](clients.length);
// 0.5 eth each
for (uint i = 0; i < clientETHAmounts.length; i++) {
clientETHAmounts[i] = 0.5 ether;
}
uint256 clientPrivateKey = 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcded;

// uint256[] memory clientPrivateKeys = stdJson.readUintArray(config_data, ".clientPrivateKeys");
// address[] memory clients = new address[](clientPrivateKeys.length);
// for (uint i = 0; i < clients.length; i++) {
// clients[i] = vm.addr(clientPrivateKeys[i]);
// }
// uint256[] memory clientETHAmounts = new uint256[](clients.length);
// // 0.5 eth each
// for (uint i = 0; i < clientETHAmounts.length; i++) {
// clientETHAmounts[i] = 0.5 ether;
// }

vm.startBroadcast();

Expand All @@ -139,11 +141,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++) {
Expand Down Expand Up @@ -176,35 +178,28 @@ 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),
endTimestamp: uint64(block.timestamp + 1000000000),
quorumNumbers: hex"0001",
quorumSplits: hex"3232"
});
vm.broadcast(clientPrivateKeys[0]);
address reservedClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKeys[0])))));
vm.broadcast(clientPrivateKey);
address reservedClient = address(uint160(uint256(keccak256(abi.encodePacked(clientPrivateKey)))));
// vm.prank(eigenDACommunityMultisig);
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.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++) {
Expand Down

0 comments on commit 978cc3a

Please sign in to comment.