evm

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 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 added in v1.5.1

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

func EstimateBaseFee added in v1.5.1

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 added in v1.5.1

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 added in v1.5.1

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

func GetTrace added in v1.5.0

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

func GetTxOptsWithSigner added in v1.5.1

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

func IssueTx

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

func IssueTxsToActivateProposerVMFork added in v1.5.1

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

func NonceAt added in v1.5.1

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

func SendTransaction added in v1.5.1

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

func SetupProposerVM added in v1.5.0

func SetupProposerVM(
	endpoint string,
	privKeyStr string,
) error

func SuggestGasTipCap added in v1.5.1

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