Documentation ¶
Index ¶
- Variables
- type Batch
- type Block
- type Claim
- type Client
- func NewClient(cfg Config, PoEAddr, bridgeAddr, globalExitRootManAddr common.Address) (*Client, error)
- func NewL2Client(url string, bridgeAddr common.Address) (*Client, error)
- func NewSimulatedEtherman(cfg Config, auth *bind.TransactOpts) (etherman *Client, ethBackend *backends.SimulatedBackend, ...)
- func (etherMan *Client) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error)
- func (etherMan *Client) GetLatestBatchNumber() (uint64, error)
- func (etherMan *Client) GetNetworkID(ctx context.Context) (uint, error)
- func (etherMan *Client) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]Block, map[common.Hash][]Order, error)
- func (etherMan *Client) GetTrustedSequencerURL() (string, error)
- func (etherMan *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- type Config
- type Deposit
- type EventOrder
- type ForcedBatch
- type GlobalExitRoot
- type Order
- type SequencedBatch
- type SequencedForceBatch
- type TokenMetadata
- type TokenWrapped
- type VerifiedBatch
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is used when the object is not found ErrNotFound = errors.New("Not found") )
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { BatchNumber uint64 Coinbase common.Address BatchL2Data []byte Timestamp time.Time GlobalExitRoot common.Hash }
Batch struct
type Block ¶
type Block struct { ID uint64 BlockNumber uint64 BlockHash common.Hash ParentHash common.Hash NetworkID uint GlobalExitRoots []GlobalExitRoot ForcedBatches []ForcedBatch SequencedBatches [][]SequencedBatch VerifiedBatches []VerifiedBatch SequencedForceBatches [][]SequencedForceBatch Deposits []Deposit Claims []Claim Tokens []TokenWrapped ReceivedAt time.Time }
Block struct
type Claim ¶
type Claim struct { Index uint OriginalNetwork uint OriginalAddress common.Address Amount *big.Int DestinationAddress common.Address BlockID uint64 BlockNumber uint64 NetworkID uint TxHash common.Hash }
Claim struct
type Client ¶
type Client struct { EtherClient ethClienter PoE *polygonzkevm.Polygonzkevm Bridge *polygonzkevmbridge.Polygonzkevmbridge GlobalExitRootManager *polygonzkevmglobalexitroot.Polygonzkevmglobalexitroot SCAddresses []common.Address }
Client is a simple implementation of EtherMan.
func NewClient ¶
func NewClient(cfg Config, PoEAddr, bridgeAddr, globalExitRootManAddr common.Address) (*Client, error)
NewClient creates a new etherman.
func NewL2Client ¶
NewL2Client creates a new etherman for L2.
func NewSimulatedEtherman ¶
func NewSimulatedEtherman(cfg Config, auth *bind.TransactOpts) (etherman *Client, ethBackend *backends.SimulatedBackend, maticAddr common.Address, mockBridge *mockbridge.Polygonzkevmbridge, err error)
NewSimulatedEtherman creates an etherman that uses a simulated blockchain. It's important to notice that the ChainID of the auth must be 1337. The address that holds the auth will have an initial balance of 10 ETH
func (*Client) EthBlockByNumber ¶
func (etherMan *Client) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error)
EthBlockByNumber function retrieves the ethereum block information by ethereum block number.
func (*Client) GetLatestBatchNumber ¶
GetLatestBatchNumber function allows to retrieve the latest proposed batch in the smc
func (*Client) GetNetworkID ¶
GetNetworkID gets the network ID of the dedicated chain.
func (*Client) GetRollupInfoByBlockRange ¶
func (etherMan *Client) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]Block, map[common.Hash][]Order, error)
GetRollupInfoByBlockRange function retrieves the Rollup information that are included in all this ethereum blocks from block x to block y.
func (*Client) GetTrustedSequencerURL ¶ added in v0.1.0
GetTrustedSequencerURL Gets the trusted sequencer url from rollup smc
type Deposit ¶
type Deposit struct { LeafType uint8 OriginalNetwork uint OriginalAddress common.Address Amount *big.Int DestinationNetwork uint DestinationAddress common.Address DepositCount uint BlockID uint64 BlockNumber uint64 NetworkID uint TxHash common.Hash Metadata []byte // it is only used for the bridge service ReadyForClaim bool }
Deposit struct
type EventOrder ¶
type EventOrder string
EventOrder is the the type used to identify the events order
const ( // GlobalExitRootsOrder identifies a GlobalExitRoot event GlobalExitRootsOrder EventOrder = "GlobalExitRoot" // SequenceBatchesOrder identifies a VerifyBatch event SequenceBatchesOrder EventOrder = "SequenceBatches" // TrustedVerifyBatchOrder identifies a TrustedVerifyBatch event TrustedVerifyBatchOrder EventOrder = "TrustedVerifyBatch" // SequenceForceBatchesOrder identifies a SequenceForceBatches event SequenceForceBatchesOrder EventOrder = "SequenceForceBatches" // ForcedBatchesOrder identifies a ForcedBatches event ForcedBatchesOrder EventOrder = "ForcedBatches" // DepositsOrder identifies a Deposits event DepositsOrder EventOrder = "Deposit" // ClaimsOrder identifies a Claims event ClaimsOrder EventOrder = "Claim" // TokensOrder identifies a TokenWrapped event TokensOrder EventOrder = "TokenWrapped" )
type ForcedBatch ¶
type ForcedBatch struct { BlockID uint64 BlockNumber uint64 BatchNumber *uint64 ForcedBatchNumber uint64 Sequencer common.Address GlobalExitRoot common.Hash RawTxsData []byte ForcedAt time.Time }
ForcedBatch represents a ForcedBatch
type GlobalExitRoot ¶
type GlobalExitRoot struct { BlockID uint64 BlockNumber uint64 ExitRoots []common.Hash GlobalExitRoot common.Hash }
GlobalExitRoot struct
type Order ¶
type Order struct { Name EventOrder Pos int }
Order contains the event order to let the synchronizer store the information following this order.
type SequencedBatch ¶
type SequencedBatch struct { BatchNumber uint64 Sequencer common.Address TxHash common.Hash polygonzkevm.PolygonZkEVMBatchData }
SequencedBatch represents virtual batches
type SequencedForceBatch ¶
type SequencedForceBatch struct { BatchNumber uint64 Sequencer common.Address TxHash common.Hash Timestamp time.Time polygonzkevm.PolygonZkEVMForcedBatchData }
SequencedForceBatch is a sturct to track the ForceSequencedBatches event.
type TokenMetadata ¶
TokenMetadata is a metadata of ERC20 token.