etherman

package
v0.0.1-RC13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrGasRequiredExceedsAllowance gas required exceeds the allowance
	ErrGasRequiredExceedsAllowance = errors.New("gas required exceeds allowance")
	// ErrContentLengthTooLarge content length is too large
	ErrContentLengthTooLarge = errors.New("content length too large")
	//ErrTimestampMustBeInsideRange Timestamp must be inside range
	ErrTimestampMustBeInsideRange = errors.New("timestamp must be inside range")
	//ErrInsufficientAllowance insufficient allowance
	ErrInsufficientAllowance = errors.New("insufficient allowance")
	// ErrBothGasPriceAndMaxFeeGasAreSpecified both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified
	ErrBothGasPriceAndMaxFeeGasAreSpecified = errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
	// ErrMaxFeeGasAreSpecifiedButLondonNotActive maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet
	ErrMaxFeeGasAreSpecifiedButLondonNotActive = errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
	// ErrNoSigner no signer to authorize the transaction with
	ErrNoSigner = errors.New("no signer to authorize the transaction with")
	// ErrMissingTrieNode means that a node is missing on the trie
	ErrMissingTrieNode = errors.New("missing trie node")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	EthClient     ethereumClient
	OldZkEVM      *oldpolygonzkevm.Oldpolygonzkevm
	RollupManager *polygonrollupmanager.Polygonrollupmanager
	SCAddresses   []common.Address

	RollupID uint32
	// contains filtered or unexported fields
}

Client is a simple implementation of EtherMan.

func NewClient

func NewClient(cfg Config, l1Config L1Config) (*Client, error)

NewClient creates a new etherman.

func (*Client) BuildTrustedVerifyBatchesTxData

func (etherMan *Client) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, inputs *ethmanTypes.FinalProofInputs, beneficiary common.Address) (to *common.Address, data []byte, err error)

BuildTrustedVerifyBatchesTxData builds a []bytes to be sent to the PoE SC method TrustedVerifyBatches.

func (*Client) GetBatchAccInputHash

func (etherman *Client) GetBatchAccInputHash(ctx context.Context, batchNumber uint64) (common.Hash, error)

GetBatchAccInputHash gets the batch accumulated input hash from the ethereum

func (*Client) GetL2ChainID

func (etherMan *Client) GetL2ChainID() (uint64, error)

GetL2ChainID returns L2 Chain ID

func (*Client) GetLatestBlockHeader

func (etherMan *Client) GetLatestBlockHeader(ctx context.Context) (*types.Header, error)

GetLatestBlockHeader gets the latest block header from the ethereum

func (*Client) GetLatestVerifiedBatchNum

func (etherMan *Client) GetLatestVerifiedBatchNum() (uint64, error)

GetLatestVerifiedBatchNum gets latest verified batch from ethereum

type Config

type Config struct {
	// URL is the URL of the Ethereum node for L1
	URL string `mapstructure:"URL"`
}

Config represents the configuration of the etherman

type L1Config

type L1Config struct {
	// Chain ID of the L1 network
	L1ChainID uint64 `json:"chainId"`
	// ZkEVMAddr Address of the L1 contract polygonZkEVMAddress
	ZkEVMAddr common.Address `json:"polygonZkEVMAddress"`
	// RollupManagerAddr Address of the L1 contract
	RollupManagerAddr common.Address `json:"polygonRollupManagerAddress"`
	// GER Manager ADdress of the L1 contract
	GlobalExitRootManagerAddr common.Address `json:"polygonZkEVMGlobalExitRootAddress"`
}

L1Config represents the configuration of the network used in L1

Directories

Path Synopsis
smartcontracts

Jump to

Keyboard shortcuts

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