github.com/ethereum/go-ethereum@v1.16.1/accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go (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 solc_errors
     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  // CMetaData contains all meta data concerning the C contract.
    28  var CMetaData = bind.MetaData{
    29  	ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"arg1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg2\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg3\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"arg4\",\"type\":\"bool\"}],\"name\":\"BadThing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"arg1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg2\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg3\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg4\",\"type\":\"uint256\"}],\"name\":\"BadThing2\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Bar\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"Foo\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
    30  	ID:  "55ef3c19a0ab1c1845f9e347540c1e51f5",
    31  	Bin: "0x6080604052348015600e575f5ffd5b506101c58061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610034575f3560e01c8063b0a378b014610038578063bfb4ebcf14610042575b5f5ffd5b61004061004c565b005b61004a610092565b005b5f6001600260036040517fd233a24f00000000000000000000000000000000000000000000000000000000815260040161008994939291906100ef565b60405180910390fd5b5f600160025f6040517fbb6a82f10000000000000000000000000000000000000000000000000000000081526004016100ce949392919061014c565b60405180910390fd5b5f819050919050565b6100e9816100d7565b82525050565b5f6080820190506101025f8301876100e0565b61010f60208301866100e0565b61011c60408301856100e0565b61012960608301846100e0565b95945050505050565b5f8115159050919050565b61014681610132565b82525050565b5f60808201905061015f5f8301876100e0565b61016c60208301866100e0565b61017960408301856100e0565b610186606083018461013d565b9594505050505056fea26469706673582212206a82b4c28576e4483a81102558271cfefc891cd63b95440dea521185c1ff6a2a64736f6c634300081c0033",
    32  }
    33  
    34  // C is an auto generated Go binding around an Ethereum contract.
    35  type C struct {
    36  	abi abi.ABI
    37  }
    38  
    39  // NewC creates a new instance of C.
    40  func NewC() *C {
    41  	parsed, err := CMetaData.ParseABI()
    42  	if err != nil {
    43  		panic(errors.New("invalid ABI: " + err.Error()))
    44  	}
    45  	return &C{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 *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
    51  	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
    52  }
    53  
    54  // PackBar is the Go binding used to pack the parameters required for calling
    55  // the contract method with ID 0xb0a378b0.  This method will panic if any
    56  // invalid/nil inputs are passed.
    57  //
    58  // Solidity: function Bar() pure returns()
    59  func (c *C) PackBar() []byte {
    60  	enc, err := c.abi.Pack("Bar")
    61  	if err != nil {
    62  		panic(err)
    63  	}
    64  	return enc
    65  }
    66  
    67  // TryPackBar is the Go binding used to pack the parameters required for calling
    68  // the contract method with ID 0xb0a378b0.  This method will return an error
    69  // if any inputs are invalid/nil.
    70  //
    71  // Solidity: function Bar() pure returns()
    72  func (c *C) TryPackBar() ([]byte, error) {
    73  	return c.abi.Pack("Bar")
    74  }
    75  
    76  // PackFoo is the Go binding used to pack the parameters required for calling
    77  // the contract method with ID 0xbfb4ebcf.  This method will panic if any
    78  // invalid/nil inputs are passed.
    79  //
    80  // Solidity: function Foo() pure returns()
    81  func (c *C) PackFoo() []byte {
    82  	enc, err := c.abi.Pack("Foo")
    83  	if err != nil {
    84  		panic(err)
    85  	}
    86  	return enc
    87  }
    88  
    89  // TryPackFoo is the Go binding used to pack the parameters required for calling
    90  // the contract method with ID 0xbfb4ebcf.  This method will return an error
    91  // if any inputs are invalid/nil.
    92  //
    93  // Solidity: function Foo() pure returns()
    94  func (c *C) TryPackFoo() ([]byte, error) {
    95  	return c.abi.Pack("Foo")
    96  }
    97  
    98  // UnpackError attempts to decode the provided error data using user-defined
    99  // error definitions.
   100  func (c *C) UnpackError(raw []byte) (any, error) {
   101  	if bytes.Equal(raw[:4], c.abi.Errors["BadThing"].ID.Bytes()[:4]) {
   102  		return c.UnpackBadThingError(raw[4:])
   103  	}
   104  	if bytes.Equal(raw[:4], c.abi.Errors["BadThing2"].ID.Bytes()[:4]) {
   105  		return c.UnpackBadThing2Error(raw[4:])
   106  	}
   107  	return nil, errors.New("Unknown error")
   108  }
   109  
   110  // CBadThing represents a BadThing error raised by the C contract.
   111  type CBadThing struct {
   112  	Arg1 *big.Int
   113  	Arg2 *big.Int
   114  	Arg3 *big.Int
   115  	Arg4 bool
   116  }
   117  
   118  // ErrorID returns the hash of canonical representation of the error's signature.
   119  //
   120  // Solidity: error BadThing(uint256 arg1, uint256 arg2, uint256 arg3, bool arg4)
   121  func CBadThingErrorID() common.Hash {
   122  	return common.HexToHash("0xbb6a82f123854747ef4381e30e497f934a3854753fec99a69c35c30d4b46714d")
   123  }
   124  
   125  // UnpackBadThingError is the Go binding used to decode the provided
   126  // error data into the corresponding Go error struct.
   127  //
   128  // Solidity: error BadThing(uint256 arg1, uint256 arg2, uint256 arg3, bool arg4)
   129  func (c *C) UnpackBadThingError(raw []byte) (*CBadThing, error) {
   130  	out := new(CBadThing)
   131  	if err := c.abi.UnpackIntoInterface(out, "BadThing", raw); err != nil {
   132  		return nil, err
   133  	}
   134  	return out, nil
   135  }
   136  
   137  // CBadThing2 represents a BadThing2 error raised by the C contract.
   138  type CBadThing2 struct {
   139  	Arg1 *big.Int
   140  	Arg2 *big.Int
   141  	Arg3 *big.Int
   142  	Arg4 *big.Int
   143  }
   144  
   145  // ErrorID returns the hash of canonical representation of the error's signature.
   146  //
   147  // Solidity: error BadThing2(uint256 arg1, uint256 arg2, uint256 arg3, uint256 arg4)
   148  func CBadThing2ErrorID() common.Hash {
   149  	return common.HexToHash("0xd233a24f02271fe7c9470e060d0fda6447a142bf12ab31fed7ab65affd546175")
   150  }
   151  
   152  // UnpackBadThing2Error is the Go binding used to decode the provided
   153  // error data into the corresponding Go error struct.
   154  //
   155  // Solidity: error BadThing2(uint256 arg1, uint256 arg2, uint256 arg3, uint256 arg4)
   156  func (c *C) UnpackBadThing2Error(raw []byte) (*CBadThing2, error) {
   157  	out := new(CBadThing2)
   158  	if err := c.abi.UnpackIntoInterface(out, "BadThing2", raw); err != nil {
   159  		return nil, err
   160  	}
   161  	return out, nil
   162  }
   163  
   164  // C2MetaData contains all meta data concerning the C2 contract.
   165  var C2MetaData = bind.MetaData{
   166  	ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"arg1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg2\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"arg3\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"arg4\",\"type\":\"bool\"}],\"name\":\"BadThing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Foo\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
   167  	ID:  "78ef2840de5b706112ca2dbfa765501a89",
   168  	Bin: "0x6080604052348015600e575f5ffd5b506101148061001c5f395ff3fe6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063bfb4ebcf14602a575b5f5ffd5b60306032565b005b5f600160025f6040517fbb6a82f1000000000000000000000000000000000000000000000000000000008152600401606c949392919060a3565b60405180910390fd5b5f819050919050565b6085816075565b82525050565b5f8115159050919050565b609d81608b565b82525050565b5f60808201905060b45f830187607e565b60bf6020830186607e565b60ca6040830185607e565b60d560608301846096565b9594505050505056fea2646970667358221220e90bf647ffc897060e44b88d54995ed0c03c988fbccaf034375c2ff4e594690764736f6c634300081c0033",
   169  }
   170  
   171  // C2 is an auto generated Go binding around an Ethereum contract.
   172  type C2 struct {
   173  	abi abi.ABI
   174  }
   175  
   176  // NewC2 creates a new instance of C2.
   177  func NewC2() *C2 {
   178  	parsed, err := C2MetaData.ParseABI()
   179  	if err != nil {
   180  		panic(errors.New("invalid ABI: " + err.Error()))
   181  	}
   182  	return &C2{abi: *parsed}
   183  }
   184  
   185  // Instance creates a wrapper for a deployed contract instance at the given address.
   186  // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
   187  func (c *C2) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
   188  	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
   189  }
   190  
   191  // PackFoo is the Go binding used to pack the parameters required for calling
   192  // the contract method with ID 0xbfb4ebcf.  This method will panic if any
   193  // invalid/nil inputs are passed.
   194  //
   195  // Solidity: function Foo() pure returns()
   196  func (c2 *C2) PackFoo() []byte {
   197  	enc, err := c2.abi.Pack("Foo")
   198  	if err != nil {
   199  		panic(err)
   200  	}
   201  	return enc
   202  }
   203  
   204  // TryPackFoo is the Go binding used to pack the parameters required for calling
   205  // the contract method with ID 0xbfb4ebcf.  This method will return an error
   206  // if any inputs are invalid/nil.
   207  //
   208  // Solidity: function Foo() pure returns()
   209  func (c2 *C2) TryPackFoo() ([]byte, error) {
   210  	return c2.abi.Pack("Foo")
   211  }
   212  
   213  // UnpackError attempts to decode the provided error data using user-defined
   214  // error definitions.
   215  func (c2 *C2) UnpackError(raw []byte) (any, error) {
   216  	if bytes.Equal(raw[:4], c2.abi.Errors["BadThing"].ID.Bytes()[:4]) {
   217  		return c2.UnpackBadThingError(raw[4:])
   218  	}
   219  	return nil, errors.New("Unknown error")
   220  }
   221  
   222  // C2BadThing represents a BadThing error raised by the C2 contract.
   223  type C2BadThing struct {
   224  	Arg1 *big.Int
   225  	Arg2 *big.Int
   226  	Arg3 *big.Int
   227  	Arg4 bool
   228  }
   229  
   230  // ErrorID returns the hash of canonical representation of the error's signature.
   231  //
   232  // Solidity: error BadThing(uint256 arg1, uint256 arg2, uint256 arg3, bool arg4)
   233  func C2BadThingErrorID() common.Hash {
   234  	return common.HexToHash("0xbb6a82f123854747ef4381e30e497f934a3854753fec99a69c35c30d4b46714d")
   235  }
   236  
   237  // UnpackBadThingError is the Go binding used to decode the provided
   238  // error data into the corresponding Go error struct.
   239  //
   240  // Solidity: error BadThing(uint256 arg1, uint256 arg2, uint256 arg3, bool arg4)
   241  func (c2 *C2) UnpackBadThingError(raw []byte) (*C2BadThing, error) {
   242  	out := new(C2BadThing)
   243  	if err := c2.abi.UnpackIntoInterface(out, "BadThing", raw); err != nil {
   244  		return nil, err
   245  	}
   246  	return out, nil
   247  }