evm

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 12 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressToBytes added in v0.44.0

func AddressToBytes(address string) ([]byte, error)

AddressToBytes converts an EVM address string to bytes. EVM addresses are hex strings (with or without 0x prefix) representing 20 bytes.

Types

type AddressConverter added in v0.44.0

type AddressConverter struct{}

AddressConverter implements address conversion for EVM-compatible chains. This struct implements the AddressConverter strategy interface.

func (AddressConverter) ConvertToBytes added in v0.44.0

func (e AddressConverter) ConvertToBytes(address string) ([]byte, error)

ConvertToBytes converts an EVM address string to bytes.

func (AddressConverter) Supports added in v0.44.0

func (e AddressConverter) Supports(family string) bool

Supports returns true if this converter supports the given chain family.

type Chain

type Chain struct {
	Selector uint64

	Client OnchainClient
	// Note the Sign function can be abstract supporting a variety of key storage mechanisms (e.g. KMS etc).
	DeployerKey *bind.TransactOpts
	Confirm     ConfirmFunc
	// Users are a set of keys that can be used to interact with the chain.
	// These are distinct from the deployer key.
	Users []*bind.TransactOpts

	// SignHash allows signing of arbitrary hashes using the deployer key's signing mechanism.
	// This function signature matches the expected format: func([]byte) ([]byte, error)
	SignHash func([]byte) ([]byte, error)

	// ZK deployment specifics
	IsZkSyncVM          bool
	ClientZkSyncVM      *clients.Client
	DeployerKeyZkSyncVM *accounts.Wallet
}

Chain represents an EVM chain.

func (Chain) ChainSelector

func (c Chain) ChainSelector() uint64

ChainSelector returns the chain selector of the chain

func (Chain) Family added in v0.5.1

func (c Chain) Family() string

Family returns the family of the chain

func (Chain) Name

func (c Chain) Name() string

Name returns the name of the chain

func (Chain) String

func (c Chain) String() string

String returns chain name and selector "<name> (<selector>)"

type ConfirmFunc added in v0.14.0

type ConfirmFunc func(tx *types.Transaction) (uint64, error)

ConfirmFunc is a function that takes a transaction, waits for the transaction to be confirmed, and returns the block number and an error.

type MockOnchainClient added in v0.65.0

type MockOnchainClient struct {
	mock.Mock
}

MockOnchainClient is an autogenerated mock type for the OnchainClient type

func NewMockOnchainClient added in v0.65.0

func NewMockOnchainClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOnchainClient

NewMockOnchainClient creates a new instance of MockOnchainClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockOnchainClient) BalanceAt added in v0.65.0

func (_mock *MockOnchainClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

BalanceAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) CallContract added in v0.65.0

func (_mock *MockOnchainClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

CallContract provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) CodeAt added in v0.65.0

func (_mock *MockOnchainClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

CodeAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) EXPECT added in v0.65.0

func (*MockOnchainClient) EstimateGas added in v0.65.0

func (_mock *MockOnchainClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)

EstimateGas provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) FilterLogs added in v0.65.0

func (_mock *MockOnchainClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)

FilterLogs provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) HeaderByNumber added in v0.65.0

func (_mock *MockOnchainClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

HeaderByNumber provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) NonceAt added in v0.65.0

func (_mock *MockOnchainClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

NonceAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) PendingCodeAt added in v0.65.0

func (_mock *MockOnchainClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

PendingCodeAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) PendingNonceAt added in v0.65.0

func (_mock *MockOnchainClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

PendingNonceAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) SendTransaction added in v0.65.0

func (_mock *MockOnchainClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) StorageAt added in v0.65.0

func (_mock *MockOnchainClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)

StorageAt provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) SubscribeFilterLogs added in v0.65.0

func (_mock *MockOnchainClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

SubscribeFilterLogs provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) SuggestGasPrice added in v0.65.0

func (_mock *MockOnchainClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) SuggestGasTipCap added in v0.65.0

func (_mock *MockOnchainClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

SuggestGasTipCap provides a mock function for the type MockOnchainClient

func (*MockOnchainClient) TransactionReceipt added in v0.65.0

func (_mock *MockOnchainClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt provides a mock function for the type MockOnchainClient

type MockOnchainClient_BalanceAt_Call added in v0.65.0

type MockOnchainClient_BalanceAt_Call struct {
	*mock.Call
}

MockOnchainClient_BalanceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BalanceAt'

func (*MockOnchainClient_BalanceAt_Call) Return added in v0.65.0

func (*MockOnchainClient_BalanceAt_Call) Run added in v0.65.0

func (*MockOnchainClient_BalanceAt_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_BalanceAt_Call) RunAndReturn(run func(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)) *MockOnchainClient_BalanceAt_Call

type MockOnchainClient_CallContract_Call added in v0.65.0

type MockOnchainClient_CallContract_Call struct {
	*mock.Call
}

MockOnchainClient_CallContract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallContract'

func (*MockOnchainClient_CallContract_Call) Return added in v0.65.0

func (*MockOnchainClient_CallContract_Call) Run added in v0.65.0

func (_c *MockOnchainClient_CallContract_Call) Run(run func(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int)) *MockOnchainClient_CallContract_Call

func (*MockOnchainClient_CallContract_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_CallContract_Call) RunAndReturn(run func(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)) *MockOnchainClient_CallContract_Call

type MockOnchainClient_CodeAt_Call added in v0.65.0

type MockOnchainClient_CodeAt_Call struct {
	*mock.Call
}

MockOnchainClient_CodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CodeAt'

func (*MockOnchainClient_CodeAt_Call) Return added in v0.65.0

func (*MockOnchainClient_CodeAt_Call) Run added in v0.65.0

func (_c *MockOnchainClient_CodeAt_Call) Run(run func(ctx context.Context, contract common.Address, blockNumber *big.Int)) *MockOnchainClient_CodeAt_Call

func (*MockOnchainClient_CodeAt_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_CodeAt_Call) RunAndReturn(run func(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)) *MockOnchainClient_CodeAt_Call

type MockOnchainClient_EstimateGas_Call added in v0.65.0

type MockOnchainClient_EstimateGas_Call struct {
	*mock.Call
}

MockOnchainClient_EstimateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateGas'

func (*MockOnchainClient_EstimateGas_Call) Return added in v0.65.0

func (*MockOnchainClient_EstimateGas_Call) Run added in v0.65.0

func (_c *MockOnchainClient_EstimateGas_Call) Run(run func(ctx context.Context, call ethereum.CallMsg)) *MockOnchainClient_EstimateGas_Call

func (*MockOnchainClient_EstimateGas_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_EstimateGas_Call) RunAndReturn(run func(ctx context.Context, call ethereum.CallMsg) (uint64, error)) *MockOnchainClient_EstimateGas_Call

type MockOnchainClient_Expecter added in v0.65.0

type MockOnchainClient_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOnchainClient_Expecter) BalanceAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) BalanceAt(ctx interface{}, account interface{}, blockNumber interface{}) *MockOnchainClient_BalanceAt_Call

BalanceAt is a helper method to define mock.On call

  • ctx context.Context
  • account common.Address
  • blockNumber *big.Int

func (*MockOnchainClient_Expecter) CallContract added in v0.65.0

func (_e *MockOnchainClient_Expecter) CallContract(ctx interface{}, call interface{}, blockNumber interface{}) *MockOnchainClient_CallContract_Call

CallContract is a helper method to define mock.On call

  • ctx context.Context
  • call ethereum.CallMsg
  • blockNumber *big.Int

func (*MockOnchainClient_Expecter) CodeAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) CodeAt(ctx interface{}, contract interface{}, blockNumber interface{}) *MockOnchainClient_CodeAt_Call

CodeAt is a helper method to define mock.On call

  • ctx context.Context
  • contract common.Address
  • blockNumber *big.Int

func (*MockOnchainClient_Expecter) EstimateGas added in v0.65.0

func (_e *MockOnchainClient_Expecter) EstimateGas(ctx interface{}, call interface{}) *MockOnchainClient_EstimateGas_Call

EstimateGas is a helper method to define mock.On call

  • ctx context.Context
  • call ethereum.CallMsg

func (*MockOnchainClient_Expecter) FilterLogs added in v0.65.0

func (_e *MockOnchainClient_Expecter) FilterLogs(ctx interface{}, q interface{}) *MockOnchainClient_FilterLogs_Call

FilterLogs is a helper method to define mock.On call

  • ctx context.Context
  • q ethereum.FilterQuery

func (*MockOnchainClient_Expecter) HeaderByNumber added in v0.65.0

func (_e *MockOnchainClient_Expecter) HeaderByNumber(ctx interface{}, number interface{}) *MockOnchainClient_HeaderByNumber_Call

HeaderByNumber is a helper method to define mock.On call

  • ctx context.Context
  • number *big.Int

func (*MockOnchainClient_Expecter) NonceAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) NonceAt(ctx interface{}, account interface{}, blockNumber interface{}) *MockOnchainClient_NonceAt_Call

NonceAt is a helper method to define mock.On call

  • ctx context.Context
  • account common.Address
  • blockNumber *big.Int

func (*MockOnchainClient_Expecter) PendingCodeAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) PendingCodeAt(ctx interface{}, account interface{}) *MockOnchainClient_PendingCodeAt_Call

PendingCodeAt is a helper method to define mock.On call

  • ctx context.Context
  • account common.Address

func (*MockOnchainClient_Expecter) PendingNonceAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) PendingNonceAt(ctx interface{}, account interface{}) *MockOnchainClient_PendingNonceAt_Call

PendingNonceAt is a helper method to define mock.On call

  • ctx context.Context
  • account common.Address

func (*MockOnchainClient_Expecter) SendTransaction added in v0.65.0

func (_e *MockOnchainClient_Expecter) SendTransaction(ctx interface{}, tx interface{}) *MockOnchainClient_SendTransaction_Call

SendTransaction is a helper method to define mock.On call

  • ctx context.Context
  • tx *types.Transaction

func (*MockOnchainClient_Expecter) StorageAt added in v0.65.0

func (_e *MockOnchainClient_Expecter) StorageAt(ctx interface{}, account interface{}, key interface{}, blockNumber interface{}) *MockOnchainClient_StorageAt_Call

StorageAt is a helper method to define mock.On call

  • ctx context.Context
  • account common.Address
  • key common.Hash
  • blockNumber *big.Int

func (*MockOnchainClient_Expecter) SubscribeFilterLogs added in v0.65.0

func (_e *MockOnchainClient_Expecter) SubscribeFilterLogs(ctx interface{}, q interface{}, ch interface{}) *MockOnchainClient_SubscribeFilterLogs_Call

SubscribeFilterLogs is a helper method to define mock.On call

  • ctx context.Context
  • q ethereum.FilterQuery
  • ch chan<- types.Log

func (*MockOnchainClient_Expecter) SuggestGasPrice added in v0.65.0

func (_e *MockOnchainClient_Expecter) SuggestGasPrice(ctx interface{}) *MockOnchainClient_SuggestGasPrice_Call

SuggestGasPrice is a helper method to define mock.On call

  • ctx context.Context

func (*MockOnchainClient_Expecter) SuggestGasTipCap added in v0.65.0

func (_e *MockOnchainClient_Expecter) SuggestGasTipCap(ctx interface{}) *MockOnchainClient_SuggestGasTipCap_Call

SuggestGasTipCap is a helper method to define mock.On call

  • ctx context.Context

func (*MockOnchainClient_Expecter) TransactionReceipt added in v0.65.0

func (_e *MockOnchainClient_Expecter) TransactionReceipt(ctx interface{}, txHash interface{}) *MockOnchainClient_TransactionReceipt_Call

TransactionReceipt is a helper method to define mock.On call

  • ctx context.Context
  • txHash common.Hash

type MockOnchainClient_FilterLogs_Call added in v0.65.0

type MockOnchainClient_FilterLogs_Call struct {
	*mock.Call
}

MockOnchainClient_FilterLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterLogs'

func (*MockOnchainClient_FilterLogs_Call) Return added in v0.65.0

func (*MockOnchainClient_FilterLogs_Call) Run added in v0.65.0

func (_c *MockOnchainClient_FilterLogs_Call) Run(run func(ctx context.Context, q ethereum.FilterQuery)) *MockOnchainClient_FilterLogs_Call

func (*MockOnchainClient_FilterLogs_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_FilterLogs_Call) RunAndReturn(run func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)) *MockOnchainClient_FilterLogs_Call

type MockOnchainClient_HeaderByNumber_Call added in v0.65.0

type MockOnchainClient_HeaderByNumber_Call struct {
	*mock.Call
}

MockOnchainClient_HeaderByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByNumber'

func (*MockOnchainClient_HeaderByNumber_Call) Return added in v0.65.0

func (*MockOnchainClient_HeaderByNumber_Call) Run added in v0.65.0

func (*MockOnchainClient_HeaderByNumber_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_NonceAt_Call added in v0.65.0

type MockOnchainClient_NonceAt_Call struct {
	*mock.Call
}

MockOnchainClient_NonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAt'

func (*MockOnchainClient_NonceAt_Call) Return added in v0.65.0

func (*MockOnchainClient_NonceAt_Call) Run added in v0.65.0

func (_c *MockOnchainClient_NonceAt_Call) Run(run func(ctx context.Context, account common.Address, blockNumber *big.Int)) *MockOnchainClient_NonceAt_Call

func (*MockOnchainClient_NonceAt_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_NonceAt_Call) RunAndReturn(run func(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)) *MockOnchainClient_NonceAt_Call

type MockOnchainClient_PendingCodeAt_Call added in v0.65.0

type MockOnchainClient_PendingCodeAt_Call struct {
	*mock.Call
}

MockOnchainClient_PendingCodeAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingCodeAt'

func (*MockOnchainClient_PendingCodeAt_Call) Return added in v0.65.0

func (*MockOnchainClient_PendingCodeAt_Call) Run added in v0.65.0

func (*MockOnchainClient_PendingCodeAt_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_PendingNonceAt_Call added in v0.65.0

type MockOnchainClient_PendingNonceAt_Call struct {
	*mock.Call
}

MockOnchainClient_PendingNonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingNonceAt'

func (*MockOnchainClient_PendingNonceAt_Call) Return added in v0.65.0

func (*MockOnchainClient_PendingNonceAt_Call) Run added in v0.65.0

func (*MockOnchainClient_PendingNonceAt_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_SendTransaction_Call added in v0.65.0

type MockOnchainClient_SendTransaction_Call struct {
	*mock.Call
}

MockOnchainClient_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction'

func (*MockOnchainClient_SendTransaction_Call) Return added in v0.65.0

func (*MockOnchainClient_SendTransaction_Call) Run added in v0.65.0

func (*MockOnchainClient_SendTransaction_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_StorageAt_Call added in v0.65.0

type MockOnchainClient_StorageAt_Call struct {
	*mock.Call
}

MockOnchainClient_StorageAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StorageAt'

func (*MockOnchainClient_StorageAt_Call) Return added in v0.65.0

func (*MockOnchainClient_StorageAt_Call) Run added in v0.65.0

func (*MockOnchainClient_StorageAt_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_StorageAt_Call) RunAndReturn(run func(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)) *MockOnchainClient_StorageAt_Call

type MockOnchainClient_SubscribeFilterLogs_Call added in v0.65.0

type MockOnchainClient_SubscribeFilterLogs_Call struct {
	*mock.Call
}

MockOnchainClient_SubscribeFilterLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeFilterLogs'

func (*MockOnchainClient_SubscribeFilterLogs_Call) Return added in v0.65.0

func (_c *MockOnchainClient_SubscribeFilterLogs_Call) Return(subscription ethereum.Subscription, err error) *MockOnchainClient_SubscribeFilterLogs_Call

func (*MockOnchainClient_SubscribeFilterLogs_Call) Run added in v0.65.0

func (_c *MockOnchainClient_SubscribeFilterLogs_Call) Run(run func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log)) *MockOnchainClient_SubscribeFilterLogs_Call

func (*MockOnchainClient_SubscribeFilterLogs_Call) RunAndReturn added in v0.65.0

func (_c *MockOnchainClient_SubscribeFilterLogs_Call) RunAndReturn(run func(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)) *MockOnchainClient_SubscribeFilterLogs_Call

type MockOnchainClient_SuggestGasPrice_Call added in v0.65.0

type MockOnchainClient_SuggestGasPrice_Call struct {
	*mock.Call
}

MockOnchainClient_SuggestGasPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasPrice'

func (*MockOnchainClient_SuggestGasPrice_Call) Return added in v0.65.0

func (*MockOnchainClient_SuggestGasPrice_Call) Run added in v0.65.0

func (*MockOnchainClient_SuggestGasPrice_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_SuggestGasTipCap_Call added in v0.65.0

type MockOnchainClient_SuggestGasTipCap_Call struct {
	*mock.Call
}

MockOnchainClient_SuggestGasTipCap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestGasTipCap'

func (*MockOnchainClient_SuggestGasTipCap_Call) Return added in v0.65.0

func (*MockOnchainClient_SuggestGasTipCap_Call) Run added in v0.65.0

func (*MockOnchainClient_SuggestGasTipCap_Call) RunAndReturn added in v0.65.0

type MockOnchainClient_TransactionReceipt_Call added in v0.65.0

type MockOnchainClient_TransactionReceipt_Call struct {
	*mock.Call
}

MockOnchainClient_TransactionReceipt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransactionReceipt'

func (*MockOnchainClient_TransactionReceipt_Call) Return added in v0.65.0

func (*MockOnchainClient_TransactionReceipt_Call) Run added in v0.65.0

func (*MockOnchainClient_TransactionReceipt_Call) RunAndReturn added in v0.65.0

type OnchainClient

type OnchainClient interface {
	bind.ContractBackend
	bind.DeployBackend

	BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
	NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
	// StorageAt reads a storage slot from the given account at the specified block number.
	// This is needed for operations like EIP-1967 proxy detection.
	StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)
}

OnchainClient is an EVM chain client. For EVM specifically we can use existing geth interface to abstract chain clients.

Directories

Path Synopsis
Package provider contains EVM chain providers for the Chainlink Deployments Framework.
Package provider contains EVM chain providers for the Chainlink Deployments Framework.

Jump to

Keyboard shortcuts

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