accounts/abi/bind: update converted v1 bind tests

This commit is contained in:
Felix Lange 2025-01-22 13:58:10 +01:00
parent 5598edfe48
commit 92b1f74a5d
21 changed files with 210 additions and 105 deletions

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type CallbackParam struct {
}
// NewCallbackParam creates a new instance of CallbackParam.
func NewCallbackParam() (*CallbackParam, error) {
func NewCallbackParam() *CallbackParam {
parsed, err := CallbackParamMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &CallbackParam{abi: *parsed}, nil
return &CallbackParam{abi: *parsed}
}
// 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 *CallbackParam) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// Test is a free data retrieval call binding the contract method 0xd7a5aba2.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Crowdsale struct {
}
// NewCrowdsale creates a new instance of Crowdsale.
func NewCrowdsale() (*Crowdsale, error) {
func NewCrowdsale() *Crowdsale {
parsed, err := CrowdsaleMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Crowdsale{abi: *parsed}, nil
return &Crowdsale{abi: *parsed}
}
// 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 *Crowdsale) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
func (crowdsale *Crowdsale) PackConstructor(ifSuccessfulSendTo common.Address, fundingGoalInEthers *big.Int, durationInMinutes *big.Int, etherCostOfEachToken *big.Int, addressOfTokenUsedAsReward common.Address) []byte {

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type DAO struct {
}
// NewDAO creates a new instance of DAO.
func NewDAO() (*DAO, error) {
func NewDAO() *DAO {
parsed, err := DAOMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &DAO{abi: *parsed}, nil
return &DAO{abi: *parsed}
}
// 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 *DAO) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
func (dAO *DAO) PackConstructor(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int, congressLeader common.Address) []byte {

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type DeeplyNestedArray struct {
}
// NewDeeplyNestedArray creates a new instance of DeeplyNestedArray.
func NewDeeplyNestedArray() (*DeeplyNestedArray, error) {
func NewDeeplyNestedArray() *DeeplyNestedArray {
parsed, err := DeeplyNestedArrayMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &DeeplyNestedArray{abi: *parsed}, nil
return &DeeplyNestedArray{abi: *parsed}
}
// 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 *DeeplyNestedArray) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// DeepUint64Array is a free data retrieval call binding the contract method 0x98ed1856.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,10 +35,16 @@ type Empty struct {
}
// NewEmpty creates a new instance of Empty.
func NewEmpty() (*Empty, error) {
func NewEmpty() *Empty {
parsed, err := EmptyMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Empty{abi: *parsed}, nil
return &Empty{abi: *parsed}
}
// 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.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -35,12 +34,18 @@ type EventChecker struct {
}
// NewEventChecker creates a new instance of EventChecker.
func NewEventChecker() (*EventChecker, error) {
func NewEventChecker() *EventChecker {
parsed, err := EventCheckerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &EventChecker{abi: *parsed}, nil
return &EventChecker{abi: *parsed}
}
// 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 *EventChecker) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// EventCheckerDynamic represents a Dynamic event raised by the EventChecker contract.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Getter struct {
}
// NewGetter creates a new instance of Getter.
func NewGetter() (*Getter, error) {
func NewGetter() *Getter {
parsed, err := GetterMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Getter{abi: *parsed}, nil
return &Getter{abi: *parsed}
}
// 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 *Getter) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// Getter is a free data retrieval call binding the contract method 0x993a04b7.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type IdentifierCollision struct {
}
// NewIdentifierCollision creates a new instance of IdentifierCollision.
func NewIdentifierCollision() (*IdentifierCollision, error) {
func NewIdentifierCollision() *IdentifierCollision {
parsed, err := IdentifierCollisionMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &IdentifierCollision{abi: *parsed}, nil
return &IdentifierCollision{abi: *parsed}
}
// 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 *IdentifierCollision) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// MyVar is a free data retrieval call binding the contract method 0x4ef1f0ad.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -35,12 +34,18 @@ type InputChecker struct {
}
// NewInputChecker creates a new instance of InputChecker.
func NewInputChecker() (*InputChecker, error) {
func NewInputChecker() *InputChecker {
parsed, err := InputCheckerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &InputChecker{abi: *parsed}, nil
return &InputChecker{abi: *parsed}
}
// 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 *InputChecker) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// AnonInput is a free data retrieval call binding the contract method 0x3e708e82.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Interactor struct {
}
// NewInteractor creates a new instance of Interactor.
func NewInteractor() (*Interactor, error) {
func NewInteractor() *Interactor {
parsed, err := InteractorMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Interactor{abi: *parsed}, nil
return &Interactor{abi: *parsed}
}
// 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 *Interactor) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
func (interactor *Interactor) PackConstructor(str string) []byte {

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -42,12 +41,18 @@ type NameConflict struct {
}
// NewNameConflict creates a new instance of NameConflict.
func NewNameConflict() (*NameConflict, error) {
func NewNameConflict() *NameConflict {
parsed, err := NameConflictMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &NameConflict{abi: *parsed}, nil
return &NameConflict{abi: *parsed}
}
// 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 *NameConflict) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// AddRequest is a free data retrieval call binding the contract method 0xcce7b048.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type NumericMethodName struct {
}
// NewNumericMethodName creates a new instance of NumericMethodName.
func NewNumericMethodName() (*NumericMethodName, error) {
func NewNumericMethodName() *NumericMethodName {
parsed, err := NumericMethodNameMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &NumericMethodName{abi: *parsed}, nil
return &NumericMethodName{abi: *parsed}
}
// 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 *NumericMethodName) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// E1test is a free data retrieval call binding the contract method 0xffa02795.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -35,12 +34,18 @@ type OutputChecker struct {
}
// NewOutputChecker creates a new instance of OutputChecker.
func NewOutputChecker() (*OutputChecker, error) {
func NewOutputChecker() *OutputChecker {
parsed, err := OutputCheckerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &OutputChecker{abi: *parsed}, nil
return &OutputChecker{abi: *parsed}
}
// 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 *OutputChecker) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// AnonOutput is a free data retrieval call binding the contract method 0x008bda05.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Overload struct {
}
// NewOverload creates a new instance of Overload.
func NewOverload() (*Overload, error) {
func NewOverload() *Overload {
parsed, err := OverloadMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Overload{abi: *parsed}, nil
return &Overload{abi: *parsed}
}
// 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 *Overload) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// Foo is a free data retrieval call binding the contract method 0x04bc52f8.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type RangeKeyword struct {
}
// NewRangeKeyword creates a new instance of RangeKeyword.
func NewRangeKeyword() (*RangeKeyword, error) {
func NewRangeKeyword() *RangeKeyword {
parsed, err := RangeKeywordMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &RangeKeyword{abi: *parsed}, nil
return &RangeKeyword{abi: *parsed}
}
// 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 *RangeKeyword) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// FunctionWithKeywordParameter is a free data retrieval call binding the contract method 0x527a119f.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Slicer struct {
}
// NewSlicer creates a new instance of Slicer.
func NewSlicer() (*Slicer, error) {
func NewSlicer() *Slicer {
parsed, err := SlicerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Slicer{abi: *parsed}, nil
return &Slicer{abi: *parsed}
}
// 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 *Slicer) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// EchoAddresses is a free data retrieval call binding the contract method 0xbe1127a3.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -41,12 +40,18 @@ type Structs struct {
}
// NewStructs creates a new instance of Structs.
func NewStructs() (*Structs, error) {
func NewStructs() *Structs {
parsed, err := StructsMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Structs{abi: *parsed}, nil
return &Structs{abi: *parsed}
}
// 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 *Structs) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// F is a free data retrieval call binding the contract method 0x28811f59.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Token struct {
}
// NewToken creates a new instance of Token.
func NewToken() (*Token, error) {
func NewToken() *Token {
parsed, err := TokenMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Token{abi: *parsed}, nil
return &Token{abi: *parsed}
}
// 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 *Token) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
func (token *Token) PackConstructor(initialSupply *big.Int, tokenName string, decimalUnits uint8, tokenSymbol string) []byte {

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -61,12 +60,18 @@ type Tuple struct {
}
// NewTuple creates a new instance of Tuple.
func NewTuple() (*Tuple, error) {
func NewTuple() *Tuple {
parsed, err := TupleMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Tuple{abi: *parsed}, nil
return &Tuple{abi: *parsed}
}
// 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 *Tuple) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// Func1 is a free data retrieval call binding the contract method 0x443c79b4.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Tupler struct {
}
// NewTupler creates a new instance of Tupler.
func NewTupler() (*Tupler, error) {
func NewTupler() *Tupler {
parsed, err := TuplerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Tupler{abi: *parsed}, nil
return &Tupler{abi: *parsed}
}
// 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 *Tupler) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// Tuple is a free data retrieval call binding the contract method 0x3175aae2.

View file

@ -8,7 +8,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
@ -17,7 +17,6 @@ import (
var (
_ = errors.New
_ = big.NewInt
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = abi.ConvertType
@ -36,12 +35,18 @@ type Underscorer struct {
}
// NewUnderscorer creates a new instance of Underscorer.
func NewUnderscorer() (*Underscorer, error) {
func NewUnderscorer() *Underscorer {
parsed, err := UnderscorerMetaData.GetAbi()
if err != nil {
return nil, err
panic(errors.New("invalid ABI: " + err.Error()))
}
return &Underscorer{abi: *parsed}, nil
return &Underscorer{abi: *parsed}
}
// 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 *Underscorer) Instance(backend bind.ContractBackend, addr common.Address) bind.ContractInstance {
return bind.NewContractInstance(backend, addr, c.abi)
}
// AllPurelyUnderscoredOutput is a free data retrieval call binding the contract method 0xb564b34d.