common

package
v1.13.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArbitrumGoerliChainID int64 = 421613
	ArbitrumOneChainID    int64 = 42161
)

Variables

This section is empty.

Functions

func ConfirmCodeAt added in v1.12.0

func ConfirmCodeAt(ctx context.Context, client *ethclient.Client, addr common.Address, chainID int64)

func ConfirmContractDeployed added in v1.6.0

func ConfirmContractDeployed(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64) (address common.Address)

ConfirmContractDeployed confirms that the given contract deployment transaction completed and prints useful execution information.

func ConfirmTXMined added in v1.6.0

func ConfirmTXMined(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64, txInfo ...string) (receipt *types.Receipt)

ConfirmTXMined confirms that the given transaction is mined and prints useful execution information.

func ContractExplorerLink(chainID int64, contractAddress common.Address) string

ContractExplorerLink creates a block explorer link for the given contract address. If the chain ID is unrecognized the address is returned as-is.

func DeployLinkEthFeed added in v1.7.0

func DeployLinkEthFeed(e Environment, linkAddress string, weiPerUnitLink *big.Int) common.Address

func DeployLinkToken added in v1.7.0

func DeployLinkToken(e Environment) common.Address
func ExplorerLink(chainID int64, txHash common.Hash) string

ExplorerLink creates a block explorer link for the given transaction hash. If the chain ID is unrecognized, the hash is returned as-is.

func FundNodes added in v1.7.0

func FundNodes(e Environment, transmitters []string, fundingAmount *big.Int)

func IsArbitrumChainID added in v1.10.0

func IsArbitrumChainID(chainID int64) bool

IsArbitrumChainID returns true if and only if the given chain ID corresponds to an Arbitrum chain (testnet or mainnet).

func IsAvaxNetwork added in v1.8.0

func IsAvaxNetwork(chainID int64) bool

IsAvaxNetwork returns true if the given chain ID corresponds to an avalanche network or subnet.

func PanicErr

func PanicErr(err error)

PanicErr panics if error the given error is non-nil.

func ParseAddressSlice added in v1.6.0

func ParseAddressSlice(arg string) (ret []common.Address)

ParseAddressSlice parses the given comma-separated string of addresses into a slice of common.Address objects.

func ParseArgs

func ParseArgs(flagSet *flag.FlagSet, args []string, requiredArgs ...string)

ParseArgs parses arguments and ensures required args are set.

func ParseBigIntSlice added in v1.6.0

func ParseBigIntSlice(arg string) (ret []*big.Int)

ParseBigIntSlice parses the given comma-separated string of integers into a slice of *big.Int objects.

func ParseHashSlice added in v1.6.0

func ParseHashSlice(arg string) (ret []common.Hash)

ParseHashSlice parses the given comma-separated string of hashes into a slice of common.Hash objects.

func ParseHexSlice added in v1.12.0

func ParseHexSlice(arg string) (ret [][]byte)

func ParseIntSlice added in v1.6.0

func ParseIntSlice(arg string) (ret []int)

ParseIntSlice parses the given comma-separated string of integers into a slice of int.

Types

type Environment added in v1.6.0

type Environment struct {
	Owner *bind.TransactOpts
	Ec    *ethclient.Client

	// AvaxEc is appropriately set if the environment is configured to interact with an avalanche
	// chain. It should be used instead of the regular Ec field because avalanche calculates
	// blockhashes differently and the regular Ec will give consistently incorrect results on basic
	// queries (like e.g eth_blockByNumber).
	AvaxEc  avaxclient.Client
	ChainID int64
}

func SetupEnv added in v1.6.0

func SetupEnv(overrideNonce bool) Environment

SetupEnv returns an Environment object populated from environment variables. If overrideNonce is set to true, the nonce will be set to what is returned by NonceAt (rather than the typical PendingNonceAt).

Jump to

Keyboard shortcuts

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