evm

package
v0.13.2-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

View Source
const (
	BaseFeeFactor               = 2
	MaxPriorityFeePerGas        = 2500000000 // 2.5 gwei
	NativeTransferGas    uint64 = 21_000
)

Variables

This section is empty.

Functions

func CalculateTxParams

func CalculateTxParams(
	client ethclient.Client,
	addressStr string,
) (*big.Int, *big.Int, uint64, error)

Returns the gasFeeCap, gasTipCap, and nonce the be used when constructing a transaction from address

func ContractAlreadyDeployed

func ContractAlreadyDeployed(
	client ethclient.Client,
	contractAddress string,
) (bool, error)

func DebugTraceTransaction

func DebugTraceTransaction(
	client *rpc.Client,
	txID string,
) (map[string]interface{}, error)

func EstimateBaseFee

func EstimateBaseFee(
	client ethclient.Client,
) (*big.Int, error)

func FundAddress

func FundAddress(
	client ethclient.Client,
	sourceAddressPrivateKeyStr string,
	targetAddressStr string,
	amount *big.Int,
) error

func GetAddressBalance

func GetAddressBalance(
	client ethclient.Client,
	addressStr string,
) (*big.Int, error)

func GetChainID

func GetChainID(client ethclient.Client) (*big.Int, error)

func GetClient

func GetClient(rpcURL string) (ethclient.Client, error)

func GetContractBytecode

func GetContractBytecode(
	client ethclient.Client,
	contractAddressStr string,
) ([]byte, error)

func GetEventFromLogs

func GetEventFromLogs[T any](logs []*types.Log, parser func(log types.Log) (T, error)) (T, error)

Returns the first log in 'logs' that is successfully parsed by 'parser'

func GetRPCClient

func GetRPCClient(rpcURL string) (*rpc.Client, error)

func GetTrace

func GetTrace(rpcURL string, txID string) (map[string]interface{}, error)

func GetTxOptsWithSigner

func GetTxOptsWithSigner(client ethclient.Client, prefundedPrivateKeyStr string) (*bind.TransactOpts, error)

func IssueTx

func IssueTx(
	client ethclient.Client,
	txStr string,
) error

func IssueTxsToActivateProposerVMFork

func IssueTxsToActivateProposerVMFork(
	client ethclient.Client,
	chainID *big.Int,
	privKey *ecdsa.PrivateKey,
) error

func NonceAt

func NonceAt(
	client ethclient.Client,
	addressStr string,
) (uint64, error)

func SendTransaction

func SendTransaction(
	client ethclient.Client,
	tx *types.Transaction,
) error

func SetupProposerVM

func SetupProposerVM(
	endpoint string,
	privKeyStr string,
) error

func SuggestGasTipCap

func SuggestGasTipCap(
	client ethclient.Client,
) (*big.Int, error)

func WaitForTransaction

func WaitForTransaction(
	client ethclient.Client,
	tx *types.Transaction,
) (*types.Receipt, bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL