Documentation
¶
Overview ¶
Package changesets provides reusable MCMS changesets.
Index ¶
- Variables
- func DeployMCMSWithTimelockV2(env cldf.Environment, ...) (cldf.ChangesetOutput, error)
- func LoadOwnableContract(addr common.Address, client bind.ContractBackend) (common.Address, evmstate.Ownable, error)
- func RenounceTimelockDeployer(e cldf.Environment, cfg RenounceTimelockDeployerConfig) (cldf.ChangesetOutput, error)
- func SetConfigMCMSV2(e cldf.Environment, cfg MCMSConfigV2) (cldf.ChangesetOutput, error)
- func TransferToDeployer(e cldf.Environment, cfg TransferToDeployerConfig) (cldf.ChangesetOutput, error)
- func TransferToMCMSWithTimelockV2(e cldf.Environment, cfg TransferToMCMSWithTimelockConfig) (cldf.ChangesetOutput, error)
- func ValidateOwnership(ctx context.Context, mcms bool, deployerKey, timelock common.Address, ...) error
- func ValidateOwnershipSolanaCommon(mcms bool, deployerKey solana.PublicKey, timelockSignerPDA solana.PublicKey, ...) error
- type AmountsToTransfer
- type ConfigPerRoleV2
- type FireDrillConfig
- type FundMCMSignerConfig
- type FundMCMSignersChangeset
- type GrantRoleInput
- type GrantRoleTimelockSolana
- type GrantRoleTimelockSolanaConfig
- type MCMSConfigV2
- type MCMSSignFireDrillChangeset
- type RenounceTimelockDeployerConfig
- type TransferToDeployerConfig
- type TransferToMCMSWithTimelockConfig
Constants ¶
This section is empty.
Variables ¶
var ( // GrantRoleInTimeLock grants proposer, canceller, bypasser, executor, admin roles to the timelock contract with corresponding addresses if the // roles are not already set with the same addresses. // It creates a proposal if deployer key is not admin of the timelock contract. // otherwise it executes the transactions directly. // If neither timelock, nor the deployer key is the admin of the timelock contract, it returns an error. GrantRoleInTimeLock = cldf.CreateChangeSet(grantRoleLogic, grantRolePreconditions) )
Functions ¶
func DeployMCMSWithTimelockV2 ¶
func DeployMCMSWithTimelockV2( env cldf.Environment, cfgByChain map[uint64]cldfproposalutils.MCMSWithTimelockConfig, ) (cldf.ChangesetOutput, error)
DeployMCMSWithTimelockV2 deploys and initializes the MCM and Timelock contracts
func LoadOwnableContract ¶ added in v0.4.0
func RenounceTimelockDeployer ¶ added in v0.4.0
func RenounceTimelockDeployer(e cldf.Environment, cfg RenounceTimelockDeployerConfig) (cldf.ChangesetOutput, error)
RenounceTimelockDeployer revokes the deployer key from administering the contract.
func SetConfigMCMSV2 ¶ added in v0.4.0
func SetConfigMCMSV2(e cldf.Environment, cfg MCMSConfigV2) (cldf.ChangesetOutput, error)
SetConfigMCMSV2 is a reimplementation of SetConfigMCMS that uses the new MCMS library.
func TransferToDeployer ¶ added in v0.4.0
func TransferToDeployer(e cldf.Environment, cfg TransferToDeployerConfig) (cldf.ChangesetOutput, error)
TransferToDeployer relies on the deployer key still being a timelock admin and transfers the ownership of a contract back to the deployer key. It's effectively the rollback function of transferring to the timelock.
func TransferToMCMSWithTimelockV2 ¶ added in v0.4.0
func TransferToMCMSWithTimelockV2( e cldf.Environment, cfg TransferToMCMSWithTimelockConfig, ) (cldf.ChangesetOutput, error)
TransferToMCMSWithTimelockV2 is a reimplementation of TransferToMCMSWithTimelock which uses the new MCMS library.
func ValidateOwnership ¶
Types ¶
type AmountsToTransfer ¶
type ConfigPerRoleV2 ¶ added in v0.4.0
type FireDrillConfig ¶
type FireDrillConfig struct {
TimelockCfg cldfproposalutils.TimelockConfig `json:"timelockCfg"`
Selectors []uint64 `json:"selectors,omitempty"`
}
FireDrillConfig selects chains and MCMS timelock routing for a signing fire drill.
func (FireDrillConfig) ResolvedSelectors ¶
func (cfg FireDrillConfig) ResolvedSelectors(e cldf.Environment) []uint64
ResolvedSelectors returns the chain selectors VerifyPreconditions and the fire-drill operation will use. When cfg.Selectors is empty, it defaults to every Solana chain in the environment followed by every EVM chain.
type FundMCMSignerConfig ¶
type FundMCMSignerConfig struct {
AmountsPerChain map[uint64]AmountsToTransfer
}
type FundMCMSignersChangeset ¶
type FundMCMSignersChangeset struct{}
FundMCMSignersChangeset is a changeset that funds the MCMS signers on each chain. It will find the signer PDA for the proposer, canceller and bypasser MCM as well as the timelock signer PDA and send the amount of SOL specified in the config to each of them.
func (FundMCMSignersChangeset) Apply ¶
func (f FundMCMSignersChangeset) Apply(e cldf.Environment, config FundMCMSignerConfig) (cldf.ChangesetOutput, error)
Apply funds the MCMS signers on each chain.
func (FundMCMSignersChangeset) VerifyPreconditions ¶
func (f FundMCMSignersChangeset) VerifyPreconditions(e cldf.Environment, config FundMCMSignerConfig) error
VerifyPreconditions checks if the deployer has enough SOL to fund the MCMS signers on each chain.
type GrantRoleInput ¶
type GrantRoleInput struct {
ExistingProposerByChain map[uint64]common.Address // if needed in the future, need to add bypasser and canceller here
MCMS *cldfproposalutils.TimelockConfig
GasBoostConfigPerChain map[uint64]cldfproposalutils.GasBoostConfig
}
type GrantRoleTimelockSolana ¶
type GrantRoleTimelockSolana struct{}
GrantRoleTimelockSolana grants the given accounts access to the given role on the timelock
func (GrantRoleTimelockSolana) Apply ¶
func (t GrantRoleTimelockSolana) Apply( env cldf.Environment, cfg GrantRoleTimelockSolanaConfig, ) (cldf.ChangesetOutput, error)
func (GrantRoleTimelockSolana) VerifyPreconditions ¶
func (t GrantRoleTimelockSolana) VerifyPreconditions( env cldf.Environment, config GrantRoleTimelockSolanaConfig, ) error
type GrantRoleTimelockSolanaConfig ¶
type GrantRoleTimelockSolanaConfig struct {
Accounts map[uint64][]solana.PublicKey // chain selector to accounts mapping
Role timelockbindings.Role
MCMS *cldfproposalutils.TimelockConfig
}
type MCMSConfigV2 ¶ added in v0.4.0
type MCMSConfigV2 struct {
ConfigsPerChain map[uint64]ConfigPerRoleV2
ProposalConfig *cldfproposalutils.TimelockConfig
}
func (MCMSConfigV2) Validate ¶ added in v0.4.0
func (cfg MCMSConfigV2) Validate(e cldf.Environment, selectors []uint64) error
Validate checks that the MCMSConfigV2 is valid
type MCMSSignFireDrillChangeset ¶
type MCMSSignFireDrillChangeset struct{}
MCMSSignFireDrillChangeset creates an MCMS signing fire-drill proposal with noop operations per chain. It exercises signing and execution pipelines without mutating on-chain configuration.
func (MCMSSignFireDrillChangeset) Apply ¶
func (MCMSSignFireDrillChangeset) Apply(e cldf.Environment, cfg FireDrillConfig) (cldf.ChangesetOutput, error)
Apply builds the fire-drill proposal via the operations API (with force execute for repeatable drills).
func (MCMSSignFireDrillChangeset) VerifyPreconditions ¶
func (MCMSSignFireDrillChangeset) VerifyPreconditions(e cldf.Environment, cfg FireDrillConfig) error
VerifyPreconditions ensures each target chain exists and MCMS timelock state satisfies the configured action.
type RenounceTimelockDeployerConfig ¶ added in v0.4.0
func (RenounceTimelockDeployerConfig) Validate ¶ added in v0.4.0
func (cfg RenounceTimelockDeployerConfig) Validate(e cldf.Environment) error
type TransferToDeployerConfig ¶ added in v0.4.0
type TransferToMCMSWithTimelockConfig ¶ added in v0.4.0
type TransferToMCMSWithTimelockConfig struct {
ContractsByChain map[uint64][]common.Address
// MCMSConfig is for the accept ownership proposal
MCMSConfig cldfproposalutils.TimelockConfig
// Optional flag: Only runs accept ownership (not transfer ownership) if enabled
OnlyAcceptOwnership bool
}
func (TransferToMCMSWithTimelockConfig) Validate ¶ added in v0.4.0
func (t TransferToMCMSWithTimelockConfig) Validate(e cldf.Environment) error