From badc44667cd4a926ef1ca9f79d9fef3b10701e53 Mon Sep 17 00:00:00 2001 From: Brandon Chatham Date: Wed, 18 Dec 2024 16:12:31 -0800 Subject: [PATCH 1/2] Updating output code path to correctly detect empty string input for caller-address. --- pkg/user/admin/accept.go | 1 + pkg/user/admin/add_pending.go | 1 + pkg/user/admin/remove.go | 1 + pkg/user/admin/remove_pending.go | 1 + pkg/user/appointee/remove.go | 1 + pkg/user/appointee/set.go | 1 + 6 files changed, 6 insertions(+) diff --git a/pkg/user/admin/accept.go b/pkg/user/admin/accept.go index 045f4d67..6fea6beb 100644 --- a/pkg/user/admin/accept.go +++ b/pkg/user/admin/accept.go @@ -3,6 +3,7 @@ package admin import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" diff --git a/pkg/user/admin/add_pending.go b/pkg/user/admin/add_pending.go index 4784a264..9502d757 100644 --- a/pkg/user/admin/add_pending.go +++ b/pkg/user/admin/add_pending.go @@ -3,6 +3,7 @@ package admin import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" diff --git a/pkg/user/admin/remove.go b/pkg/user/admin/remove.go index 18e13210..5b7bcf6e 100644 --- a/pkg/user/admin/remove.go +++ b/pkg/user/admin/remove.go @@ -3,6 +3,7 @@ package admin import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" diff --git a/pkg/user/admin/remove_pending.go b/pkg/user/admin/remove_pending.go index 8110ad20..507bcb86 100644 --- a/pkg/user/admin/remove_pending.go +++ b/pkg/user/admin/remove_pending.go @@ -3,6 +3,7 @@ package admin import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" diff --git a/pkg/user/appointee/remove.go b/pkg/user/appointee/remove.go index 276ccadf..6b267efa 100644 --- a/pkg/user/appointee/remove.go +++ b/pkg/user/appointee/remove.go @@ -3,6 +3,7 @@ package appointee import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" diff --git a/pkg/user/appointee/set.go b/pkg/user/appointee/set.go index 9227d9b3..ed46f1a6 100644 --- a/pkg/user/appointee/set.go +++ b/pkg/user/appointee/set.go @@ -3,6 +3,7 @@ package appointee import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" From f54c32cd6be5227f09806356b0d4319ac674399e Mon Sep 17 00:00:00 2001 From: Brandon Chatham Date: Fri, 20 Dec 2024 12:14:01 -0800 Subject: [PATCH 2/2] Renaming PermissionManager to PermissionController to match the contract name. --- pkg/internal/common/helper.go | 46 ++++---- pkg/types/chain_metadata.go | 14 +-- pkg/user/admin/accept.go | 35 +++--- pkg/user/admin/add_pending.go | 37 +++---- pkg/user/admin/is_admin.go | 26 ++--- pkg/user/admin/is_pending.go | 26 ++--- pkg/user/admin/list.go | 24 ++-- pkg/user/admin/list_pending.go | 24 ++-- pkg/user/admin/remove.go | 37 +++---- pkg/user/admin/remove_pending.go | 37 +++---- pkg/user/admin/types.go | 146 ++++++++++++------------- pkg/user/appointee/can_call.go | 30 ++--- pkg/user/appointee/list.go | 28 ++--- pkg/user/appointee/list_permissions.go | 26 ++--- pkg/user/appointee/remove.go | 41 ++++--- pkg/user/appointee/set.go | 41 ++++--- pkg/user/appointee/types.go | 104 +++++++++--------- 17 files changed, 358 insertions(+), 364 deletions(-) diff --git a/pkg/internal/common/helper.go b/pkg/internal/common/helper.go index 13098a4b..8b61a4da 100644 --- a/pkg/internal/common/helper.go +++ b/pkg/internal/common/helper.go @@ -48,31 +48,31 @@ const ( var ChainMetadataMap = map[int64]types.ChainMetadata{ MainnetChainId: { - BlockExplorerUrl: "https://etherscan.io/tx", - ELDelegationManagerAddress: "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", - ELAVSDirectoryAddress: "0x135dda560e946695d6f155dacafc6f1f25c1f5af", - ELRewardsCoordinatorAddress: "0x7750d328b314EfFa365A0402CcfD489B80B0adda", - ELPermissionManagerAddress: "", - WebAppUrl: "https://app.eigenlayer.xyz/operator", - ProofStoreBaseURL: "https://eigenlabs-rewards-mainnet-ethereum.s3.amazonaws.com", + BlockExplorerUrl: "https://etherscan.io/tx", + ELDelegationManagerAddress: "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", + ELAVSDirectoryAddress: "0x135dda560e946695d6f155dacafc6f1f25c1f5af", + ELRewardsCoordinatorAddress: "0x7750d328b314EfFa365A0402CcfD489B80B0adda", + ELPermissionControllerAddress: "", + WebAppUrl: "https://app.eigenlayer.xyz/operator", + ProofStoreBaseURL: "https://eigenlabs-rewards-mainnet-ethereum.s3.amazonaws.com", }, HoleskyChainId: { - BlockExplorerUrl: "https://holesky.etherscan.io/tx", - ELDelegationManagerAddress: "0xA44151489861Fe9e3055d95adC98FbD462B948e7", - ELAVSDirectoryAddress: "0x055733000064333CaDDbC92763c58BF0192fFeBf", - ELRewardsCoordinatorAddress: "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", - ELPermissionManagerAddress: "0x598cb226B591155F767dA17AfE7A2241a68C5C10", - WebAppUrl: "https://holesky.eigenlayer.xyz/operator", - ProofStoreBaseURL: "https://eigenlabs-rewards-testnet-holesky.s3.amazonaws.com", + BlockExplorerUrl: "https://holesky.etherscan.io/tx", + ELDelegationManagerAddress: "0xA44151489861Fe9e3055d95adC98FbD462B948e7", + ELAVSDirectoryAddress: "0x055733000064333CaDDbC92763c58BF0192fFeBf", + ELRewardsCoordinatorAddress: "0xAcc1fb458a1317E886dB376Fc8141540537E68fE", + ELPermissionControllerAddress: "0x598cb226B591155F767dA17AfE7A2241a68C5C10", + WebAppUrl: "https://holesky.eigenlayer.xyz/operator", + ProofStoreBaseURL: "https://eigenlabs-rewards-testnet-holesky.s3.amazonaws.com", }, AnvilChainId: { - BlockExplorerUrl: "", - ELDelegationManagerAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", - ELAVSDirectoryAddress: "0x0165878A594ca255338adfa4d48449f69242Eb8F", - ELRewardsCoordinatorAddress: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", - ELPermissionManagerAddress: "", - WebAppUrl: "", - ProofStoreBaseURL: "", + BlockExplorerUrl: "", + ELDelegationManagerAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + ELAVSDirectoryAddress: "0x0165878A594ca255338adfa4d48449f69242Eb8F", + ELRewardsCoordinatorAddress: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", + ELPermissionControllerAddress: "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c", + WebAppUrl: "", + ProofStoreBaseURL: "", }, } @@ -342,13 +342,13 @@ func GetDelegationManagerAddress(chainID *big.Int) (string, error) { } } -func GetPermissionManagerAddress(chainID *big.Int) (string, error) { +func GetPermissionControllerAddress(chainID *big.Int) (string, error) { chainIDInt := chainID.Int64() chainMetadata, ok := ChainMetadataMap[chainIDInt] if !ok { return "", fmt.Errorf("chain ID %d not supported", chainIDInt) } else { - return chainMetadata.ELDelegationManagerAddress, nil + return chainMetadata.ELPermissionControllerAddress, nil } } diff --git a/pkg/types/chain_metadata.go b/pkg/types/chain_metadata.go index f59f3538..742ef8c5 100644 --- a/pkg/types/chain_metadata.go +++ b/pkg/types/chain_metadata.go @@ -1,11 +1,11 @@ package types type ChainMetadata struct { - BlockExplorerUrl string - ELDelegationManagerAddress string - ELAVSDirectoryAddress string - ELRewardsCoordinatorAddress string - ELPermissionManagerAddress string - WebAppUrl string - ProofStoreBaseURL string + BlockExplorerUrl string + ELDelegationManagerAddress string + ELAVSDirectoryAddress string + ELRewardsCoordinatorAddress string + ELPermissionControllerAddress string + WebAppUrl string + ProofStoreBaseURL string } diff --git a/pkg/user/admin/accept.go b/pkg/user/admin/accept.go index 6fea6beb..19e9f1c8 100644 --- a/pkg/user/admin/accept.go +++ b/pkg/user/admin/accept.go @@ -3,7 +3,6 @@ package admin import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -164,34 +163,34 @@ func readAndValidateAcceptAdminConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &acceptAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - CallerAddress: callerAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - SignerConfig: *signerConfig, - ChainID: chainID, - Environment: environment, - OutputFile: outputFile, - OutputType: outputType, - Broadcast: broadcast, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + CallerAddress: callerAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + SignerConfig: *signerConfig, + ChainID: chainID, + Environment: environment, + OutputFile: outputFile, + OutputType: outputType, + Broadcast: broadcast, }, nil } @@ -226,7 +225,7 @@ func generateAcceptAdminWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, diff --git a/pkg/user/admin/add_pending.go b/pkg/user/admin/add_pending.go index 9502d757..623fa9a1 100644 --- a/pkg/user/admin/add_pending.go +++ b/pkg/user/admin/add_pending.go @@ -3,7 +3,6 @@ package admin import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -167,36 +166,36 @@ func readAndValidateAddPendingAdminConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &addPendingAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AdminAddress: adminAddress, - CallerAddress: callerAddress, - SignerConfig: *signerConfig, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, - OutputFile: outputFile, - OutputType: outputType, - Broadcast: broadcast, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AdminAddress: adminAddress, + CallerAddress: callerAddress, + SignerConfig: *signerConfig, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, + OutputFile: outputFile, + OutputType: outputType, + Broadcast: broadcast, }, nil } @@ -213,7 +212,7 @@ func generateAddPendingAdminWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, diff --git a/pkg/user/admin/is_admin.go b/pkg/user/admin/is_admin.go index 2f2a8936..6064c898 100644 --- a/pkg/user/admin/is_admin.go +++ b/pkg/user/admin/is_admin.go @@ -73,32 +73,32 @@ func readAndValidateIsAdminConfig(cliContext *cli.Context, logger logging.Logger } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) var err error - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &isAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AdminAddress: adminAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AdminAddress: adminAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -117,7 +117,7 @@ func generateIsAdminReader(logger logging.Logger, config *isAdminConfig) (IsAdmi } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/admin/is_pending.go b/pkg/user/admin/is_pending.go index cdcdab99..371bc15a 100644 --- a/pkg/user/admin/is_pending.go +++ b/pkg/user/admin/is_pending.go @@ -81,32 +81,32 @@ func readAndValidateIsPendingAdminConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) var err error - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &isPendingAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - PendingAdminAddress: pendingAdminAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + PendingAdminAddress: pendingAdminAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -125,7 +125,7 @@ func generateIsPendingAdminReader(logger logging.Logger, config *isPendingAdminC } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/admin/list.go b/pkg/user/admin/list.go index 417f55b0..e04a7549 100644 --- a/pkg/user/admin/list.go +++ b/pkg/user/admin/list.go @@ -83,31 +83,31 @@ func readAndValidateListAdminsConfig(cliContext *cli.Context, logger logging.Log } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + permissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) var err error - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(permissionControllerAddress) { + permissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + permissionControllerAddress, ) return &listAdminsConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + PermissionControllerAddress: gethcommon.HexToAddress(permissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -118,7 +118,7 @@ func generateListAdminsReader(logger logging.Logger, config *listAdminsConfig) ( } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/admin/list_pending.go b/pkg/user/admin/list_pending.go index d724b7ab..7d97cb4b 100644 --- a/pkg/user/admin/list_pending.go +++ b/pkg/user/admin/list_pending.go @@ -88,31 +88,31 @@ func readAndValidateListPendingAdminsConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + permissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) var err error - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(permissionControllerAddress) { + permissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + permissionControllerAddress, ) return &listPendingAdminsConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + PermissionControllerAddress: gethcommon.HexToAddress(permissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -126,7 +126,7 @@ func generateListPendingAdminsReader( } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/admin/remove.go b/pkg/user/admin/remove.go index 5b7bcf6e..e6aa71d3 100644 --- a/pkg/user/admin/remove.go +++ b/pkg/user/admin/remove.go @@ -3,7 +3,6 @@ package admin import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -165,36 +164,36 @@ func readAndValidateRemoveAdminConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &removeAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AdminAddress: adminAddress, - CallerAddress: callerAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - SignerConfig: *signerConfig, - ChainID: chainID, - Environment: environment, - OutputFile: outputFile, - OutputType: outputType, - Broadcast: broadcast, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AdminAddress: adminAddress, + CallerAddress: callerAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + SignerConfig: *signerConfig, + ChainID: chainID, + Environment: environment, + OutputFile: outputFile, + OutputType: outputType, + Broadcast: broadcast, }, nil } @@ -211,7 +210,7 @@ func generateRemoveAdminWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, diff --git a/pkg/user/admin/remove_pending.go b/pkg/user/admin/remove_pending.go index 507bcb86..408bfec4 100644 --- a/pkg/user/admin/remove_pending.go +++ b/pkg/user/admin/remove_pending.go @@ -3,7 +3,6 @@ package admin import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -165,36 +164,36 @@ func readAndValidateRemovePendingAdminConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &removePendingAdminConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AdminAddress: adminAddress, - CallerAddress: callerAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - SignerConfig: *signerConfig, - ChainID: chainID, - Environment: environment, - OutputFile: outputFile, - OutputType: outputType, - Broadcast: broadcast, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AdminAddress: adminAddress, + CallerAddress: callerAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + SignerConfig: *signerConfig, + ChainID: chainID, + Environment: environment, + OutputFile: outputFile, + OutputType: outputType, + Broadcast: broadcast, }, nil } @@ -211,7 +210,7 @@ func generateRemovePendingAdminWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, diff --git a/pkg/user/admin/types.go b/pkg/user/admin/types.go index 8a95d56f..a4635f76 100644 --- a/pkg/user/admin/types.go +++ b/pkg/user/admin/types.go @@ -8,98 +8,98 @@ import ( ) type listPendingAdminsConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type listAdminsConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type isPendingAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - PendingAdminAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + PendingAdminAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type isAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AdminAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + AdminAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type acceptAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - CallerAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - SignerConfig types.SignerConfig - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + CallerAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + SignerConfig types.SignerConfig + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool } type addPendingAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AdminAddress gethcommon.Address - CallerAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - SignerConfig types.SignerConfig - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + AdminAddress gethcommon.Address + CallerAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + SignerConfig types.SignerConfig + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool } type removeAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AdminAddress gethcommon.Address - CallerAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - SignerConfig types.SignerConfig - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + AdminAddress gethcommon.Address + CallerAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + SignerConfig types.SignerConfig + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool } type removePendingAdminConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AdminAddress gethcommon.Address - CallerAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - SignerConfig types.SignerConfig - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + AdminAddress gethcommon.Address + CallerAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + SignerConfig types.SignerConfig + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool } diff --git a/pkg/user/appointee/can_call.go b/pkg/user/appointee/can_call.go index c5b79c97..fe95e32e 100644 --- a/pkg/user/appointee/can_call.go +++ b/pkg/user/appointee/can_call.go @@ -84,33 +84,33 @@ func readAndValidateCanCallConfig(cliContext *cli.Context, logger logging.Logger } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &canCallConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AppointeeAddress: appointeeAddress, - Target: target, - Selector: selectorBytes, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AppointeeAddress: appointeeAddress, + Target: target, + Selector: selectorBytes, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -124,7 +124,7 @@ func generateCanCallReader( } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/appointee/list.go b/pkg/user/appointee/list.go index 541a4cd1..32fc7308 100644 --- a/pkg/user/appointee/list.go +++ b/pkg/user/appointee/list.go @@ -102,32 +102,32 @@ func readAndValidateListAppointeesConfig( chainID := utils.NetworkNameToChainId(network) cliContext.App.Metadata["network"] = chainID.String() - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &listAppointeesConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - Target: target, - Selector: selectorBytes, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + Target: target, + Selector: selectorBytes, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -138,7 +138,7 @@ func generateListAppointeesReader(logger logging.Logger, config *listAppointeesC } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/appointee/list_permissions.go b/pkg/user/appointee/list_permissions.go index f3845cd1..1bb63046 100644 --- a/pkg/user/appointee/list_permissions.go +++ b/pkg/user/appointee/list_permissions.go @@ -83,32 +83,32 @@ func readAndValidateListAppointeePermissionsConfig( } chainID := utils.NetworkNameToChainId(network) - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) var err error - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &listAppointeePermissionsConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AppointeeAddress: appointeeAddress, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AppointeeAddress: appointeeAddress, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, }, nil } @@ -132,7 +132,7 @@ func generateListAppointeePermissionsReader( } elReader, err := elcontracts.NewReaderFromConfig( elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, ethClient, logger, diff --git a/pkg/user/appointee/remove.go b/pkg/user/appointee/remove.go index 6b267efa..6149f937 100644 --- a/pkg/user/appointee/remove.go +++ b/pkg/user/appointee/remove.go @@ -3,7 +3,6 @@ package appointee import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -159,7 +158,7 @@ func generateRemoveAppointeePermissionWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, @@ -198,37 +197,37 @@ func readAndValidateRemoveConfig(cliContext *cli.Context, logger logging.Logger) chainID := utils.NetworkNameToChainId(network) cliContext.App.Metadata["network"] = chainID.String() - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &removeConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AppointeeAddress: appointeeAddress, - CallerAddress: callerAddress, - Target: target, - Selector: selectorBytes, - SignerConfig: *signerConfig, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, - Broadcast: broadcast, - OutputType: outputType, - OutputFile: outputFile, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AppointeeAddress: appointeeAddress, + CallerAddress: callerAddress, + Target: target, + Selector: selectorBytes, + SignerConfig: *signerConfig, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, + Broadcast: broadcast, + OutputType: outputType, + OutputFile: outputFile, }, nil } diff --git a/pkg/user/appointee/set.go b/pkg/user/appointee/set.go index ed46f1a6..5ce47870 100644 --- a/pkg/user/appointee/set.go +++ b/pkg/user/appointee/set.go @@ -3,7 +3,6 @@ package appointee import ( "context" "fmt" - "github.com/Layr-Labs/eigenlayer-cli/pkg/user" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -162,7 +161,7 @@ func generateSetAppointeePermissionWriter( &config.SignerConfig, ethClient, elcontracts.Config{ - PermissionsControllerAddress: config.PermissionManagerAddress, + PermissionsControllerAddress: config.PermissionControllerAddress, }, prompter, config.ChainID, @@ -201,38 +200,38 @@ func readAndValidateSetConfig(cliContext *cli.Context, logger logging.Logger) (* chainID := utils.NetworkNameToChainId(network) cliContext.App.Metadata["network"] = chainID.String() - permissionManagerAddress := cliContext.String(PermissionControllerAddressFlag.Name) + PermissionControllerAddress := cliContext.String(PermissionControllerAddressFlag.Name) - if common.IsEmptyString(permissionManagerAddress) { - permissionManagerAddress, err = common.GetPermissionManagerAddress(utils.NetworkNameToChainId(network)) + if common.IsEmptyString(PermissionControllerAddress) { + PermissionControllerAddress, err = common.GetPermissionControllerAddress(utils.NetworkNameToChainId(network)) if err != nil { return nil, err } } logger.Debugf( - "Env: %s, network: %s, chain ID: %s, PermissionManager address: %s", + "Env: %s, network: %s, chain ID: %s, PermissionController address: %s", environment, network, chainID, - permissionManagerAddress, + PermissionControllerAddress, ) return &setConfig{ - Network: network, - RPCUrl: ethRpcUrl, - AccountAddress: accountAddress, - AppointeeAddress: appointeeAddress, - CallerAddress: callerAddress, - Target: target, - Selector: selectorBytes, - SignerConfig: *signerConfig, - PermissionManagerAddress: gethcommon.HexToAddress(permissionManagerAddress), - ChainID: chainID, - Environment: environment, - OutputFile: outputFile, - OutputType: outputType, - Broadcast: broadcast, + Network: network, + RPCUrl: ethRpcUrl, + AccountAddress: accountAddress, + AppointeeAddress: appointeeAddress, + CallerAddress: callerAddress, + Target: target, + Selector: selectorBytes, + SignerConfig: *signerConfig, + PermissionControllerAddress: gethcommon.HexToAddress(PermissionControllerAddress), + ChainID: chainID, + Environment: environment, + OutputFile: outputFile, + OutputType: outputType, + Broadcast: broadcast, }, nil } diff --git a/pkg/user/appointee/types.go b/pkg/user/appointee/types.go index e505adc3..7d6ff1ac 100644 --- a/pkg/user/appointee/types.go +++ b/pkg/user/appointee/types.go @@ -8,68 +8,68 @@ import ( ) type canCallConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AppointeeAddress gethcommon.Address - Target gethcommon.Address - Selector [4]byte - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + AppointeeAddress gethcommon.Address + Target gethcommon.Address + Selector [4]byte + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type listAppointeesConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - Target gethcommon.Address - Selector [4]byte - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + Target gethcommon.Address + Selector [4]byte + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type listAppointeePermissionsConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AppointeeAddress gethcommon.Address - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string + Network string + RPCUrl string + AccountAddress gethcommon.Address + AppointeeAddress gethcommon.Address + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string } type removeConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AppointeeAddress gethcommon.Address - CallerAddress gethcommon.Address - Target gethcommon.Address - SignerConfig types.SignerConfig - Selector [4]byte - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + AppointeeAddress gethcommon.Address + CallerAddress gethcommon.Address + Target gethcommon.Address + SignerConfig types.SignerConfig + Selector [4]byte + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool } type setConfig struct { - Network string - RPCUrl string - AccountAddress gethcommon.Address - AppointeeAddress gethcommon.Address - CallerAddress gethcommon.Address - Target gethcommon.Address - SignerConfig types.SignerConfig - Selector [4]byte - PermissionManagerAddress gethcommon.Address - ChainID *big.Int - Environment string - OutputFile string - OutputType string - Broadcast bool + Network string + RPCUrl string + AccountAddress gethcommon.Address + AppointeeAddress gethcommon.Address + CallerAddress gethcommon.Address + Target gethcommon.Address + SignerConfig types.SignerConfig + Selector [4]byte + PermissionControllerAddress gethcommon.Address + ChainID *big.Int + Environment string + OutputFile string + OutputType string + Broadcast bool }