return multiple results in exported struct (instead of anonymous one). add return_structs contract example to have an example of it.
This commit is contained in:
parent
ff9946cd48
commit
4f6ae72a66
|
@ -69,9 +69,6 @@ var (
|
|||
return &{{.Type}}{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_{{$contract.Type}} *{{$contract.Type}}) PackConstructor({{range .Constructor.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) ([]byte, error) {
|
||||
return _{{$contract.Type}}.abi.Pack("" {{range .Constructor.Inputs}}, {{.Name}}{{end}})
|
||||
}
|
||||
|
@ -86,10 +83,16 @@ var (
|
|||
|
||||
{{/* Unpack method is needed only when there are return args */}}
|
||||
{{if .Normalized.Outputs }}
|
||||
func (_{{$contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) ({{if .Structured}}struct{ {{range .Normalized.Outputs}}{{.Name}} {{bindtype .Type $structs}};{{end}} },{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
|
||||
{{ if .Structured }}
|
||||
type {{.Normalized.Name}}Output struct {
|
||||
{{range .Normalized.Outputs}}
|
||||
{{.Name}} {{bindtype .Type $structs}}{{end}}
|
||||
}
|
||||
{{ end }}
|
||||
func (_{{$contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) ({{if .Structured}} {{.Normalized.Name}}Output,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
|
||||
out, err := _{{$contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
|
||||
{{if .Structured}}
|
||||
outstruct := new(struct{ {{range .Normalized.Outputs}} {{.Name}} {{bindtype .Type $structs}}; {{end}} })
|
||||
outstruct := new({{.Normalized.Name}}Output)
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
|
|
@ -23,14 +23,20 @@ var (
|
|||
_ = abi.ConvertType
|
||||
)
|
||||
|
||||
// CPoint is an auto generated low-level Go binding around an user-defined struct.
|
||||
type CPoint struct {
|
||||
X *big.Int
|
||||
Y *big.Int
|
||||
}
|
||||
|
||||
var CLibraryDeps = []*bind.MetaData{}
|
||||
|
||||
// TODO: convert this type to value type after everything works.
|
||||
// CMetaData contains all meta data concerning the C contract.
|
||||
var CMetaData = &bind.MetaData{
|
||||
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"basic1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"flag\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"basic2\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"EmitMulti\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EmitOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
|
||||
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"basic1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"flag\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"basic2\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DoSomethingWithManyArgs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"structC.Point\",\"name\":\"p\",\"type\":\"tuple\"}],\"name\":\"DoSomethingWithPoint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"structC.Point\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EmitMulti\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EmitOne\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
|
||||
Pattern: "55ef3c19a0ab1c1845f9e347540c1e51f5",
|
||||
Bin: "0x6080604052348015600e575f80fd5b506101a08061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c8063cb49374914610038578063e8e49a7114610042575b5f80fd5b61004061004c565b005b61004a6100fd565b005b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd207600260405161007e9190610151565b60405180910390a260037f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760046040516100b89190610151565b60405180910390a25f15157f3b29b9f6d15ba80d866afb3d70b7548ab1ffda3ef6e65f35f1cb05b0e2b29f4e60016040516100f39190610151565b60405180910390a2565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd207600260405161012f9190610151565b60405180910390a2565b5f819050919050565b61014b81610139565b82525050565b5f6020820190506101645f830184610142565b9291505056fea26469706673582212203624d263fed93ccf2a175b7c701e773f413c64394a51928aa2b1968299798fe664736f6c634300081a0033",
|
||||
Bin: "0x6080604052348015600e575f80fd5b5061042c8061001c5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80636fd8b9681461004e578063cb4937491461006f578063e8e49a7114610079578063edcdc89414610083575b5f80fd5b6100566100b3565b6040516100669493929190610244565b60405180910390f35b6100776100c9565b005b61008161017a565b005b61009d600480360381019061009891906102ad565b6101b6565b6040516100aa9190610364565b60405180910390f35b5f805f805f805f80935093509350935090919293565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760026040516100fb919061037d565b60405180910390a260037f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd2076004604051610135919061037d565b60405180910390a25f15157f3b29b9f6d15ba80d866afb3d70b7548ab1ffda3ef6e65f35f1cb05b0e2b29f4e6001604051610170919061037d565b60405180910390a2565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760026040516101ac919061037d565b60405180910390a2565b366101bf6101fa565b6001835f01356101cf91906103c3565b815f018181525050600183602001356101e891906103c3565b81602001818152505082915050919050565b60405180604001604052805f81526020015f81525090565b5f819050919050565b61022481610212565b82525050565b5f8115159050919050565b61023e8161022a565b82525050565b5f6080820190506102575f83018761021b565b610264602083018661021b565b610271604083018561021b565b61027e6060830184610235565b95945050505050565b5f80fd5b5f80fd5b5f604082840312156102a4576102a361028b565b5b81905092915050565b5f604082840312156102c2576102c1610287565b5b5f6102cf8482850161028f565b91505092915050565b6102e181610212565b81146102eb575f80fd5b50565b5f813590506102fc816102d8565b92915050565b5f61031060208401846102ee565b905092915050565b61032181610212565b82525050565b604082016103375f830183610302565b6103435f850182610318565b506103516020830183610302565b61035e6020850182610318565b50505050565b5f6040820190506103775f830184610327565b92915050565b5f6020820190506103905f83018461021b565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6103cd82610212565b91506103d883610212565b92508282019050808211156103f0576103ef610396565b5b9291505056fea264697066735822122037c4a3caaa4ac1fad7bb712bf2dc85b5d19726dd357808a46ac3b90d2f03dff564736f6c634300081a0033",
|
||||
}
|
||||
|
||||
// C is an auto generated Go binding around an Ethereum contract.
|
||||
|
@ -47,13 +53,61 @@ func NewC() (*C, error) {
|
|||
return &C{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_C *C) PackConstructor() ([]byte, error) {
|
||||
return _C.abi.Pack("")
|
||||
}
|
||||
|
||||
// DoSomethingWithManyArgs is a free data retrieval call binding the contract method 0x6fd8b968.
|
||||
//
|
||||
// Solidity: function DoSomethingWithManyArgs() pure returns(uint256, uint256, uint256, bool)
|
||||
func (_C *C) PackDoSomethingWithManyArgs() ([]byte, error) {
|
||||
return _C.abi.Pack("DoSomethingWithManyArgs")
|
||||
}
|
||||
|
||||
type DoSomethingWithManyArgsOutput struct {
|
||||
Arg *big.Int
|
||||
Arg0 *big.Int
|
||||
Arg1 *big.Int
|
||||
Arg2 bool
|
||||
}
|
||||
|
||||
func (_C *C) UnpackDoSomethingWithManyArgs(data []byte) (DoSomethingWithManyArgsOutput, error) {
|
||||
out, err := _C.abi.Unpack("DoSomethingWithManyArgs", data)
|
||||
|
||||
outstruct := new(DoSomethingWithManyArgsOutput)
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
||||
outstruct.Arg = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg0 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg1 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg2 = *abi.ConvertType(out[3], new(bool)).(*bool)
|
||||
|
||||
return *outstruct, err
|
||||
|
||||
}
|
||||
|
||||
// DoSomethingWithPoint is a free data retrieval call binding the contract method 0xedcdc894.
|
||||
//
|
||||
// Solidity: function DoSomethingWithPoint((uint256,uint256) p) pure returns((uint256,uint256))
|
||||
func (_C *C) PackDoSomethingWithPoint(p CPoint) ([]byte, error) {
|
||||
return _C.abi.Pack("DoSomethingWithPoint", p)
|
||||
}
|
||||
|
||||
func (_C *C) UnpackDoSomethingWithPoint(data []byte) (CPoint, error) {
|
||||
out, err := _C.abi.Unpack("DoSomethingWithPoint", data)
|
||||
|
||||
if err != nil {
|
||||
return *new(CPoint), err
|
||||
}
|
||||
|
||||
out0 := *abi.ConvertType(out[0], new(CPoint)).(*CPoint)
|
||||
|
||||
return out0, err
|
||||
|
||||
}
|
||||
|
||||
// EmitMulti is a free data retrieval call binding the contract method 0xcb493749.
|
||||
//
|
||||
// Solidity: function EmitMulti() returns()
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"contracts":{"contract.sol:C":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"data","type":"uint256"}],"name":"basic1","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"flag","type":"bool"},{"indexed":false,"internalType":"uint256","name":"data","type":"uint256"}],"name":"basic2","type":"event"},{"inputs":[],"name":"EmitMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"EmitOne","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bin":"6080604052348015600e575f80fd5b506101a08061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c8063cb49374914610038578063e8e49a7114610042575b5f80fd5b61004061004c565b005b61004a6100fd565b005b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd207600260405161007e9190610151565b60405180910390a260037f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760046040516100b89190610151565b60405180910390a25f15157f3b29b9f6d15ba80d866afb3d70b7548ab1ffda3ef6e65f35f1cb05b0e2b29f4e60016040516100f39190610151565b60405180910390a2565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd207600260405161012f9190610151565b60405180910390a2565b5f819050919050565b61014b81610139565b82525050565b5f6020820190506101645f830184610142565b9291505056fea26469706673582212203624d263fed93ccf2a175b7c701e773f413c64394a51928aa2b1968299798fe664736f6c634300081a0033"}},"version":"0.8.26+commit.8a97fa7a.Darwin.appleclang"}
|
||||
{"contracts":{"contract.sol:C":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"data","type":"uint256"}],"name":"basic1","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"flag","type":"bool"},{"indexed":false,"internalType":"uint256","name":"data","type":"uint256"}],"name":"basic2","type":"event"},{"inputs":[],"name":"DoSomethingWithManyArgs","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"x","type":"uint256"},{"internalType":"uint256","name":"y","type":"uint256"}],"internalType":"struct C.Point","name":"p","type":"tuple"}],"name":"DoSomethingWithPoint","outputs":[{"components":[{"internalType":"uint256","name":"x","type":"uint256"},{"internalType":"uint256","name":"y","type":"uint256"}],"internalType":"struct C.Point","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"EmitMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"EmitOne","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bin":"6080604052348015600e575f80fd5b5061042c8061001c5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80636fd8b9681461004e578063cb4937491461006f578063e8e49a7114610079578063edcdc89414610083575b5f80fd5b6100566100b3565b6040516100669493929190610244565b60405180910390f35b6100776100c9565b005b61008161017a565b005b61009d600480360381019061009891906102ad565b6101b6565b6040516100aa9190610364565b60405180910390f35b5f805f805f805f80935093509350935090919293565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760026040516100fb919061037d565b60405180910390a260037f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd2076004604051610135919061037d565b60405180910390a25f15157f3b29b9f6d15ba80d866afb3d70b7548ab1ffda3ef6e65f35f1cb05b0e2b29f4e6001604051610170919061037d565b60405180910390a2565b60017f8f17dc823e2f9fcdf730b8182c935574691e811e7d46399fe0ff0087795cd20760026040516101ac919061037d565b60405180910390a2565b366101bf6101fa565b6001835f01356101cf91906103c3565b815f018181525050600183602001356101e891906103c3565b81602001818152505082915050919050565b60405180604001604052805f81526020015f81525090565b5f819050919050565b61022481610212565b82525050565b5f8115159050919050565b61023e8161022a565b82525050565b5f6080820190506102575f83018761021b565b610264602083018661021b565b610271604083018561021b565b61027e6060830184610235565b95945050505050565b5f80fd5b5f80fd5b5f604082840312156102a4576102a361028b565b5b81905092915050565b5f604082840312156102c2576102c1610287565b5b5f6102cf8482850161028f565b91505092915050565b6102e181610212565b81146102eb575f80fd5b50565b5f813590506102fc816102d8565b92915050565b5f61031060208401846102ee565b905092915050565b61032181610212565b82525050565b604082016103375f830183610302565b6103435f850182610318565b506103516020830183610302565b61035e6020850182610318565b50505050565b5f6040820190506103775f830184610327565b92915050565b5f6020820190506103905f83018461021b565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6103cd82610212565b91506103d883610212565b92508282019050808211156103f0576103ef610396565b5b9291505056fea264697066735822122037c4a3caaa4ac1fad7bb712bf2dc85b5d19726dd357808a46ac3b90d2f03dff564736f6c634300081a0033"}},"version":"0.8.26+commit.8a97fa7a.Darwin.appleclang"}
|
||||
|
|
|
@ -52,9 +52,6 @@ func NewC1() (*C1, error) {
|
|||
return &C1{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_C1 *C1) PackConstructor(v1 *big.Int, v2 *big.Int) ([]byte, error) {
|
||||
return _C1.abi.Pack("", v1, v2)
|
||||
}
|
||||
|
@ -107,9 +104,6 @@ func NewC2() (*C2, error) {
|
|||
return &C2{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_C2 *C2) PackConstructor(v1 *big.Int, v2 *big.Int) ([]byte, error) {
|
||||
return _C2.abi.Pack("", v1, v2)
|
||||
}
|
||||
|
@ -158,9 +152,6 @@ func NewL1() (*L1, error) {
|
|||
return &L1{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L1 *L1) PackConstructor() ([]byte, error) {
|
||||
return _L1.abi.Pack("")
|
||||
}
|
||||
|
@ -209,9 +200,6 @@ func NewL2() (*L2, error) {
|
|||
return &L2{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L2 *L2) PackConstructor() ([]byte, error) {
|
||||
return _L2.abi.Pack("")
|
||||
}
|
||||
|
@ -260,9 +248,6 @@ func NewL2b() (*L2b, error) {
|
|||
return &L2b{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L2b *L2b) PackConstructor() ([]byte, error) {
|
||||
return _L2b.abi.Pack("")
|
||||
}
|
||||
|
@ -311,9 +296,6 @@ func NewL3() (*L3, error) {
|
|||
return &L3{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L3 *L3) PackConstructor() ([]byte, error) {
|
||||
return _L3.abi.Pack("")
|
||||
}
|
||||
|
@ -362,9 +344,6 @@ func NewL4() (*L4, error) {
|
|||
return &L4{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L4 *L4) PackConstructor() ([]byte, error) {
|
||||
return _L4.abi.Pack("")
|
||||
}
|
||||
|
@ -413,9 +392,6 @@ func NewL4b() (*L4b, error) {
|
|||
return &L4b{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
// TODO: create custom exported types where unpack would generate a struct return.
|
||||
|
||||
// TODO: test constructor with inputs
|
||||
func (_L4b *L4b) PackConstructor() ([]byte, error) {
|
||||
return _L4b.abi.Pack("")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
// Code generated via abigen V2 - DO NOT EDIT.
|
||||
// This file is a generated binding and any manual changes will be lost.
|
||||
|
||||
package return_structs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var (
|
||||
_ = errors.New
|
||||
_ = big.NewInt
|
||||
_ = bind.Bind
|
||||
_ = common.Big1
|
||||
_ = types.BloomLookup
|
||||
_ = abi.ConvertType
|
||||
)
|
||||
|
||||
var CLibraryDeps = []*bind.MetaData{}
|
||||
|
||||
// TODO: convert this type to value type after everything works.
|
||||
// CMetaData contains all meta data concerning the C contract.
|
||||
var CMetaData = &bind.MetaData{
|
||||
ABI: "[{\"inputs\":[],\"name\":\"DoSomethingWithManyArgs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]",
|
||||
Pattern: "55ef3c19a0ab1c1845f9e347540c1e51f5",
|
||||
Bin: "0x6080604052348015600e575f80fd5b5060fc8061001b5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c80636fd8b96814602a575b5f80fd5b60306047565b604051603e9493929190608b565b60405180910390f35b5f805f805f805f80935093509350935090919293565b5f819050919050565b606d81605d565b82525050565b5f8115159050919050565b6085816073565b82525050565b5f608082019050609c5f8301876066565b60a760208301866066565b60b260408301856066565b60bd6060830184607e565b9594505050505056fea2646970667358221220ca49ad4f133bcee385e1656fc277c9fd6546763a73df384f7d5d0fdd3c4808a564736f6c634300081a0033",
|
||||
}
|
||||
|
||||
// C is an auto generated Go binding around an Ethereum contract.
|
||||
type C struct {
|
||||
abi abi.ABI
|
||||
}
|
||||
|
||||
// NewC creates a new instance of C.
|
||||
func NewC() (*C, error) {
|
||||
parsed, err := CMetaData.GetAbi()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &C{abi: *parsed}, nil
|
||||
}
|
||||
|
||||
func (_C *C) PackConstructor() ([]byte, error) {
|
||||
return _C.abi.Pack("")
|
||||
}
|
||||
|
||||
// DoSomethingWithManyArgs is a free data retrieval call binding the contract method 0x6fd8b968.
|
||||
//
|
||||
// Solidity: function DoSomethingWithManyArgs() pure returns(uint256, uint256, uint256, bool)
|
||||
func (_C *C) PackDoSomethingWithManyArgs() ([]byte, error) {
|
||||
return _C.abi.Pack("DoSomethingWithManyArgs")
|
||||
}
|
||||
|
||||
type DoSomethingWithManyArgsOutput struct {
|
||||
Arg *big.Int
|
||||
Arg0 *big.Int
|
||||
Arg1 *big.Int
|
||||
Arg2 bool
|
||||
}
|
||||
|
||||
func (_C *C) UnpackDoSomethingWithManyArgs(data []byte) (DoSomethingWithManyArgsOutput, error) {
|
||||
out, err := _C.abi.Unpack("DoSomethingWithManyArgs", data)
|
||||
|
||||
outstruct := new(DoSomethingWithManyArgsOutput)
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
||||
outstruct.Arg = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg0 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg1 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
|
||||
outstruct.Arg2 = *abi.ConvertType(out[3], new(bool)).(*bool)
|
||||
|
||||
return *outstruct, err
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"contracts":{"contract.sol:C":{"abi":[{"inputs":[],"name":"DoSomethingWithManyArgs","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}],"bin":"6080604052348015600e575f80fd5b5060fc8061001b5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c80636fd8b96814602a575b5f80fd5b60306047565b604051603e9493929190608b565b60405180910390f35b5f805f805f805f80935093509350935090919293565b5f819050919050565b606d81605d565b82525050565b5f8115159050919050565b6085816073565b82525050565b5f608082019050609c5f8301876066565b60a760208301866066565b60b260408301856066565b60bd6060830184607e565b9594505050505056fea2646970667358221220ca49ad4f133bcee385e1656fc277c9fd6546763a73df384f7d5d0fdd3c4808a564736f6c634300081a0033"}},"version":"0.8.26+commit.8a97fa7a.Darwin.appleclang"}
|
|
@ -0,0 +1,8 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.26;
|
||||
|
||||
contract C {
|
||||
function DoSomethingWithManyArgs() public pure returns (uint256, uint256, uint256, bool) {
|
||||
return(uint256(0), uint256(0), uint256(0), false);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue