go-ethereum/accounts/abi/abigen/testdata/v2/empty.go.txt
Moshe Malawach fd862fb6df accounts/abi/abigen: add ABI method to v2 bindings
Expose the parsed abi.ABI held by generated v2 contract bindings via a
public ABI() method. This lets callers access event and error metadata
(for example to build FilterQuery topics spanning multiple contracts)
without re-parsing the ABI via ContractMetaData.ParseABI().

The method is named ABI() rather than GetABI() (as originally proposed in
the issue) to follow the Go getter naming convention used elsewhere in
this repository and in the standard library.

Closes #34705.
2026-04-21 22:11:06 +02:00

59 lines
1.6 KiB
Text

// Code generated via abigen V2 - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package bindtests
import (
"bytes"
"errors"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
// Reference imports to suppress errors if they are not otherwise used.
var (
_ = bytes.Equal
_ = errors.New
_ = big.NewInt
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
)
// EmptyMetaData contains all meta data concerning the Empty contract.
var EmptyMetaData = bind.MetaData{
ABI: "[]",
ID: "c4ce3210982aa6fc94dabe46dc1dbf454d",
Bin: "0x606060405260068060106000396000f3606060405200",
}
// Empty is an auto generated Go binding around an Ethereum contract.
type Empty struct {
abi abi.ABI
}
// NewEmpty creates a new instance of Empty.
func NewEmpty() *Empty {
parsed, err := EmptyMetaData.ParseABI()
if err != nil {
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Empty{abi: *parsed}
}
// ABI returns the parsed ABI of the contract. The returned value shares
// its internal maps (Methods, Events, Errors) with the binding, so callers
// must not mutate it.
func (c *Empty) ABI() abi.ABI {
return c.abi
}
// Instance creates a wrapper for a deployed contract instance at the given address.
// Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
func (c *Empty) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
}