Documentation
¶
Index ¶
- Constants
- func BlockUntilSuccessful(ctx context.Context, c *ethclient.Client, retryable func() error) error
- func Ecrecover(block *types.Block) ([]byte, error)
- func EcrecoverTx(tx *types.Transaction) ([]byte, error)
- func GetAddress(ctx context.Context, privateKey *ecdsa.PrivateKey) common.Address
- func GetAddressAndPrivateKeyHex(ctx context.Context, privateKey *ecdsa.PrivateKey) (string, string)
- func GetBlockRange(ctx context.Context, from, to uint64, c *ethrpc.Client, onlyTxHashes bool) ([]*json.RawMessage, error)
- func GetBlockRangeInPages(ctx context.Context, from, to, pageSize uint64, c *ethrpc.Client, ...) ([]*json.RawMessage, error)
- func GetForkID(rpc *ethrpc.Client) (uint64, error)
- func GetHexString(data any) string
- func GetPrivateKeyHex(privateKey *ecdsa.PrivateKey) string
- func GetReceipts(ctx context.Context, rawBlocks []*json.RawMessage, c *ethrpc.Client, ...) ([]*json.RawMessage, error)
- func GetRollupAddress(rpc *ethrpc.Client) (string, error)
- func GetRollupManagerAddress(rpc *ethrpc.Client) (string, error)
- func GetTxPoolStatus(rpc *ethrpc.Client) (uint64, uint64, error)
- func GetZkEVMBatches(rpc *ethrpc.Client) (uint64, uint64, uint64, error)
- func HexToBigInt(hexString string) (*big.Int, error)
- func IsMulticall3Supported(ctx context.Context, c *ethclient.Client, tryDeployIfNotExist bool, ...) (*common.Address, bool)
- func Multicall3Deploy(c *ethclient.Client, sender *bind.TransactOpts) (common.Address, *types.Transaction, *multicall3.Multicall3, error)
- func Multicall3Exists(ctx context.Context, c *ethclient.Client, customAddr *common.Address) (common.Address, bool, error)
- func Multicall3FundAccountsWithERC20Token(ctx context.Context, c *ethclient.Client, tops *bind.TransactOpts, ...) (approveTx, transfersTx *types.Transaction, err error)
- func Multicall3FundAccountsWithNativeToken(c *ethclient.Client, tops *bind.TransactOpts, accounts []common.Address, ...) (*types.Transaction, error)
- func Multicall3MaxAccountsToFundPerTx(ctx context.Context, c *ethclient.Client) (uint64, error)
- func Multicall3New(c *ethclient.Client, customAddr *common.Address) (common.Address, *multicall3.Multicall3, error)
- func ParseVerbosity(v string) (int, error)
- func ReadPrivateKeysFromFile(sendingAddressesFile string) ([]*ecdsa.PrivateKey, error)
- func SendTx(ctx context.Context, c *ethclient.Client, privateKey *ecdsa.PrivateKey, ...) error
- func SetLogLevel(verbosity int)
- func SetLogMode(mode LogMode) error
- func ValidateUrl(input string) error
- func WaitReceipt(ctx context.Context, client *ethclient.Client, txHash common.Hash) (*types.Receipt, error)
- func WaitReceiptWithRetries(ctx context.Context, client *ethclient.Client, txHash common.Hash, ...) (*types.Receipt, error)
- func WaitReceiptWithTimeout(ctx context.Context, client *ethclient.Client, txHash common.Hash, ...) (*types.Receipt, error)
- func WrapDeployedCode(deployedBytecode string, storageBytecode string) string
- type BlockUntilSuccessfulFn
- type LogMode
Constants ¶
const ( Silent = 0 Panic = 100 Fatal = 200 Error = 300 Warn = 400 Info = 500 Debug = 600 Trace = 700 )
Verbosity levels. https://pkg.go.dev/github.com/rs/zerolog#readme-leveled-logging
const DefaultMulticall3Addr = "0xcA11bde05977b3631167028862bE2a173976CA11"
Variables ¶
This section is empty.
Functions ¶
func BlockUntilSuccessful ¶
func EcrecoverTx ¶ added in v0.1.73
func EcrecoverTx(tx *types.Transaction) ([]byte, error)
func GetAddress ¶ added in v0.1.88
func GetAddressAndPrivateKeyHex ¶ added in v0.1.88
Returns the address and private key of the given private key
func GetBlockRange ¶
func GetBlockRangeInPages ¶
func GetHexString ¶ added in v0.1.65
func GetPrivateKeyHex ¶ added in v0.1.88
func GetPrivateKeyHex(privateKey *ecdsa.PrivateKey) string
func GetReceipts ¶
func GetReceipts(ctx context.Context, rawBlocks []*json.RawMessage, c *ethrpc.Client, batchSize uint64) ([]*json.RawMessage, error)
func GetRollupManagerAddress ¶ added in v0.1.63
func HexToBigInt ¶
HexToBigInt converts a hexadecimal string to a big integer.
func IsMulticall3Supported ¶ added in v0.1.90
func Multicall3Deploy ¶ added in v0.1.90
func Multicall3Deploy(c *ethclient.Client, sender *bind.TransactOpts) (common.Address, *types.Transaction, *multicall3.Multicall3, error)
func Multicall3Exists ¶ added in v0.1.90
func Multicall3FundAccountsWithERC20Token ¶ added in v0.1.92
func Multicall3FundAccountsWithNativeToken ¶ added in v0.1.90
func Multicall3MaxAccountsToFundPerTx ¶ added in v0.1.90
func Multicall3New ¶ added in v0.1.90
func Multicall3New(c *ethclient.Client, customAddr *common.Address) (common.Address, *multicall3.Multicall3, error)
func ParseVerbosity ¶ added in v0.1.90
ParseVerbosity parses a verbosity string (e.g., "info", "debug") or integer and returns the corresponding verbosity level.
func ReadPrivateKeysFromFile ¶ added in v0.1.88
func ReadPrivateKeysFromFile(sendingAddressesFile string) ([]*ecdsa.PrivateKey, error)
func SendTx ¶
func SendTx(ctx context.Context, c *ethclient.Client, privateKey *ecdsa.PrivateKey, to *common.Address, amount *big.Int, data []byte, gasLimit uint64) error
SendTx is a simple wrapper to send a transaction from one Ethereum address to another.
func SetLogLevel ¶
func SetLogLevel(verbosity int)
SetLogLevel sets the log level based on the flags. https://logging.apache.org/log4j/2.x/manual/customloglevels.html
func ValidateUrl ¶
ValidateUrl checks if a string URL can be parsed and if it has a valid scheme.
func WaitReceipt ¶ added in v0.1.92
func WaitReceipt(ctx context.Context, client *ethclient.Client, txHash common.Hash) (*types.Receipt, error)
WaitReceipt waits for a transaction receipt with default parameters.
func WaitReceiptWithRetries ¶ added in v0.1.92
func WaitReceiptWithRetries(ctx context.Context, client *ethclient.Client, txHash common.Hash, maxRetries uint, initialDelayMs uint) (*types.Receipt, error)
WaitReceiptWithRetries waits for a transaction receipt with retries and exponential backoff.
func WaitReceiptWithTimeout ¶ added in v0.1.92
func WaitReceiptWithTimeout(ctx context.Context, client *ethclient.Client, txHash common.Hash, timeout time.Duration) (*types.Receipt, error)
WaitReceiptWithTimeout waits for a transaction receipt with a specified timeout.
func WrapDeployedCode ¶ added in v0.1.65
Types ¶
type BlockUntilSuccessfulFn ¶
BlockUntilSuccessfulFn is designed to wait until a specified number of Ethereum blocks have been mined, periodically checking for the completion of a given function within each block interval.