package bind

import "github.com/ethereum/go-ethereum/accounts/abi/bind"

Package bind is the runtime for abigen v1 generated contract bindings. Deprecated: please use github.com/ethereum/go-ethereum/bind/v2

Index

Variables

var (
	// ErrNoCode is returned by call and transact operations for which the requested
	// recipient contract to operate on does not exist in the state db or does not
	// have any code associated with it (i.e. self-destructed).
	ErrNoCode = bind2.ErrNoCode

	// ErrNoPendingState is raised when attempting to perform a pending state action
	// on a backend that doesn't implement PendingContractCaller.
	ErrNoPendingState = bind2.ErrNoPendingState

	// ErrNoBlockHashState is raised when attempting to perform a block hash action
	// on a backend that doesn't implement BlockHashContractCaller.
	ErrNoBlockHashState = bind2.ErrNoBlockHashState

	// ErrNoCodeAfterDeploy is returned by WaitDeployed if contract creation leaves
	// an empty contract behind.
	ErrNoCodeAfterDeploy = bind2.ErrNoCodeAfterDeploy
)
var ErrNoChainID = errors.New("no chain id specified")

ErrNoChainID is returned whenever the user failed to specify a chain id.

var ErrNotAuthorized = bind2.ErrNotAuthorized

ErrNotAuthorized is returned when an account is not properly unlocked.

Functions

func Bind

func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]string, pkg string, libs map[string]string, aliases map[string]string) (string, error)

Bind generates a v1 contract binding. Deprecated: binding generation has moved to github.com/ethereum/go-ethereum/accounts/abi/abigen

func WaitDeployed

func WaitDeployed(ctx context.Context, b DeployBackend, tx *types.Transaction) (common.Address, error)

WaitDeployed waits for a contract deployment transaction and returns the on-chain contract address when it is mined. It stops waiting when ctx is canceled.

func WaitDeployedHash

func WaitDeployedHash(ctx context.Context, b DeployBackend, hash common.Hash) (common.Address, error)

WaitDeployedHash waits for a contract deployment transaction with the provided hash and returns the on-chain contract address when it is mined. It stops waiting when ctx is canceled.

func WaitMined

func WaitMined(ctx context.Context, b DeployBackend, tx *types.Transaction) (*types.Receipt, error)

WaitMined waits for tx to be mined on the blockchain. It stops waiting when the context is canceled.

func WaitMinedHash

func WaitMinedHash(ctx context.Context, b DeployBackend, hash common.Hash) (*types.Receipt, error)

WaitMinedHash waits for a transaction with the provided hash to be mined on the blockchain. It stops waiting when the context is canceled.

Types

type BlockHashContractCaller

type BlockHashContractCaller = bind2.BlockHashContractCaller

BlockHashContractCaller defines methods to perform contract calls on a specific block hash. Call will try to discover this interface when access to a block by hash is requested. If the backend does not support the block hash state, Call returns ErrNoBlockHashState.

type BoundContract

type BoundContract = bind2.BoundContract

func DeployContract

func DeployContract(opts *TransactOpts, abi abi.ABI, bytecode []byte, backend ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error)

func NewBoundContract

func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller, transactor ContractTransactor, filterer ContractFilterer) *BoundContract

type CallOpts

type CallOpts = bind2.CallOpts

type ContractBackend

type ContractBackend = bind2.ContractBackend

ContractBackend defines the methods needed to work with contracts on a read-write basis.

type ContractCaller

type ContractCaller = bind2.ContractCaller

ContractCaller defines the methods needed to allow operating with a contract on a read only basis.

type ContractFilterer

type ContractFilterer = bind2.ContractFilterer

ContractFilterer defines the methods needed to access log events using one-off queries or continuous event subscriptions.

type ContractTransactor

type ContractTransactor = bind2.ContractTransactor

ContractTransactor defines the methods needed to allow operating with a contract on a write only basis. Besides the transacting method, the remainder are helpers used when the user does not provide some needed values, but rather leaves it up to the transactor to decide.

type DeployBackend

type DeployBackend = bind2.DeployBackend

DeployBackend wraps the operations needed by WaitMined and WaitDeployed.

type FilterOpts

type FilterOpts = bind2.FilterOpts

type MetaData

type MetaData struct {
	Bin  string            // runtime bytecode (as a hex string)
	ABI  string            // the raw ABI definition (JSON)
	Sigs map[string]string // 4byte identifier -> function signature
	// contains filtered or unexported fields
}

MetaData collects all metadata for a bound contract.

func (*MetaData) GetAbi

func (m *MetaData) GetAbi() (*abi.ABI, error)

GetAbi returns the parsed ABI definition.

type PendingContractCaller

type PendingContractCaller = bind2.PendingContractCaller

PendingContractCaller defines methods to perform contract calls on the pending state. Call will try to discover this interface when access to the pending state is requested. If the backend does not support the pending state, Call returns ErrNoPendingState.

type SignerFn

type SignerFn = bind2.SignerFn

type TransactOpts

type TransactOpts = bind2.TransactOpts

func NewClefTransactor

func NewClefTransactor(clef *external.ExternalSigner, account accounts.Account) *TransactOpts

NewClefTransactor is a utility method to easily create a transaction signer with a clef backend.

func NewKeyStoreTransactor

func NewKeyStoreTransactor(keystore *keystore.KeyStore, account accounts.Account) (*TransactOpts, error)

NewKeyStoreTransactor is a utility method to easily create a transaction signer from a decrypted key from a keystore.

Deprecated: Use NewKeyStoreTransactorWithChainID instead.

func NewKeyStoreTransactorWithChainID

func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accounts.Account, chainID *big.Int) (*TransactOpts, error)

NewKeyStoreTransactorWithChainID is a utility method to easily create a transaction signer from a decrypted key from a keystore.

func NewKeyedTransactor

func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts

NewKeyedTransactor is a utility method to easily create a transaction signer from a single private key.

Deprecated: Use NewKeyedTransactorWithChainID instead.

func NewKeyedTransactorWithChainID

func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error)

NewKeyedTransactorWithChainID is a utility method to easily create a transaction signer from a single private key.

func NewTransactor

func NewTransactor(keyin io.Reader, passphrase string) (*TransactOpts, error)

NewTransactor is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.

Deprecated: Use NewTransactorWithChainID instead.

func NewTransactorWithChainID

func NewTransactorWithChainID(keyin io.Reader, passphrase string, chainID *big.Int) (*TransactOpts, error)

NewTransactorWithChainID is a utility method to easily create a transaction signer from an encrypted json key stream and the associated passphrase.

type WatchOpts

type WatchOpts = bind2.WatchOpts

Source Files

old.go

Directories

PathSynopsis
accounts/abi/bind/backends
accounts/abi/bind/v2Package bind implements utilities for interacting with Solidity contracts.
accounts/abi/bind/v2/internal
Version
v1.15.11 (latest)
Published
May 5, 2025
Platform
linux/amd64
Imports
17 packages
Last checked
1 day ago

Tools for package owners.