Documentation ¶
Index ¶
- Variables
- func DecodeGlobalIndex(globalIndex *big.Int) (bool, uint64, uint64, error)
- func GenerateGlobalIndex(mainnetFlag bool, rollupIndex uint, localExitRootIndex uint) *big.Int
- type Block
- type Claim
- type Client
- func (etherMan *Client) AddExistingRollupEvent(ctx context.Context, vLog types.Log, blocks *[]Block, ...) error
- func (etherMan *Client) CompressClaimCall(mainnetExitRoot, rollupExitRoot common.Hash, ...) ([]byte, error)
- func (etherMan *Client) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error)
- func (etherMan *Client) GetNetworkID(ctx context.Context) (uint, error)
- func (etherMan *Client) GetRollupID() uint
- func (etherMan *Client) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]Block, map[common.Hash][]Order, error)
- func (etherMan *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (etherMan *Client) SendCompressedClaims(auth *bind.TransactOpts, compressedTxData []byte) (*types.Transaction, error)
- type Config
- type Deposit
- type EventOrder
- type GlobalExitRoot
- type Order
- type RollupExitLeaf
- 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 ¶
func DecodeGlobalIndex ¶ added in v0.5.0
Types ¶
type Block ¶
type Block struct { ID uint64 BlockNumber uint64 BlockHash common.Hash ParentHash common.Hash NetworkID uint GlobalExitRoots []GlobalExitRoot Deposits []Deposit Claims []Claim Tokens []TokenWrapped VerifiedBatches []VerifiedBatch ActivateEtrog []bool ReceivedAt time.Time }
Block struct
type Claim ¶
type Claim struct { MainnetFlag bool RollupIndex uint64 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 PolygonBridge *polygonzkevmbridge.Polygonzkevmbridge OldPolygonBridge *oldpolygonzkevmbridge.Oldpolygonzkevmbridge PolygonZkEVMGlobalExitRoot *polygonzkevmglobalexitroot.Polygonzkevmglobalexitroot PolygonRollupManager *polygonrollupmanager.Polygonrollupmanager ClaimCompressor *claimcompressor.Claimcompressor RollupID uint32 SCAddresses []common.Address }
Client is a simple implementation of EtherMan.
func NewClient ¶
func NewClient(cfg Config, polygonBridgeAddr, polygonZkEVMGlobalExitRootAddress, polygonRollupManagerAddress, polygonZkEvmAddress common.Address) (*Client, error)
NewClient creates a new etherman.
func NewL2Client ¶
func NewL2Client(url string, polygonBridgeAddr, claimCompressorAddress common.Address) (*Client, error)
NewL2Client creates a new etherman for L2.
func NewSimulatedEtherman ¶
func NewSimulatedEtherman(cfg Config, auth *bind.TransactOpts) (*Client, *backends.SimulatedBackend, common.Address, *polygonzkevmbridge.Polygonzkevmbridge, *polygonzkevm.Polygonzkevm, 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) AddExistingRollupEvent ¶ added in v0.4.0
func (*Client) CompressClaimCall ¶ added in v0.5.0
func (etherMan *Client) CompressClaimCall(mainnetExitRoot, rollupExitRoot common.Hash, claimData []claimcompressor.ClaimCompressorCompressClaimCallData) ([]byte, error)
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) GetNetworkID ¶
GetNetworkID gets the network ID of the dedicated chain.
func (*Client) GetRollupID ¶ added in v0.4.0
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) HeaderByNumber ¶
HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.
func (*Client) SendCompressedClaims ¶ added in v0.5.0
func (etherMan *Client) SendCompressedClaims(auth *bind.TransactOpts, compressedTxData []byte) (*types.Transaction, error)
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" // DepositsOrder identifies a Deposits event DepositsOrder EventOrder = "Deposit" // ClaimsOrder identifies a Claims event ClaimsOrder EventOrder = "Claim" // TokensOrder identifies a TokenWrapped event TokensOrder EventOrder = "TokenWrapped" // VerifyBatchOrder identifies a VerifyBatch event VerifyBatchOrder EventOrder = "VerifyBatch" // ActivateEtrogOrder identifies the event to activate etrog ActivateEtrogOrder EventOrder = "etrog" )
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 RollupExitLeaf ¶ added in v0.4.0
type RollupExitLeaf struct { ID uint64 BlockID uint64 Leaf common.Hash RollupId uint Root common.Hash }
RollupExitLeaf struct
type TokenMetadata ¶
TokenMetadata is a metadata of ERC20 token.