proposalutils

package
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingTimelockBinding = errors.New("missing Timelock RBACTimelock binding")
	ErrMissingCancellerMCM    = errors.New("missing CancellerMcm ManyChainMultiSig binding")
	ErrMissingProposerMCM     = errors.New("missing ProposerMcm ManyChainMultiSig binding")
	ErrMissingBypasserMCM     = errors.New("missing BypasserMcm ManyChainMultiSig binding")
	ErrMissingCallProxy       = errors.New("missing CallProxy binding")
)

Functions

func BatchOperationForChain

func BatchOperationForChain(
	chain uint64, toAddress string, data []byte, value *big.Int, contractType string, tags []string,
) (mcmstypes.BatchOperation, error)

BatchOperationForChain creates an mcmstypes.BatchOperation containing a single transaction for the given chain selector. It delegates to TransactionForChain, so it supports EVM and Solana chains.

func GetAptosRoleFromAction

func GetAptosRoleFromAction(action mcmstypes.TimelockAction) (mcmsaptossdk.TimelockRole, error)

func McmsInspectorForChain

func McmsInspectorForChain(env cldf.Environment, chain uint64, opts ...MCMSInspectorOption) (mcmssdk.Inspector, error)

McmsInspectorForChain builds an mcmssdk.Inspector for a single chain in the given environment. The chain must be present in env.BlockChains, otherwise an error is returned.

func McmsInspectors

func McmsInspectors(env cldf.Environment) (map[uint64]mcmssdk.Inspector, error)

McmsInspectors builds an mcmssdk.Inspector for every chain in the environment, returning them keyed by uint64 chain selector. All inspectors use the default TimelockActionSchedule action.

func TransactionForChain

func TransactionForChain(
	chain uint64, toAddress string, data []byte, value *big.Int, contractType string, tags []string,
) (mcmstypes.Transaction, error)

TransactionForChain builds an mcmstypes.Transaction for the given chain selector. It currently supports EVM and Solana chains; other chain families return an error.

Types

type EVMMCMSWithTimelock added in v0.99.0

type EVMMCMSWithTimelock interface {
	TimelockContracts() MCMSWithTimelockContracts
}

EVMMCMSWithTimelock adapts EVM MCMS-with-timelock state for TimelockConfig helpers.

type GasBoostConfig

type GasBoostConfig struct {
	InitialGasLimit   uint64 `json:"initialGasLimit"`
	GasLimitIncrement uint64 `json:"gasLimitIncrement"`
	InitialGasPrice   uint64 `json:"initialGasPrice"`
	GasPriceIncrement uint64 `json:"gasPriceIncrement"`
}

GasBoostConfig defines the configuration for EVM gas boosting during retries. It allows customization of the initial gas limit, gas limit increment, initial gas price, and gas price increment.

type MCMSInspectorOption

type MCMSInspectorOption func(*mcmsInspectorOptions)

MCMSInspectorOption configures how MCMS inspectors are built.

func WithTimelockAction

func WithTimelockAction(action mcmstypes.TimelockAction) MCMSInspectorOption

WithTimelockAction sets the timelock action used by the inspector. When omitted, the default action is TimelockActionSchedule.

type MCMSWithTimelockConfig

type MCMSWithTimelockConfig struct {
	Canceller        mcmstypes.Config `json:"canceller"`
	Bypasser         mcmstypes.Config `json:"bypasser"`
	Proposer         mcmstypes.Config `json:"proposer"`
	TimelockMinDelay *big.Int         `json:"timelockMinDelay"`
	Label            *string          `json:"label"`
	GasBoostConfig   *GasBoostConfig  `json:"gasBoostConfig"`
	Qualifier        *string          `json:"qualifier"`
}

MCMSWithTimelockConfig holds the configuration for an MCMS with timelock. Unlike the legacy MCMSWithTimelockConfigLegacy type above, this variant uses the newer mcmstypes.Config definitions.

type MCMSWithTimelockConfigLegacy deprecated

type MCMSWithTimelockConfigLegacy struct {
	Canceller        config.Config `json:"canceller"`
	Bypasser         config.Config `json:"bypasser"`
	Proposer         config.Config `json:"proposer"`
	TimelockMinDelay *big.Int      `json:"timelockMinDelay"`
	Label            *string       `json:"label"`
}

Deprecated: use MCMSWithTimelockConfig. This will be removed once all CCIP code is migrated to use the new MCMSWithTimelockConfig type.

type MCMSWithTimelockContracts

type MCMSWithTimelockContracts struct {
	CancellerMcm *ownerhelpers.ManyChainMultiSig
	BypasserMcm  *ownerhelpers.ManyChainMultiSig
	ProposerMcm  *ownerhelpers.ManyChainMultiSig
	Timelock     *ownerhelpers.RBACTimelock
	CallProxy    *ownerhelpers.CallProxy
}

MCMSWithTimelockContracts holds the Go bindings for a MCMSWithTimelock standard contract deployment.

func (MCMSWithTimelockContracts) Validate

func (state MCMSWithTimelockContracts) Validate() error

Validate checks all contract bindings are non-nil, ensuring the struct is ready for use generating views or interactions.

type MCMSWithTimelockPrograms added in v0.99.0

type MCMSWithTimelockPrograms struct {
	McmProgram       solana.PublicKey
	ProposerMcmSeed  mcmssolanasdk.PDASeed
	CancellerMcmSeed mcmssolanasdk.PDASeed
	BypasserMcmSeed  mcmssolanasdk.PDASeed
}

MCMSWithTimelockPrograms holds the Solana program and PDA seed values needed to resolve MCMS role addresses.

type SolanaMCMSWithTimelock added in v0.99.0

type SolanaMCMSWithTimelock interface {
	TimelockPrograms() MCMSWithTimelockPrograms
}

SolanaMCMSWithTimelock adapts Solana MCMS-with-timelock state for TimelockConfig helpers.

type TimelockConfig added in v0.99.0

type TimelockConfig struct {
	MinDelay                  time.Duration            `json:"minDelay"` // delay for timelock worker to execute the transfers.
	MCMSAction                mcmstypes.TimelockAction `json:"mcmsAction"`
	OverrideRoot              bool                     `json:"overrideRoot"`                        // if true, override the previous root with the new one.
	TimelockQualifierPerChain map[uint64]string        `json:"timelockQualifierPerChain,omitempty"` // optional qualifier to fetch timelock address from datastore
	ValidDuration             *mcmstypes.Duration      `json:"validDuration" yaml:"validDuration"`
}

TimelockConfig configures MCMS timelock proposal behavior.

func (*TimelockConfig) MCMBasedOnAction added in v0.99.0

func (*TimelockConfig) MCMBasedOnActionSolana added in v0.99.0

func (tc *TimelockConfig) MCMBasedOnActionSolana(s SolanaMCMSWithTimelock) (string, error)

func (*TimelockConfig) Validate added in v0.99.0

func (tc *TimelockConfig) Validate(chain cldf_evm.Chain, s EVMMCMSWithTimelock) error

func (*TimelockConfig) ValidateAptos added in v0.99.0

func (tc *TimelockConfig) ValidateAptos(chain cldf_aptos.Chain, mcmsAddress aptos.AccountAddress) error

func (*TimelockConfig) ValidateSolana added in v0.99.0

func (tc *TimelockConfig) ValidateSolana(e cldf.Environment, chainSelector uint64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL