Documentation
¶
Index ¶
- func AddEVMCallSequenceToCSOutput[IN any](e cldf.Environment, csOutput cldf.ChangesetOutput, ...) (cldf.ChangesetOutput, error)
- func CloneTransactOptsWithGas(opts *bind.TransactOpts, gasLimit uint64, gasPrice uint64) *bind.TransactOpts
- func GasBoostConfigsForChainMap[T any](chainMap map[uint64]T, ...) map[uint64]*cldfproposalutils.GasBoostConfig
- func GetBoostedGasForAttempt(cfg cldfproposalutils.GasBoostConfig, attempt uint) (gasLimit uint64, gasPrice uint64)
- func NewEVMCallOperation[IN any, C any](name string, version *semver.Version, description string, abi string, ...) *operations.Operation[EVMCallInput[IN], EVMCallOutput, cldf_evm.Chain]
- func NewEVMDeployOperation[IN any](name string, version *semver.Version, description string, ...) *operations.Operation[EVMDeployInput[IN], EVMDeployOutput, cldf_evm.Chain]
- func RetryCallWithGasBoost[IN any](cfg *cldfproposalutils.GasBoostConfig) operations.ExecuteOption[EVMCallInput[IN], cldf_evm.Chain]
- func RetryDeploymentWithGasBoost[IN any](cfg *cldfproposalutils.GasBoostConfig) operations.ExecuteOption[EVMDeployInput[IN], cldf_evm.Chain]
- type ContractOpts
- type EVMCallInput
- type EVMCallOutput
- type EVMDeployInput
- type EVMDeployOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEVMCallSequenceToCSOutput ¶
func AddEVMCallSequenceToCSOutput[IN any]( e cldf.Environment, csOutput cldf.ChangesetOutput, seqReport operations.SequenceReport[IN, map[uint64][]EVMCallOutput], seqErr error, mcmsStateByChain map[uint64]evmstate.MCMSWithTimelockState, mcmsCfg *cldfproposalutils.TimelockConfig, mcmsDescription string, ) (cldf.ChangesetOutput, error)
AddEVMCallSequenceToCSOutput updates the ChangesetOutput with the results of an EVM call sequence. It appends the execution reports from the sequence report to the ChangesetOutput's reports. If the sequence execution was successful and MCMS configuration is provided, it adds a proposal to the output.
func CloneTransactOptsWithGas ¶
func CloneTransactOptsWithGas(opts *bind.TransactOpts, gasLimit uint64, gasPrice uint64) *bind.TransactOpts
CloneTransactOptsWithGas ensures that we don't impact the transact opts used by other operations.
func GasBoostConfigsForChainMap ¶
func GasBoostConfigsForChainMap[T any](chainMap map[uint64]T, gasBoostConfigs map[uint64]cldfproposalutils.GasBoostConfig) map[uint64]*cldfproposalutils.GasBoostConfig
GasBoostConfigsForChainMap creates a map of GasBoostConfig pointers for each chain in the provided chainMap. If a chain selector exists in gasBoostConfigs, it uses that config; otherwise, it sets nil.
func GetBoostedGasForAttempt ¶
func GetBoostedGasForAttempt(cfg cldfproposalutils.GasBoostConfig, attempt uint) (gasLimit uint64, gasPrice uint64)
func NewEVMCallOperation ¶
func NewEVMCallOperation[IN any, C any]( name string, version *semver.Version, description string, abi string, contractType cldf.ContractType, constructor func(address common.Address, backend bind.ContractBackend) (C, error), call func(contract C, opts *bind.TransactOpts, input IN) (*types.Transaction, error), ) *operations.Operation[EVMCallInput[IN], EVMCallOutput, cldf_evm.Chain]
NewEVMCallOperation creates a new operation that performs an EVM call. Any interfacing with gethwrappers should happen in the call function.
func NewEVMDeployOperation ¶
func NewEVMDeployOperation[IN any]( name string, version *semver.Version, description string, contractType cldf.ContractType, contractMetadata *bind.MetaData, defaultContractOpts *ContractOpts, makeArgs func(IN) []any, ) *operations.Operation[EVMDeployInput[IN], EVMDeployOutput, cldf_evm.Chain]
NewEVMDeployOperation creates a new operation that deploys an EVM contract. Any interfacing with gethwrappers should happen in the deploy function.
func RetryCallWithGasBoost ¶
func RetryCallWithGasBoost[IN any](cfg *cldfproposalutils.GasBoostConfig) operations.ExecuteOption[EVMCallInput[IN], cldf_evm.Chain]
RetryCallWithGasBoost is an ExecuteOption that retries EVM calls with gas boosting. It uses the provided GasBoostConfig to adjust the gas limit and gas price on each retry attempt. If NoSend is true, it will not apply gas boosting since the transaction is never sent.
func RetryDeploymentWithGasBoost ¶
func RetryDeploymentWithGasBoost[IN any](cfg *cldfproposalutils.GasBoostConfig) operations.ExecuteOption[EVMDeployInput[IN], cldf_evm.Chain]
RetryDeploymentWithGasBoost is an ExecuteOption that retries EVM deployments with gas boosting. It uses the provided GasBoostConfig to adjust the gas limit and gas price on each retry attempt.
Types ¶
type ContractOpts ¶
ContractOpts specify the exact bytecode and version of the contract to deploy. Deployment operations must define defaults for these options in case users do not provide them. These options allow operators to deploy new bytecodes for the same ABI.
func (*ContractOpts) Validate ¶
func (c *ContractOpts) Validate(isZkSyncVM bool) error
type EVMCallInput ¶
type EVMCallInput[IN any] struct { // Address is the address of the contract to call. Address common.Address `json:"address"` // ChainSelector is the selector for the chain on which the contract resides. ChainSelector uint64 `json:"chainSelector"` // CallInput is the input data for the call. CallInput IN `json:"callInput"` // NoSend indicates whether or not the transaction should be sent. // If true, the transaction data be prepared and returned but not sent. NoSend bool `json:"noSend"` // GasPrice is a custom gas price to set for the transaction. GasPrice uint64 `json:"gasPrice"` // GasLimit is a custom gas limit to set for the transaction. GasLimit uint64 `json:"gasLimit"` }
EVMCallInput is the input structure for an EVM call operation.
type EVMCallOutput ¶
type EVMCallOutput struct {
// To is the address that initiated the transaction.
To common.Address `json:"to"`
// Data is the transaction data
Data []byte `json:"data"`
// ContractType is the type of contract that is being called.
ContractType cldf.ContractType `json:"contractType"`
// Confirmed indicates whether or not the transaction was confirmed.
Confirmed bool `json:"confirmed"`
}
EVMCallOutput is the output structure for an EVM call operation. It contains the transaction and the type of contract that is being called.
type EVMDeployInput ¶
type EVMDeployInput[IN any] struct { // ChainSelector is the selector for the chain on which the contract will be deployed. ChainSelector uint64 `json:"chainSelector"` // DeployInput is the input data for the call. DeployInput IN `json:"deployInput"` // GasPrice is a custom gas price to set for the transaction. GasPrice uint64 `json:"gasPrice"` // GasLimit is a custom gas limit to set for the transaction. GasLimit uint64 `json:"gasLimit"` // Qualifier is an optional qualifier for the deployment. Qualifier *string `json:"qualifier"` // ContractOpts (optional) further configure the deployment with a specific bytecode and version. ContractOpts *ContractOpts `json:"contractOpts"` }
EVMDeployInput is the input structure for an EVM deploy operation.
type EVMDeployOutput ¶
type EVMDeployOutput struct {
// Address is the address of the deployed contract.
Address common.Address `json:"address"`
// TypeAndVersion is the type and version of the contract that was deployed.
TypeAndVersion string `json:"typeAndVersion"`
// Qualifier is an optional qualifier for the deployment.
Qualifier *string `json:"qualifier"`
}
EVMDeployOutput is the output structure for an EVM deploy operation. It contains the new address, the deployment transaction, and the type and version of the contract that was deployed.