github.com/ethereum/go-ethereum@v1.16.1/accounts/abi/abigen/testdata/v2/tupler.go.txt (about)

     1  // Code generated via abigen V2 - DO NOT EDIT.
     2  // This file is a generated binding and any manual changes will be lost.
     3  
     4  package bindtests
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"math/big"
    10  
    11  	"github.com/ethereum/go-ethereum/accounts/abi"
    12  	"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
    13  	"github.com/ethereum/go-ethereum/common"
    14  	"github.com/ethereum/go-ethereum/core/types"
    15  )
    16  
    17  // Reference imports to suppress errors if they are not otherwise used.
    18  var (
    19  	_ = bytes.Equal
    20  	_ = errors.New
    21  	_ = big.NewInt
    22  	_ = common.Big1
    23  	_ = types.BloomLookup
    24  	_ = abi.ConvertType
    25  )
    26  
    27  // TuplerMetaData contains all meta data concerning the Tupler contract.
    28  var TuplerMetaData = bind.MetaData{
    29  	ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"tuple\",\"outputs\":[{\"name\":\"a\",\"type\":\"string\"},{\"name\":\"b\",\"type\":\"int256\"},{\"name\":\"c\",\"type\":\"bytes32\"}],\"type\":\"function\"}]",
    30  	ID:  "a8f4d2061f55c712cfae266c426a1cd568",
    31  	Bin: "0x606060405260dc8060106000396000f3606060405260e060020a60003504633175aae28114601a575b005b600060605260c0604052600260809081527f486900000000000000000000000000000000000000000000000000000000000060a05260017fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060e0829052610100819052606060c0908152600261012081905281906101409060a09080838184600060046012f1505081517fffff000000000000000000000000000000000000000000000000000000000000169091525050604051610160819003945092505050f3",
    32  }
    33  
    34  // Tupler is an auto generated Go binding around an Ethereum contract.
    35  type Tupler struct {
    36  	abi abi.ABI
    37  }
    38  
    39  // NewTupler creates a new instance of Tupler.
    40  func NewTupler() *Tupler {
    41  	parsed, err := TuplerMetaData.ParseABI()
    42  	if err != nil {
    43  		panic(errors.New("invalid ABI: " + err.Error()))
    44  	}
    45  	return &Tupler{abi: *parsed}
    46  }
    47  
    48  // Instance creates a wrapper for a deployed contract instance at the given address.
    49  // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
    50  func (c *Tupler) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
    51  	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
    52  }
    53  
    54  // PackTuple is the Go binding used to pack the parameters required for calling
    55  // the contract method with ID 0x3175aae2.  This method will panic if any
    56  // invalid/nil inputs are passed.
    57  //
    58  // Solidity: function tuple() returns(string a, int256 b, bytes32 c)
    59  func (tupler *Tupler) PackTuple() []byte {
    60  	enc, err := tupler.abi.Pack("tuple")
    61  	if err != nil {
    62  		panic(err)
    63  	}
    64  	return enc
    65  }
    66  
    67  // TryPackTuple is the Go binding used to pack the parameters required for calling
    68  // the contract method with ID 0x3175aae2.  This method will return an error
    69  // if any inputs are invalid/nil.
    70  //
    71  // Solidity: function tuple() returns(string a, int256 b, bytes32 c)
    72  func (tupler *Tupler) TryPackTuple() ([]byte, error) {
    73  	return tupler.abi.Pack("tuple")
    74  }
    75  
    76  // TupleOutput serves as a container for the return parameters of contract
    77  // method Tuple.
    78  type TupleOutput struct {
    79  	A string
    80  	B *big.Int
    81  	C [32]byte
    82  }
    83  
    84  // UnpackTuple is the Go binding that unpacks the parameters returned
    85  // from invoking the contract method with ID 0x3175aae2.
    86  //
    87  // Solidity: function tuple() returns(string a, int256 b, bytes32 c)
    88  func (tupler *Tupler) UnpackTuple(data []byte) (TupleOutput, error) {
    89  	out, err := tupler.abi.Unpack("tuple", data)
    90  	outstruct := new(TupleOutput)
    91  	if err != nil {
    92  		return *outstruct, err
    93  	}
    94  	outstruct.A = *abi.ConvertType(out[0], new(string)).(*string)
    95  	outstruct.B = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
    96  	outstruct.C = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
    97  	return *outstruct, nil
    98  }