github.com/ethereum/go-ethereum@v1.16.1/accounts/abi/abigen/testdata/v2/getter.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  // GetterMetaData contains all meta data concerning the Getter contract.
    28  var GetterMetaData = bind.MetaData{
    29  	ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"getter\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"int256\"},{\"name\":\"\",\"type\":\"bytes32\"}],\"type\":\"function\"}]",
    30  	ID:  "e23a74c8979fe93c9fff15e4f51535ad54",
    31  	Bin: "0x606060405260dc8060106000396000f3606060405260e060020a6000350463993a04b78114601a575b005b600060605260c0604052600260809081527f486900000000000000000000000000000000000000000000000000000000000060a05260017fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060e0829052610100819052606060c0908152600261012081905281906101409060a09080838184600060046012f1505081517fffff000000000000000000000000000000000000000000000000000000000000169091525050604051610160819003945092505050f3",
    32  }
    33  
    34  // Getter is an auto generated Go binding around an Ethereum contract.
    35  type Getter struct {
    36  	abi abi.ABI
    37  }
    38  
    39  // NewGetter creates a new instance of Getter.
    40  func NewGetter() *Getter {
    41  	parsed, err := GetterMetaData.ParseABI()
    42  	if err != nil {
    43  		panic(errors.New("invalid ABI: " + err.Error()))
    44  	}
    45  	return &Getter{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 *Getter) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
    51  	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
    52  }
    53  
    54  // PackGetter is the Go binding used to pack the parameters required for calling
    55  // the contract method with ID 0x993a04b7.  This method will panic if any
    56  // invalid/nil inputs are passed.
    57  //
    58  // Solidity: function getter() returns(string, int256, bytes32)
    59  func (getter *Getter) PackGetter() []byte {
    60  	enc, err := getter.abi.Pack("getter")
    61  	if err != nil {
    62  		panic(err)
    63  	}
    64  	return enc
    65  }
    66  
    67  // TryPackGetter is the Go binding used to pack the parameters required for calling
    68  // the contract method with ID 0x993a04b7.  This method will return an error
    69  // if any inputs are invalid/nil.
    70  //
    71  // Solidity: function getter() returns(string, int256, bytes32)
    72  func (getter *Getter) TryPackGetter() ([]byte, error) {
    73  	return getter.abi.Pack("getter")
    74  }
    75  
    76  // GetterOutput serves as a container for the return parameters of contract
    77  // method Getter.
    78  type GetterOutput struct {
    79  	Arg0 string
    80  	Arg1 *big.Int
    81  	Arg2 [32]byte
    82  }
    83  
    84  // UnpackGetter is the Go binding that unpacks the parameters returned
    85  // from invoking the contract method with ID 0x993a04b7.
    86  //
    87  // Solidity: function getter() returns(string, int256, bytes32)
    88  func (getter *Getter) UnpackGetter(data []byte) (GetterOutput, error) {
    89  	out, err := getter.abi.Unpack("getter", data)
    90  	outstruct := new(GetterOutput)
    91  	if err != nil {
    92  		return *outstruct, err
    93  	}
    94  	outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
    95  	outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
    96  	outstruct.Arg2 = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
    97  	return *outstruct, nil
    98  }