Documentation
¶
Overview ¶
Package transfertotimelock provides the transfer-to-timelock changeset and a registry for per-chain-family implementations.
Usage ¶
Import the changeset and blank-import each chain family's transfer-to-timelock sequence (plus MCMS readers when building timelock proposals):
import (
transfertotimelock "github.com/smartcontractkit/cld-changesets/mcms/changesets/transfer-to-timelock"
"github.com/smartcontractkit/cld-changesets/datastore/refkey"
_ "github.com/smartcontractkit/cld-changesets/mcms/evm/readers"
_ "github.com/smartcontractkit/cld-changesets/mcms/evm/transfer-to-timelock"
)
rt.Exec(runtime.ChangesetTask(transfertotimelock.Changeset{}, transfertotimelock.Input{
Cfg: transfertotimelock.Config{
ContractsByChain: map[uint64][]refkey.RefKey{
chainSelector: {
refkey.New(chainSelector, contractType, version, qualifier),
},
},
},
MCMS: mcmsInput,
}))
For pipelines that need every built-in family, blank-import [all] instead:
_ "github.com/smartcontractkit/cld-changesets/mcms/changesets/transfer-to-timelock/all"
MCMS timelock refs are resolved from the environment datastore only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registry = familyregistry.New[Sequence, ChainInput]("mcms transfer-to-timelock")
Registry holds per-family transfer-to-timelock sequences.
Functions ¶
func EnvFromDeps ¶
func EnvFromDeps(deps Deps) cldf.Environment
EnvFromDeps reconstructs the environment fields sequences need for datastore resolution.
Types ¶
type ChainInput ¶
type ChainInput struct {
ChainSelector uint64 `json:"chainSelector"`
Contracts []refkey.RefKey `json:"contracts,omitempty"`
OnlyAcceptOwnership bool `json:"onlyAcceptOwnership,omitempty"`
MCMS *cldf.MCMSTimelockProposalInput `json:"mcms,omitempty"`
}
ChainInput is the per-chain request passed to a family sequence.
type Changeset ¶
type Changeset struct{}
Changeset transfers ownable contract ownership to the MCMS timelock. transferOwnership is sent on-chain by the deployer; acceptOwnership is returned as batch operations in an MCMS timelock proposal. MCMS refs are resolved from the datastore only.
func (Changeset) Apply ¶
func (Changeset) Apply(env cldf.Environment, input Input) (cldf.ChangesetOutput, error)
func (Changeset) VerifyPreconditions ¶
func (Changeset) VerifyPreconditions(env cldf.Environment, input Input) error
type Config ¶
type Config struct {
// ContractsByChain lists contracts as datastore refs for every supported chain family.
ContractsByChain map[uint64][]refkey.RefKey `json:"contractsByChain,omitempty"`
// OnlyAcceptOwnership skips the on-chain transferOwnership step and only
// builds accept-ownership operations for the MCMS proposal.
OnlyAcceptOwnership bool `json:"onlyAcceptOwnership,omitempty"`
}
Config selects ownable contracts to transfer to the MCMS timelock per chain.
type Deps ¶
type Deps struct {
BlockChains chain.BlockChains
DataStore cldfdatastore.DataStore
}
Deps is the read-only dependency bundle available to every family sequence.
type Input ¶
type Input = sequenceutils.WithMCMS[Config]
Input is the changeset configuration with MCMS timelock proposal settings.
type Registration ¶
type Registration = familyregistry.Registration[Sequence, ChainInput]
Registration describes one chain family's transfer-to-timelock implementation.
type Sequence ¶
type Sequence = operations.Sequence[ChainInput, sequenceutils.OnChainOutput, Deps]
Sequence is the required operations sequence type for all family implementations.