Documentation
¶
Index ¶
- Constants
- func GenerateRandomHash() [sha256.Size]byte
- func WaitTxToBeMined(ctx context.Context, client *ethclient.Client, tx *types.Transaction, ...) error
- type Client
- func (c *Client) ApproveERC20(ctx context.Context, erc20Addr, spender common.Address, amount *big.Int, ...) error
- func (c *Client) BuildSendClaim(ctx context.Context, deposit *etherman.Deposit, ...) (*types.Transaction, error)
- func (c *Client) CheckTxWasMined(ctx context.Context, txHash common.Hash) (bool, *types.Receipt, error)
- func (c *Client) DeployBridgeMessageReceiver(ctx context.Context, auth *bind.TransactOpts) (common.Address, error)
- func (c *Client) DeployERC20(ctx context.Context, name, symbol string, auth *bind.TransactOpts) (common.Address, *ERC20.ERC20, error)
- func (c *Client) GetSigner(ctx context.Context, accHexPrivateKey string) (*bind.TransactOpts, error)
- func (c *Client) GetSignerFromKeystore(ctx context.Context, ks zkevmtypes.KeystoreFileConfig) (*bind.TransactOpts, error)
- func (c *Client) MintERC20(ctx context.Context, erc20Addr common.Address, amount *big.Int, ...) error
- func (c *Client) SendBridgeAsset(ctx context.Context, tokenAddr common.Address, amount *big.Int, ...) error
- func (c *Client) SendBridgeMessage(ctx context.Context, destNetwork uint32, destAddr common.Address, ...) error
- func (c *Client) SendClaim(ctx context.Context, deposit *pb.Deposit, smtProof [mtHeight][keyLen]byte, ...) error
Constants ¶
View Source
const ( // LeafTypeAsset represents a bridge asset LeafTypeAsset uint32 = 0 // LeafTypeMessage represents a bridge message LeafTypeMessage uint32 = 1 )
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomHash ¶
GenerateRandomHash generates a random hash.
Types ¶
type Client ¶
type Client struct { // Client ethclient *ethclient.Client // contains filtered or unexported fields }
Client is the utillity client
func (*Client) ApproveERC20 ¶
func (c *Client) ApproveERC20(ctx context.Context, erc20Addr, spender common.Address, amount *big.Int, auth *bind.TransactOpts) error
ApproveERC20 approves erc20 tokens.
func (*Client) BuildSendClaim ¶
func (c *Client) BuildSendClaim(ctx context.Context, deposit *etherman.Deposit, smtProof [mtHeight][keyLen]byte, smtRollupProof [mtHeight][keyLen]byte, globalExitRoot *etherman.GlobalExitRoot, nonce, gasPrice int64, gasLimit uint64, rollupID uint, auth *bind.TransactOpts) (*types.Transaction, error)
BuildSendClaim builds a tx data to be sent to the bridge method SendClaim.
func (*Client) CheckTxWasMined ¶
func (c *Client) CheckTxWasMined(ctx context.Context, txHash common.Hash) (bool, *types.Receipt, error)
CheckTxWasMined check if a tx was already mined
func (*Client) DeployBridgeMessageReceiver ¶
func (c *Client) DeployBridgeMessageReceiver(ctx context.Context, auth *bind.TransactOpts) (common.Address, error)
DeployBridgeMessageReceiver deploys the brdige message receiver smc.
func (*Client) DeployERC20 ¶
func (c *Client) DeployERC20(ctx context.Context, name, symbol string, auth *bind.TransactOpts) (common.Address, *ERC20.ERC20, error)
DeployERC20 deploys erc20 smc.
func (*Client) GetSigner ¶
func (c *Client) GetSigner(ctx context.Context, accHexPrivateKey string) (*bind.TransactOpts, error)
GetSigner returns a transaction signer.
func (*Client) GetSignerFromKeystore ¶
func (c *Client) GetSignerFromKeystore(ctx context.Context, ks zkevmtypes.KeystoreFileConfig) (*bind.TransactOpts, error)
GetSignerFromKeystore returns a transaction signer from the keystore file.
func (*Client) MintERC20 ¶
func (c *Client) MintERC20(ctx context.Context, erc20Addr common.Address, amount *big.Int, auth *bind.TransactOpts) error
MintERC20 mint erc20 tokens.
func (*Client) SendBridgeAsset ¶
func (c *Client) SendBridgeAsset(ctx context.Context, tokenAddr common.Address, amount *big.Int, destNetwork uint32, destAddr *common.Address, metadata []byte, auth *bind.TransactOpts, ) error
SendBridgeAsset sends a bridge asset transaction.
Click to show internal directories.
Click to hide internal directories.