Documentation
¶
Index ¶
- Constants
- func GetSignerFromKeystore(ctx context.Context, ethClient *ethclient.Client, ...) (*bind.TransactOpts, error)
- type Client
- func (bm *Client) CompressClaimCall(mainnetExitRoot, rollupExitRoot common.Hash, ...) ([]byte, error)
- func (bm *Client) EstimateGasClaim(metadata []byte, amount *big.Int, ...) (*types.Transaction, error)
- func (bm *Client) SendClaim(leafType, origNet uint32, origAddr common.Address, amount *big.Int, ...) (*types.Transaction, error)
- func (bm *Client) SendCompressedClaims(compressedTxData []byte) (*types.Transaction, error)
- type Config
Constants ¶
View Source
const ( // LeafTypeAsset represents a bridge asset LeafTypeAsset uint32 = 0 // LeafTypeMessage represents a bridge message LeafTypeMessage uint32 = 1 MtHeight = 32 KeyLen = 32 )
Variables ¶
This section is empty.
Functions ¶
func GetSignerFromKeystore ¶
func GetSignerFromKeystore(ctx context.Context, ethClient *ethclient.Client, ks zkevmtypes.KeystoreFileConfig) (*bind.TransactOpts, error)
GetSignerFromKeystore returns a transaction signer from the keystore file.
Types ¶
type Client ¶
type Client struct { EtherClient *ethclient.Client PolygonBridge *polygonzkevmbridgev2.Polygonzkevmbridgev2 ClaimCompressor *claimcompressor.Claimcompressor NetworkID uint32 // contains filtered or unexported fields }
Client is a simple implementation of EtherMan.
func (*Client) CompressClaimCall ¶
func (bm *Client) CompressClaimCall(mainnetExitRoot, rollupExitRoot common.Hash, claimData []claimcompressor.ClaimCompressorCompressClaimCallData) ([]byte, error)
func (*Client) EstimateGasClaim ¶
func (bm *Client) EstimateGasClaim(metadata []byte, amount *big.Int, originalAddress, destinationAddress common.Address, originalNetwork, destinationNetwork uint32, mainnetExitRoot, rollupExitRoot common.Hash, leafType uint32, globalIndex *big.Int, smtProof [MtHeight][KeyLen]byte, smtRollupProof [MtHeight][KeyLen]byte) (*types.Transaction, error)
func (*Client) SendClaim ¶
func (bm *Client) SendClaim(leafType, origNet uint32, origAddr common.Address, amount *big.Int, destNet uint32, destAddr common.Address, networkId uint32, metadata []byte, globalIndex *big.Int, smtProof [MtHeight][KeyLen]byte, smtRollupProof [MtHeight][KeyLen]byte, mainnetExitRoot, rollupExitRoot common.Hash, ) (*types.Transaction, error)
SendClaim sends a claim transaction.
func (*Client) SendCompressedClaims ¶
func (bm *Client) SendCompressedClaims(compressedTxData []byte) (*types.Transaction, error)
type Config ¶
type Config struct { // L2RPC is the URL of the L2 node L2RPC string `mapstructure:"L2RPC"` // PrivateKey defines the key store file that is going // to be read in order to provide the private key to sign the claim txs PrivateKey types.KeystoreFileConfig `mapstructure:"PrivateKey"` // PolygonBridgeAddress is the l2 bridge smc address PolygonBridgeAddress common.Address `mapstructure:"PolygonBridgeAddress"` // ClaimCompressorAddress is the l2 claim compressor smc address. If it's not set, then group claims is disabled ClaimCompressorAddress common.Address `mapstructure:"ClaimCompressorAddress"` }
Config is the configuration struct for the different environments.
Click to show internal directories.
Click to hide internal directories.