From 27fc8ad7a09dd1a840fefddfb6508038170dcce7 Mon Sep 17 00:00:00 2001 From: Dmitri Tsumak Date: Fri, 22 Mar 2024 23:52:54 +0200 Subject: [PATCH] Extract vault EigenPod to separate contract --- abi/IEigenBlocklistErc20Vault.json | 490 +------------ abi/IEigenBlocklistVault.json | 490 +------------ abi/IEigenErc20Vault.json | 490 +------------ abi/IEigenPodManager.json | 19 + abi/IEigenPodProxyFactory.json | 15 - abi/IEigenPods.json | 652 ++++++++++++++++++ abi/IEigenPrivErc20Vault.json | 490 +------------ abi/IEigenPrivVault.json | 490 +------------ abi/IEigenVault.json | 490 +------------ abi/IOwnable.json | 15 - abi/IVaultEigenStaking.json | 490 +------------ contracts/interfaces/IEigenPodManager.sol | 7 + .../interfaces/IEigenPodProxyFactory.sol | 16 - contracts/interfaces/IEigenPods.sol | 240 +++++++ contracts/interfaces/IOwnable.sol | 16 - contracts/interfaces/IVaultEigenStaking.sol | 183 +---- .../eigenLayer/EigenBlocklistErc20Vault.sol | 14 +- .../vaults/eigenLayer/EigenBlocklistVault.sol | 14 +- .../vaults/eigenLayer/EigenErc20Vault.sol | 16 +- .../vaults/eigenLayer/EigenPrivErc20Vault.sol | 14 +- .../vaults/eigenLayer/EigenPrivVault.sol | 14 +- contracts/vaults/eigenLayer/EigenVault.sol | 16 +- .../eigenLayer/eigenPod/EigenPodProxy.sol | 5 +- .../eigenPod/EigenPodProxyFactory.sol | 18 - .../vaults/eigenLayer/eigenPod/EigenPods.sol | 475 +++++++++++++ .../vaults/modules/VaultEigenStaking.sol | 393 +---------- 26 files changed, 1479 insertions(+), 4093 deletions(-) delete mode 100644 abi/IEigenPodProxyFactory.json create mode 100644 abi/IEigenPods.json delete mode 100644 abi/IOwnable.json delete mode 100644 contracts/interfaces/IEigenPodProxyFactory.sol create mode 100644 contracts/interfaces/IEigenPods.sol delete mode 100644 contracts/interfaces/IOwnable.sol delete mode 100644 contracts/vaults/eigenLayer/eigenPod/EigenPodProxyFactory.sol create mode 100644 contracts/vaults/eigenLayer/eigenPod/EigenPods.sol diff --git a/abi/IEigenBlocklistErc20Vault.json b/abi/IEigenBlocklistErc20Vault.json index 3acb46f9..1779bfeb 100644 --- a/abi/IEigenBlocklistErc20Vault.json +++ b/abi/IEigenBlocklistErc20Vault.json @@ -124,107 +124,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -699,154 +598,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -885,19 +636,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "decimals", @@ -935,32 +673,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -1076,61 +788,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1266,123 +933,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1476,32 +1026,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IEigenBlocklistVault.json b/abi/IEigenBlocklistVault.json index 4a06581c..0468c57c 100644 --- a/abi/IEigenBlocklistVault.json +++ b/abi/IEigenBlocklistVault.json @@ -99,107 +99,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -569,154 +468,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -755,19 +506,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -792,32 +530,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -933,61 +645,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1048,123 +715,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1258,32 +808,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IEigenErc20Vault.json b/abi/IEigenErc20Vault.json index 41709e1b..a36e13b9 100644 --- a/abi/IEigenErc20Vault.json +++ b/abi/IEigenErc20Vault.json @@ -80,107 +80,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -623,154 +522,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -809,19 +560,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "decimals", @@ -859,32 +597,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -1000,61 +712,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1190,123 +857,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1387,32 +937,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IEigenPodManager.json b/abi/IEigenPodManager.json index 63e0d082..fe3e383a 100644 --- a/abi/IEigenPodManager.json +++ b/abi/IEigenPodManager.json @@ -11,5 +11,24 @@ ], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ownerToPod", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ] diff --git a/abi/IEigenPodProxyFactory.json b/abi/IEigenPodProxyFactory.json deleted file mode 100644 index c50bc91f..00000000 --- a/abi/IEigenPodProxyFactory.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "inputs": [], - "name": "createProxy", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/abi/IEigenPods.json b/abi/IEigenPods.json new file mode 100644 index 00000000..881fbf30 --- /dev/null +++ b/abi/IEigenPods.json @@ -0,0 +1,652 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "eigenOperatorUpdateRoot", + "type": "bytes32" + } + ], + "name": "EigenOperatorUpdateCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOperator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "eigenOperatorUpdateRoot", + "type": "bytes32" + } + ], + "name": "EigenOperatorUpdateInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "eigenPodProxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "eigenPod", + "type": "address" + } + ], + "name": "EigenPodCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "EigenPodsManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "EigenWithdrawalsManagerUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "delegatedTo", + "type": "address" + }, + { + "internalType": "uint32", + "name": "startBlock", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "internalType": "struct IEigenPods.EigenWithdrawal[]", + "name": "eigenWithdrawals", + "type": "tuple[]" + } + ], + "name": "completeEigenFullWithdrawals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "delegatedTo", + "type": "address" + }, + { + "internalType": "uint32", + "name": "startBlock", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "internalType": "struct IEigenPods.EigenWithdrawal", + "name": "eigenWithdrawal", + "type": "tuple" + } + ], + "name": "completeEigenOperatorUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxClaimsCount", + "type": "uint256" + } + ], + "name": "completeEigenPartialWithdrawals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "internalType": "uint64", + "name": "oracleTimestamp", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "beaconStateRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "internalType": "struct IEigenPod.StateRootProof", + "name": "stateRootProof", + "type": "tuple" + }, + { + "internalType": "uint40[]", + "name": "validatorIndices", + "type": "uint40[]" + }, + { + "internalType": "bytes[]", + "name": "validatorFieldsProofs", + "type": "bytes[]" + }, + { + "internalType": "bytes32[][]", + "name": "validatorFields", + "type": "bytes32[][]" + } + ], + "name": "completeEigenValidatorsRegistration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + } + ], + "name": "createEigenPod", + "outputs": [ + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pod", + "type": "address" + } + ], + "name": "getPodProxy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + } + ], + "name": "getPods", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + } + ], + "name": "getPodsManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyPod", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + } + ], + "name": "getWithdrawalsManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "initiateEigenFullWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "internalType": "address", + "name": "newOperator", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", + "name": "approverSignatureAndExpiry", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "approverSalt", + "type": "bytes32" + } + ], + "name": "initiateEigenOperatorUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "pod", + "type": "address" + } + ], + "name": "isVaultPod", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "eigenPod", + "type": "address" + }, + { + "internalType": "uint64", + "name": "oracleTimestamp", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "beaconStateRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "internalType": "struct IEigenPod.StateRootProof", + "name": "stateRootProof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bytes", + "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": "uint64", + "name": "blockRootIndex", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "historicalSummaryIndex", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "withdrawalIndex", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "blockRoot", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "slotRoot", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "timestampRoot", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "executionPayloadRoot", + "type": "bytes32" + } + ], + "internalType": "struct IEigenPod.WithdrawalProof[]", + "name": "withdrawalProofs", + "type": "tuple[]" + }, + { + "internalType": "bytes[]", + "name": "validatorFieldsProofs", + "type": "bytes[]" + }, + { + "internalType": "bytes32[][]", + "name": "validatorFields", + "type": "bytes32[][]" + }, + { + "internalType": "bytes32[][]", + "name": "withdrawalFields", + "type": "bytes32[][]" + } + ], + "name": "processEigenFullAndPartialWithdrawals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "setPodsManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault", + "type": "address" + }, + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "setWithdrawalsManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IEigenPrivErc20Vault.json b/abi/IEigenPrivErc20Vault.json index 89a5ce69..39f23c16 100644 --- a/abi/IEigenPrivErc20Vault.json +++ b/abi/IEigenPrivErc20Vault.json @@ -80,107 +80,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -667,154 +566,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -853,19 +604,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "decimals", @@ -903,32 +641,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -1044,61 +756,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1234,123 +901,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1431,32 +981,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IEigenPrivVault.json b/abi/IEigenPrivVault.json index cc03aaaa..183c74af 100644 --- a/abi/IEigenPrivVault.json +++ b/abi/IEigenPrivVault.json @@ -55,107 +55,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -537,154 +436,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -723,19 +474,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -760,32 +498,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -901,61 +613,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1016,123 +683,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1213,32 +763,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IEigenVault.json b/abi/IEigenVault.json index 4b3bce9c..01685e06 100644 --- a/abi/IEigenVault.json +++ b/abi/IEigenVault.json @@ -55,107 +55,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -493,154 +392,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -679,19 +430,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -716,32 +454,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -857,61 +569,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -972,123 +639,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "proxiableUUID", @@ -1169,32 +719,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/abi/IOwnable.json b/abi/IOwnable.json deleted file mode 100644 index c8cd3884..00000000 --- a/abi/IOwnable.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/abi/IVaultEigenStaking.json b/abi/IVaultEigenStaking.json index 535bde81..94184788 100644 --- a/abi/IVaultEigenStaking.json +++ b/abi/IVaultEigenStaking.json @@ -55,107 +55,6 @@ "name": "Deposited", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateCompleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "eigenOperatorUpdateRoot", - "type": "bytes32" - } - ], - "name": "EigenOperatorUpdateInitiated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operatorsManager", - "type": "address" - } - ], - "name": "EigenOperatorsManagerUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "eigenPodProxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "eigenPod", - "type": "address" - } - ], - "name": "EigenPodCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "withdrawalsManager", - "type": "address" - } - ], - "name": "EigenWithdrawalsManagerUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -493,154 +392,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal[]", - "name": "eigenWithdrawals", - "type": "tuple[]" - } - ], - "name": "completeEigenFullWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "delegatedTo", - "type": "address" - }, - { - "internalType": "uint32", - "name": "startBlock", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "internalType": "struct IVaultEigenStaking.EigenWithdrawal", - "name": "eigenWithdrawal", - "type": "tuple" - } - ], - "name": "completeEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxClaimsCount", - "type": "uint256" - } - ], - "name": "completeEigenPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "internalType": "uint40[]", - "name": "validatorIndices", - "type": "uint40[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - } - ], - "name": "completeEigenValidatorsRegistration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -679,19 +430,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "createEigenPod", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -716,32 +454,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "eigenOperatorsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eigenWithdrawalsManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -831,61 +543,16 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "initiateEigenFullWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "address", - "name": "newOperator", - "type": "address" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct IEigenDelegationManager.SignatureWithExpiry", - "name": "approverSignatureAndExpiry", - "type": "tuple" - }, + "inputs": [], + "name": "isEigenVault", + "outputs": [ { - "internalType": "bytes32", - "name": "approverSalt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "initiateEigenOperatorUpdate", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -927,123 +594,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenPod", - "type": "address" - }, - { - "internalType": "uint64", - "name": "oracleTimestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "beaconStateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "internalType": "struct IEigenPod.StateRootProof", - "name": "stateRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "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": "uint64", - "name": "blockRootIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "historicalSummaryIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "withdrawalIndex", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "blockRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "slotRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "timestampRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "executionPayloadRoot", - "type": "bytes32" - } - ], - "internalType": "struct IEigenPod.WithdrawalProof[]", - "name": "withdrawalProofs", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "validatorFieldsProofs", - "type": "bytes[]" - }, - { - "internalType": "bytes32[][]", - "name": "validatorFields", - "type": "bytes32[][]" - }, - { - "internalType": "bytes32[][]", - "name": "withdrawalFields", - "type": "bytes32[][]" - } - ], - "name": "processEigenFullAndPartialWithdrawals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "queuedShares", @@ -1111,32 +661,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenOperatorsManager_", - "type": "address" - } - ], - "name": "setEigenOperatorsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "eigenWithdrawalsManager_", - "type": "address" - } - ], - "name": "setEigenWithdrawalsManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/contracts/interfaces/IEigenPodManager.sol b/contracts/interfaces/IEigenPodManager.sol index 03d0e110..c061fcfe 100644 --- a/contracts/interfaces/IEigenPodManager.sol +++ b/contracts/interfaces/IEigenPodManager.sol @@ -14,4 +14,11 @@ interface IEigenPodManager { * @return The address of the new EigenPod contract */ function createPod() external returns (address); + + /** + * @notice Pod owner to deployed EigenPod address. + * @param owner The address of the owner + * @return The address of the EigenPod contract + */ + function ownerToPod(address owner) external view returns (address); } diff --git a/contracts/interfaces/IEigenPodProxyFactory.sol b/contracts/interfaces/IEigenPodProxyFactory.sol deleted file mode 100644 index 335b6618..00000000 --- a/contracts/interfaces/IEigenPodProxyFactory.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 - -pragma solidity =0.8.22; - -/** - * @title IEigenPodProxyFactory - * @author StakeWise - * @notice Defines the interface for the EigenPodProxyFactory contract - */ -interface IEigenPodProxyFactory { - /** - * @notice Creates a new EigenPod proxy contract. - * @return proxy The address of the newly created proxy contract - */ - function createProxy() external returns (address); -} diff --git a/contracts/interfaces/IEigenPods.sol b/contracts/interfaces/IEigenPods.sol new file mode 100644 index 00000000..9bc0d6fe --- /dev/null +++ b/contracts/interfaces/IEigenPods.sol @@ -0,0 +1,240 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity =0.8.22; + +import {IMulticall} from './IMulticall.sol'; +import {IEigenDelegationManager} from './IEigenDelegationManager.sol'; +import {IEigenPod} from './IEigenPod.sol'; + +/** + * @title IEigenPods + * @author StakeWise + * @notice Defines the interface for the EigenPods contract + */ +interface IEigenPods is IMulticall { + /** + * @notice Struct used to represent a withdrawal from the EigenLayer. + * @param delegatedTo The address that the staker was delegated to at the time that the Withdrawal was created + * @param nonce Nonce used to guarantee that otherwise identical withdrawals have unique hashes + * @param startBlock Block number when the Withdrawal was created + * @param assets The amount of assets to withdraw + */ + struct EigenWithdrawal { + address delegatedTo; + uint32 startBlock; + uint256 nonce; + uint256 assets; + } + + /** + * @notice Event emitted when the pods manager is updated + * @param vault The address of the Vault contract + * @param manager The address of the new pods manager + */ + event EigenPodsManagerUpdated(address indexed vault, address manager); + + /** + * @notice Event emitted when the withdrawals manager is updated + * @param vault The address of the Vault contract + * @param manager The address of the new withdrawals manager + */ + event EigenWithdrawalsManagerUpdated(address indexed vault, address manager); + + /** + * @notice Event emitted when a new EigenPod is created + * @param vault The address of the Vault contract + * @param eigenPodProxy The address of the new EigenPod proxy + * @param eigenPod The address of the new EigenPod contract + */ + event EigenPodCreated(address indexed vault, address eigenPodProxy, address eigenPod); + + /** + * @notice Event emitted when the EigenLayer operator update is initiated + * @param vault The address of the Vault contract + * @param eigenPod The address of the EigenPod contract + * @param newOperator The address of the new EigenLayer operator + * @param eigenOperatorUpdateRoot The hash of the assets withdrawal + */ + event EigenOperatorUpdateInitiated( + address indexed vault, + address eigenPod, + address newOperator, + bytes32 eigenOperatorUpdateRoot + ); + + /** + * @notice Event emitted when the EigenLayer operator update is completed + * @param vault The address of the Vault contract + * @param eigenPod The address of the EigenPod contract + * @param eigenOperatorUpdateRoot The hash of the assets withdrawal that got transferred to the new operator + */ + event EigenOperatorUpdateCompleted( + address indexed vault, + address eigenPod, + bytes32 eigenOperatorUpdateRoot + ); + + /** + * @notice Function for getting the pods manager for a given Vault. Default is the admin of the Vault. + * @param vault The address of the Vault contract + * @return The address of the pods manager + */ + function getPodsManager(address vault) external view returns (address); + + /** + * @notice Function for getting the withdrawals manager for a given Vault. Default is the admin of the Vault. + * @param vault The address of the Vault contract + * @return The address of the withdrawals manager + */ + function getWithdrawalsManager(address vault) external view returns (address); + + /** + * @notice Function for checking whether the pod belongs to the Vault + * @param vault The address of the Vault contract + * @param pod The address of the EigenPod contract + * @return True if the pod belongs to the Vault, false otherwise + */ + function isVaultPod(address vault, address pod) external view returns (bool); + + /** + * @notice Function for getting the pods for a given Vault + * @param vault The address of the Vault contract + * @return The array of Eigen pod addresses + */ + function getPods(address vault) external view returns (address[] memory); + + /** + * @notice Function for getting the proxy for a given EigenPod. + * The proxies are used for the vaults to delegate to multiple Eigenlayer operators. + * @param pod The address of the EigenPod contract + * @return The address of the EigenPodProxy contract + */ + function getPodProxy(address pod) external view returns (address); + + /** + * @notice Function for getting the EigenPod for a given proxy. + * @param proxy The address of the EigenPodProxy contract + * @return The address of the EigenPod contract + */ + function getProxyPod(address proxy) external view returns (address); + + /** + * @notice Function for setting the pods manager for a given Vault. Can only be called by the Vault admin. + * @param vault The address of the Vault contract + * @param manager The address of the pods manager + */ + function setPodsManager(address vault, address manager) external; + + /** + * @notice Function for setting the withdrawals manager for a given Vault. Can only be called by the Vault admin. + * @param vault The address of the Vault contract + * @param manager The address of the withdrawals manager + */ + function setWithdrawalsManager(address vault, address manager) external; + + /** + * @notice Function for creating an EigenPod for a given Vault. Can only be called by the Vault or pods manager. + * @param vault The address of the Vault contract + * @return eigenPod The address of the new EigenPod contract + */ + function createEigenPod(address vault) external returns (address eigenPod); + + /** + * @notice Verifies that the withdrawal credentials of validator(s) owned by the Vault are pointed to the EigenPod contract. + * Must be called by the operator once registered validators are included in the Beacon Chain. + * @param eigenPod The address of the EigenPod contract + * @param oracleTimestamp The Beacon Chain timestamp whose state root the `proof` will be proven against. + * @param stateRootProof Proves a `beaconStateRoot` against a block root fetched from the oracle + * @param validatorIndices The list of indices of the validators being proven, refer to consensus specs + * @param validatorFieldsProofs Proves against the `beaconStateRoot` for each validator in `validatorFields` + * @param validatorFields The fields of the "Validator Container", refer to consensus specs + * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator + */ + function completeEigenValidatorsRegistration( + address eigenPod, + uint64 oracleTimestamp, + IEigenPod.StateRootProof calldata stateRootProof, + uint40[] calldata validatorIndices, + bytes[] calldata validatorFieldsProofs, + bytes32[][] calldata validatorFields + ) external; + + /** + * @notice Function for initiating EigenLayer operator update. The vault assets will be delegated to the new operator. + * Can only be called by the pods manager. + * @param vault The address of the Vault contract + * @param eigenPod The address of the EigenPod contract + * @param newOperator The address of the new EigenLayer operator + * @param approverSignatureAndExpiry Verifies the operator approves of this delegation + * @param approverSalt A unique single use value tied to an individual signature + */ + function initiateEigenOperatorUpdate( + address vault, + address eigenPod, + address newOperator, + IEigenDelegationManager.SignatureWithExpiry memory approverSignatureAndExpiry, + bytes32 approverSalt + ) external; + + /** + * @notice Function for completing EigenLayer operator update. The vault assets will be delegated to the new operator. + * If the new operator is zero address, the vault assets will be undelegated. + * @param vault The address of the Vault contract + * @param eigenPod The address of the EigenPod contract + * @param eigenWithdrawal The withdrawal details to complete transferring assets to the new operator. + */ + function completeEigenOperatorUpdate( + address vault, + address eigenPod, + EigenWithdrawal calldata eigenWithdrawal + ) external; + + /** + * @notice Function for initiating EigenLayer full withdrawals. The withdrawal can be completed after the withdrawal delay. + * Can only be called by the pods manager or the owner of the contract. + * @param vault The address of the Vault contract + * @param eigenPod The address of the EigenPod contract + * @param assets The amount of assets to withdraw. + */ + function initiateEigenFullWithdrawal(address vault, address eigenPod, uint256 assets) external; + + /** + * @notice This function records full and partial withdrawals on behalf of one or more of this EigenPod's validators. + * The partial withdrawals can be completed after the transfer delay. + * @param eigenPod The address of the EigenPod contract + * @param oracleTimestamp The timestamp of the oracle slot that the withdrawal is being proven against + * @param stateRootProof Proves a `beaconStateRoot` against a block root fetched from the oracle + * @param withdrawalProofs Proves several withdrawal-related values against the `beaconStateRoot` + * @param validatorFieldsProofs Proves `validatorFields` against the `beaconStateRoot` + * @param withdrawalFields The fields of the withdrawals being proven + * @param validatorFields The fields of the validators being proven + */ + function processEigenFullAndPartialWithdrawals( + address eigenPod, + uint64 oracleTimestamp, + IEigenPod.StateRootProof calldata stateRootProof, + IEigenPod.WithdrawalProof[] calldata withdrawalProofs, + bytes[] calldata validatorFieldsProofs, + bytes32[][] calldata validatorFields, + bytes32[][] calldata withdrawalFields + ) external; + + /** + * @notice Function for completing EigenLayer partial withdrawals. The withdrawn assets will be transferred to the Vault. + * Make sure to call `processEigenFullAndPartialWithdrawals` before calling this function. + * @param eigenPod The address of the EigenPod contract + * @param maxClaimsCount The maximum number of claims to complete + */ + function completeEigenPartialWithdrawals(address eigenPod, uint256 maxClaimsCount) external; + + /** + * @notice Function for completing EigenLayer full withdrawals. The withdrawn assets will be transferred to the Vault. + * Make sure to call `processEigenFullAndPartialWithdrawals` before calling this function. + * @param eigenPod The address of the EigenPod contract + * @param eigenWithdrawals The withdrawals to complete + */ + function completeEigenFullWithdrawals( + address eigenPod, + EigenWithdrawal[] calldata eigenWithdrawals + ) external; +} diff --git a/contracts/interfaces/IOwnable.sol b/contracts/interfaces/IOwnable.sol deleted file mode 100644 index e6c64845..00000000 --- a/contracts/interfaces/IOwnable.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 - -pragma solidity =0.8.22; - -/** - * @title IOwnable - * @author StakeWise - * @notice Defines the interface for the Ownable contract - */ -interface IOwnable { - /** - * @notice Returns the address of the owner of the contract. - * @return The address of the owner - */ - function owner() external view returns (address); -} diff --git a/contracts/interfaces/IVaultEigenStaking.sol b/contracts/interfaces/IVaultEigenStaking.sol index caa43af8..654f0180 100644 --- a/contracts/interfaces/IVaultEigenStaking.sol +++ b/contracts/interfaces/IVaultEigenStaking.sol @@ -2,12 +2,8 @@ pragma solidity =0.8.22; -import {IEigenDelegationManager} from './IEigenDelegationManager.sol'; -import {IVaultState} from './IVaultState.sol'; import {IVaultValidators} from './IVaultValidators.sol'; import {IVaultEthStaking} from './IVaultEthStaking.sol'; -import {IVaultMev} from './IVaultMev.sol'; -import {IEigenPod} from './IEigenPod.sol'; /** * @title IVaultEigenStaking @@ -16,182 +12,13 @@ import {IEigenPod} from './IEigenPod.sol'; */ interface IVaultEigenStaking is IVaultValidators, IVaultEthStaking { /** - * @notice Struct used to represent a withdrawal from the EigenLayer. - * @param delegatedTo The address that the staker was delegated to at the time that the Withdrawal was created - * @param nonce Nonce used to guarantee that otherwise identical withdrawals have unique hashes - * @param startBlock Block number when the Withdrawal was created - * @param assets The amount of assets to withdraw - */ - struct EigenWithdrawal { - address delegatedTo; - uint32 startBlock; - uint256 nonce; - uint256 assets; - } - - /** - * @notice Event emitted when a new EigenPod is created - * @param eigenPodProxy The address of the new EigenPod proxy - * @param eigenPod The address of the new EigenPod contract - */ - event EigenPodCreated(address eigenPodProxy, address eigenPod); - - /** - * @notice Event emitted when the EigenLayer operator update is initiated - * @param eigenPod The address of the EigenPod contract - * @param newOperator The address of the new EigenLayer operator - * @param eigenOperatorUpdateRoot The hash of the assets withdrawal - */ - event EigenOperatorUpdateInitiated( - address eigenPod, - address newOperator, - bytes32 eigenOperatorUpdateRoot - ); - - /** - * @notice Event emitted when the EigenLayer operator update is completed - * @param eigenPod The address of the EigenPod contract - * @param eigenOperatorUpdateRoot The hash of the assets withdrawal that got transferred to the new operator - */ - event EigenOperatorUpdateCompleted(address eigenPod, bytes32 eigenOperatorUpdateRoot); - - /** - * @notice Event emitted when the EigenLayer operators manager is updated - * @param caller The address of the function caller - * @param operatorsManager The address of the new EigenLayer operators manager - */ - event EigenOperatorsManagerUpdated(address indexed caller, address indexed operatorsManager); - - /** - * @notice Event emitted when the EigenLayer withdrawals manager is updated - * @param caller The address of the function caller - * @param withdrawalsManager The address of the new EigenLayer withdrawals manager - */ - event EigenWithdrawalsManagerUpdated(address indexed caller, address indexed withdrawalsManager); - - /** - * @notice EigenLayer operators and pods manager - * @return The address of the EigenLayer operators manager - */ - function eigenOperatorsManager() external view returns (address); - - /** - * @notice EigenLayer withdrawals manager - * @return The address that can initiate full withdrawals from the EigenLayer - */ - function eigenWithdrawalsManager() external view returns (address); - - /** - * @notice Function for setting the EigenLayer operators manager. Can only be called by the admin. - * @param eigenOperatorsManager_ The address of the new EigenLayer operators manager - */ - function setEigenOperatorsManager(address eigenOperatorsManager_) external; - - /** - * @notice Function for setting the EigenLayer withdrawals manager. Can only be called by the admin. - * @param eigenWithdrawalsManager_ The address of the new EigenLayer withdrawals manager - */ - function setEigenWithdrawalsManager(address eigenWithdrawalsManager_) external; - - /** - * @notice Function for creating a new EigenPod. The Vault will be the owner of the new EigenPod. - */ - function createEigenPod() external returns (address); - - /** - * @notice Verifies that the withdrawal credentials of validator(s) owned by the Vault are pointed to the EigenPod contract. - * Must be called by the operator once registered validators are included in the Beacon Chain. - * @param eigenPod The address of the EigenPod contract - * @param oracleTimestamp The Beacon Chain timestamp whose state root the `proof` will be proven against. - * @param stateRootProof Proves a `beaconStateRoot` against a block root fetched from the oracle - * @param validatorIndices The list of indices of the validators being proven, refer to consensus specs - * @param validatorFieldsProofs Proves against the `beaconStateRoot` for each validator in `validatorFields` - * @param validatorFields The fields of the "Validator Container", refer to consensus specs - * for details: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator - */ - function completeEigenValidatorsRegistration( - address eigenPod, - uint64 oracleTimestamp, - IEigenPod.StateRootProof calldata stateRootProof, - uint40[] calldata validatorIndices, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields - ) external; - - /** - * @notice Function for initiating EigenLayer operator update. The vault assets will be delegated to the new operator. - * @param eigenPod The address of the EigenPod contract - * @param newOperator The address of the new EigenLayer operator - * @param approverSignatureAndExpiry Verifies the operator approves of this delegation - * @param approverSalt A unique single use value tied to an individual signature - */ - function initiateEigenOperatorUpdate( - address eigenPod, - address newOperator, - IEigenDelegationManager.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 approverSalt - ) external; - - /** - * @notice Function for completing EigenLayer operator update. The vault assets will be delegated to the new operator. - * If the new operator is zero address, the vault assets will be undelegated. - * @param eigenPod The address of the EigenPod contract - * @param eigenWithdrawal The withdrawal details to complete transferring assets to the new operator. - */ - function completeEigenOperatorUpdate( - address eigenPod, - EigenWithdrawal calldata eigenWithdrawal - ) external; - - /** - * @notice Function for initiating EigenLayer full withdrawals. The withdrawal can be completed after the withdrawal delay. - * @param eigenPod The address of the EigenPod contract - * @param assets The amount of assets to withdraw. - */ - function initiateEigenFullWithdrawal(address eigenPod, uint256 assets) external; - - /** - * @notice This function records full and partial withdrawals on behalf of one or more of this EigenPod's validators. - * The partial withdrawals can be completed after the transfer delay. - * @param eigenPod The address of the EigenPod contract - * @param oracleTimestamp The timestamp of the oracle slot that the withdrawal is being proven against - * @param stateRootProof Proves a `beaconStateRoot` against a block root fetched from the oracle - * @param withdrawalProofs Proves several withdrawal-related values against the `beaconStateRoot` - * @param validatorFieldsProofs Proves `validatorFields` against the `beaconStateRoot` - * @param withdrawalFields The fields of the withdrawals being proven - * @param validatorFields The fields of the validators being proven - */ - function processEigenFullAndPartialWithdrawals( - address eigenPod, - uint64 oracleTimestamp, - IEigenPod.StateRootProof calldata stateRootProof, - IEigenPod.WithdrawalProof[] calldata withdrawalProofs, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields, - bytes32[][] calldata withdrawalFields - ) external; - - /** - * @notice Function for completing EigenLayer partial withdrawals. The withdrawn assets will be transferred to the Vault. - * Make sure to call `processEigenFullAndPartialWithdrawals` before calling this function. - * @param eigenPod The address of the EigenPod contract - * @param maxClaimsCount The maximum number of claims to complete - */ - function completeEigenPartialWithdrawals(address eigenPod, uint256 maxClaimsCount) external; - - /** - * @notice Function for completing EigenLayer full withdrawals. The withdrawn assets will be transferred to the Vault. - * Make sure to call `processEigenFullAndPartialWithdrawals` before calling this function. - * @param eigenPod The address of the EigenPod contract - * @param eigenWithdrawals The withdrawals to complete + * @notice Function for receiving assets from the EigenPodProxy. */ - function completeEigenFullWithdrawals( - address eigenPod, - EigenWithdrawal[] calldata eigenWithdrawals - ) external; + function receiveEigenAssets() external payable; /** - * @notice Function for receiving assets from the EigenPodProxy. + * @notice Checks if the contract is an EigenVault. + * @return True if the contract is an EigenVault, false otherwise. */ - function receiveEigenAssets() external payable; + function isEigenVault() external pure returns (bool); } diff --git a/contracts/vaults/eigenLayer/EigenBlocklistErc20Vault.sol b/contracts/vaults/eigenLayer/EigenBlocklistErc20Vault.sol index 84a52acf..a80c4347 100644 --- a/contracts/vaults/eigenLayer/EigenBlocklistErc20Vault.sol +++ b/contracts/vaults/eigenLayer/EigenBlocklistErc20Vault.sol @@ -34,9 +34,7 @@ contract EigenBlocklistErc20Vault is * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -46,10 +44,7 @@ contract EigenBlocklistErc20Vault is address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) EigenErc20Vault( @@ -58,10 +53,7 @@ contract EigenBlocklistErc20Vault is _validatorsRegistry, sharedMevEscrow, depositDataManager, - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory, + eigenPods, exitingAssetsClaimDelay ) {} diff --git a/contracts/vaults/eigenLayer/EigenBlocklistVault.sol b/contracts/vaults/eigenLayer/EigenBlocklistVault.sol index 753d7cb1..205e59f0 100644 --- a/contracts/vaults/eigenLayer/EigenBlocklistVault.sol +++ b/contracts/vaults/eigenLayer/EigenBlocklistVault.sol @@ -28,9 +28,7 @@ contract EigenBlocklistVault is Initializable, EigenVault, VaultBlocklist, IEige * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -40,10 +38,7 @@ contract EigenBlocklistVault is Initializable, EigenVault, VaultBlocklist, IEige address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) EigenVault( @@ -52,10 +47,7 @@ contract EigenBlocklistVault is Initializable, EigenVault, VaultBlocklist, IEige _validatorsRegistry, sharedMevEscrow, depositDataManager, - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory, + eigenPods, exitingAssetsClaimDelay ) {} diff --git a/contracts/vaults/eigenLayer/EigenErc20Vault.sol b/contracts/vaults/eigenLayer/EigenErc20Vault.sol index 0eaaeb63..348af6b6 100644 --- a/contracts/vaults/eigenLayer/EigenErc20Vault.sol +++ b/contracts/vaults/eigenLayer/EigenErc20Vault.sol @@ -52,9 +52,7 @@ contract EigenErc20Vault is * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -64,22 +62,14 @@ contract EigenErc20Vault is address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) VaultImmutables(_keeper, _vaultsRegistry, _validatorsRegistry) VaultValidators(depositDataManager) VaultEnterExit(exitingAssetsClaimDelay) VaultMev(sharedMevEscrow) - VaultEigenStaking( - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory - ) + VaultEigenStaking(eigenPods) { _disableInitializers(); } diff --git a/contracts/vaults/eigenLayer/EigenPrivErc20Vault.sol b/contracts/vaults/eigenLayer/EigenPrivErc20Vault.sol index 12d7efd3..7643deca 100644 --- a/contracts/vaults/eigenLayer/EigenPrivErc20Vault.sol +++ b/contracts/vaults/eigenLayer/EigenPrivErc20Vault.sol @@ -34,9 +34,7 @@ contract EigenPrivErc20Vault is * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -46,10 +44,7 @@ contract EigenPrivErc20Vault is address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) EigenErc20Vault( @@ -58,10 +53,7 @@ contract EigenPrivErc20Vault is _validatorsRegistry, sharedMevEscrow, depositDataManager, - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory, + eigenPods, exitingAssetsClaimDelay ) {} diff --git a/contracts/vaults/eigenLayer/EigenPrivVault.sol b/contracts/vaults/eigenLayer/EigenPrivVault.sol index 2cd2dc92..0cfa78ce 100644 --- a/contracts/vaults/eigenLayer/EigenPrivVault.sol +++ b/contracts/vaults/eigenLayer/EigenPrivVault.sol @@ -28,9 +28,7 @@ contract EigenPrivVault is Initializable, EigenVault, VaultWhitelist, IEigenPriv * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -40,10 +38,7 @@ contract EigenPrivVault is Initializable, EigenVault, VaultWhitelist, IEigenPriv address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) EigenVault( @@ -52,10 +47,7 @@ contract EigenPrivVault is Initializable, EigenVault, VaultWhitelist, IEigenPriv _validatorsRegistry, sharedMevEscrow, depositDataManager, - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory, + eigenPods, exitingAssetsClaimDelay ) {} diff --git a/contracts/vaults/eigenLayer/EigenVault.sol b/contracts/vaults/eigenLayer/EigenVault.sol index 01affbfe..5ccbd03e 100644 --- a/contracts/vaults/eigenLayer/EigenVault.sol +++ b/contracts/vaults/eigenLayer/EigenVault.sol @@ -48,9 +48,7 @@ contract EigenVault is * @param _validatorsRegistry The contract address used for registering validators in beacon chain * @param sharedMevEscrow The address of the shared MEV escrow * @param depositDataManager The address of the DepositDataManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract * @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking */ /// @custom:oz-upgrades-unsafe-allow constructor @@ -60,22 +58,14 @@ contract EigenVault is address _validatorsRegistry, address sharedMevEscrow, address depositDataManager, - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory, + address eigenPods, uint256 exitingAssetsClaimDelay ) VaultImmutables(_keeper, _vaultsRegistry, _validatorsRegistry) VaultValidators(depositDataManager) VaultEnterExit(exitingAssetsClaimDelay) VaultMev(sharedMevEscrow) - VaultEigenStaking( - eigenPodManager, - eigenDelegationManager, - eigenDelayedWithdrawalRouter, - eigenPodProxyFactory - ) + VaultEigenStaking(eigenPods) { _disableInitializers(); } diff --git a/contracts/vaults/eigenLayer/eigenPod/EigenPodProxy.sol b/contracts/vaults/eigenLayer/eigenPod/EigenPodProxy.sol index 2d4262cc..836fc45f 100644 --- a/contracts/vaults/eigenLayer/eigenPod/EigenPodProxy.sol +++ b/contracts/vaults/eigenLayer/eigenPod/EigenPodProxy.sol @@ -17,10 +17,13 @@ contract EigenPodProxy is IEigenPodProxy { error TransferFailed(); error CallFailed(); + address private immutable _eigenPods; + address public immutable override vault; /// @dev Constructor - constructor(address _vault) { + constructor(address eigenPods, address _vault) { + _eigenPods = eigenPods; vault = _vault; } diff --git a/contracts/vaults/eigenLayer/eigenPod/EigenPodProxyFactory.sol b/contracts/vaults/eigenLayer/eigenPod/EigenPodProxyFactory.sol deleted file mode 100644 index e9b34fd1..00000000 --- a/contracts/vaults/eigenLayer/eigenPod/EigenPodProxyFactory.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 - -pragma solidity =0.8.22; - -import {IEigenPodProxyFactory} from '../../../interfaces/IEigenPodProxyFactory.sol'; -import {EigenPodProxy} from './EigenPodProxy.sol'; - -/** - * @title EigenPodProxyFactory - * @author StakeWise - * @notice Factory for deploying EigenPod proxies. - */ -contract EigenPodProxyFactory is IEigenPodProxyFactory { - /// @inheritdoc IEigenPodProxyFactory - function createProxy() external override returns (address proxy) { - return address(new EigenPodProxy(msg.sender)); - } -} diff --git a/contracts/vaults/eigenLayer/eigenPod/EigenPods.sol b/contracts/vaults/eigenLayer/eigenPod/EigenPods.sol new file mode 100644 index 00000000..4968d548 --- /dev/null +++ b/contracts/vaults/eigenLayer/eigenPod/EigenPods.sol @@ -0,0 +1,475 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity =0.8.22; + +import {EnumerableSet} from '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; +import {Ownable2Step, Ownable} from '@openzeppelin/contracts/access/Ownable2Step.sol'; +import {IEigenPodManager} from '../../../interfaces/IEigenPodManager.sol'; +import {IEigenDelegationManager} from '../../../interfaces/IEigenDelegationManager.sol'; +import {IEigenDelayedWithdrawalRouter} from '../../../interfaces/IEigenDelayedWithdrawalRouter.sol'; +import {IEigenPod} from '../../../interfaces/IEigenPod.sol'; +import {IEigenPodProxy} from '../../../interfaces/IEigenPodProxy.sol'; +import {IVaultsRegistry} from '../../../interfaces/IVaultsRegistry.sol'; +import {IVaultAdmin} from '../../../interfaces/IVaultAdmin.sol'; +import {IVaultEigenStaking} from '../../../interfaces/IVaultEigenStaking.sol'; +import {IEigenPods} from '../../../interfaces/IEigenPods.sol'; +import {Errors} from '../../../libraries/Errors.sol'; +import {Multicall} from '../../../base/Multicall.sol'; +import {EigenPodProxy} from './EigenPodProxy.sol'; + +/** + * @title EigenPods + * @author StakeWise + * @notice Defines the EigenLayer staking functionality for the Vault + */ +contract EigenPods is Ownable2Step, Multicall, IEigenPods { + using EnumerableSet for EnumerableSet.AddressSet; + + address private constant _eigenPodStrategy = 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0; + + IVaultsRegistry private immutable _vaultsRegistry; + IEigenPodManager private immutable _eigenPodManager; + IEigenDelegationManager private immutable _eigenDelegationManager; + IEigenDelayedWithdrawalRouter private immutable _eigenDelayedWithdrawalRouter; + + mapping(address vault => EnumerableSet.AddressSet pods) private _vaultPods; + mapping(address pod => address proxy) private _podToProxy; + mapping(address vault => address manager) private _podsManagers; + mapping(address vault => address manager) private _withdrawalsManagers; + mapping(address pod => bytes32 root) private _podToOperatorUpdateRoot; + + /** + * @notice Modifier used to restrict access to the EigenLayer vaults + * @param vault The address of the vault + */ + modifier onlyEigenVault(address vault) { + if (!(_vaultsRegistry.vaults(vault) && IVaultEigenStaking(vault).isEigenVault())) { + revert Errors.AccessDenied(); + } + _; + } + + /** + * @notice Modifier used to check whether the pod belongs to the provided vault + * @param vault The address of the vault + * @param pod The address of the pod + */ + modifier onlyVaultPod(address vault, address pod) { + if (!isVaultPod(vault, pod)) { + revert Errors.EigenPodNotFound(); + } + _; + } + + /** + * @notice Modifier used to restrict access to the vault admin + * @param vault The address of the vault + */ + modifier onlyVaultAdmin(address vault) { + if (msg.sender != IVaultAdmin(vault).admin()) { + revert Errors.AccessDenied(); + } + _; + } + + /** + * @notice Modifier used to restrict access to the pods manager + * @param vault The address of the vault + */ + modifier onlyPodsManager(address vault) { + if (msg.sender != getPodsManager(vault)) { + revert Errors.AccessDenied(); + } + _; + } + + /** + * @notice Modifier used to restrict access to the withdrawals manager or the owner this contract + * @param vault The address of the vault + */ + modifier onlyWithdrawalsManager(address vault) { + if (msg.sender != getWithdrawalsManager(vault) && msg.sender != owner()) { + revert Errors.AccessDenied(); + } + _; + } + + /** + * @dev Constructor + * @param vaultsRegistry The address of the VaultsRegistry contract + * @param eigenPodManager The address of the EigenPodManager contract + * @param eigenDelegationManager The address of the EigenDelegationManager contract + * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract + */ + constructor( + address vaultsRegistry, + address eigenPodManager, + address eigenDelegationManager, + address eigenDelayedWithdrawalRouter + ) Ownable(msg.sender) { + _vaultsRegistry = IVaultsRegistry(vaultsRegistry); + _eigenPodManager = IEigenPodManager(eigenPodManager); + _eigenDelegationManager = IEigenDelegationManager(eigenDelegationManager); + _eigenDelayedWithdrawalRouter = IEigenDelayedWithdrawalRouter(eigenDelayedWithdrawalRouter); + } + + /// @inheritdoc IEigenPods + function getPodsManager(address vault) public view override returns (address) { + // SLOAD to memory + address manager = _podsManagers[vault]; + // if manager is not set, use admin address + return manager == address(0) ? IVaultAdmin(vault).admin() : manager; + } + + /// @inheritdoc IEigenPods + function getWithdrawalsManager(address vault) public view override returns (address) { + // SLOAD to memory + address manager = _withdrawalsManagers[vault]; + // if manager is not set, use admin address + return manager == address(0) ? IVaultAdmin(vault).admin() : manager; + } + + /// @inheritdoc IEigenPods + function isVaultPod(address vault, address pod) public view override returns (bool) { + return _vaultPods[vault].contains(pod); + } + + /// @inheritdoc IEigenPods + function getPods(address vault) external view override returns (address[] memory) { + return _vaultPods[vault].values(); + } + + /// @inheritdoc IEigenPods + function getPodProxy(address pod) public view override returns (address) { + return _podToProxy[pod]; + } + + /// @inheritdoc IEigenPods + function getProxyPod(address proxy) external view override returns (address) { + return _eigenPodManager.ownerToPod(proxy); + } + + /// @inheritdoc IEigenPods + function setPodsManager( + address vault, + address manager + ) external override onlyEigenVault(vault) onlyVaultAdmin(vault) { + if (manager == _podsManagers[vault]) revert Errors.ValueNotChanged(); + + // set the pods manager + _podsManagers[vault] = manager; + emit EigenPodsManagerUpdated(vault, manager); + } + + /// @inheritdoc IEigenPods + function setWithdrawalsManager( + address vault, + address manager + ) external override onlyEigenVault(vault) onlyVaultAdmin(vault) { + if (manager == _withdrawalsManagers[vault]) revert Errors.ValueNotChanged(); + + // set the withdrawals manager + _withdrawalsManagers[vault] = manager; + emit EigenWithdrawalsManagerUpdated(vault, manager); + } + + /// @inheritdoc IEigenPods + function createEigenPod( + address vault + ) external override onlyEigenVault(vault) returns (address eigenPod) { + // only vault during initialization or the pods manager can create a new EigenPod + if (msg.sender != vault && msg.sender != getPodsManager(vault)) revert Errors.AccessDenied(); + + // create a new EigenPod proxy + address eigenPodProxy = address(new EigenPodProxy(address(this), vault)); + + // create a new EigenPod from the proxy + bytes memory response = IEigenPodProxy(eigenPodProxy).functionCall( + address(_eigenPodManager), + abi.encodeWithSelector(_eigenPodManager.createPod.selector) + ); + eigenPod = abi.decode(response, (address)); + + // store the eigen pod to the list of vault's eigen pods + _vaultPods[vault].add(eigenPod); + + // store the mapping between the eigen pod and the proxy + _podToProxy[eigenPod] = eigenPodProxy; + + emit EigenPodCreated(vault, eigenPodProxy, eigenPod); + } + + /// @inheritdoc IEigenPods + function completeEigenValidatorsRegistration( + address eigenPod, + uint64 oracleTimestamp, + IEigenPod.StateRootProof calldata stateRootProof, + uint40[] calldata validatorIndices, + bytes[] calldata validatorFieldsProofs, + bytes32[][] calldata validatorFields + ) external override { + _getEigenPodProxy(eigenPod).functionCall( + eigenPod, + abi.encodeWithSelector( + IEigenPod(eigenPod).verifyWithdrawalCredentials.selector, + oracleTimestamp, + stateRootProof, + validatorIndices, + validatorFieldsProofs, + validatorFields + ) + ); + } + + /// @inheritdoc IEigenPods + function initiateEigenOperatorUpdate( + address vault, + address eigenPod, + address newOperator, + IEigenDelegationManager.SignatureWithExpiry memory approverSignatureAndExpiry, + bytes32 approverSalt + ) external override onlyVaultPod(vault, eigenPod) onlyPodsManager(vault) { + // check if operator change is in progress + bytes32 podOperatorUpdateRoot = _podToOperatorUpdateRoot[eigenPod]; + if (podOperatorUpdateRoot != bytes32(0)) { + revert Errors.EigenOperatorUpdateNotCompleted(); + } + + // check whether the new operator is different from the current one + IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); + address currentOperator = _eigenDelegationManager.delegatedTo(address(eigenPodProxy)); + if (currentOperator == newOperator) { + revert Errors.EigenOperatorUpdateNoChange(); + } + + bytes32 eigenOperatorUpdateRoot; + if (currentOperator != address(0)) { + // undelegate from current operator + bytes memory response = eigenPodProxy.functionCall( + address(_eigenDelegationManager), + abi.encodeWithSelector(_eigenDelegationManager.undelegate.selector, address(eigenPodProxy)) + ); + bytes32[] memory roots = abi.decode(response, (bytes32[])); + if (roots.length != 1) { + // cannot be more than one strategy + revert Errors.EigenOperatorUpdateUndelegationFailed(); + } + // store the root of the withdrawal to later complete redelagation without withdrawing all the validators + eigenOperatorUpdateRoot = roots[0]; + _podToOperatorUpdateRoot[eigenPod] = eigenOperatorUpdateRoot; + } + + if (newOperator != address(0)) { + // delegate to new operator + eigenPodProxy.functionCall( + address(_eigenDelegationManager), + abi.encodeWithSelector( + _eigenDelegationManager.delegateTo.selector, + newOperator, + approverSignatureAndExpiry, + approverSalt + ) + ); + } + + // emit event + emit EigenOperatorUpdateInitiated(vault, eigenPod, newOperator, eigenOperatorUpdateRoot); + } + + /// @inheritdoc IEigenPods + function completeEigenOperatorUpdate( + address vault, + address eigenPod, + EigenWithdrawal calldata eigenWithdrawal + ) external override onlyVaultPod(vault, eigenPod) onlyPodsManager(vault) { + // SLOAD to memory + bytes32 eigenOperatorUpdateRoot = _podToOperatorUpdateRoot[eigenPod]; + + // check if operator change is in progress + if (eigenOperatorUpdateRoot == bytes32(0)) { + revert Errors.EigenOperatorUpdateNotInitiated(); + } + + // check if the withdrawal is still pending + if (_eigenDelegationManager.pendingWithdrawals(eigenOperatorUpdateRoot)) { + // only EigenPod strategy is used + address[] memory strategies = new address[](1); + strategies[0] = _eigenPodStrategy; + uint256[] memory shares = new uint256[](1); + shares[0] = eigenWithdrawal.assets; + + // define withdrawal for the EigenDelegationManager call + IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); + IEigenDelegationManager.Withdrawal memory withdrawal = IEigenDelegationManager.Withdrawal({ + staker: address(eigenPodProxy), + delegatedTo: eigenWithdrawal.delegatedTo, + withdrawer: address(eigenPodProxy), + nonce: eigenWithdrawal.nonce, + startBlock: eigenWithdrawal.startBlock, + strategies: strategies, + shares: shares + }); + + // check whether the withdrawal is correct + if (keccak256(abi.encode(withdrawal)) != eigenOperatorUpdateRoot) { + revert Errors.EigenOperatorUpdateInvalidWithdrawal(); + } + + // use empty array for tokens parameter (tokens are not used in the case of EigenPod strategy) + // the shares are delegated to the new operator (if there is such) without withdrawing them + // middlewareTimesIndex is also not used, pass zero + eigenPodProxy.functionCall( + address(_eigenDelegationManager), + abi.encodeWithSelector( + _eigenDelegationManager.completeQueuedWithdrawal.selector, + withdrawal, + new address[](1), + 0, + false + ) + ); + } + + // the withdrawal has been completed, mark as resolved + _podToOperatorUpdateRoot[eigenPod] = bytes32(0); + + // emit event + emit EigenOperatorUpdateCompleted(vault, eigenPod, eigenOperatorUpdateRoot); + } + + /// @inheritdoc IEigenPods + function initiateEigenFullWithdrawal( + address vault, + address eigenPod, + uint256 assets + ) external override onlyVaultPod(vault, eigenPod) onlyWithdrawalsManager(vault) { + // only EigenPod strategy is used + address[] memory strategies = new address[](1); + strategies[0] = _eigenPodStrategy; + + uint256[] memory shares = new uint256[](1); + shares[0] = assets; + + // create withdrawals for the EigenDelegationManager call + IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); + IEigenDelegationManager.QueuedWithdrawalParams[] + memory withdrawals = new IEigenDelegationManager.QueuedWithdrawalParams[](1); + withdrawals[0] = IEigenDelegationManager.QueuedWithdrawalParams({ + strategies: strategies, + shares: shares, + withdrawer: address(eigenPodProxy) + }); + + // initiate withdrawal + eigenPodProxy.functionCall( + address(_eigenDelegationManager), + abi.encodeWithSelector(_eigenDelegationManager.queueWithdrawals.selector, withdrawals) + ); + } + + /// @inheritdoc IEigenPods + function processEigenFullAndPartialWithdrawals( + address eigenPod, + uint64 oracleTimestamp, + IEigenPod.StateRootProof calldata stateRootProof, + IEigenPod.WithdrawalProof[] calldata withdrawalProofs, + bytes[] calldata validatorFieldsProofs, + bytes32[][] calldata validatorFields, + bytes32[][] calldata withdrawalFields + ) external override { + _getEigenPodProxy(eigenPod).functionCall( + eigenPod, + abi.encodeWithSelector( + IEigenPod(eigenPod).verifyAndProcessWithdrawals.selector, + oracleTimestamp, + stateRootProof, + withdrawalProofs, + validatorFieldsProofs, + validatorFields, + withdrawalFields + ) + ); + } + + /// @inheritdoc IEigenPods + function completeEigenPartialWithdrawals( + address eigenPod, + uint256 maxClaimsCount + ) external override { + // claim partial withdrawals form the EigenLayer + _getEigenPodProxy(eigenPod).functionCall( + address(_eigenDelayedWithdrawalRouter), + abi.encodeWithSelector( + _eigenDelayedWithdrawalRouter.claimDelayedWithdrawals.selector, + maxClaimsCount + ) + ); + } + + /// @inheritdoc IEigenPods + function completeEigenFullWithdrawals( + address eigenPod, + EigenWithdrawal[] calldata eigenWithdrawals + ) external override { + // only EigenPod strategy is used + address[] memory strategies = new address[](1); + strategies[0] = _eigenPodStrategy; + + // create withdrawals for the EigenDelegationManager call + uint256 count = eigenWithdrawals.length; + IEigenDelegationManager.Withdrawal[] + memory withdrawals = new IEigenDelegationManager.Withdrawal[](count); + address[][] memory tokens = new address[][](count); + bool[] memory receiveTokens = new bool[](count); + IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); + for (uint256 i = 0; i < count; ) { + EigenWithdrawal calldata eigenWithdrawal = eigenWithdrawals[i]; + + uint256[] memory shares = new uint256[](1); + shares[0] = eigenWithdrawal.assets; + + // define withdrawal for the EigenDelegationManager call + withdrawals[i] = IEigenDelegationManager.Withdrawal({ + staker: address(eigenPodProxy), + delegatedTo: eigenWithdrawal.delegatedTo, + withdrawer: address(eigenPodProxy), + nonce: eigenWithdrawal.nonce, + startBlock: eigenWithdrawal.startBlock, + strategies: strategies, + shares: shares + }); + + // use empty array for tokens parameter (tokens are not used in the case of EigenPod strategy) + tokens[i] = new address[](1); + receiveTokens[i] = true; + + unchecked { + // cannot realistically overflow + ++i; + } + } + + // middlewareTimesIndex is not currently used, pass empty array + eigenPodProxy.functionCall( + address(_eigenDelegationManager), + abi.encodeWithSelector( + _eigenDelegationManager.completeQueuedWithdrawals.selector, + withdrawals, + tokens, + new uint256[](count), + receiveTokens + ) + ); + } + + /** + * @dev Internal function to get the EigenPodProxy address for the given EigenPod. + * @param eigenPod The address of the EigenPod + * @return The address of the EigenPodProxy + */ + function _getEigenPodProxy(address eigenPod) private view returns (IEigenPodProxy) { + address eigenPodProxy = getPodProxy(eigenPod); + if (eigenPodProxy == address(0)) revert Errors.EigenPodNotFound(); + return IEigenPodProxy(eigenPodProxy); + } +} diff --git a/contracts/vaults/modules/VaultEigenStaking.sol b/contracts/vaults/modules/VaultEigenStaking.sol index 036277f3..70bdca21 100644 --- a/contracts/vaults/modules/VaultEigenStaking.sol +++ b/contracts/vaults/modules/VaultEigenStaking.sol @@ -3,17 +3,10 @@ pragma solidity =0.8.22; import {Initializable} from '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; -import {IOwnable} from '../../interfaces/IOwnable.sol'; -import {IEigenPod} from '../../interfaces/IEigenPod.sol'; -import {IEigenPodManager} from '../../interfaces/IEigenPodManager.sol'; -import {IEigenDelegationManager} from '../../interfaces/IEigenDelegationManager.sol'; -import {IEigenDelayedWithdrawalRouter} from '../../interfaces/IEigenDelayedWithdrawalRouter.sol'; -import {IEigenPodProxyFactory} from '../../interfaces/IEigenPodProxyFactory.sol'; -import {IEigenPodProxy} from '../../interfaces/IEigenPodProxy.sol'; import {IVaultEigenStaking} from '../../interfaces/IVaultEigenStaking.sol'; import {IEthValidatorsRegistry} from '../../interfaces/IEthValidatorsRegistry.sol'; +import {IEigenPods} from '../../interfaces/IEigenPods.sol'; import {Errors} from '../../libraries/Errors.sol'; -import {VaultAdmin} from './VaultAdmin.sol'; import {VaultValidators} from './VaultValidators.sol'; import {VaultEthStaking} from './VaultEthStaking.sol'; @@ -24,366 +17,32 @@ import {VaultEthStaking} from './VaultEthStaking.sol'; */ abstract contract VaultEigenStaking is Initializable, - VaultAdmin, VaultValidators, VaultEthStaking, IVaultEigenStaking { - address private constant _eigenPodStrategy = 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0; - - /// @custom:oz-upgrades-unsafe-allow state-variable-immutable - IEigenPodManager private immutable _eigenPodManager; - - /// @custom:oz-upgrades-unsafe-allow state-variable-immutable - IEigenDelegationManager private immutable _eigenDelegationManager; - - /// @custom:oz-upgrades-unsafe-allow state-variable-immutable - IEigenDelayedWithdrawalRouter private immutable _eigenDelayedWithdrawalRouter; - /// @custom:oz-upgrades-unsafe-allow state-variable-immutable - IEigenPodProxyFactory private immutable _eigenPodProxyFactory; - - mapping(address => address) private _eigenPods; - mapping(address => address) private _eigenPodProxies; - mapping(address => bytes32) private _podOperatorUpdateRoots; - address private _eigenOperatorsManager; - address private _eigenWithdrawalsManager; + IEigenPods private immutable _eigenPods; /** * @dev Constructor * @dev Since the immutable variable value is stored in the bytecode, * its value would be shared among all proxies pointing to a given contract instead of each proxy’s storage. - * @param eigenPodManager The address of the EigenPodManager contract - * @param eigenDelegationManager The address of the EigenDelegationManager contract - * @param eigenDelayedWithdrawalRouter The address of the EigenDelayedWithdrawalRouter contract - * @param eigenPodProxyFactory The address of the EigenPodProxyFactory contract + * @param eigenPods The address of the EigenPods contract */ /// @custom:oz-upgrades-unsafe-allow constructor - constructor( - address eigenPodManager, - address eigenDelegationManager, - address eigenDelayedWithdrawalRouter, - address eigenPodProxyFactory - ) { - _eigenPodManager = IEigenPodManager(eigenPodManager); - _eigenDelegationManager = IEigenDelegationManager(eigenDelegationManager); - _eigenDelayedWithdrawalRouter = IEigenDelayedWithdrawalRouter(eigenDelayedWithdrawalRouter); - _eigenPodProxyFactory = IEigenPodProxyFactory(eigenPodProxyFactory); - } - - /// @inheritdoc IVaultEigenStaking - function eigenOperatorsManager() public view override returns (address) { - // SLOAD to memory - address eigenOperatorsManager_ = _eigenOperatorsManager; - // if eigenOperatorsManager is not set, use admin address - return eigenOperatorsManager_ == address(0) ? admin : eigenOperatorsManager_; - } - - /// @inheritdoc IVaultEigenStaking - function eigenWithdrawalsManager() public view override returns (address) { - // SLOAD to memory - address eigenWithdrawalsManager_ = _eigenOperatorsManager; - // if eigenWithdrawalsManager is not set, use admin address - return eigenWithdrawalsManager_ == address(0) ? admin : eigenWithdrawalsManager_; - } - - /// @inheritdoc IVaultEigenStaking - function setEigenOperatorsManager(address eigenOperatorsManager_) external override { - _checkAdmin(); - if (eigenOperatorsManager_ == address(0)) revert Errors.ZeroAddress(); - // update eigenOperatorsManager address - _eigenOperatorsManager = eigenOperatorsManager_; - emit EigenOperatorsManagerUpdated(msg.sender, eigenOperatorsManager_); - } - - /// @inheritdoc IVaultEigenStaking - function setEigenWithdrawalsManager(address eigenWithdrawalsManager_) external override { - _checkAdmin(); - if (eigenWithdrawalsManager_ == address(0)) revert Errors.ZeroAddress(); - // update eigenWithdrawalsManager address - _eigenWithdrawalsManager = eigenWithdrawalsManager_; - emit EigenWithdrawalsManagerUpdated(msg.sender, eigenWithdrawalsManager_); - } - - /// @inheritdoc IVaultEigenStaking - function createEigenPod() external override returns (address) { - if (msg.sender != eigenOperatorsManager()) revert Errors.AccessDenied(); - return _createEigenPod(); - } - - /// @inheritdoc IVaultEigenStaking - function completeEigenValidatorsRegistration( - address eigenPod, - uint64 oracleTimestamp, - IEigenPod.StateRootProof calldata stateRootProof, - uint40[] calldata validatorIndices, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields - ) external override { - _getEigenPodProxy(eigenPod).functionCall( - eigenPod, - abi.encodeWithSelector( - IEigenPod(eigenPod).verifyWithdrawalCredentials.selector, - oracleTimestamp, - stateRootProof, - validatorIndices, - validatorFieldsProofs, - validatorFields - ) - ); - } - - /// @inheritdoc IVaultEigenStaking - function initiateEigenOperatorUpdate( - address eigenPod, - address newOperator, - IEigenDelegationManager.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 approverSalt - ) external override { - if (msg.sender != eigenOperatorsManager()) revert Errors.AccessDenied(); - - // check if operator change is in progress - bytes32 podOperatorUpdateRoot = _podOperatorUpdateRoots[eigenPod]; - if (podOperatorUpdateRoot != bytes32(0)) { - revert Errors.EigenOperatorUpdateNotCompleted(); - } - - // check whether the new operator is different from the current one - IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); - address currentOperator = _eigenDelegationManager.delegatedTo(address(eigenPodProxy)); - if (currentOperator == newOperator) { - revert Errors.EigenOperatorUpdateNoChange(); - } - - bytes32 eigenOperatorUpdateRoot; - if (currentOperator != address(0)) { - // undelegate from current operator - bytes memory response = eigenPodProxy.functionCall( - address(_eigenDelegationManager), - abi.encodeWithSelector(_eigenDelegationManager.undelegate.selector, address(eigenPodProxy)) - ); - bytes32[] memory roots = abi.decode(response, (bytes32[])); - if (roots.length != 1) { - // cannot be more than one strategy - revert Errors.EigenOperatorUpdateUndelegationFailed(); - } - // store the root of the withdrawal to later complete redelagation without withdrawing all the validators - eigenOperatorUpdateRoot = roots[0]; - _podOperatorUpdateRoots[eigenPod] = eigenOperatorUpdateRoot; - } - - if (newOperator != address(0)) { - // delegate to new operator - eigenPodProxy.functionCall( - address(_eigenDelegationManager), - abi.encodeWithSelector( - _eigenDelegationManager.delegateTo.selector, - newOperator, - approverSignatureAndExpiry, - approverSalt - ) - ); - } - - // emit event - emit EigenOperatorUpdateInitiated(eigenPod, newOperator, eigenOperatorUpdateRoot); - } - - /// @inheritdoc IVaultEigenStaking - function completeEigenOperatorUpdate( - address eigenPod, - EigenWithdrawal calldata eigenWithdrawal - ) external override { - if (msg.sender != eigenOperatorsManager()) revert Errors.AccessDenied(); - - // SLOAD to memory - bytes32 eigenOperatorUpdateRoot = _podOperatorUpdateRoots[eigenPod]; - - // check if operator change is in progress - if (eigenOperatorUpdateRoot == bytes32(0)) { - revert Errors.EigenOperatorUpdateNotInitiated(); - } - - // check if the withdrawal is still pending - if (_eigenDelegationManager.pendingWithdrawals(eigenOperatorUpdateRoot)) { - // only EigenPod strategy is used - address[] memory strategies = new address[](1); - strategies[0] = _eigenPodStrategy; - uint256[] memory shares = new uint256[](1); - shares[0] = eigenWithdrawal.assets; - - // define withdrawal for the EigenDelegationManager call - IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); - IEigenDelegationManager.Withdrawal memory withdrawal = IEigenDelegationManager.Withdrawal({ - staker: address(eigenPodProxy), - delegatedTo: eigenWithdrawal.delegatedTo, - withdrawer: address(eigenPodProxy), - nonce: eigenWithdrawal.nonce, - startBlock: eigenWithdrawal.startBlock, - strategies: strategies, - shares: shares - }); - - // check whether the withdrawal is correct - if (keccak256(abi.encode(withdrawal)) != eigenOperatorUpdateRoot) { - revert Errors.EigenOperatorUpdateInvalidWithdrawal(); - } - - // use empty array for tokens parameter (tokens are not used in the case of EigenPod strategy) - // the shares are delegated to the new operator (if there is such) without withdrawing them - // middlewareTimesIndex is also not used, pass zero - eigenPodProxy.functionCall( - address(_eigenDelegationManager), - abi.encodeWithSelector( - _eigenDelegationManager.completeQueuedWithdrawal.selector, - withdrawal, - new address[](1), - 0, - false - ) - ); - } - - // the withdrawal has been completed, mark as resolved - _podOperatorUpdateRoots[eigenPod] = bytes32(0); - - // emit event - emit EigenOperatorUpdateCompleted(eigenPod, eigenOperatorUpdateRoot); + constructor(address eigenPods) { + _eigenPods = IEigenPods(eigenPods); } /// @inheritdoc IVaultEigenStaking - function initiateEigenFullWithdrawal(address eigenPod, uint256 assets) external override { - // only eigen withdrawals manager or the owner of the vaults registry can initiate full withdrawal - if ( - msg.sender != eigenWithdrawalsManager() && msg.sender != IOwnable(_vaultsRegistry).owner() - ) { - revert Errors.AccessDenied(); - } - - // only EigenPod strategy is used - address[] memory strategies = new address[](1); - strategies[0] = _eigenPodStrategy; - - uint256[] memory shares = new uint256[](1); - shares[0] = assets; - - // create withdrawals for the EigenDelegationManager call - IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); - IEigenDelegationManager.QueuedWithdrawalParams[] - memory withdrawals = new IEigenDelegationManager.QueuedWithdrawalParams[](1); - withdrawals[0] = IEigenDelegationManager.QueuedWithdrawalParams({ - strategies: strategies, - shares: shares, - withdrawer: address(eigenPodProxy) - }); - - // initiate withdrawal - eigenPodProxy.functionCall( - address(_eigenDelegationManager), - abi.encodeWithSelector(_eigenDelegationManager.queueWithdrawals.selector, withdrawals) - ); - } - - /// @inheritdoc IVaultEigenStaking - function processEigenFullAndPartialWithdrawals( - address eigenPod, - uint64 oracleTimestamp, - IEigenPod.StateRootProof calldata stateRootProof, - IEigenPod.WithdrawalProof[] calldata withdrawalProofs, - bytes[] calldata validatorFieldsProofs, - bytes32[][] calldata validatorFields, - bytes32[][] calldata withdrawalFields - ) external override { - _getEigenPodProxy(eigenPod).functionCall( - eigenPod, - abi.encodeWithSelector( - IEigenPod(eigenPod).verifyAndProcessWithdrawals.selector, - oracleTimestamp, - stateRootProof, - withdrawalProofs, - validatorFieldsProofs, - validatorFields, - withdrawalFields - ) - ); - } - - /// @inheritdoc IVaultEigenStaking - function completeEigenPartialWithdrawals( - address eigenPod, - uint256 maxClaimsCount - ) external override { - // claim partial withdrawals form the EigenLayer - _getEigenPodProxy(eigenPod).functionCall( - address(_eigenDelayedWithdrawalRouter), - abi.encodeWithSelector( - _eigenDelayedWithdrawalRouter.claimDelayedWithdrawals.selector, - maxClaimsCount - ) - ); + function isEigenVault() external pure override returns (bool) { + return true; } /// @inheritdoc IVaultEigenStaking - function completeEigenFullWithdrawals( - address eigenPod, - EigenWithdrawal[] calldata eigenWithdrawals - ) external override { - // only EigenPod strategy is used - address[] memory strategies = new address[](1); - strategies[0] = _eigenPodStrategy; - - // create withdrawals for the EigenDelegationManager call - uint256 count = eigenWithdrawals.length; - IEigenDelegationManager.Withdrawal[] - memory withdrawals = new IEigenDelegationManager.Withdrawal[](count); - address[][] memory tokens = new address[][](count); - bool[] memory receiveTokens = new bool[](count); - IEigenPodProxy eigenPodProxy = _getEigenPodProxy(eigenPod); - for (uint256 i = 0; i < count; ) { - EigenWithdrawal calldata eigenWithdrawal = eigenWithdrawals[i]; - - uint256[] memory shares = new uint256[](1); - shares[0] = eigenWithdrawal.assets; - - // define withdrawal for the EigenDelegationManager call - withdrawals[i] = IEigenDelegationManager.Withdrawal({ - staker: address(eigenPodProxy), - delegatedTo: eigenWithdrawal.delegatedTo, - withdrawer: address(eigenPodProxy), - nonce: eigenWithdrawal.nonce, - startBlock: eigenWithdrawal.startBlock, - strategies: strategies, - shares: shares - }); - - // use empty array for tokens parameter (tokens are not used in the case of EigenPod strategy) - tokens[i] = new address[](1); - receiveTokens[i] = true; - - unchecked { - // cannot realistically overflow - ++i; - } - } - - // middlewareTimesIndex is not currently used, pass empty array - eigenPodProxy.functionCall( - address(_eigenDelegationManager), - abi.encodeWithSelector( - _eigenDelegationManager.completeQueuedWithdrawals.selector, - withdrawals, - tokens, - new uint256[](count), - receiveTokens - ) - ); - } - - /* - * @dev This function is called by EigenPod proxy to transfer assets to the vault. - */ function receiveEigenAssets() external payable override { - if (msg.sender != _eigenPodProxies[msg.sender]) revert Errors.AccessDenied(); + if (_eigenPods.getProxyPod(msg.sender) == address(0)) revert Errors.AccessDenied(); } /// @inheritdoc VaultValidators @@ -391,7 +50,6 @@ abstract contract VaultEigenStaking is bytes calldata validator ) internal virtual override(VaultValidators, VaultEthStaking) { bytes calldata publicKey = validator[:48]; - IEthValidatorsRegistry(_validatorsRegistry).deposit{value: _validatorDeposit()}( publicKey, _extractWithdrawalCredentials(validator[176:validator.length]), @@ -433,17 +91,6 @@ abstract contract VaultEigenStaking is } } - /** - * @dev Internal function to get the EigenPodProxy address for the given EigenPod. - * @param eigenPod The address of the EigenPod - * @return The address of the EigenPodProxy - */ - function _getEigenPodProxy(address eigenPod) private view returns (IEigenPodProxy) { - address eigenPodProxy = _eigenPods[eigenPod]; - if (eigenPodProxy == address(0)) revert Errors.EigenPodNotFound(); - return IEigenPodProxy(eigenPodProxy); - } - /** * @dev Internal function to extract the withdrawal credentials from the validator data * @param eigenPodBytes The bytes containing the address of the EigenPod @@ -456,31 +103,11 @@ abstract contract VaultEigenStaking is // check if the EigenPod exists address eigenPod = abi.decode(eigenPodBytes, (address)); - if (_eigenPods[eigenPod] == address(0)) revert Errors.EigenPodNotFound(); + if (!_eigenPods.isVaultPod(address(this), eigenPod)) revert Errors.EigenPodNotFound(); return abi.encodePacked(bytes1(0x01), bytes11(0x0), eigenPod); } - /** - * @dev Internal function to create a new EigenPod - */ - function _createEigenPod() private returns (address eigenPod) { - // create a new EigenPod proxy - address eigenPodProxy = _eigenPodProxyFactory.createProxy(); - - // create a new EigenPod from the proxy - bytes memory response = IEigenPodProxy(eigenPodProxy).functionCall( - address(_eigenPodManager), - abi.encodeWithSelector(_eigenPodManager.createPod.selector) - ); - eigenPod = abi.decode(response, (address)); - _eigenPods[eigenPod] = eigenPodProxy; - _eigenPodProxies[eigenPodProxy] = eigenPod; - - // currently multiple eigen pods are not supported due to the withdrawal credentials being fixed - emit EigenPodCreated(eigenPodProxy, eigenPod); - } - /// @inheritdoc VaultEthStaking function _withdrawalCredentials() internal view virtual override returns (bytes memory) {} @@ -499,7 +126,7 @@ abstract contract VaultEigenStaking is * @dev Initializes the VaultEigenStaking contract */ function __VaultEigenStaking_init() internal onlyInitializing { - _createEigenPod(); + _eigenPods.createEigenPod(address(this)); } /**