Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressToBytes ¶ added in v0.44.0
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 ¶
ChainSelector returns the chain selector of the chain
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 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)
}
OnchainClient is an EVM chain client. For EVM specifically we can use existing geth interface to abstract chain clients.