Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SeqEVMDeployMCMWithConfig = operations.NewSequence( "seq-deploy-mcm-with-config", semver.MustParse("1.0.0"), "Deploys MCM contract & sets config", func(b operations.Bundle, deps cldf_evm.Chain, in SeqDeployMCMWithConfigInput) (opsevm.EVMDeployOutput, error) { // Deploy MCM contract var deployReport operations.Report[opsevm.EVMDeployInput[any], opsevm.EVMDeployOutput] var deployErr error switch in.ContractType { case mcmscontracts.BypasserManyChainMultisig: deployReport, deployErr = operations.ExecuteOperation(b, opsevm.OpEVMDeployBypasserMCM, deps, opsevm.EVMDeployInput[any]{ ChainSelector: in.ChainSelector, Qualifier: in.Qualifier, }, opsevm.RetryDeploymentWithGasBoost[any](in.GasBoostConfig)) case mcmscontracts.ProposerManyChainMultisig: deployReport, deployErr = operations.ExecuteOperation(b, opsevm.OpEVMDeployProposerMCM, deps, opsevm.EVMDeployInput[any]{ ChainSelector: in.ChainSelector, Qualifier: in.Qualifier, }, opsevm.RetryDeploymentWithGasBoost[any](in.GasBoostConfig)) case mcmscontracts.CancellerManyChainMultisig: deployReport, deployErr = operations.ExecuteOperation(b, opsevm.OpEVMDeployCancellerMCM, deps, opsevm.EVMDeployInput[any]{ ChainSelector: in.ChainSelector, Qualifier: in.Qualifier, }, opsevm.RetryDeploymentWithGasBoost[any](in.GasBoostConfig)) default: return opsevm.EVMDeployOutput{}, fmt.Errorf("unsupported contract type for seq-deploy-mcm-with-config: %s", in.ContractType) } if deployErr != nil { return opsevm.EVMDeployOutput{}, fmt.Errorf("failed to deploy %s: %w", in.ContractType, deployErr) } groupQuorums, groupParents, signerAddresses, signerGroups, err := sdk.ExtractSetConfigInputs(&in.MCMConfig) if err != nil { return opsevm.EVMDeployOutput{}, err } _, err = operations.ExecuteOperation(b, opsevm.OpEVMSetConfigMCM, deps, opsevm.EVMCallInput[opsevm.OpEVMSetConfigMCMInput]{ ChainSelector: in.ChainSelector, Address: deployReport.Output.Address, NoSend: false, CallInput: opsevm.OpEVMSetConfigMCMInput{ SignerAddresses: signerAddresses, SignerGroups: signerGroups, GroupQuorums: groupQuorums, GroupParents: groupParents, }, }, opsevm.RetryCallWithGasBoost[opsevm.OpEVMSetConfigMCMInput](in.GasBoostConfig), ) if err != nil { return opsevm.EVMDeployOutput{}, err } return deployReport.Output, nil }, )
View Source
var SeqGrantRolesTimelock = operations.NewSequence( "seq-grant-role-with-config", semver.MustParse("1.0.0"), "Grants appropriate roles to MCMS contracts in the EVM Timelock contract", func(b operations.Bundle, deps SeqGrantRolesTimelockDeps, in SeqGrantRolesTimelockInput) (map[uint64][]opsevm.EVMCallOutput, error) { var ( addressesInInspector []string err2 error ) out := make([]opsevm.EVMCallOutput, 0) timelockInspector := evmMcms.NewTimelockInspector(deps.Chain.Client) for _, roleAndAddress := range in.RolesAndAddresses { switch roleAndAddress.Role { case v1_0.PROPOSER_ROLE.ID: addressesInInspector, err2 = timelockInspector.GetProposers(b.GetContext(), in.Timelock.Hex()) case v1_0.CANCELLER_ROLE.ID: addressesInInspector, err2 = timelockInspector.GetCancellers(b.GetContext(), in.Timelock.Hex()) case v1_0.BYPASSER_ROLE.ID: addressesInInspector, err2 = timelockInspector.GetBypassers(b.GetContext(), in.Timelock.Hex()) case v1_0.EXECUTOR_ROLE.ID: addressesInInspector, err2 = timelockInspector.GetExecutors(b.GetContext(), in.Timelock.Hex()) case v1_0.ADMIN_ROLE.ID: addressesInInspector = []string{} } if err2 != nil { b.Logger.Errorw("Failed to get addresses from Timelock Inspector", "chainSelector", deps.Chain.ChainSelector(), "chainName", deps.Chain.Name(), "Timelock Address", in.Timelock.Hex(), "Role", roleAndAddress.Name, "Error", err2, ) return nil, err2 } for _, addressToGrantRole := range roleAndAddress.Addresses { if !slices.Contains(addressesInInspector, addressToGrantRole.Hex()) { opReport, err := operations.ExecuteOperation(b, opsevm.OpEVMGrantRole, deps.Chain, opsevm.EVMCallInput[opsevm.OpEVMGrantRoleInput]{ ChainSelector: in.ChainSelector, CallInput: opsevm.OpEVMGrantRoleInput{ Account: addressToGrantRole, RoleID: roleAndAddress.Role, }, NoSend: !in.IsDeployerKeyAdmin, Address: in.Timelock, }, opsevm.RetryCallWithGasBoost[opsevm.OpEVMGrantRoleInput](in.GasBoostConfig), ) if err != nil { b.Logger.Errorw("Failed to grant role", "chainSelector", deps.Chain.ChainSelector(), "chainName", deps.Chain.Name(), "Timelock Address", in.Timelock.Hex(), "Role Name", roleAndAddress.Name, "Address", addressToGrantRole.Hex(), ) return nil, err } out = append(out, opReport.Output) if in.IsDeployerKeyAdmin { b.Logger.Infow("Role granted", "Role Name", roleAndAddress.Name, "chainSelector", deps.Chain.ChainSelector(), "chainName", deps.Chain.Name(), "Timelock Address", in.Timelock.Hex(), "Address", addressToGrantRole.Hex(), ) } } } } return map[uint64][]opsevm.EVMCallOutput{ in.ChainSelector: out, }, nil }, )
Functions ¶
This section is empty.
Types ¶
type RolesAndAddresses ¶
type SeqDeployMCMWithConfigInput ¶
type SeqDeployMCMWithConfigInput struct {
ContractType cldf.ContractType `json:"contractType"`
MCMConfig mcmsTypes.Config `json:"mcmConfig"`
ChainSelector uint64 `json:"chainSelector"`
GasBoostConfig *cldfproposalutils.GasBoostConfig `json:"gasBoostConfig"`
Qualifier *string `json:"qualifier"`
}
type SeqGrantRolesTimelockInput ¶
type SeqGrantRolesTimelockInput struct {
ContractType cldf.ContractType `json:"contractType"`
ChainSelector uint64 `json:"chainSelector"`
Timelock common.Address `json:"timelock"`
RolesAndAddresses []RolesAndAddresses `json:"rolesAndAddresses"`
IsDeployerKeyAdmin bool `json:"isDeployerKeyAdmin"`
GasBoostConfig *cldfproposalutils.GasBoostConfig `json:"gasBoostConfig"`
}
type SeqGrantRolesTimelockOutput ¶
type SeqGrantRolesTimelockOutput struct {
McmsTxs []mcmsTypes.Transaction `json:"mcmsTxs"`
}
Click to show internal directories.
Click to hide internal directories.