From df1058939c3abb4b996674eda6bd11e058342320 Mon Sep 17 00:00:00 2001 From: Jeff Zhao Date: Mon, 25 Mar 2024 15:55:47 -0400 Subject: [PATCH] add --module-name to keygen (#10) * add --module-name to coral-cli * update docs * make sure module_name is actually valid [u8; 32] --- ...RestakingModule.json => PufferModule.json} | 560 +++--- coral-cli/abi/PufferModuleManager.json | 1067 +++++++++++ coral-cli/abi/PufferOracleV2.json | 314 ++++ coral-cli/abi/PufferProtocol.json | 28 +- coral-cli/abi/PufferVault.json | 1641 ----------------- coral-cli/abi/PufferVaultV2.json | 26 +- coral-cli/abi/RestakingOperator.json | 350 ++++ coral-cli/docs/validator.md | 21 +- coral-cli/src/commands/validator/keygen.rs | 68 +- coral-cli/src/commands/validator/mod.rs | 10 +- .../commands/validator/register_calldata.rs | 4 +- .../src/commands/validator/register_key.rs | 4 +- coral-cli/src/main.rs | 5 +- 13 files changed, 2198 insertions(+), 1900 deletions(-) rename coral-cli/abi/{NoRestakingModule.json => PufferModule.json} (56%) create mode 100644 coral-cli/abi/PufferModuleManager.json create mode 100644 coral-cli/abi/PufferOracleV2.json delete mode 100644 coral-cli/abi/PufferVault.json create mode 100644 coral-cli/abi/RestakingOperator.json diff --git a/coral-cli/abi/NoRestakingModule.json b/coral-cli/abi/PufferModule.json similarity index 56% rename from coral-cli/abi/NoRestakingModule.json rename to coral-cli/abi/PufferModule.json index 4d13055..5aebbf1 100644 --- a/coral-cli/abi/NoRestakingModule.json +++ b/coral-cli/abi/PufferModule.json @@ -3,24 +3,29 @@ "type": "constructor", "inputs": [ { - "name": "initialAuthority", + "name": "protocol", + "type": "address", + "internalType": "contract IPufferProtocol" + }, + { + "name": "eigenPodManager", "type": "address", "internalType": "address" }, { - "name": "puffer", + "name": "eigenWithdrawalRouter", "type": "address", - "internalType": "contract PufferProtocol" + "internalType": "contract IDelayedWithdrawalRouter" }, { - "name": "depositContract", + "name": "delegationManager", "type": "address", - "internalType": "address" + "internalType": "contract IDelegationManager" }, { - "name": "name", - "type": "bytes32", - "internalType": "bytes32" + "name": "moduleManager", + "type": "address", + "internalType": "contract IPufferModuleManager" } ], "stateMutability": "payable" @@ -31,13 +36,39 @@ }, { "type": "function", - "name": "BEACON_CHAIN_DEPOSIT_CONTRACT", + "name": "EIGEN_DELEGATION_MANAGER", "inputs": [], "outputs": [ { "name": "", "type": "address", - "internalType": "address" + "internalType": "contract IDelegationManager" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "EIGEN_POD_MANAGER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IEigenPodManager" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "EIGEN_WITHDRAWAL_ROUTER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IDelayedWithdrawalRouter" } ], "stateMutability": "view" @@ -55,6 +86,19 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "PUFFER_MODULE_MANAGER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IPufferModuleManager" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "PUFFER_PROTOCOL", @@ -115,6 +159,41 @@ ], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "callDelegateTo", + "inputs": [ + { + "name": "operator", + "type": "address", + "internalType": "address" + }, + { + "name": "approverSignatureAndExpiry", + "type": "tuple", + "internalType": "struct ISignatureUtils.SignatureWithExpiry", + "components": [ + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "expiry", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "approverSalt", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "callStake", @@ -140,27 +219,16 @@ }, { "type": "function", - "name": "claimedRewards", - "inputs": [ - { - "name": "blockNumber", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "node", - "type": "address", - "internalType": "address" - } - ], + "name": "callUndelegate", + "inputs": [], "outputs": [ { - "name": "claimed", - "type": "bool", - "internalType": "bool" + "name": "withdrawalRoot", + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "stateMutability": "view" + "stateMutability": "nonpayable" }, { "type": "function", @@ -192,146 +260,125 @@ }, { "type": "function", - "name": "getLastProofOfRewardsBlock", - "inputs": [], - "outputs": [ + "name": "completeQueuedWithdrawals", + "inputs": [ { - "name": "", - "type": "uint256", - "internalType": "uint256" + "name": "withdrawals", + "type": "tuple[]", + "internalType": "struct IDelegationManager.Withdrawal[]", + "components": [ + { + "name": "staker", + "type": "address", + "internalType": "address" + }, + { + "name": "delegatedTo", + "type": "address", + "internalType": "address" + }, + { + "name": "withdrawer", + "type": "address", + "internalType": "address" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "startBlock", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "strategies", + "type": "address[]", + "internalType": "contract IStrategy[]" + }, + { + "name": "shares", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "tokens", + "type": "address[][]", + "internalType": "contract IERC20[][]" + }, + { + "name": "middlewareTimesIndexes", + "type": "uint256[]", + "internalType": "uint256[]" } ], - "stateMutability": "view" + "outputs": [], + "stateMutability": "nonpayable" }, { "type": "function", - "name": "getWithdrawalCredentials", + "name": "getEigenPod", "inputs": [], "outputs": [ { "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "address", + "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", - "name": "isConsumingScheduledOp", + "name": "getLastProofOfRewardsBlock", "inputs": [], "outputs": [ { "name": "", - "type": "bytes4", - "internalType": "bytes4" + "type": "uint256", + "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", - "name": "onERC1155BatchReceived", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - }, + "name": "getWithdrawalCredentials", + "inputs": [], + "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "stateMutability": "nonpayable" + "stateMutability": "view" }, { "type": "function", - "name": "onERC1155Received", + "name": "initialize", "inputs": [ { - "name": "", - "type": "address", - "internalType": "address" + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" }, { - "name": "", + "name": "initialAuthority", "type": "address", "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" } ], + "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", - "name": "onERC721Received", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], + "name": "isConsumingScheduledOp", + "inputs": [], "outputs": [ { "name": "", @@ -339,7 +386,7 @@ "internalType": "bytes4" } ], - "stateMutability": "nonpayable" + "stateMutability": "view" }, { "type": "function", @@ -366,33 +413,29 @@ }, { "type": "function", - "name": "recoverERC1155", + "name": "queueWithdrawals", "inputs": [ { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "tokenId", + "name": "shareAmount", "type": "uint256", "internalType": "uint256" - }, + } + ], + "outputs": [ { - "name": "tokenAmount", - "type": "uint256", - "internalType": "uint256" + "name": "", + "type": "bytes32[]", + "internalType": "bytes32[]" } ], - "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", - "name": "recoverERC20", + "name": "setAuthority", "inputs": [ { - "name": "token", + "name": "newAuthority", "type": "address", "internalType": "address" } @@ -402,17 +445,111 @@ }, { "type": "function", - "name": "recoverERC721", + "name": "verifyAndProcessWithdrawals", "inputs": [ { - "name": "token", - "type": "address", - "internalType": "address" + "name": "oracleTimestamp", + "type": "uint64", + "internalType": "uint64" }, { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" + "name": "stateRootProof", + "type": "tuple", + "internalType": "struct BeaconChainProofs.StateRootProof", + "components": [ + { + "name": "beaconStateRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "proof", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "withdrawalProofs", + "type": "tuple[]", + "internalType": "struct BeaconChainProofs.WithdrawalProof[]", + "components": [ + { + "name": "withdrawalProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "slotProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "executionPayloadProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timestampProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "historicalSummaryBlockRootProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "blockRootIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "historicalSummaryIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "withdrawalIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "blockRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "slotRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "timestampRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "executionPayloadRoot", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validatorFieldsProofs", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "validatorFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + }, + { + "name": "withdrawalFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" } ], "outputs": [], @@ -420,77 +557,103 @@ }, { "type": "function", - "name": "rewardsRoots", + "name": "verifyWithdrawalCredentials", "inputs": [ { - "name": "blockNumber", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ + "name": "oracleTimestamp", + "type": "uint64", + "internalType": "uint64" + }, { - "name": "root", - "type": "bytes32", - "internalType": "bytes32" + "name": "stateRootProof", + "type": "tuple", + "internalType": "struct BeaconChainProofs.StateRootProof", + "components": [ + { + "name": "beaconStateRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "proof", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validatorIndices", + "type": "uint40[]", + "internalType": "uint40[]" + }, + { + "name": "validatorFieldsProofs", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "validatorFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" } ], - "stateMutability": "view" + "outputs": [], + "stateMutability": "nonpayable" }, { "type": "function", - "name": "setAuthority", + "name": "withdrawNonBeaconChainETHBalanceWei", "inputs": [ { - "name": "newAuthority", - "type": "address", - "internalType": "address" + "name": "amountToWithdraw", + "type": "uint256", + "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { - "type": "function", - "name": "supportsInterface", + "type": "event", + "name": "AuthorityUpdated", "inputs": [ { - "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" + "name": "authority", + "type": "address", + "indexed": false, + "internalType": "address" } ], - "stateMutability": "view" + "anonymous": false }, { - "type": "function", - "name": "to", - "inputs": [], - "outputs": [ + "type": "event", + "name": "Initialized", + "inputs": [ { - "name": "", - "type": "address", - "internalType": "address" + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" } ], - "stateMutability": "view" + "anonymous": false }, { "type": "event", - "name": "AuthorityUpdated", + "name": "RewardsClaimed", "inputs": [ { - "name": "authority", + "name": "node", "type": "address", - "indexed": false, + "indexed": true, "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" } ], "anonymous": false @@ -552,17 +715,6 @@ } ] }, - { - "type": "error", - "name": "AddressEmptyCode", - "inputs": [ - { - "name": "target", - "type": "address", - "internalType": "address" - } - ] - }, { "type": "error", "name": "AddressInsufficientBalance", @@ -590,11 +742,6 @@ } ] }, - { - "type": "error", - "name": "FailedDeposit", - "inputs": [] - }, { "type": "error", "name": "FailedInnerCall", @@ -613,21 +760,20 @@ }, { "type": "error", - "name": "NothingToClaim", - "inputs": [ - { - "name": "node", - "type": "address", - "internalType": "address" - } - ] + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] }, { "type": "error", - "name": "SafeERC20FailedOperation", + "name": "NothingToClaim", "inputs": [ { - "name": "token", + "name": "node", "type": "address", "internalType": "address" } diff --git a/coral-cli/abi/PufferModuleManager.json b/coral-cli/abi/PufferModuleManager.json new file mode 100644 index 0000000..e88f6b4 --- /dev/null +++ b/coral-cli/abi/PufferModuleManager.json @@ -0,0 +1,1067 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "pufferModuleBeacon", + "type": "address", + "internalType": "address" + }, + { + "name": "restakingOperatorBeacon", + "type": "address", + "internalType": "address" + }, + { + "name": "pufferProtocol", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "PUFFER_MODULE_BEACON", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PUFFER_PROTOCOL", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "RESTAKING_OPERATOR_BEACON", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "UPGRADE_INTERFACE_VERSION", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "authority", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "callCompleteQueuedWithdrawals", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "withdrawals", + "type": "tuple[]", + "internalType": "struct IDelegationManager.Withdrawal[]", + "components": [ + { + "name": "staker", + "type": "address", + "internalType": "address" + }, + { + "name": "delegatedTo", + "type": "address", + "internalType": "address" + }, + { + "name": "withdrawer", + "type": "address", + "internalType": "address" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "startBlock", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "strategies", + "type": "address[]", + "internalType": "contract IStrategy[]" + }, + { + "name": "shares", + "type": "uint256[]", + "internalType": "uint256[]" + } + ] + }, + { + "name": "tokens", + "type": "address[][]", + "internalType": "contract IERC20[][]" + }, + { + "name": "middlewareTimesIndexes", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callDelegateTo", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "operator", + "type": "address", + "internalType": "address" + }, + { + "name": "approverSignatureAndExpiry", + "type": "tuple", + "internalType": "struct ISignatureUtils.SignatureWithExpiry", + "components": [ + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "expiry", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "approverSalt", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callModifyOperatorDetails", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "internalType": "contract IRestakingOperator" + }, + { + "name": "newOperatorDetails", + "type": "tuple", + "internalType": "struct IDelegationManager.OperatorDetails", + "components": [ + { + "name": "earningsReceiver", + "type": "address", + "internalType": "address" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callOptIntoSlashing", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "internalType": "contract IRestakingOperator" + }, + { + "name": "slasher", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callQueueWithdrawals", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "sharesAmount", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callUndelegate", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "withdrawalRoot", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callUpdateMetadataURI", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "internalType": "contract IRestakingOperator" + }, + { + "name": "metadataURI", + "type": "string", + "internalType": "string" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callVerifyAndProcessWithdrawals", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "oracleTimestamp", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "stateRootProof", + "type": "tuple", + "internalType": "struct BeaconChainProofs.StateRootProof", + "components": [ + { + "name": "beaconStateRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "proof", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "withdrawalProofs", + "type": "tuple[]", + "internalType": "struct BeaconChainProofs.WithdrawalProof[]", + "components": [ + { + "name": "withdrawalProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "slotProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "executionPayloadProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timestampProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "historicalSummaryBlockRootProof", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "blockRootIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "historicalSummaryIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "withdrawalIndex", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "blockRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "slotRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "timestampRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "executionPayloadRoot", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "validatorFieldsProofs", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "validatorFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + }, + { + "name": "withdrawalFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callVerifyWithdrawalCredentials", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "oracleTimestamp", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "stateRootProof", + "type": "tuple", + "internalType": "struct BeaconChainProofs.StateRootProof", + "components": [ + { + "name": "beaconStateRoot", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "proof", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "validatorIndices", + "type": "uint40[]", + "internalType": "uint40[]" + }, + { + "name": "validatorFieldsProofs", + "type": "bytes[]", + "internalType": "bytes[]" + }, + { + "name": "validatorFields", + "type": "bytes32[][]", + "internalType": "bytes32[][]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "callWithdrawNonBeaconChainETHBalanceWei", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "amountToWithdraw", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "createNewPufferModule", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IPufferModule" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "createNewRestakingOperator", + "inputs": [ + { + "name": "metadataURI", + "type": "string", + "internalType": "string" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IRestakingOperator" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "accessManager", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isConsumingScheduledOp", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "proxiableUUID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setAuthority", + "inputs": [ + { + "name": "newAuthority", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateAVSRegistrationSignatureProof", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "internalType": "contract IRestakingOperator" + }, + { + "name": "digestHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "signer", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "event", + "name": "AVSRegistrationSignatureProofUpdated", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "digestHash", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + }, + { + "name": "signer", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AuthorityUpdated", + "inputs": [ + { + "name": "authority", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "CompletedQueuedWithdrawals", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "sharesWithdrawn", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "NonBeaconChainETHBalanceWithdrawn", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "amountToWithdraw", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "PufferModuleDelegated", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "operator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "PufferModuleUndelegated", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RestakingOperatorCreated", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "operatorDetails", + "type": "tuple", + "indexed": false, + "internalType": "struct IDelegationManager.OperatorDetails", + "components": [ + { + "name": "earningsReceiver", + "type": "address", + "internalType": "address" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RestakingOperatorMetadataURIUpdated", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "metadataURI", + "type": "string", + "indexed": false, + "internalType": "string" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RestakingOperatorModified", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOperatorDetails", + "type": "tuple", + "indexed": false, + "internalType": "struct IDelegationManager.OperatorDetails", + "components": [ + { + "name": "earningsReceiver", + "type": "address", + "internalType": "address" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RestakingOperatorOptedInSlasher", + "inputs": [ + { + "name": "restakingOperator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "slasher", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ValidatorCredentialsVerified", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "validatorIndices", + "type": "uint40[]", + "indexed": false, + "internalType": "uint40[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "VerifiedAndProcessedWithdrawals", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "validatorFields", + "type": "bytes32[][]", + "indexed": false, + "internalType": "bytes32[][]" + }, + { + "name": "withdrawalFields", + "type": "bytes32[][]", + "indexed": false, + "internalType": "bytes32[][]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "WithdrawalsQueued", + "inputs": [ + { + "name": "moduleName", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "shareAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "withdrawalRoot", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AccessManagedInvalidAuthority", + "inputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AccessManagedRequiredDelay", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + }, + { + "name": "delay", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "error", + "name": "AccessManagedUnauthorized", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "Create2EmptyBytecode", + "inputs": [] + }, + { + "type": "error", + "name": "Create2FailedDeployment", + "inputs": [] + }, + { + "type": "error", + "name": "Create2InsufficientBalance", + "inputs": [ + { + "name": "balance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "needed", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC1967InvalidImplementation", + "inputs": [ + { + "name": "implementation", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC1967NonPayable", + "inputs": [] + }, + { + "type": "error", + "name": "FailedInnerCall", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] + }, + { + "type": "error", + "name": "UUPSUnauthorizedCallContext", + "inputs": [] + }, + { + "type": "error", + "name": "UUPSUnsupportedProxiableUUID", + "inputs": [ + { + "name": "slot", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [] + } +] diff --git a/coral-cli/abi/PufferOracleV2.json b/coral-cli/abi/PufferOracleV2.json new file mode 100644 index 0000000..f970882 --- /dev/null +++ b/coral-cli/abi/PufferOracleV2.json @@ -0,0 +1,314 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "guardianModule", + "type": "address", + "internalType": "contract IGuardianModule" + }, + { + "name": "vault", + "type": "address", + "internalType": "address payable" + }, + { + "name": "accessManager", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "GUARDIAN_MODULE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IGuardianModule" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PUFFER_VAULT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address payable" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "authority", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "exitValidators", + "inputs": [ + { + "name": "numberOfExits", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getLockedEthAmount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTotalNumberOfValidators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getValidatorTicketPrice", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isConsumingScheduledOp", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isOverBurstThreshold", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "provisionNode", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setAuthority", + "inputs": [ + { + "name": "newAuthority", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setMintPrice", + "inputs": [ + { + "name": "newPrice", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setTotalNumberOfValidators", + "inputs": [ + { + "name": "newTotalNumberOfValidators", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "epochNumber", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "guardianEOASignatures", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AuthorityUpdated", + "inputs": [ + { + "name": "authority", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "NumberOfActiveValidators", + "inputs": [ + { + "name": "numberOfActivePufferValidators", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TotalNumberOfValidatorsUpdated", + "inputs": [ + { + "name": "oldNumberOfValidators", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newNumberOfValidators", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "epochNumber", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ValidatorTicketMintPriceUpdated", + "inputs": [ + { + "name": "oldPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "newPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AccessManagedInvalidAuthority", + "inputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AccessManagedRequiredDelay", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + }, + { + "name": "delay", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "error", + "name": "AccessManagedUnauthorized", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "InvalidUpdate", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidValidatorTicketPrice", + "inputs": [] + } +] diff --git a/coral-cli/abi/PufferProtocol.json b/coral-cli/abi/PufferProtocol.json index 345ded7..ea4d169 100644 --- a/coral-cli/abi/PufferProtocol.json +++ b/coral-cli/abi/PufferProtocol.json @@ -13,7 +13,7 @@ "internalType": "contract IGuardianModule" }, { - "name": "moduleFactory", + "name": "moduleManager", "type": "address", "internalType": "address" }, @@ -45,13 +45,13 @@ }, { "type": "function", - "name": "PUFFER_MODULE_FACTORY", + "name": "PUFFER_MODULE_MANAGER", "inputs": [], "outputs": [ { "name": "", "type": "address", - "internalType": "contract IPufferModuleFactory" + "internalType": "contract IPufferModuleManager" } ], "stateMutability": "view" @@ -197,16 +197,6 @@ "name": "moduleName", "type": "bytes32", "internalType": "bytes32" - }, - { - "name": "metadataURI", - "type": "string", - "internalType": "string" - }, - { - "name": "delegationApprover", - "type": "address", - "internalType": "address" } ], "outputs": [ @@ -637,11 +627,6 @@ "name": "accessManager", "type": "address", "internalType": "address" - }, - { - "name": "noRestakingModule", - "type": "address", - "internalType": "address" } ], "outputs": [], @@ -805,6 +790,13 @@ "outputs": [], "stateMutability": "payable" }, + { + "type": "function", + "name": "revertIfPaused", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "setAuthority", diff --git a/coral-cli/abi/PufferVault.json b/coral-cli/abi/PufferVault.json deleted file mode 100644 index 236d295..0000000 --- a/coral-cli/abi/PufferVault.json +++ /dev/null @@ -1,1641 +0,0 @@ -[ - { - "type": "constructor", - "inputs": [ - { - "name": "stETH", - "type": "address", - "internalType": "contract IStETH" - }, - { - "name": "weth", - "type": "address", - "internalType": "contract IWETH" - }, - { - "name": "lidoWithdrawalQueue", - "type": "address", - "internalType": "contract ILidoWithdrawalQueue" - }, - { - "name": "stETHStrategy", - "type": "address", - "internalType": "contract IStrategy" - }, - { - "name": "eigenStrategyManager", - "type": "address", - "internalType": "contract IEigenLayer" - }, - { - "name": "oracle", - "type": "address", - "internalType": "contract IPufferOracle" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, - { - "type": "function", - "name": "DOMAIN_SEPARATOR", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "PUFFER_ORACLE", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IPufferOracle" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "UPGRADE_INTERFACE_VERSION", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "allowance", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - }, - { - "name": "spender", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "approve", - "inputs": [ - { - "name": "spender", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "asset", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "authority", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "balanceOf", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "burn", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "claimWithdrawalFromEigenLayer", - "inputs": [ - { - "name": "queuedWithdrawal", - "type": "tuple", - "internalType": "struct IEigenLayer.QueuedWithdrawal", - "components": [ - { - "name": "strategies", - "type": "address[]", - "internalType": "contract IStrategy[]" - }, - { - "name": "shares", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "depositor", - "type": "address", - "internalType": "address" - }, - { - "name": "withdrawerAndNonce", - "type": "tuple", - "internalType": "struct IEigenLayer.WithdrawerAndNonce", - "components": [ - { - "name": "withdrawer", - "type": "address", - "internalType": "address" - }, - { - "name": "nonce", - "type": "uint96", - "internalType": "uint96" - } - ] - }, - { - "name": "withdrawalStartBlock", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "delegatedAddress", - "type": "address", - "internalType": "address" - } - ] - }, - { - "name": "tokens", - "type": "address[]", - "internalType": "contract IERC20[]" - }, - { - "name": "middlewareTimesIndex", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "claimWithdrawalsFromLido", - "inputs": [ - { - "name": "requestIds", - "type": "uint256[]", - "internalType": "uint256[]" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "convertToAssets", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "convertToShares", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "decimals", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint8", - "internalType": "uint8" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "receiver", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "depositETH", - "inputs": [ - { - "name": "receiver", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "depositStETH", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "receiver", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "depositToEigenLayer", - "inputs": [ - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "eip712Domain", - "inputs": [], - "outputs": [ - { - "name": "fields", - "type": "bytes1", - "internalType": "bytes1" - }, - { - "name": "name", - "type": "string", - "internalType": "string" - }, - { - "name": "version", - "type": "string", - "internalType": "string" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "verifyingContract", - "type": "address", - "internalType": "address" - }, - { - "name": "salt", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "extensions", - "type": "uint256[]", - "internalType": "uint256[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getELBackingEthAmount", - "inputs": [], - "outputs": [ - { - "name": "ethAmount", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getPendingLidoETHAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getRemainingAssetsDailyWithdrawalLimit", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint96", - "internalType": "uint96" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "initialize", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "initialize", - "inputs": [ - { - "name": "accessManager", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "initiateETHWithdrawalsFromLido", - "inputs": [ - { - "name": "amounts", - "type": "uint256[]", - "internalType": "uint256[]" - } - ], - "outputs": [ - { - "name": "requestIds", - "type": "uint256[]", - "internalType": "uint256[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "initiateStETHWithdrawalFromEigenLayer", - "inputs": [ - { - "name": "sharesToWithdraw", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "isConsumingScheduledOp", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maxDeposit", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maxMint", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maxRedeem", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "maxShares", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maxWithdraw", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "maxAssets", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "mint", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "receiver", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "nonces", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "onERC721Received", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "permit", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - }, - { - "name": "spender", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "deadline", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "v", - "type": "uint8", - "internalType": "uint8" - }, - { - "name": "r", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "s", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "previewDeposit", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "previewMint", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "previewRedeem", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "previewWithdraw", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "proxiableUUID", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "redeem", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "receiver", - "type": "address", - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setAuthority", - "inputs": [ - { - "name": "newAuthority", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setDailyWithdrawalLimit", - "inputs": [ - { - "name": "newLimit", - "type": "uint96", - "internalType": "uint96" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "symbol", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "totalAssets", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "totalSupply", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "transfer", - "inputs": [ - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferETH", - "inputs": [ - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "ethAmount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferFrom", - "inputs": [ - { - "name": "from", - "type": "address", - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "upgradeToAndCall", - "inputs": [ - { - "name": "newImplementation", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "withdraw", - "inputs": [ - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "receiver", - "type": "address", - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "Approval", - "inputs": [ - { - "name": "owner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "spender", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "AuthorityUpdated", - "inputs": [ - { - "name": "authority", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ClaimedWithdrawals", - "inputs": [ - { - "name": "requestIds", - "type": "uint256[]", - "indexed": false, - "internalType": "uint256[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DailyWithdrawalLimitSet", - "inputs": [ - { - "name": "oldLimit", - "type": "uint96", - "indexed": false, - "internalType": "uint96" - }, - { - "name": "newLimit", - "type": "uint96", - "indexed": false, - "internalType": "uint96" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Deposit", - "inputs": [ - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "assets", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "shares", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "EIP712DomainChanged", - "inputs": [], - "anonymous": false - }, - { - "type": "event", - "name": "Initialized", - "inputs": [ - { - "name": "version", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RequestedWithdrawals", - "inputs": [ - { - "name": "requestIds", - "type": "uint256[]", - "indexed": false, - "internalType": "uint256[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Transfer", - "inputs": [ - { - "name": "from", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Upgraded", - "inputs": [ - { - "name": "implementation", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Withdraw", - "inputs": [ - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "receiver", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "assets", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "shares", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AccessManagedInvalidAuthority", - "inputs": [ - { - "name": "authority", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AccessManagedRequiredDelay", - "inputs": [ - { - "name": "caller", - "type": "address", - "internalType": "address" - }, - { - "name": "delay", - "type": "uint32", - "internalType": "uint32" - } - ] - }, - { - "type": "error", - "name": "AccessManagedUnauthorized", - "inputs": [ - { - "name": "caller", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AddressEmptyCode", - "inputs": [ - { - "name": "target", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AddressInsufficientBalance", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ECDSAInvalidSignature", - "inputs": [] - }, - { - "type": "error", - "name": "ECDSAInvalidSignatureLength", - "inputs": [ - { - "name": "length", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ECDSAInvalidSignatureS", - "inputs": [ - { - "name": "s", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "ERC1967InvalidImplementation", - "inputs": [ - { - "name": "implementation", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC1967NonPayable", - "inputs": [] - }, - { - "type": "error", - "name": "ERC20InsufficientAllowance", - "inputs": [ - { - "name": "spender", - "type": "address", - "internalType": "address" - }, - { - "name": "allowance", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "needed", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC20InsufficientBalance", - "inputs": [ - { - "name": "sender", - "type": "address", - "internalType": "address" - }, - { - "name": "balance", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "needed", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC20InvalidApprover", - "inputs": [ - { - "name": "approver", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC20InvalidReceiver", - "inputs": [ - { - "name": "receiver", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC20InvalidSender", - "inputs": [ - { - "name": "sender", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC20InvalidSpender", - "inputs": [ - { - "name": "spender", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC2612ExpiredSignature", - "inputs": [ - { - "name": "deadline", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC2612InvalidSigner", - "inputs": [ - { - "name": "signer", - "type": "address", - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC4626ExceededMaxDeposit", - "inputs": [ - { - "name": "receiver", - "type": "address", - "internalType": "address" - }, - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC4626ExceededMaxMint", - "inputs": [ - { - "name": "receiver", - "type": "address", - "internalType": "address" - }, - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC4626ExceededMaxRedeem", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - }, - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ERC4626ExceededMaxWithdraw", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - }, - { - "name": "assets", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ETHTransferFailed", - "inputs": [] - }, - { - "type": "error", - "name": "FailedInnerCall", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidAccountNonce", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - }, - { - "name": "currentNonce", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "InvalidInitialization", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidWithdrawal", - "inputs": [] - }, - { - "type": "error", - "name": "MathOverflowedMulDiv", - "inputs": [] - }, - { - "type": "error", - "name": "NotInitializing", - "inputs": [] - }, - { - "type": "error", - "name": "SafeERC20FailedOperation", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "UUPSUnauthorizedCallContext", - "inputs": [] - }, - { - "type": "error", - "name": "UUPSUnsupportedProxiableUUID", - "inputs": [ - { - "name": "slot", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "WithdrawalsAreDisabled", - "inputs": [] - } -] diff --git a/coral-cli/abi/PufferVaultV2.json b/coral-cli/abi/PufferVaultV2.json index 6da6ad1..71e4b61 100644 --- a/coral-cli/abi/PufferVaultV2.json +++ b/coral-cli/abi/PufferVaultV2.json @@ -382,7 +382,7 @@ "name": "depositStETH", "inputs": [ { - "name": "assets", + "name": "stETHSharesAmount", "type": "uint256", "internalType": "uint256" }, @@ -1122,6 +1122,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "AssetsWithdrawnToday", + "inputs": [ + { + "name": "withdrawalAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, { "type": "event", "name": "AuthorityUpdated", @@ -1148,6 +1161,12 @@ ], "anonymous": false }, + { + "type": "event", + "name": "DailyWithdrawalLimitReset", + "inputs": [], + "anonymous": false + }, { "type": "event", "name": "DailyWithdrawalLimitSet", @@ -1422,6 +1441,11 @@ } ] }, + { + "type": "error", + "name": "DepositAndWithdrawalForbidden", + "inputs": [] + }, { "type": "error", "name": "ECDSAInvalidSignature", diff --git a/coral-cli/abi/RestakingOperator.json b/coral-cli/abi/RestakingOperator.json new file mode 100644 index 0000000..f550b6a --- /dev/null +++ b/coral-cli/abi/RestakingOperator.json @@ -0,0 +1,350 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "delegationManager", + "type": "address", + "internalType": "contract IDelegationManager" + }, + { + "name": "slasher", + "type": "address", + "internalType": "contract ISlasher" + }, + { + "name": "moduleManager", + "type": "address", + "internalType": "contract IPufferModuleManager" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "EIGEN_DELEGATION_MANAGER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IDelegationManager" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "EIGEN_SLASHER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ISlasher" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PUFFER_MODULE_MANAGER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IPufferModuleManager" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "authority", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "initialAuthority", + "type": "address", + "internalType": "address" + }, + { + "name": "operatorDetails", + "type": "tuple", + "internalType": "struct IDelegationManager.OperatorDetails", + "components": [ + { + "name": "earningsReceiver", + "type": "address", + "internalType": "address" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "name": "metadataURI", + "type": "string", + "internalType": "string" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isConsumingScheduledOp", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isValidSignature", + "inputs": [ + { + "name": "digestHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "modifyOperatorDetails", + "inputs": [ + { + "name": "newOperatorDetails", + "type": "tuple", + "internalType": "struct IDelegationManager.OperatorDetails", + "components": [ + { + "name": "earningsReceiver", + "type": "address", + "internalType": "address" + }, + { + "name": "delegationApprover", + "type": "address", + "internalType": "address" + }, + { + "name": "stakerOptOutWindowBlocks", + "type": "uint32", + "internalType": "uint32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "optIntoSlashing", + "inputs": [ + { + "name": "slasher", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setAuthority", + "inputs": [ + { + "name": "newAuthority", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateOperatorMetadataURI", + "inputs": [ + { + "name": "metadataURI", + "type": "string", + "internalType": "string" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateSignatureProof", + "inputs": [ + { + "name": "digestHash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "signer", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AuthorityUpdated", + "inputs": [ + { + "name": "authority", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AccessManagedInvalidAuthority", + "inputs": [ + { + "name": "authority", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "AccessManagedRequiredDelay", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + }, + { + "name": "delay", + "type": "uint32", + "internalType": "uint32" + } + ] + }, + { + "type": "error", + "name": "AccessManagedUnauthorized", + "inputs": [ + { + "name": "caller", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ECDSAInvalidSignature", + "inputs": [] + }, + { + "type": "error", + "name": "ECDSAInvalidSignatureLength", + "inputs": [ + { + "name": "length", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ECDSAInvalidSignatureS", + "inputs": [ + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "InvalidAddress", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [] + } +] diff --git a/coral-cli/docs/validator.md b/coral-cli/docs/validator.md index 338fee2..6852a55 100644 --- a/coral-cli/docs/validator.md +++ b/coral-cli/docs/validator.md @@ -23,14 +23,29 @@ coral-cli validator list-keys \ ## `validator keygen` Generates BLS keyshares to be used for registering a new validator +### with enclave ``` coral-cli validator keygen \ --guardian-threshold 1 \ --fork-version 0x01017000 \ - --enclave-url http://localhost:9001 \ - --withdrawal-credentials 0x01000000000000000000000049ce199bba75926ab5c6fc16fedd11d418cb2edf + --module-name 0x4e4f5f52455354414b494e470000000000000000000000000000000000000000 \ + --withdrawal-credentials 0x01000000000000000000000049ce199bba75926ab5c6fc16fedd11d418cb2edf \ + --guardian-pubkeys 0x040783e639f5675cd12c86bab61678a2c4be44846b36df9a9648970ea803e92fd8dd25c51660b64f61d20fc04c77c34145410496fd923309a5c143b9c5eadd19e7 \ + --output-file registration_001.json \ + --enclave-url http://localhost:9001 +``` + + +### without enclave +``` +coral-cli validator keygen \ + --guardian-threshold 1 \ + --fork-version 0x01017000 \ + --module-name 0x4e4f5f52455354414b494e470000000000000000000000000000000000000000 \ + --withdrawal-credentials 0x01000000000000000000000049ce199bba75926ab5c6fc16fedd11d418cb2edf \ + --guardian-pubkeys 0x040783e639f5675cd12c86bab61678a2c4be44846b36df9a9648970ea803e92fd8dd25c51660b64f61d20fc04c77c34145410496fd923309a5c143b9c5eadd19e7 \ --output-file registration_001.json \ - --guardian-pubkeys 0x040783e639f5675cd12c86bab61678a2c4be44846b36df9a9648970ea803e92fd8dd25c51660b64f61d20fc04c77c34145410496fd923309a5c143b9c5eadd19e7 + --password-file passwd.txt ``` ## `validator sign-voluntary-exit` diff --git a/coral-cli/src/commands/validator/keygen.rs b/coral-cli/src/commands/validator/keygen.rs index eea20f9..730c341 100644 --- a/coral-cli/src/commands/validator/keygen.rs +++ b/coral-cli/src/commands/validator/keygen.rs @@ -4,6 +4,7 @@ use axum::http::StatusCode; use colored::*; +use coral_lib::utils::parse::parse_module_name; use ecies::PublicKey as EthPublicKey; use hex::ToHex; @@ -18,6 +19,8 @@ use coral_lib::error::{ServerErrorCode, ServerErrorResponse}; use coral_lib::strip_0x_prefix; use coral_lib::structs::eth_types::WithdrawalCredentials; +use crate::APP_VERSION; + #[derive(Clone, Debug, Serialize, Deserialize)] pub struct ForkVersionInfo { pub current_version: String, @@ -28,9 +31,10 @@ pub struct ForkVersionInfo { } #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegisterValidatorInput { +pub struct BlsKeygenInput { pub guardian_pubkeys: Vec, pub guardian_threshold: u64, + pub module_name: String, pub withdrawal_credentials: String, pub fork_version: String, pub output_file: String, @@ -39,30 +43,47 @@ pub struct RegisterValidatorInput { } #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RegisterValidatorOutput { +pub struct BlsKeygenOutput { + pub version: String, pub guardian_threshold: u64, + pub guardian_pubkeys: Vec, + pub module_name: String, pub withdrawal_credentials: String, - pub bls_pub_key_set: String, - pub bls_pub_key: String, + pub fork_version: String, pub signature: String, pub deposit_data_root: String, + pub bls_pub_key_set: String, + pub bls_pub_key: String, pub bls_enc_priv_key_shares: Vec, pub intel_sig: String, pub intel_report: String, pub intel_x509: String, - pub guardian_pubkeys: Vec, +} + +#[derive(Clone, Debug)] +pub struct KeygenCmdInput { + pub guardian_pubkeys: String, + pub guardian_threshold: u64, + pub module_name: String, + pub withdrawal_credentials: String, pub fork_version: String, + pub enclave_url: Option, + pub password_file: Option, + pub output_file: String, } -pub async fn keygen_from_cmd( - guardian_pubkeys: String, - guardian_threshold: u64, - withdrawal_credentials: String, - fork_version: String, - enclave_url: Option, - password_file: Option, - output_file: String, -) -> AppResult { +pub async fn keygen_from_cmd(data: KeygenCmdInput) -> AppResult { + let KeygenCmdInput { + guardian_pubkeys, + guardian_threshold, + module_name, + withdrawal_credentials, + fork_version, + enclave_url, + password_file, + output_file, + } = data; + let guardian_pubkeys: Vec = guardian_pubkeys.split(',').map(|s| s.to_string()).collect(); @@ -78,9 +99,10 @@ pub async fn keygen_from_cmd( } }; - let input_data = RegisterValidatorInput { + let input_data = BlsKeygenInput { guardian_pubkeys, guardian_threshold, + module_name, withdrawal_credentials, fork_version, enclave_url, @@ -91,7 +113,9 @@ pub async fn keygen_from_cmd( register_validator(&input_data).await } -pub async fn register_validator(input_data: &RegisterValidatorInput) -> AppResult { +pub async fn register_validator(input_data: &BlsKeygenInput) -> AppResult { + let module_name = parse_module_name(&input_data.module_name)?; + let mut guardian_pubkeys = Vec::with_capacity(input_data.guardian_pubkeys.len()); for key in input_data.guardian_pubkeys.iter() { let key = strip_0x_prefix(key); @@ -215,20 +239,22 @@ pub async fn register_validator(input_data: &RegisterValidatorInput) -> AppResul } }; - let registraton_payload = RegisterValidatorOutput { + let registraton_payload = BlsKeygenOutput { + version: APP_VERSION.to_string(), guardian_threshold: input_data.guardian_threshold, + guardian_pubkeys: bls_keygen_payload.guardian_eth_pub_keys, + module_name: module_name.encode_hex(), withdrawal_credentials: hex::encode(withdrawal_credentials), + fork_version: genesis_fork_version.encode_hex(), - bls_pub_key_set: bls_keygen_payload.bls_pub_key_set, - bls_pub_key: bls_keygen_payload.bls_pub_key, signature: bls_keygen_payload.signature, deposit_data_root: bls_keygen_payload.deposit_data_root, + bls_pub_key_set: bls_keygen_payload.bls_pub_key_set, + bls_pub_key: bls_keygen_payload.bls_pub_key, bls_enc_priv_key_shares: bls_keygen_payload.bls_enc_priv_key_shares, intel_sig: bls_keygen_payload.intel_sig, intel_report: bls_keygen_payload.intel_report, intel_x509: bls_keygen_payload.intel_x509, - guardian_pubkeys: bls_keygen_payload.guardian_eth_pub_keys, - fork_version: genesis_fork_version.encode_hex(), }; let json_string_pretty = serde_json::to_string_pretty(®istraton_payload)?; diff --git a/coral-cli/src/commands/validator/mod.rs b/coral-cli/src/commands/validator/mod.rs index f48c65d..8ea0a35 100644 --- a/coral-cli/src/commands/validator/mod.rs +++ b/coral-cli/src/commands/validator/mod.rs @@ -28,6 +28,8 @@ pub enum ValidatorCommand { guardian_pubkeys: String, #[arg(long = "guardian-threshold")] guardian_threshold: u64, + #[arg(long = "module-name")] + module_name: String, #[arg(long = "withdrawal-credentials")] withdrawal_credentials: String, #[arg(long = "fork-version")] @@ -113,22 +115,24 @@ impl ValidatorCommand { Self::Keygen { guardian_pubkeys, guardian_threshold, + module_name, withdrawal_credentials, fork_version, enclave_url, password_file, output_file, } => { - keygen::keygen_from_cmd( + let data = keygen::KeygenCmdInput { guardian_pubkeys, guardian_threshold, + module_name, withdrawal_credentials, fork_version, enclave_url, password_file, output_file, - ) - .await?; + }; + keygen::keygen_from_cmd(data).await?; } Self::WithdrawalCredentials { rpc_url, diff --git a/coral-cli/src/commands/validator/register_calldata.rs b/coral-cli/src/commands/validator/register_calldata.rs index b4bc69e..e2c0a3a 100644 --- a/coral-cli/src/commands/validator/register_calldata.rs +++ b/coral-cli/src/commands/validator/register_calldata.rs @@ -11,7 +11,7 @@ use ethers::utils::hex; use coral_lib::utils; use crate::{ - commands::validator::keygen::RegisterValidatorOutput, Permit, ValidatorKeyData, ValidatorTicket, + commands::validator::keygen::BlsKeygenOutput, Permit, ValidatorKeyData, ValidatorTicket, }; use crate::PufferProtocol; @@ -54,7 +54,7 @@ pub async fn generate_register_calldata( let client = utils::ethereum::get_client(provider.clone(), wallet.clone(), chain_id.as_u64()); let content = std::fs::read_to_string(input_file)?; - let keygen_data: RegisterValidatorOutput = serde_json::from_str(&content).unwrap(); + let keygen_data: BlsKeygenOutput = serde_json::from_str(&content).unwrap(); println!("Generating calldata..."); diff --git a/coral-cli/src/commands/validator/register_key.rs b/coral-cli/src/commands/validator/register_key.rs index 4ed9f2b..1e3b551 100644 --- a/coral-cli/src/commands/validator/register_key.rs +++ b/coral-cli/src/commands/validator/register_key.rs @@ -12,7 +12,7 @@ use ethers::utils::hex::{self, ToHex}; use coral_lib::utils; use crate::{ - commands::validator::keygen::RegisterValidatorOutput, Permit, PufferOracle, ValidatorKeyData, + commands::validator::keygen::BlsKeygenOutput, Permit, PufferOracle, ValidatorKeyData, ValidatorTicket, }; @@ -69,7 +69,7 @@ pub async fn register_validator_key( let client = utils::ethereum::get_client(provider.clone(), wallet.clone(), chain_id.as_u64()); let content = std::fs::read_to_string(input_file)?; - let keygen_data: RegisterValidatorOutput = serde_json::from_str(&content).unwrap(); + let keygen_data: BlsKeygenOutput = serde_json::from_str(&content).unwrap(); println!("Generating calldata..."); diff --git a/coral-cli/src/main.rs b/coral-cli/src/main.rs index c65e6d4..fff9b85 100644 --- a/coral-cli/src/main.rs +++ b/coral-cli/src/main.rs @@ -16,9 +16,10 @@ abigen!(PufferOracle, "./abi/PufferOracle.json"); abigen!(PufferProtocol, "./abi/PufferProtocol.json"); abigen!(ValidatorTicket, "./abi/ValidatorTicket.json"); +pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); + pub fn print_version() { - let version = env!("CARGO_PKG_VERSION"); - println!("{PROGRAM_NAME}-{version}"); + println!("{PROGRAM_NAME}-{APP_VERSION}"); } async fn run_main(args: CommandArgs) -> AppResult {