github.com/ethereum/go-ethereum@v1.16.1/accounts/abi/abigen/testdata/v2/nameconflict.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  // Oraclerequest is an auto generated low-level Go binding around an user-defined struct.
    28  type Oraclerequest struct {
    29  	Data  []byte
    30  	Data0 []byte
    31  }
    32  
    33  // NameConflictMetaData contains all meta data concerning the NameConflict contract.
    34  var NameConflictMetaData = bind.MetaData{
    35  	ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"msg\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_msg\",\"type\":\"int256\"}],\"name\":\"log\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"internalType\":\"structoracle.request\",\"name\":\"req\",\"type\":\"tuple\"}],\"name\":\"addRequest\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"internalType\":\"structoracle.request\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
    36  	ID:  "8f6e2703b307244ae6bd61ed94ce959cf9",
    37  	Bin: "0x608060405234801561001057600080fd5b5061042b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063c2bb515f1461003b578063cce7b04814610059575b600080fd5b610043610075565b60405161005091906101af565b60405180910390f35b610073600480360381019061006e91906103ac565b6100b5565b005b61007d6100b8565b604051806040016040528060405180602001604052806000815250815260200160405180602001604052806000815250815250905090565b50565b604051806040016040528060608152602001606081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561010c5780820151818401526020810190506100f1565b8381111561011b576000848401525b50505050565b6000601f19601f8301169050919050565b600061013d826100d2565b61014781856100dd565b93506101578185602086016100ee565b61016081610121565b840191505092915050565b600060408301600083015184820360008601526101888282610132565b915050602083015184820360208601526101a28282610132565b9150508091505092915050565b600060208201905081810360008301526101c9818461016b565b905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61022282610121565b810181811067ffffffffffffffff82111715610241576102406101ea565b5b80604052505050565b60006102546101d1565b90506102608282610219565b919050565b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff82111561028f5761028e6101ea565b5b61029882610121565b9050602081019050919050565b82818337600083830152505050565b60006102c76102c284610274565b61024a565b9050828152602081018484840111156102e3576102e261026f565b5b6102ee8482856102a5565b509392505050565b600082601f83011261030b5761030a61026a565b5b813561031b8482602086016102b4565b91505092915050565b60006040828403121561033a576103396101e5565b5b610344604061024a565b9050600082013567ffffffffffffffff81111561036457610363610265565b5b610370848285016102f6565b600083015250602082013567ffffffffffffffff81111561039457610393610265565b5b6103a0848285016102f6565b60208301525092915050565b6000602082840312156103c2576103c16101db565b5b600082013567ffffffffffffffff8111156103e0576103df6101e0565b5b6103ec84828501610324565b9150509291505056fea264697066735822122033bca1606af9b6aeba1673f98c52003cec19338539fb44b86690ce82c51483b564736f6c634300080e0033",
    38  }
    39  
    40  // NameConflict is an auto generated Go binding around an Ethereum contract.
    41  type NameConflict struct {
    42  	abi abi.ABI
    43  }
    44  
    45  // NewNameConflict creates a new instance of NameConflict.
    46  func NewNameConflict() *NameConflict {
    47  	parsed, err := NameConflictMetaData.ParseABI()
    48  	if err != nil {
    49  		panic(errors.New("invalid ABI: " + err.Error()))
    50  	}
    51  	return &NameConflict{abi: *parsed}
    52  }
    53  
    54  // Instance creates a wrapper for a deployed contract instance at the given address.
    55  // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
    56  func (c *NameConflict) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
    57  	return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
    58  }
    59  
    60  // PackAddRequest is the Go binding used to pack the parameters required for calling
    61  // the contract method with ID 0xcce7b048.  This method will panic if any
    62  // invalid/nil inputs are passed.
    63  //
    64  // Solidity: function addRequest((bytes,bytes) req) pure returns()
    65  func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
    66  	enc, err := nameConflict.abi.Pack("addRequest", req)
    67  	if err != nil {
    68  		panic(err)
    69  	}
    70  	return enc
    71  }
    72  
    73  // TryPackAddRequest is the Go binding used to pack the parameters required for calling
    74  // the contract method with ID 0xcce7b048.  This method will return an error
    75  // if any inputs are invalid/nil.
    76  //
    77  // Solidity: function addRequest((bytes,bytes) req) pure returns()
    78  func (nameConflict *NameConflict) TryPackAddRequest(req Oraclerequest) ([]byte, error) {
    79  	return nameConflict.abi.Pack("addRequest", req)
    80  }
    81  
    82  // PackGetRequest is the Go binding used to pack the parameters required for calling
    83  // the contract method with ID 0xc2bb515f.  This method will panic if any
    84  // invalid/nil inputs are passed.
    85  //
    86  // Solidity: function getRequest() pure returns((bytes,bytes))
    87  func (nameConflict *NameConflict) PackGetRequest() []byte {
    88  	enc, err := nameConflict.abi.Pack("getRequest")
    89  	if err != nil {
    90  		panic(err)
    91  	}
    92  	return enc
    93  }
    94  
    95  // TryPackGetRequest is the Go binding used to pack the parameters required for calling
    96  // the contract method with ID 0xc2bb515f.  This method will return an error
    97  // if any inputs are invalid/nil.
    98  //
    99  // Solidity: function getRequest() pure returns((bytes,bytes))
   100  func (nameConflict *NameConflict) TryPackGetRequest() ([]byte, error) {
   101  	return nameConflict.abi.Pack("getRequest")
   102  }
   103  
   104  // UnpackGetRequest is the Go binding that unpacks the parameters returned
   105  // from invoking the contract method with ID 0xc2bb515f.
   106  //
   107  // Solidity: function getRequest() pure returns((bytes,bytes))
   108  func (nameConflict *NameConflict) UnpackGetRequest(data []byte) (Oraclerequest, error) {
   109  	out, err := nameConflict.abi.Unpack("getRequest", data)
   110  	if err != nil {
   111  		return *new(Oraclerequest), err
   112  	}
   113  	out0 := *abi.ConvertType(out[0], new(Oraclerequest)).(*Oraclerequest)
   114  	return out0, nil
   115  }
   116  
   117  // NameConflictLog represents a log event raised by the NameConflict contract.
   118  type NameConflictLog struct {
   119  	Msg  *big.Int
   120  	Msg0 *big.Int
   121  	Raw  *types.Log // Blockchain specific contextual infos
   122  }
   123  
   124  const NameConflictLogEventName = "log"
   125  
   126  // ContractEventName returns the user-defined event name.
   127  func (NameConflictLog) ContractEventName() string {
   128  	return NameConflictLogEventName
   129  }
   130  
   131  // UnpackLogEvent is the Go binding that unpacks the event data emitted
   132  // by contract.
   133  //
   134  // Solidity: event log(int256 msg, int256 _msg)
   135  func (nameConflict *NameConflict) UnpackLogEvent(log *types.Log) (*NameConflictLog, error) {
   136  	event := "log"
   137  	if log.Topics[0] != nameConflict.abi.Events[event].ID {
   138  		return nil, errors.New("event signature mismatch")
   139  	}
   140  	out := new(NameConflictLog)
   141  	if len(log.Data) > 0 {
   142  		if err := nameConflict.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
   143  			return nil, err
   144  		}
   145  	}
   146  	var indexed abi.Arguments
   147  	for _, arg := range nameConflict.abi.Events[event].Inputs {
   148  		if arg.Indexed {
   149  			indexed = append(indexed, arg)
   150  		}
   151  	}
   152  	if err := abi.ParseTopics(out, indexed, log.Topics[1:]); err != nil {
   153  		return nil, err
   154  	}
   155  	out.Raw = log
   156  	return out, nil
   157  }