accounts/abi: ABI explicit difference between Unpack and UnpackIntoInterface (#21091)

* accounts/abi: refactored abi.Unpack

* accounts/abi/bind: fixed error

* accounts/abi/bind: modified template

* accounts/abi/bind: added ToStruct for conversion

* accounts/abi: reenabled tests

* accounts/abi: fixed tests

* accounts/abi: fixed tests for packing/unpacking

* accounts/abi: fixed tests

* accounts/abi: added more logic to ToStruct

* accounts/abi/bind: fixed template

* accounts/abi/bind: fixed ToStruct conversion

* accounts/abi/: removed unused code

* accounts/abi: updated template

* accounts/abi: refactored unused code

* contracts/checkpointoracle: updated contracts to sol ^0.6.0

* accounts/abi: refactored reflection logic

* accounts/abi: less code duplication in Unpack*

* accounts/abi: fixed rebasing bug

* fix a few typos in comments

* rebase on master

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
This commit is contained in:
Daniel Liu 2025-01-14 10:56:11 +08:00
parent 22df50c77a
commit b0063d39b9
28 changed files with 747 additions and 356 deletions

View file

@ -36,7 +36,7 @@ func RunContract(chain consensus.ChainContext, statedb *state.StateDB, contractA
return nil, err return nil, err
} }
var unpackResult interface{} var unpackResult interface{}
err = abi.Unpack(&unpackResult, method, result) err = abi.UnpackIntoInterface(&unpackResult, method, result)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -80,36 +80,56 @@ func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error) {
return append(method.ID, arguments...), nil return append(method.ID, arguments...), nil
} }
// Unpack output in v according to the abi specification. func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
func (abi ABI) Unpack(v interface{}, name string, data []byte) (err error) {
// since there can't be naming collisions with contracts and events, // since there can't be naming collisions with contracts and events,
// we need to decide whether we're calling a method or an event // we need to decide whether we're calling a method or an event
var args Arguments
if method, ok := abi.Methods[name]; ok { if method, ok := abi.Methods[name]; ok {
if len(data)%32 != 0 { if len(data)%32 != 0 {
return fmt.Errorf("abi: improperly formatted output: %s - Bytes: [%+v]", string(data), data) return nil, fmt.Errorf("abi: improperly formatted output: %s - Bytes: [%+v]", string(data), data)
} }
return method.Outputs.Unpack(v, data) args = method.Outputs
} }
if event, ok := abi.Events[name]; ok { if event, ok := abi.Events[name]; ok {
return event.Inputs.Unpack(v, data) args = event.Inputs
} }
return fmt.Errorf("abi: could not locate named method or event") if args == nil {
return nil, errors.New("abi: could not locate named method or event")
}
return args, nil
}
// Unpack unpacks the output according to the abi specification.
func (abi ABI) Unpack(name string, data []byte) ([]interface{}, error) {
args, err := abi.getArguments(name, data)
if err != nil {
return nil, err
}
return args.Unpack(data)
}
// UnpackIntoInterface unpacks the output in v according to the abi specification.
// It performs an additional copy. Please only use, if you want to unpack into a
// structure that does not strictly conform to the abi structure (e.g. has additional arguments)
func (abi ABI) UnpackIntoInterface(v interface{}, name string, data []byte) error {
args, err := abi.getArguments(name, data)
if err != nil {
return err
}
unpacked, err := args.Unpack(data)
if err != nil {
return err
}
return args.Copy(v, unpacked)
} }
// UnpackIntoMap unpacks a log into the provided map[string]interface{}. // UnpackIntoMap unpacks a log into the provided map[string]interface{}.
func (abi ABI) UnpackIntoMap(v map[string]interface{}, name string, data []byte) (err error) { func (abi ABI) UnpackIntoMap(v map[string]interface{}, name string, data []byte) (err error) {
// since there can't be naming collisions with contracts and events, args, err := abi.getArguments(name, data)
// we need to decide whether we're calling a method or an event if err != nil {
if method, ok := abi.Methods[name]; ok { return err
if len(data)%32 != 0 {
return fmt.Errorf("abi: improperly formatted output")
}
return method.Outputs.UnpackIntoMap(v, data)
} }
if event, ok := abi.Events[name]; ok { return args.UnpackIntoMap(v, data)
return event.Inputs.UnpackIntoMap(v, data)
}
return errors.New("abi: could not locate named method or event")
} }
// UnmarshalJSON implements json.Unmarshaler interface. // UnmarshalJSON implements json.Unmarshaler interface.
@ -250,10 +270,10 @@ func UnpackRevert(data []byte) (string, error) {
if !bytes.Equal(data[:4], revertSelector) { if !bytes.Equal(data[:4], revertSelector) {
return "", errors.New("invalid data for unpacking") return "", errors.New("invalid data for unpacking")
} }
var reason string
typ, _ := NewType("string", "", nil) typ, _ := NewType("string", "", nil)
if err := (Arguments{{Type: typ}}).Unpack(&reason, data[4:]); err != nil { unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
if err != nil {
return "", err return "", err
} }
return reason, nil return unpacked[0].(string), nil
} }

View file

@ -181,18 +181,15 @@ func TestConstructor(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
v := struct { unpacked, err := abi.Constructor.Inputs.Unpack(packed)
A *big.Int if err != nil {
B *big.Int
}{new(big.Int), new(big.Int)}
//abi.Unpack(&v, "", packed)
if err := abi.Constructor.Inputs.Unpack(&v, packed); err != nil {
t.Error(err) t.Error(err)
} }
if !reflect.DeepEqual(v.A, big.NewInt(1)) {
if !reflect.DeepEqual(unpacked[0], big.NewInt(1)) {
t.Error("Unable to pack/unpack from constructor") t.Error("Unable to pack/unpack from constructor")
} }
if !reflect.DeepEqual(v.B, big.NewInt(2)) { if !reflect.DeepEqual(unpacked[1], big.NewInt(2)) {
t.Error("Unable to pack/unpack from constructor") t.Error("Unable to pack/unpack from constructor")
} }
} }
@ -747,7 +744,7 @@ func TestUnpackEvent(t *testing.T) {
} }
var ev ReceivedEvent var ev ReceivedEvent
err = abi.Unpack(&ev, "received", data) err = abi.UnpackIntoInterface(&ev, "received", data)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -756,7 +753,7 @@ func TestUnpackEvent(t *testing.T) {
Sender common.Address Sender common.Address
} }
var receivedAddrEv ReceivedAddrEvent var receivedAddrEv ReceivedAddrEvent
err = abi.Unpack(&receivedAddrEv, "receivedAddr", data) err = abi.UnpackIntoInterface(&receivedAddrEv, "receivedAddr", data)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View file

@ -76,28 +76,20 @@ func (arguments Arguments) isTuple() bool {
} }
// Unpack performs the operation hexdata -> Go format. // Unpack performs the operation hexdata -> Go format.
func (arguments Arguments) Unpack(v interface{}, data []byte) error { func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
if len(data) == 0 { if len(data) == 0 {
if len(arguments) != 0 { if len(arguments) != 0 {
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected") return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
} }
return nil // Nothing to unmarshal, return // Nothing to unmarshal, return default variables
nonIndexedArgs := arguments.NonIndexed()
defaultVars := make([]interface{}, len(nonIndexedArgs))
for index, arg := range nonIndexedArgs {
defaultVars[index] = reflect.New(arg.Type.GetType())
}
return defaultVars, nil
} }
// make sure the passed value is arguments pointer return arguments.UnpackValues(data)
if reflect.Ptr != reflect.ValueOf(v).Kind() {
return fmt.Errorf("abi: Unpack(non-pointer %T)", v)
}
marshalledValues, err := arguments.UnpackValues(data)
if err != nil {
return err
}
if len(marshalledValues) == 0 {
return fmt.Errorf("abi: Unpack(no-values unmarshalled %T)", v)
}
if arguments.isTuple() {
return arguments.unpackTuple(v, marshalledValues)
}
return arguments.unpackAtomic(v, marshalledValues[0])
} }
// UnpackIntoMap performs the operation hexdata -> mapping of argument name to argument value. // UnpackIntoMap performs the operation hexdata -> mapping of argument name to argument value.
@ -122,8 +114,26 @@ func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte)
return nil return nil
} }
// unpackAtomic unpacks ( hexdata -> go ) a single value. // Copy performs the operation go format -> provided struct.
func (arguments Arguments) unpackAtomic(v interface{}, marshalledValues interface{}) error { func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
// make sure the passed value is arguments pointer
if reflect.Ptr != reflect.ValueOf(v).Kind() {
return fmt.Errorf("abi: Unpack(non-pointer %T)", v)
}
if len(values) == 0 {
if len(arguments) != 0 {
return fmt.Errorf("abi: attempting to copy no values while %d arguments are expected", len(arguments))
}
return nil // Nothing to copy, return
}
if arguments.isTuple() {
return arguments.copyTuple(v, values)
}
return arguments.copyAtomic(v, values[0])
}
// unpackAtomic unpacks ( hexdata -> go ) a single value
func (arguments Arguments) copyAtomic(v interface{}, marshalledValues interface{}) error {
dst := reflect.ValueOf(v).Elem() dst := reflect.ValueOf(v).Elem()
src := reflect.ValueOf(marshalledValues) src := reflect.ValueOf(marshalledValues)
@ -133,8 +143,8 @@ func (arguments Arguments) unpackAtomic(v interface{}, marshalledValues interfac
return set(dst, src) return set(dst, src)
} }
// unpackTuple unpacks ( hexdata -> go ) a batch of values. // copyTuple copies a batch of values from marshalledValues to v.
func (arguments Arguments) unpackTuple(v interface{}, marshalledValues []interface{}) error { func (arguments Arguments) copyTuple(v interface{}, marshalledValues []interface{}) error {
value := reflect.ValueOf(v).Elem() value := reflect.ValueOf(v).Elem()
nonIndexedArgs := arguments.NonIndexed() nonIndexedArgs := arguments.NonIndexed()

View file

@ -125,11 +125,14 @@ func DeployContract(opts *TransactOpts, abi abi.ABI, bytecode []byte, backend Co
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, params ...interface{}) error { func (c *BoundContract) Call(opts *CallOpts, results *[]interface{}, method string, params ...interface{}) error {
// Don't crash on a lazy user // Don't crash on a lazy user
if opts == nil { if opts == nil {
opts = new(CallOpts) opts = new(CallOpts)
} }
if results == nil {
results = new([]interface{})
}
// Pack the input, call and unpack the results // Pack the input, call and unpack the results
input, err := c.abi.Pack(method, params...) input, err := c.abi.Pack(method, params...)
if err != nil { if err != nil {
@ -166,10 +169,14 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string,
} }
} }
} }
if err != nil {
if len(*results) == 0 {
res, err := c.abi.Unpack(method, output)
*results = res
return err return err
} }
return c.abi.Unpack(result, method, output) res := *results
return c.abi.UnpackIntoInterface(res[0], method, output)
} }
// Transact invokes the (paid) contract method with params as input values. // Transact invokes the (paid) contract method with params as input values.
@ -455,7 +462,7 @@ func (c *BoundContract) UnpackLog(out interface{}, event string, log types.Log)
return errors.New("event signature mismatch") return errors.New("event signature mismatch")
} }
if len(log.Data) > 0 { if len(log.Data) > 0 {
if err := c.abi.Unpack(out, event, log.Data); err != nil { if err := c.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
return err return err
} }
} }

View file

@ -116,24 +116,22 @@ func TestPassingBlockNumber(t *testing.T) {
bc.Call(&bind.CallOpts{}, nil, "something") bc.Call(&bind.CallOpts{}, nil, "something")
bc.Call(&bind.CallOpts{}, nil, "something")
if mc.callContractBlockNumber != nil { if mc.callContractBlockNumber != nil {
t.Fatalf("CallContract() was passed a block number when it should not have been") t.Fatal("CallContract() was passed a block number when it should not have been")
} }
if mc.codeAtBlockNumber != nil { if mc.codeAtBlockNumber != nil {
t.Fatalf("CodeAt() was passed a block number when it should not have been") t.Fatal("CodeAt() was passed a block number when it should not have been")
} }
bc.Call(&bind.CallOpts{Pending: true}, nil, "something") bc.Call(&bind.CallOpts{Pending: true}, nil, "something")
if !mc.pendingCallContractCalled { if !mc.pendingCallContractCalled {
t.Fatalf("CallContract() was not passed the block number") t.Fatal("CallContract() was not passed the block number")
} }
if !mc.pendingCodeAtCalled { if !mc.pendingCodeAtCalled {
t.Fatalf("CodeAt() was not passed the block number") t.Fatal("CodeAt() was not passed the block number")
} }
} }

View file

@ -1648,11 +1648,11 @@ func TestGolangBindings(t *testing.T) {
} }
t.Log("Using config", params.TestXDPoSMockChainConfig) t.Log("Using config", params.TestXDPoSMockChainConfig)
// Create a temporary workspace for the test suite // Create a temporary workspace for the test suite
ws, err := os.MkdirTemp("", "") ws, err := os.MkdirTemp("", "binding-test")
if err != nil { if err != nil {
t.Fatalf("failed to create temporary workspace: %v", err) t.Fatalf("failed to create temporary workspace: %v", err)
} }
defer os.RemoveAll(ws) // defer os.RemoveAll(ws)
pkg := filepath.Join(ws, "bindtest") pkg := filepath.Join(ws, "bindtest")
if err = os.MkdirAll(pkg, 0700); err != nil { if err = os.MkdirAll(pkg, 0700); err != nil {

View file

@ -260,7 +260,7 @@ var (
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_{{$contract.Type}} *{{$contract.Type}}Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_{{$contract.Type}} *{{$contract.Type}}Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _{{$contract.Type}}.Contract.{{$contract.Type}}Caller.contract.Call(opts, result, method, params...) return _{{$contract.Type}}.Contract.{{$contract.Type}}Caller.contract.Call(opts, result, method, params...)
} }
@ -279,7 +279,7 @@ var (
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_{{$contract.Type}} *{{$contract.Type}}CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_{{$contract.Type}} *{{$contract.Type}}CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _{{$contract.Type}}.Contract.contract.Call(opts, result, method, params...) return _{{$contract.Type}}.Contract.contract.Call(opts, result, method, params...)
} }
@ -299,19 +299,23 @@ var (
// //
// Solidity: {{.Original.String}} // Solidity: {{.Original.String}}
func (_{{$contract.Type}} *{{$contract.Type}}Caller) {{.Normalized.Name}}(opts *bind.CallOpts {{range .Normalized.Inputs}}, {{.Name}} {{bindtype .Type $structs}} {{end}}) ({{if .Structured}}struct{ {{range .Normalized.Outputs}}{{.Name}} {{bindtype .Type $structs}};{{end}} },{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) { func (_{{$contract.Type}} *{{$contract.Type}}Caller) {{.Normalized.Name}}(opts *bind.CallOpts {{range .Normalized.Inputs}}, {{.Name}} {{bindtype .Type $structs}} {{end}}) ({{if .Structured}}struct{ {{range .Normalized.Outputs}}{{.Name}} {{bindtype .Type $structs}};{{end}} },{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
{{if .Structured}}ret := new(struct{ var out []interface{}
{{range .Normalized.Outputs}}{{.Name}} {{bindtype .Type $structs}} err := _{{$contract.Type}}.contract.Call(opts, &out, "{{.Original.Name}}" {{range .Normalized.Inputs}}, {{.Name}}{{end}})
{{end}} {{if .Structured}}
}){{else}}var ( outstruct := new(struct{ {{range .Normalized.Outputs}} {{.Name}} {{bindtype .Type $structs}}; {{end}} })
{{range $i, $_ := .Normalized.Outputs}}ret{{$i}} = new({{bindtype .Type $structs}}) {{range $i, $t := .Normalized.Outputs}}
{{end}} outstruct.{{.Name}} = out[{{$i}}].({{bindtype .Type $structs}}){{end}}
){{end}}
out := {{if .Structured}}ret{{else}}{{if eq (len .Normalized.Outputs) 1}}ret0{{else}}&[]interface{}{ return *outstruct, err
{{range $i, $_ := .Normalized.Outputs}}ret{{$i}}, {{else}}
{{end}} if err != nil {
}{{end}}{{end}} return {{range $i, $_ := .Normalized.Outputs}}*new({{bindtype .Type $structs}}), {{end}} err
err := _{{$contract.Type}}.contract.Call(opts, out, "{{.Original.Name}}" {{range .Normalized.Inputs}}, {{.Name}}{{end}}) }
return {{if .Structured}}*ret,{{else}}{{range $i, $_ := .Normalized.Outputs}}*ret{{$i}},{{end}}{{end}} err {{range $i, $t := .Normalized.Outputs}}
out{{$i}} := *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}}){{end}}
return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} err
{{end}}
} }
// {{.Normalized.Name}} is a free data retrieval call binding the contract method 0x{{printf "%x" .Original.ID}}. // {{.Normalized.Name}} is a free data retrieval call binding the contract method 0x{{printf "%x" .Original.ID}}.

View file

@ -147,10 +147,6 @@ func TestEventString(t *testing.T) {
// TestEventMultiValueWithArrayUnpack verifies that array fields will be counted after parsing array. // TestEventMultiValueWithArrayUnpack verifies that array fields will be counted after parsing array.
func TestEventMultiValueWithArrayUnpack(t *testing.T) { func TestEventMultiValueWithArrayUnpack(t *testing.T) {
definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": false, "name":"value1", "type":"uint8[2]"},{"indexed": false, "name":"value2", "type":"uint8"}]}]` definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": false, "name":"value1", "type":"uint8[2]"},{"indexed": false, "name":"value2", "type":"uint8"}]}]`
type testStruct struct {
Value1 [2]uint8
Value2 uint8
}
abi, err := JSON(strings.NewReader(definition)) abi, err := JSON(strings.NewReader(definition))
require.NoError(t, err) require.NoError(t, err)
var b bytes.Buffer var b bytes.Buffer
@ -158,10 +154,10 @@ func TestEventMultiValueWithArrayUnpack(t *testing.T) {
for ; i <= 3; i++ { for ; i <= 3; i++ {
b.Write(packNum(reflect.ValueOf(i))) b.Write(packNum(reflect.ValueOf(i)))
} }
var rst testStruct unpacked, err := abi.Unpack("test", b.Bytes())
require.NoError(t, abi.Unpack(&rst, "test", b.Bytes())) require.NoError(t, err)
require.Equal(t, [2]uint8{1, 2}, rst.Value1) require.Equal(t, [2]uint8{1, 2}, unpacked[0])
require.Equal(t, uint8(3), rst.Value2) require.Equal(t, uint8(3), unpacked[1])
} }
func TestEventTupleUnpack(t *testing.T) { func TestEventTupleUnpack(t *testing.T) {
@ -351,14 +347,14 @@ func unpackTestEventData(dest interface{}, hexData string, jsonEvent []byte, ass
var e Event var e Event
assert.NoError(json.Unmarshal(jsonEvent, &e), "Should be able to unmarshal event ABI") assert.NoError(json.Unmarshal(jsonEvent, &e), "Should be able to unmarshal event ABI")
a := ABI{Events: map[string]Event{"e": e}} a := ABI{Events: map[string]Event{"e": e}}
return a.Unpack(dest, "e", data) return a.UnpackIntoInterface(dest, "e", data)
} }
// TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder. // TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder.
func TestEventUnpackIndexed(t *testing.T) { func TestEventUnpackIndexed(t *testing.T) {
definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]` definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]`
type testStruct struct { type testStruct struct {
Value1 uint8 Value1 uint8 // indexed
Value2 uint8 Value2 uint8
} }
abi, err := JSON(strings.NewReader(definition)) abi, err := JSON(strings.NewReader(definition))
@ -366,7 +362,7 @@ func TestEventUnpackIndexed(t *testing.T) {
var b bytes.Buffer var b bytes.Buffer
b.Write(packNum(reflect.ValueOf(uint8(8)))) b.Write(packNum(reflect.ValueOf(uint8(8))))
var rst testStruct var rst testStruct
require.NoError(t, abi.Unpack(&rst, "test", b.Bytes())) require.NoError(t, abi.UnpackIntoInterface(&rst, "test", b.Bytes()))
require.Equal(t, uint8(0), rst.Value1) require.Equal(t, uint8(0), rst.Value1)
require.Equal(t, uint8(8), rst.Value2) require.Equal(t, uint8(8), rst.Value2)
} }
@ -375,7 +371,7 @@ func TestEventUnpackIndexed(t *testing.T) {
func TestEventIndexedWithArrayUnpack(t *testing.T) { func TestEventIndexedWithArrayUnpack(t *testing.T) {
definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8[2]"},{"indexed": false, "name":"value2", "type":"string"}]}]` definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8[2]"},{"indexed": false, "name":"value2", "type":"string"}]}]`
type testStruct struct { type testStruct struct {
Value1 [2]uint8 Value1 [2]uint8 // indexed
Value2 string Value2 string
} }
abi, err := JSON(strings.NewReader(definition)) abi, err := JSON(strings.NewReader(definition))
@ -388,7 +384,7 @@ func TestEventIndexedWithArrayUnpack(t *testing.T) {
b.Write(common.RightPadBytes([]byte(stringOut), 32)) b.Write(common.RightPadBytes([]byte(stringOut), 32))
var rst testStruct var rst testStruct
require.NoError(t, abi.Unpack(&rst, "test", b.Bytes())) require.NoError(t, abi.UnpackIntoInterface(&rst, "test", b.Bytes()))
require.Equal(t, [2]uint8{0, 0}, rst.Value1) require.Equal(t, [2]uint8{0, 0}, rst.Value1)
require.Equal(t, stringOut, rst.Value2) require.Equal(t, stringOut, rst.Value2)
} }

View file

@ -44,18 +44,7 @@ func TestPack(t *testing.T) {
t.Fatalf("invalid ABI definition %s, %v", inDef, err) t.Fatalf("invalid ABI definition %s, %v", inDef, err)
} }
var packed []byte var packed []byte
if reflect.TypeOf(test.unpacked).Kind() != reflect.Struct { packed, err = inAbi.Pack("method", test.unpacked)
packed, err = inAbi.Pack("method", test.unpacked)
} else {
// if want is a struct we need to use the components.
elem := reflect.ValueOf(test.unpacked)
var values []interface{}
for i := 0; i < elem.NumField(); i++ {
field := elem.Field(i)
values = append(values, field.Interface())
}
packed, err = inAbi.Pack("method", values...)
}
if err != nil { if err != nil {
t.Fatalf("test %d (%v) failed: %v", i, test.def, err) t.Fatalf("test %d (%v) failed: %v", i, test.def, err)

View file

@ -620,7 +620,7 @@ var packUnpackTests = []packUnpackTest{
{ {
def: `[{"type": "bytes32[]"}]`, def: `[{"type": "bytes32[]"}]`,
unpacked: []common.Hash{{1}, {2}}, unpacked: [][32]byte{{1}, {2}},
packed: "0000000000000000000000000000000000000000000000000000000000000020" + packed: "0000000000000000000000000000000000000000000000000000000000000020" +
"0000000000000000000000000000000000000000000000000000000000000002" + "0000000000000000000000000000000000000000000000000000000000000002" +
"0100000000000000000000000000000000000000000000000000000000000000" + "0100000000000000000000000000000000000000000000000000000000000000" +
@ -722,7 +722,7 @@ var packUnpackTests = []packUnpackTest{
}, },
// struct outputs // struct outputs
{ {
def: `[{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}]`, def: `[{"components": [{"name":"int1","type":"int256"},{"name":"int2","type":"int256"}], "type":"tuple"}]`,
packed: "0000000000000000000000000000000000000000000000000000000000000001" + packed: "0000000000000000000000000000000000000000000000000000000000000001" +
"0000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000002",
unpacked: struct { unpacked: struct {
@ -731,28 +731,28 @@ var packUnpackTests = []packUnpackTest{
}{big.NewInt(1), big.NewInt(2)}, }{big.NewInt(1), big.NewInt(2)},
}, },
{ {
def: `[{"name":"int_one","type":"int256"}]`, def: `[{"components": [{"name":"int_one","type":"int256"}], "type":"tuple"}]`,
packed: "0000000000000000000000000000000000000000000000000000000000000001", packed: "0000000000000000000000000000000000000000000000000000000000000001",
unpacked: struct { unpacked: struct {
IntOne *big.Int IntOne *big.Int
}{big.NewInt(1)}, }{big.NewInt(1)},
}, },
{ {
def: `[{"name":"int__one","type":"int256"}]`, def: `[{"components": [{"name":"int__one","type":"int256"}], "type":"tuple"}]`,
packed: "0000000000000000000000000000000000000000000000000000000000000001", packed: "0000000000000000000000000000000000000000000000000000000000000001",
unpacked: struct { unpacked: struct {
IntOne *big.Int IntOne *big.Int
}{big.NewInt(1)}, }{big.NewInt(1)},
}, },
{ {
def: `[{"name":"int_one_","type":"int256"}]`, def: `[{"components": [{"name":"int_one_","type":"int256"}], "type":"tuple"}]`,
packed: "0000000000000000000000000000000000000000000000000000000000000001", packed: "0000000000000000000000000000000000000000000000000000000000000001",
unpacked: struct { unpacked: struct {
IntOne *big.Int IntOne *big.Int
}{big.NewInt(1)}, }{big.NewInt(1)},
}, },
{ {
def: `[{"name":"int_one","type":"int256"}, {"name":"intone","type":"int256"}]`, def: `[{"components": [{"name":"int_one","type":"int256"}, {"name":"intone","type":"int256"}], "type":"tuple"}]`,
packed: "0000000000000000000000000000000000000000000000000000000000000001" + packed: "0000000000000000000000000000000000000000000000000000000000000001" +
"0000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000002",
unpacked: struct { unpacked: struct {
@ -831,11 +831,11 @@ var packUnpackTests = []packUnpackTest{
}, },
{ {
// static tuple // static tuple
def: `[{"name":"a","type":"int64"}, def: `[{"components": [{"name":"a","type":"int64"},
{"name":"b","type":"int256"}, {"name":"b","type":"int256"},
{"name":"c","type":"int256"}, {"name":"c","type":"int256"},
{"name":"d","type":"bool"}, {"name":"d","type":"bool"},
{"name":"e","type":"bytes32[3][2]"}]`, {"name":"e","type":"bytes32[3][2]"}], "type":"tuple"}]`,
unpacked: struct { unpacked: struct {
A int64 A int64
B *big.Int B *big.Int
@ -855,21 +855,22 @@ var packUnpackTests = []packUnpackTest{
"0500000000000000000000000000000000000000000000000000000000000000", // struct[e] array[1][2] "0500000000000000000000000000000000000000000000000000000000000000", // struct[e] array[1][2]
}, },
{ {
def: `[{"name":"a","type":"string"}, def: `[{"components": [{"name":"a","type":"string"},
{"name":"b","type":"int64"}, {"name":"b","type":"int64"},
{"name":"c","type":"bytes"}, {"name":"c","type":"bytes"},
{"name":"d","type":"string[]"}, {"name":"d","type":"string[]"},
{"name":"e","type":"int256[]"}, {"name":"e","type":"int256[]"},
{"name":"f","type":"address[]"}]`, {"name":"f","type":"address[]"}], "type":"tuple"}]`,
unpacked: struct { unpacked: struct {
FieldA string `abi:"a"` // Test whether abi tag works A string
FieldB int64 `abi:"b"` B int64
C []byte C []byte
D []string D []string
E []*big.Int E []*big.Int
F []common.Address F []common.Address
}{"foobar", 1, []byte{1}, []string{"foo", "bar"}, []*big.Int{big.NewInt(1), big.NewInt(-1)}, []common.Address{{1}, {2}}}, }{"foobar", 1, []byte{1}, []string{"foo", "bar"}, []*big.Int{big.NewInt(1), big.NewInt(-1)}, []common.Address{{1}, {2}}},
packed: "00000000000000000000000000000000000000000000000000000000000000c0" + // struct[a] offset packed: "0000000000000000000000000000000000000000000000000000000000000020" + // struct a
"00000000000000000000000000000000000000000000000000000000000000c0" + // struct[a] offset
"0000000000000000000000000000000000000000000000000000000000000001" + // struct[b] "0000000000000000000000000000000000000000000000000000000000000001" + // struct[b]
"0000000000000000000000000000000000000000000000000000000000000100" + // struct[c] offset "0000000000000000000000000000000000000000000000000000000000000100" + // struct[c] offset
"0000000000000000000000000000000000000000000000000000000000000140" + // struct[d] offset "0000000000000000000000000000000000000000000000000000000000000140" + // struct[d] offset
@ -894,23 +895,24 @@ var packUnpackTests = []packUnpackTest{
"0000000000000000000000000200000000000000000000000000000000000000", // common.Address{2} "0000000000000000000000000200000000000000000000000000000000000000", // common.Address{2}
}, },
{ {
def: `[{"components": [{"name": "a","type": "uint256"}, def: `[{"components": [{ "type": "tuple","components": [{"name": "a","type": "uint256"},
{"name": "b","type": "uint256[]"}], {"name": "b","type": "uint256[]"}],
"name": "a","type": "tuple"}, "name": "a","type": "tuple"},
{"name": "b","type": "uint256[]"}]`, {"name": "b","type": "uint256[]"}], "type": "tuple"}]`,
unpacked: struct { unpacked: struct {
A struct { A struct {
FieldA *big.Int `abi:"a"` A *big.Int
B []*big.Int B []*big.Int
} }
B []*big.Int B []*big.Int
}{ }{
A: struct { A: struct {
FieldA *big.Int `abi:"a"` // Test whether abi tag works for nested tuple A *big.Int
B []*big.Int B []*big.Int
}{big.NewInt(1), []*big.Int{big.NewInt(1), big.NewInt(2)}}, }{big.NewInt(1), []*big.Int{big.NewInt(1), big.NewInt(2)}},
B: []*big.Int{big.NewInt(1), big.NewInt(2)}}, B: []*big.Int{big.NewInt(1), big.NewInt(2)}},
packed: "0000000000000000000000000000000000000000000000000000000000000040" + // a offset packed: "0000000000000000000000000000000000000000000000000000000000000020" + // struct a
"0000000000000000000000000000000000000000000000000000000000000040" + // a offset
"00000000000000000000000000000000000000000000000000000000000000e0" + // b offset "00000000000000000000000000000000000000000000000000000000000000e0" + // b offset
"0000000000000000000000000000000000000000000000000000000000000001" + // a.a value "0000000000000000000000000000000000000000000000000000000000000001" + // a.a value
"0000000000000000000000000000000000000000000000000000000000000040" + // a.b offset "0000000000000000000000000000000000000000000000000000000000000040" + // a.b offset

View file

@ -24,6 +24,29 @@ import (
"strings" "strings"
) )
// ConvertType converts an interface of a runtime type into a interface of the
// given type
// e.g. turn
// var fields []reflect.StructField
// fields = append(fields, reflect.StructField{
// Name: "X",
// Type: reflect.TypeOf(new(big.Int)),
// Tag: reflect.StructTag("json:\"" + "x" + "\""),
// }
// into
// type TupleT struct { X *big.Int }
func ConvertType(in interface{}, proto interface{}) interface{} {
protoType := reflect.TypeOf(proto)
if reflect.TypeOf(in).ConvertibleTo(protoType) {
return reflect.ValueOf(in).Convert(protoType).Interface()
}
// Use set as a last ditch effort
if err := set(reflect.ValueOf(proto), reflect.ValueOf(in)); err != nil {
panic(err)
}
return proto
}
// indirect recursively dereferences the value until it either gets the value // indirect recursively dereferences the value until it either gets the value
// or finds a big.Int // or finds a big.Int
func indirect(v reflect.Value) reflect.Value { func indirect(v reflect.Value) reflect.Value {
@ -119,6 +142,9 @@ func setSlice(dst, src reflect.Value) error {
} }
func setArray(dst, src reflect.Value) error { func setArray(dst, src reflect.Value) error {
if src.Kind() == reflect.Ptr {
return set(dst, indirect(src))
}
array := reflect.New(dst.Type()).Elem() array := reflect.New(dst.Type()).Elem()
min := src.Len() min := src.Len()
if src.Len() > dst.Len() { if src.Len() > dst.Len() {

View file

@ -17,6 +17,7 @@
package abi package abi
import ( import (
"math/big"
"reflect" "reflect"
"testing" "testing"
) )
@ -189,3 +190,72 @@ func TestReflectNameToStruct(t *testing.T) {
}) })
} }
} }
func TestConvertType(t *testing.T) {
// Test Basic Struct
type T struct {
X *big.Int
Y *big.Int
}
// Create on-the-fly structure
var fields []reflect.StructField
fields = append(fields, reflect.StructField{
Name: "X",
Type: reflect.TypeOf(new(big.Int)),
Tag: reflect.StructTag("json:\"" + "x" + "\""),
})
fields = append(fields, reflect.StructField{
Name: "Y",
Type: reflect.TypeOf(new(big.Int)),
Tag: reflect.StructTag("json:\"" + "y" + "\""),
})
val := reflect.New(reflect.StructOf(fields))
val.Elem().Field(0).Set(reflect.ValueOf(big.NewInt(1)))
val.Elem().Field(1).Set(reflect.ValueOf(big.NewInt(2)))
// ConvertType
out := *ConvertType(val.Interface(), new(T)).(*T)
if out.X.Cmp(big.NewInt(1)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out.X, big.NewInt(1))
}
if out.Y.Cmp(big.NewInt(2)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out.Y, big.NewInt(2))
}
// Slice Type
val2 := reflect.MakeSlice(reflect.SliceOf(reflect.StructOf(fields)), 2, 2)
val2.Index(0).Field(0).Set(reflect.ValueOf(big.NewInt(1)))
val2.Index(0).Field(1).Set(reflect.ValueOf(big.NewInt(2)))
val2.Index(1).Field(0).Set(reflect.ValueOf(big.NewInt(3)))
val2.Index(1).Field(1).Set(reflect.ValueOf(big.NewInt(4)))
out2 := *ConvertType(val2.Interface(), new([]T)).(*[]T)
if out2[0].X.Cmp(big.NewInt(1)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out2[0].X, big.NewInt(1))
}
if out2[0].Y.Cmp(big.NewInt(2)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out2[1].Y, big.NewInt(2))
}
if out2[1].X.Cmp(big.NewInt(3)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out2[0].X, big.NewInt(1))
}
if out2[1].Y.Cmp(big.NewInt(4)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out2[1].Y, big.NewInt(2))
}
// Array Type
val3 := reflect.New(reflect.ArrayOf(2, reflect.StructOf(fields)))
val3.Elem().Index(0).Field(0).Set(reflect.ValueOf(big.NewInt(1)))
val3.Elem().Index(0).Field(1).Set(reflect.ValueOf(big.NewInt(2)))
val3.Elem().Index(1).Field(0).Set(reflect.ValueOf(big.NewInt(3)))
val3.Elem().Index(1).Field(1).Set(reflect.ValueOf(big.NewInt(4)))
out3 := *ConvertType(val3.Interface(), new([2]T)).(*[2]T)
if out3[0].X.Cmp(big.NewInt(1)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out3[0].X, big.NewInt(1))
}
if out3[0].Y.Cmp(big.NewInt(2)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out3[1].Y, big.NewInt(2))
}
if out3[1].X.Cmp(big.NewInt(3)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out3[0].X, big.NewInt(1))
}
if out3[1].Y.Cmp(big.NewInt(4)) != 0 {
t.Errorf("ConvertType failed, got %v want %v", out3[1].Y, big.NewInt(2))
}
}

View file

@ -44,15 +44,13 @@ func TestUnpack(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("invalid hex %s: %v", test.packed, err) t.Fatalf("invalid hex %s: %v", test.packed, err)
} }
outptr := reflect.New(reflect.TypeOf(test.unpacked)) out, err := abi.Unpack("method", encb)
err = abi.Unpack(outptr.Interface(), "method", encb)
if err != nil { if err != nil {
t.Errorf("test %d (%v) failed: %v", i, test.def, err) t.Errorf("test %d (%v) failed: %v", i, test.def, err)
return return
} }
out := outptr.Elem().Interface() if !reflect.DeepEqual(test.unpacked, ConvertType(out[0], test.unpacked)) {
if !reflect.DeepEqual(test.unpacked, out) { t.Errorf("test %d (%v) failed: expected %v, got %v", i, test.def, test.unpacked, out[0])
t.Errorf("test %d (%v) failed: expected %v, got %v", i, test.def, test.unpacked, out)
} }
}) })
} }
@ -221,7 +219,7 @@ func TestLocalUnpackTests(t *testing.T) {
t.Fatalf("invalid hex %s: %v", test.enc, err) t.Fatalf("invalid hex %s: %v", test.enc, err)
} }
outptr := reflect.New(reflect.TypeOf(test.want)) outptr := reflect.New(reflect.TypeOf(test.want))
err = abi.Unpack(outptr.Interface(), "method", encb) err = abi.UnpackIntoInterface(outptr.Interface(), "method", encb)
if err := test.checkError(err); err != nil { if err := test.checkError(err); err != nil {
t.Errorf("test %d (%v) failed: %v", i, test.def, err) t.Errorf("test %d (%v) failed: %v", i, test.def, err)
return return
@ -234,7 +232,7 @@ func TestLocalUnpackTests(t *testing.T) {
} }
} }
func TestUnpackSetDynamicArrayOutput(t *testing.T) { func TestUnpackIntoInterfaceSetDynamicArrayOutput(t *testing.T) {
abi, err := JSON(strings.NewReader(`[{"constant":true,"inputs":[],"name":"testDynamicFixedBytes15","outputs":[{"name":"","type":"bytes15[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"testDynamicFixedBytes32","outputs":[{"name":"","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"}]`)) abi, err := JSON(strings.NewReader(`[{"constant":true,"inputs":[],"name":"testDynamicFixedBytes15","outputs":[{"name":"","type":"bytes15[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"testDynamicFixedBytes32","outputs":[{"name":"","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"}]`))
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -249,7 +247,7 @@ func TestUnpackSetDynamicArrayOutput(t *testing.T) {
) )
// test 32 // test 32
err = abi.Unpack(&out32, "testDynamicFixedBytes32", marshalledReturn32) err = abi.UnpackIntoInterface(&out32, "testDynamicFixedBytes32", marshalledReturn32)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -266,7 +264,7 @@ func TestUnpackSetDynamicArrayOutput(t *testing.T) {
} }
// test 15 // test 15
err = abi.Unpack(&out15, "testDynamicFixedBytes32", marshalledReturn15) err = abi.UnpackIntoInterface(&out15, "testDynamicFixedBytes32", marshalledReturn15)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -367,7 +365,7 @@ func TestMethodMultiReturn(t *testing.T) {
tc := tc tc := tc
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
require := require.New(t) require := require.New(t)
err := abi.Unpack(tc.dest, "multi", data) err := abi.UnpackIntoInterface(tc.dest, "multi", data)
if tc.error == "" { if tc.error == "" {
require.Nil(err, "Should be able to unpack method outputs.") require.Nil(err, "Should be able to unpack method outputs.")
require.Equal(tc.expected, tc.dest) require.Equal(tc.expected, tc.dest)
@ -390,7 +388,7 @@ func TestMultiReturnWithArray(t *testing.T) {
ret1, ret1Exp := new([3]uint64), [3]uint64{9, 9, 9} ret1, ret1Exp := new([3]uint64), [3]uint64{9, 9, 9}
ret2, ret2Exp := new(uint64), uint64(8) ret2, ret2Exp := new(uint64), uint64(8)
if err := abi.Unpack(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil { if err := abi.UnpackIntoInterface(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if !reflect.DeepEqual(*ret1, ret1Exp) { if !reflect.DeepEqual(*ret1, ret1Exp) {
@ -414,7 +412,7 @@ func TestMultiReturnWithStringArray(t *testing.T) {
ret2, ret2Exp := new(common.Address), common.HexToAddress("ab1257528b3782fb40d7ed5f72e624b744dffb2f") ret2, ret2Exp := new(common.Address), common.HexToAddress("ab1257528b3782fb40d7ed5f72e624b744dffb2f")
ret3, ret3Exp := new([2]string), [2]string{"Ethereum", "Hello, Ethereum!"} ret3, ret3Exp := new([2]string), [2]string{"Ethereum", "Hello, Ethereum!"}
ret4, ret4Exp := new(bool), false ret4, ret4Exp := new(bool), false
if err := abi.Unpack(&[]interface{}{ret1, ret2, ret3, ret4}, "multi", buff.Bytes()); err != nil { if err := abi.UnpackIntoInterface(&[]interface{}{ret1, ret2, ret3, ret4}, "multi", buff.Bytes()); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if !reflect.DeepEqual(*ret1, ret1Exp) { if !reflect.DeepEqual(*ret1, ret1Exp) {
@ -452,7 +450,7 @@ func TestMultiReturnWithStringSlice(t *testing.T) {
buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000065")) // output[1][1] value buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000065")) // output[1][1] value
ret1, ret1Exp := new([]string), []string{"ethereum", "go-ethereum"} ret1, ret1Exp := new([]string), []string{"ethereum", "go-ethereum"}
ret2, ret2Exp := new([]*big.Int), []*big.Int{big.NewInt(100), big.NewInt(101)} ret2, ret2Exp := new([]*big.Int), []*big.Int{big.NewInt(100), big.NewInt(101)}
if err := abi.Unpack(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil { if err := abi.UnpackIntoInterface(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if !reflect.DeepEqual(*ret1, ret1Exp) { if !reflect.DeepEqual(*ret1, ret1Exp) {
@ -492,7 +490,7 @@ func TestMultiReturnWithDeeplyNestedArray(t *testing.T) {
{{0x411, 0x412, 0x413}, {0x421, 0x422, 0x423}}, {{0x411, 0x412, 0x413}, {0x421, 0x422, 0x423}},
} }
ret2, ret2Exp := new(uint64), uint64(0x9876) ret2, ret2Exp := new(uint64), uint64(0x9876)
if err := abi.Unpack(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil { if err := abi.UnpackIntoInterface(&[]interface{}{ret1, ret2}, "multi", buff.Bytes()); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if !reflect.DeepEqual(*ret1, ret1Exp) { if !reflect.DeepEqual(*ret1, ret1Exp) {
@ -531,7 +529,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(common.Hex2Bytes("000000000000000000000000000000000000000000000000000000000000000a")) buff.Write(common.Hex2Bytes("000000000000000000000000000000000000000000000000000000000000000a"))
buff.Write(common.Hex2Bytes("0102000000000000000000000000000000000000000000000000000000000000")) buff.Write(common.Hex2Bytes("0102000000000000000000000000000000000000000000000000000000000000"))
err = abi.Unpack(&mixedBytes, "mixedBytes", buff.Bytes()) err = abi.UnpackIntoInterface(&mixedBytes, "mixedBytes", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} else { } else {
@ -546,7 +544,7 @@ func TestUnmarshal(t *testing.T) {
// marshal int // marshal int
var Int *big.Int var Int *big.Int
err = abi.Unpack(&Int, "int", common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001")) err = abi.UnpackIntoInterface(&Int, "int", common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001"))
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -557,7 +555,7 @@ func TestUnmarshal(t *testing.T) {
// marshal bool // marshal bool
var Bool bool var Bool bool
err = abi.Unpack(&Bool, "bool", common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001")) err = abi.UnpackIntoInterface(&Bool, "bool", common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001"))
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -574,7 +572,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(bytesOut) buff.Write(bytesOut)
var Bytes []byte var Bytes []byte
err = abi.Unpack(&Bytes, "bytes", buff.Bytes()) err = abi.UnpackIntoInterface(&Bytes, "bytes", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -590,7 +588,7 @@ func TestUnmarshal(t *testing.T) {
bytesOut = common.RightPadBytes([]byte("hello"), 64) bytesOut = common.RightPadBytes([]byte("hello"), 64)
buff.Write(bytesOut) buff.Write(bytesOut)
err = abi.Unpack(&Bytes, "bytes", buff.Bytes()) err = abi.UnpackIntoInterface(&Bytes, "bytes", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -606,7 +604,7 @@ func TestUnmarshal(t *testing.T) {
bytesOut = common.RightPadBytes([]byte("hello"), 64) bytesOut = common.RightPadBytes([]byte("hello"), 64)
buff.Write(bytesOut) buff.Write(bytesOut)
err = abi.Unpack(&Bytes, "bytes", buff.Bytes()) err = abi.UnpackIntoInterface(&Bytes, "bytes", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -616,7 +614,7 @@ func TestUnmarshal(t *testing.T) {
} }
// marshal dynamic bytes output empty // marshal dynamic bytes output empty
err = abi.Unpack(&Bytes, "bytes", nil) err = abi.UnpackIntoInterface(&Bytes, "bytes", nil)
if err == nil { if err == nil {
t.Error("expected error") t.Error("expected error")
} }
@ -627,7 +625,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000005")) buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000005"))
buff.Write(common.RightPadBytes([]byte("hello"), 32)) buff.Write(common.RightPadBytes([]byte("hello"), 32))
err = abi.Unpack(&Bytes, "bytes", buff.Bytes()) err = abi.UnpackIntoInterface(&Bytes, "bytes", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -641,7 +639,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(common.RightPadBytes([]byte("hello"), 32)) buff.Write(common.RightPadBytes([]byte("hello"), 32))
var hash common.Hash var hash common.Hash
err = abi.Unpack(&hash, "fixed", buff.Bytes()) err = abi.UnpackIntoInterface(&hash, "fixed", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -654,12 +652,12 @@ func TestUnmarshal(t *testing.T) {
// marshal error // marshal error
buff.Reset() buff.Reset()
buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020")) buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000020"))
err = abi.Unpack(&Bytes, "bytes", buff.Bytes()) err = abi.UnpackIntoInterface(&Bytes, "bytes", buff.Bytes())
if err == nil { if err == nil {
t.Error("expected error") t.Error("expected error")
} }
err = abi.Unpack(&Bytes, "multi", make([]byte, 64)) err = abi.UnpackIntoInterface(&Bytes, "multi", make([]byte, 64))
if err == nil { if err == nil {
t.Error("expected error") t.Error("expected error")
} }
@ -670,7 +668,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000003")) buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000003"))
// marshal int array // marshal int array
var intArray [3]*big.Int var intArray [3]*big.Int
err = abi.Unpack(&intArray, "intArraySingle", buff.Bytes()) err = abi.UnpackIntoInterface(&intArray, "intArraySingle", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -691,7 +689,7 @@ func TestUnmarshal(t *testing.T) {
buff.Write(common.Hex2Bytes("0000000000000000000000000100000000000000000000000000000000000000")) buff.Write(common.Hex2Bytes("0000000000000000000000000100000000000000000000000000000000000000"))
var outAddr []common.Address var outAddr []common.Address
err = abi.Unpack(&outAddr, "addressSliceSingle", buff.Bytes()) err = abi.UnpackIntoInterface(&outAddr, "addressSliceSingle", buff.Bytes())
if err != nil { if err != nil {
t.Fatal("didn't expect error:", err) t.Fatal("didn't expect error:", err)
} }
@ -718,7 +716,7 @@ func TestUnmarshal(t *testing.T) {
A []common.Address A []common.Address
B []common.Address B []common.Address
} }
err = abi.Unpack(&outAddrStruct, "addressSliceDouble", buff.Bytes()) err = abi.UnpackIntoInterface(&outAddrStruct, "addressSliceDouble", buff.Bytes())
if err != nil { if err != nil {
t.Fatal("didn't expect error:", err) t.Fatal("didn't expect error:", err)
} }
@ -746,7 +744,7 @@ func TestUnmarshal(t *testing.T) {
buff.Reset() buff.Reset()
buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000100")) buff.Write(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000100"))
err = abi.Unpack(&outAddr, "addressSliceSingle", buff.Bytes()) err = abi.UnpackIntoInterface(&outAddr, "addressSliceSingle", buff.Bytes())
if err == nil { if err == nil {
t.Fatal("expected error:", err) t.Fatal("expected error:", err)
} }
@ -769,7 +767,7 @@ func TestUnpackTuple(t *testing.T) {
B *big.Int B *big.Int
}{new(big.Int), new(big.Int)} }{new(big.Int), new(big.Int)}
err = abi.Unpack(&v, "tuple", buff.Bytes()) err = abi.UnpackIntoInterface(&v, "tuple", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} else { } else {
@ -841,7 +839,7 @@ func TestUnpackTuple(t *testing.T) {
A: big.NewInt(1), A: big.NewInt(1),
} }
err = abi.Unpack(&ret, "tuple", buff.Bytes()) err = abi.UnpackIntoInterface(&ret, "tuple", buff.Bytes())
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View file

@ -140,7 +140,7 @@ func bindLAbstractRegistration(address common.Address, caller bind.ContractCalle
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractRegistration *LAbstractRegistrationRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractRegistration *LAbstractRegistrationRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractRegistration.Contract.LAbstractRegistrationCaller.contract.Call(opts, result, method, params...) return _LAbstractRegistration.Contract.LAbstractRegistrationCaller.contract.Call(opts, result, method, params...)
} }
@ -159,7 +159,7 @@ func (_LAbstractRegistration *LAbstractRegistrationRaw) Transact(opts *bind.Tran
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractRegistration *LAbstractRegistrationCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractRegistration *LAbstractRegistrationCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractRegistration.Contract.contract.Call(opts, result, method, params...) return _LAbstractRegistration.Contract.contract.Call(opts, result, method, params...)
} }
@ -181,7 +181,9 @@ func (_LAbstractRegistration *LAbstractRegistrationCaller) RESIGNREQUESTS(opts *
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _LAbstractRegistration.contract.Call(opts, out, "RESIGN_REQUESTS", arg0) err := _LAbstractRegistration.contract.Call(opts, out, "RESIGN_REQUESTS", arg0)
return *ret0, err return *ret0, err
} }
@ -365,7 +367,7 @@ func bindLAbstractXDCXListing(address common.Address, caller bind.ContractCaller
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractXDCXListing *LAbstractXDCXListingRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractXDCXListing *LAbstractXDCXListingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractXDCXListing.Contract.LAbstractXDCXListingCaller.contract.Call(opts, result, method, params...) return _LAbstractXDCXListing.Contract.LAbstractXDCXListingCaller.contract.Call(opts, result, method, params...)
} }
@ -384,7 +386,7 @@ func (_LAbstractXDCXListing *LAbstractXDCXListingRaw) Transact(opts *bind.Transa
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractXDCXListing *LAbstractXDCXListingCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractXDCXListing *LAbstractXDCXListingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractXDCXListing.Contract.contract.Call(opts, result, method, params...) return _LAbstractXDCXListing.Contract.contract.Call(opts, result, method, params...)
} }
@ -406,7 +408,9 @@ func (_LAbstractXDCXListing *LAbstractXDCXListingCaller) GetTokenStatus(opts *bi
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _LAbstractXDCXListing.contract.Call(opts, out, "getTokenStatus", arg0) err := _LAbstractXDCXListing.contract.Call(opts, out, "getTokenStatus", arg0)
return *ret0, err return *ret0, err
} }
@ -552,7 +556,7 @@ func bindLAbstractTokenTRC21(address common.Address, caller bind.ContractCaller,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractTokenTRC21 *LAbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractTokenTRC21 *LAbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractTokenTRC21.Contract.LAbstractTokenTRC21Caller.contract.Call(opts, result, method, params...) return _LAbstractTokenTRC21.Contract.LAbstractTokenTRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -571,7 +575,7 @@ func (_LAbstractTokenTRC21 *LAbstractTokenTRC21Raw) Transact(opts *bind.Transact
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_LAbstractTokenTRC21 *LAbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_LAbstractTokenTRC21 *LAbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LAbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...) return _LAbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -593,7 +597,9 @@ func (_LAbstractTokenTRC21 *LAbstractTokenTRC21Caller) Issuer(opts *bind.CallOpt
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _LAbstractTokenTRC21.contract.Call(opts, out, "issuer") err := _LAbstractTokenTRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -739,7 +745,7 @@ func bindLending(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Lending *LendingRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Lending *LendingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Lending.Contract.LendingCaller.contract.Call(opts, result, method, params...) return _Lending.Contract.LendingCaller.contract.Call(opts, result, method, params...)
} }
@ -758,7 +764,7 @@ func (_Lending *LendingRaw) Transact(opts *bind.TransactOpts, method string, par
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Lending *LendingCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Lending *LendingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Lending.Contract.contract.Call(opts, result, method, params...) return _Lending.Contract.contract.Call(opts, result, method, params...)
} }
@ -780,7 +786,9 @@ func (_Lending *LendingCaller) BASES(opts *bind.CallOpts, arg0 *big.Int) (common
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "BASES", arg0) err := _Lending.contract.Call(opts, out, "BASES", arg0)
return *ret0, err return *ret0, err
} }
@ -806,7 +814,9 @@ func (_Lending *LendingCaller) COLLATERALS(opts *bind.CallOpts, arg0 *big.Int) (
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "COLLATERALS", arg0) err := _Lending.contract.Call(opts, out, "COLLATERALS", arg0)
return *ret0, err return *ret0, err
} }
@ -838,7 +848,9 @@ func (_Lending *LendingCaller) COLLATERALLIST(opts *bind.CallOpts, arg0 common.A
LiquidationRate *big.Int LiquidationRate *big.Int
RecallRate *big.Int RecallRate *big.Int
}) })
out := ret out := &[]interface{}{
ret,
}
err := _Lending.contract.Call(opts, out, "COLLATERAL_LIST", arg0) err := _Lending.contract.Call(opts, out, "COLLATERAL_LIST", arg0)
return *ret, err return *ret, err
} }
@ -872,7 +884,9 @@ func (_Lending *LendingCaller) ILOCOLLATERALS(opts *bind.CallOpts, arg0 *big.Int
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "ILO_COLLATERALS", arg0) err := _Lending.contract.Call(opts, out, "ILO_COLLATERALS", arg0)
return *ret0, err return *ret0, err
} }
@ -898,7 +912,9 @@ func (_Lending *LendingCaller) LENDINGRELAYERLIST(opts *bind.CallOpts, arg0 comm
var ( var (
ret0 = new(uint16) ret0 = new(uint16)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "LENDINGRELAYER_LIST", arg0) err := _Lending.contract.Call(opts, out, "LENDINGRELAYER_LIST", arg0)
return *ret0, err return *ret0, err
} }
@ -924,7 +940,9 @@ func (_Lending *LendingCaller) MODERATOR(opts *bind.CallOpts) (common.Address, e
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "MODERATOR") err := _Lending.contract.Call(opts, out, "MODERATOR")
return *ret0, err return *ret0, err
} }
@ -950,7 +968,9 @@ func (_Lending *LendingCaller) ORACLEPRICEFEEDER(opts *bind.CallOpts) (common.Ad
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "ORACLE_PRICE_FEEDER") err := _Lending.contract.Call(opts, out, "ORACLE_PRICE_FEEDER")
return *ret0, err return *ret0, err
} }
@ -976,7 +996,9 @@ func (_Lending *LendingCaller) Relayer(opts *bind.CallOpts) (common.Address, err
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "Relayer") err := _Lending.contract.Call(opts, out, "Relayer")
return *ret0, err return *ret0, err
} }
@ -1002,7 +1024,9 @@ func (_Lending *LendingCaller) TERMS(opts *bind.CallOpts, arg0 *big.Int) (*big.I
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "TERMS", arg0) err := _Lending.contract.Call(opts, out, "TERMS", arg0)
return *ret0, err return *ret0, err
} }
@ -1028,7 +1052,9 @@ func (_Lending *LendingCaller) XDCXListing(opts *bind.CallOpts) (common.Address,
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _Lending.contract.Call(opts, out, "XDCXListing") err := _Lending.contract.Call(opts, out, "XDCXListing")
return *ret0, err return *ret0, err
} }

View file

@ -142,7 +142,7 @@ func bindAbstractXDCXListing(address common.Address, caller bind.ContractCaller,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractXDCXListing *AbstractXDCXListingRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractXDCXListing *AbstractXDCXListingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractXDCXListing.Contract.AbstractXDCXListingCaller.contract.Call(opts, result, method, params...) return _AbstractXDCXListing.Contract.AbstractXDCXListingCaller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_AbstractXDCXListing *AbstractXDCXListingRaw) Transact(opts *bind.Transact
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractXDCXListing *AbstractXDCXListingCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractXDCXListing *AbstractXDCXListingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractXDCXListing.Contract.contract.Call(opts, result, method, params...) return _AbstractXDCXListing.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_AbstractXDCXListing *AbstractXDCXListingCaller) GetTokenStatus(opts *bind
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _AbstractXDCXListing.contract.Call(opts, out, "getTokenStatus", arg0) err := _AbstractXDCXListing.contract.Call(opts, out, "getTokenStatus", arg0)
return *ret0, err return *ret0, err
} }
@ -329,7 +331,7 @@ func bindRelayerRegistration(address common.Address, caller bind.ContractCaller,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_RelayerRegistration *RelayerRegistrationRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_RelayerRegistration *RelayerRegistrationRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _RelayerRegistration.Contract.RelayerRegistrationCaller.contract.Call(opts, result, method, params...) return _RelayerRegistration.Contract.RelayerRegistrationCaller.contract.Call(opts, result, method, params...)
} }
@ -348,7 +350,7 @@ func (_RelayerRegistration *RelayerRegistrationRaw) Transact(opts *bind.Transact
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_RelayerRegistration *RelayerRegistrationCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_RelayerRegistration *RelayerRegistrationCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _RelayerRegistration.Contract.contract.Call(opts, result, method, params...) return _RelayerRegistration.Contract.contract.Call(opts, result, method, params...)
} }
@ -370,7 +372,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) ActiveRelayerCount(opts *
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "ActiveRelayerCount") err := _RelayerRegistration.contract.Call(opts, out, "ActiveRelayerCount")
return *ret0, err return *ret0, err
} }
@ -396,7 +400,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) CONTRACTOWNER(opts *bind.
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "CONTRACT_OWNER") err := _RelayerRegistration.contract.Call(opts, out, "CONTRACT_OWNER")
return *ret0, err return *ret0, err
} }
@ -422,7 +428,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) MaximumRelayers(opts *bin
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "MaximumRelayers") err := _RelayerRegistration.contract.Call(opts, out, "MaximumRelayers")
return *ret0, err return *ret0, err
} }
@ -448,7 +456,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) MaximumTokenList(opts *bi
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "MaximumTokenList") err := _RelayerRegistration.contract.Call(opts, out, "MaximumTokenList")
return *ret0, err return *ret0, err
} }
@ -474,7 +484,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) MinimumDeposit(opts *bind
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "MinimumDeposit") err := _RelayerRegistration.contract.Call(opts, out, "MinimumDeposit")
return *ret0, err return *ret0, err
} }
@ -500,7 +512,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) RELAYERCOINBASES(opts *bi
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_COINBASES", arg0) err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_COINBASES", arg0)
return *ret0, err return *ret0, err
} }
@ -534,7 +548,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) RELAYERLIST(opts *bind.Ca
Index *big.Int Index *big.Int
Owner common.Address Owner common.Address
}) })
out := ret out := &[]interface{}{
ret,
}
err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_LIST", arg0) err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_LIST", arg0)
return *ret, err return *ret, err
} }
@ -570,7 +586,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) RELAYERONSALELIST(opts *b
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_ON_SALE_LIST", arg0) err := _RelayerRegistration.contract.Call(opts, out, "RELAYER_ON_SALE_LIST", arg0)
return *ret0, err return *ret0, err
} }
@ -596,7 +614,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) RESIGNREQUESTS(opts *bind
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "RESIGN_REQUESTS", arg0) err := _RelayerRegistration.contract.Call(opts, out, "RESIGN_REQUESTS", arg0)
return *ret0, err return *ret0, err
} }
@ -622,7 +642,9 @@ func (_RelayerRegistration *RelayerRegistrationCaller) RelayerCount(opts *bind.C
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _RelayerRegistration.contract.Call(opts, out, "RelayerCount") err := _RelayerRegistration.contract.Call(opts, out, "RelayerCount")
return *ret0, err return *ret0, err
} }
@ -2218,7 +2240,7 @@ func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
} }
@ -2237,7 +2259,7 @@ func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, p
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.contract.Call(opts, result, method, params...) return _SafeMath.Contract.contract.Call(opts, result, method, params...)
} }

View file

@ -142,7 +142,7 @@ func bindITRC21(address common.Address, caller bind.ContractCaller, transactor b
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_ITRC21 *ITRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_ITRC21 *ITRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _ITRC21.Contract.ITRC21Caller.contract.Call(opts, result, method, params...) return _ITRC21.Contract.ITRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_ITRC21 *ITRC21Raw) Transact(opts *bind.TransactOpts, method string, param
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_ITRC21 *ITRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_ITRC21 *ITRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _ITRC21.Contract.contract.Call(opts, result, method, params...) return _ITRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_ITRC21 *ITRC21Caller) Allowance(opts *bind.CallOpts, owner common.Address
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "allowance", owner, spender) err := _ITRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -209,7 +211,9 @@ func (_ITRC21 *ITRC21Caller) BalanceOf(opts *bind.CallOpts, who common.Address)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "balanceOf", who) err := _ITRC21.contract.Call(opts, out, "balanceOf", who)
return *ret0, err return *ret0, err
} }
@ -235,7 +239,9 @@ func (_ITRC21 *ITRC21Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
var ( var (
ret0 = new(uint8) ret0 = new(uint8)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "decimals") err := _ITRC21.contract.Call(opts, out, "decimals")
return *ret0, err return *ret0, err
} }
@ -261,7 +267,9 @@ func (_ITRC21 *ITRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int) (*
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "estimateFee", value) err := _ITRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -287,7 +295,9 @@ func (_ITRC21 *ITRC21Caller) Issuer(opts *bind.CallOpts) (common.Address, error)
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "issuer") err := _ITRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -313,7 +323,9 @@ func (_ITRC21 *ITRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "totalSupply") err := _ITRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }
@ -957,7 +969,7 @@ func bindMyTRC21(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MyTRC21 *MyTRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MyTRC21 *MyTRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MyTRC21.Contract.MyTRC21Caller.contract.Call(opts, result, method, params...) return _MyTRC21.Contract.MyTRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -976,7 +988,7 @@ func (_MyTRC21 *MyTRC21Raw) Transact(opts *bind.TransactOpts, method string, par
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MyTRC21 *MyTRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MyTRC21 *MyTRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MyTRC21.Contract.contract.Call(opts, result, method, params...) return _MyTRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -998,7 +1010,9 @@ func (_MyTRC21 *MyTRC21Caller) DEPOSITFEE(opts *bind.CallOpts) (*big.Int, error)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "DEPOSIT_FEE") err := _MyTRC21.contract.Call(opts, out, "DEPOSIT_FEE")
return *ret0, err return *ret0, err
} }
@ -1024,7 +1038,9 @@ func (_MyTRC21 *MyTRC21Caller) MAXOWNERCOUNT(opts *bind.CallOpts) (*big.Int, err
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "MAX_OWNER_COUNT") err := _MyTRC21.contract.Call(opts, out, "MAX_OWNER_COUNT")
return *ret0, err return *ret0, err
} }
@ -1050,7 +1066,9 @@ func (_MyTRC21 *MyTRC21Caller) WITHDRAWFEE(opts *bind.CallOpts) (*big.Int, error
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "WITHDRAW_FEE") err := _MyTRC21.contract.Call(opts, out, "WITHDRAW_FEE")
return *ret0, err return *ret0, err
} }
@ -1076,7 +1094,9 @@ func (_MyTRC21 *MyTRC21Caller) Allowance(opts *bind.CallOpts, owner common.Addre
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "allowance", owner, spender) err := _MyTRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -1102,7 +1122,9 @@ func (_MyTRC21 *MyTRC21Caller) BalanceOf(opts *bind.CallOpts, owner common.Addre
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "balanceOf", owner) err := _MyTRC21.contract.Call(opts, out, "balanceOf", owner)
return *ret0, err return *ret0, err
} }
@ -1134,7 +1156,9 @@ func (_MyTRC21 *MyTRC21Caller) BurnList(opts *bind.CallOpts, arg0 *big.Int) (str
Burner common.Address Burner common.Address
Data []byte Data []byte
}) })
out := ret out := &[]interface{}{
ret,
}
err := _MyTRC21.contract.Call(opts, out, "burnList", arg0) err := _MyTRC21.contract.Call(opts, out, "burnList", arg0)
return *ret, err return *ret, err
} }
@ -1168,7 +1192,9 @@ func (_MyTRC21 *MyTRC21Caller) Confirmations(opts *bind.CallOpts, arg0 *big.Int,
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "confirmations", arg0, arg1) err := _MyTRC21.contract.Call(opts, out, "confirmations", arg0, arg1)
return *ret0, err return *ret0, err
} }
@ -1194,7 +1220,9 @@ func (_MyTRC21 *MyTRC21Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
var ( var (
ret0 = new(uint8) ret0 = new(uint8)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "decimals") err := _MyTRC21.contract.Call(opts, out, "decimals")
return *ret0, err return *ret0, err
} }
@ -1220,7 +1248,9 @@ func (_MyTRC21 *MyTRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "estimateFee", value) err := _MyTRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -1252,7 +1282,9 @@ func (_MyTRC21 *MyTRC21Caller) GetBurn(opts *bind.CallOpts, burnId *big.Int) (st
Value *big.Int Value *big.Int
Data []byte Data []byte
}) })
out := ret out := &[]interface{}{
ret,
}
err := _MyTRC21.contract.Call(opts, out, "getBurn", burnId) err := _MyTRC21.contract.Call(opts, out, "getBurn", burnId)
return *ret, err return *ret, err
} }
@ -1286,7 +1318,9 @@ func (_MyTRC21 *MyTRC21Caller) GetBurnCount(opts *bind.CallOpts) (*big.Int, erro
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getBurnCount") err := _MyTRC21.contract.Call(opts, out, "getBurnCount")
return *ret0, err return *ret0, err
} }
@ -1312,7 +1346,9 @@ func (_MyTRC21 *MyTRC21Caller) GetConfirmationCount(opts *bind.CallOpts, transac
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getConfirmationCount", transactionId) err := _MyTRC21.contract.Call(opts, out, "getConfirmationCount", transactionId)
return *ret0, err return *ret0, err
} }
@ -1338,7 +1374,9 @@ func (_MyTRC21 *MyTRC21Caller) GetConfirmations(opts *bind.CallOpts, transaction
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getConfirmations", transactionId) err := _MyTRC21.contract.Call(opts, out, "getConfirmations", transactionId)
return *ret0, err return *ret0, err
} }
@ -1364,7 +1402,9 @@ func (_MyTRC21 *MyTRC21Caller) GetOwners(opts *bind.CallOpts) ([]common.Address,
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getOwners") err := _MyTRC21.contract.Call(opts, out, "getOwners")
return *ret0, err return *ret0, err
} }
@ -1390,7 +1430,9 @@ func (_MyTRC21 *MyTRC21Caller) GetTransactionCount(opts *bind.CallOpts, pending
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getTransactionCount", pending, executed) err := _MyTRC21.contract.Call(opts, out, "getTransactionCount", pending, executed)
return *ret0, err return *ret0, err
} }
@ -1416,7 +1458,9 @@ func (_MyTRC21 *MyTRC21Caller) GetTransactionIds(opts *bind.CallOpts, from *big.
var ( var (
ret0 = new([]*big.Int) ret0 = new([]*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "getTransactionIds", from, to, pending, executed) err := _MyTRC21.contract.Call(opts, out, "getTransactionIds", from, to, pending, executed)
return *ret0, err return *ret0, err
} }
@ -1442,7 +1486,9 @@ func (_MyTRC21 *MyTRC21Caller) IsConfirmed(opts *bind.CallOpts, transactionId *b
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "isConfirmed", transactionId) err := _MyTRC21.contract.Call(opts, out, "isConfirmed", transactionId)
return *ret0, err return *ret0, err
} }
@ -1468,7 +1514,9 @@ func (_MyTRC21 *MyTRC21Caller) IsOwner(opts *bind.CallOpts, arg0 common.Address)
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "isOwner", arg0) err := _MyTRC21.contract.Call(opts, out, "isOwner", arg0)
return *ret0, err return *ret0, err
} }
@ -1494,7 +1542,9 @@ func (_MyTRC21 *MyTRC21Caller) Issuer(opts *bind.CallOpts) (common.Address, erro
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "issuer") err := _MyTRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -1520,7 +1570,9 @@ func (_MyTRC21 *MyTRC21Caller) MinFee(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "minFee") err := _MyTRC21.contract.Call(opts, out, "minFee")
return *ret0, err return *ret0, err
} }
@ -1546,7 +1598,9 @@ func (_MyTRC21 *MyTRC21Caller) Name(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "name") err := _MyTRC21.contract.Call(opts, out, "name")
return *ret0, err return *ret0, err
} }
@ -1572,7 +1626,9 @@ func (_MyTRC21 *MyTRC21Caller) Owners(opts *bind.CallOpts, arg0 *big.Int) (commo
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "owners", arg0) err := _MyTRC21.contract.Call(opts, out, "owners", arg0)
return *ret0, err return *ret0, err
} }
@ -1598,7 +1654,9 @@ func (_MyTRC21 *MyTRC21Caller) Required(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "required") err := _MyTRC21.contract.Call(opts, out, "required")
return *ret0, err return *ret0, err
} }
@ -1624,7 +1682,9 @@ func (_MyTRC21 *MyTRC21Caller) Symbol(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "symbol") err := _MyTRC21.contract.Call(opts, out, "symbol")
return *ret0, err return *ret0, err
} }
@ -1650,7 +1710,9 @@ func (_MyTRC21 *MyTRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "totalSupply") err := _MyTRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }
@ -1676,7 +1738,9 @@ func (_MyTRC21 *MyTRC21Caller) TransactionCount(opts *bind.CallOpts) (*big.Int,
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "transactionCount") err := _MyTRC21.contract.Call(opts, out, "transactionCount")
return *ret0, err return *ret0, err
} }
@ -1710,7 +1774,9 @@ func (_MyTRC21 *MyTRC21Caller) Transactions(opts *bind.CallOpts, arg0 *big.Int)
Data []byte Data []byte
Executed bool Executed bool
}) })
out := ret out := &[]interface{}{
ret,
}
err := _MyTRC21.contract.Call(opts, out, "transactions", arg0) err := _MyTRC21.contract.Call(opts, out, "transactions", arg0)
return *ret, err return *ret, err
} }
@ -3844,7 +3910,7 @@ func bindTRC21(address common.Address, caller bind.ContractCaller, transactor bi
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21 *TRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21 *TRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21.Contract.TRC21Caller.contract.Call(opts, result, method, params...) return _TRC21.Contract.TRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -3863,7 +3929,7 @@ func (_TRC21 *TRC21Raw) Transact(opts *bind.TransactOpts, method string, params
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21 *TRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21 *TRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21.Contract.contract.Call(opts, result, method, params...) return _TRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -3885,7 +3951,9 @@ func (_TRC21 *TRC21Caller) Allowance(opts *bind.CallOpts, owner common.Address,
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "allowance", owner, spender) err := _TRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -3911,7 +3979,9 @@ func (_TRC21 *TRC21Caller) BalanceOf(opts *bind.CallOpts, owner common.Address)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "balanceOf", owner) err := _TRC21.contract.Call(opts, out, "balanceOf", owner)
return *ret0, err return *ret0, err
} }
@ -3937,7 +4007,9 @@ func (_TRC21 *TRC21Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
var ( var (
ret0 = new(uint8) ret0 = new(uint8)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "decimals") err := _TRC21.contract.Call(opts, out, "decimals")
return *ret0, err return *ret0, err
} }
@ -3963,7 +4035,9 @@ func (_TRC21 *TRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int) (*bi
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "estimateFee", value) err := _TRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -3989,7 +4063,9 @@ func (_TRC21 *TRC21Caller) Issuer(opts *bind.CallOpts) (common.Address, error) {
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "issuer") err := _TRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -4015,7 +4091,9 @@ func (_TRC21 *TRC21Caller) MinFee(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "minFee") err := _TRC21.contract.Call(opts, out, "minFee")
return *ret0, err return *ret0, err
} }
@ -4041,7 +4119,9 @@ func (_TRC21 *TRC21Caller) Name(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "name") err := _TRC21.contract.Call(opts, out, "name")
return *ret0, err return *ret0, err
} }
@ -4067,7 +4147,9 @@ func (_TRC21 *TRC21Caller) Symbol(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "symbol") err := _TRC21.contract.Call(opts, out, "symbol")
return *ret0, err return *ret0, err
} }
@ -4093,7 +4175,9 @@ func (_TRC21 *TRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "totalSupply") err := _TRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }

View file

@ -141,7 +141,7 @@ func bindAbstractTokenTRC21(address common.Address, caller bind.ContractCaller,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractTokenTRC21.Contract.AbstractTokenTRC21Caller.contract.Call(opts, result, method, params...) return _AbstractTokenTRC21.Contract.AbstractTokenTRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -160,7 +160,7 @@ func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Transact(opts *bind.TransactOp
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractTokenTRC21 *AbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractTokenTRC21 *AbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...) return _AbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -182,7 +182,9 @@ func (_AbstractTokenTRC21 *AbstractTokenTRC21Caller) Issuer(opts *bind.CallOpts)
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _AbstractTokenTRC21.contract.Call(opts, out, "issuer") err := _AbstractTokenTRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -328,7 +330,7 @@ func bindTRC21Issuer(address common.Address, caller bind.ContractCaller, transac
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21Issuer *TRC21IssuerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21Issuer *TRC21IssuerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21Issuer.Contract.TRC21IssuerCaller.contract.Call(opts, result, method, params...) return _TRC21Issuer.Contract.TRC21IssuerCaller.contract.Call(opts, result, method, params...)
} }
@ -347,7 +349,7 @@ func (_TRC21Issuer *TRC21IssuerRaw) Transact(opts *bind.TransactOpts, method str
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21Issuer *TRC21IssuerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21Issuer *TRC21IssuerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21Issuer.Contract.contract.Call(opts, result, method, params...) return _TRC21Issuer.Contract.contract.Call(opts, result, method, params...)
} }
@ -369,7 +371,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) GetTokenCapacity(opts *bind.CallOpts, tok
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "getTokenCapacity", token) err := _TRC21Issuer.contract.Call(opts, out, "getTokenCapacity", token)
return *ret0, err return *ret0, err
} }
@ -395,7 +399,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) MinCap(opts *bind.CallOpts) (*big.Int, er
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "minCap") err := _TRC21Issuer.contract.Call(opts, out, "minCap")
return *ret0, err return *ret0, err
} }
@ -421,7 +427,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) Tokens(opts *bind.CallOpts) ([]common.Add
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "tokens") err := _TRC21Issuer.contract.Call(opts, out, "tokens")
return *ret0, err return *ret0, err
} }

View file

@ -139,7 +139,7 @@ func bindXDCXListing(address common.Address, caller bind.ContractCaller, transac
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCXListing *XDCXListingRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCXListing *XDCXListingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCXListing.Contract.XDCXListingCaller.contract.Call(opts, result, method, params...) return _XDCXListing.Contract.XDCXListingCaller.contract.Call(opts, result, method, params...)
} }
@ -158,7 +158,7 @@ func (_XDCXListing *XDCXListingRaw) Transact(opts *bind.TransactOpts, method str
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCXListing *XDCXListingCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCXListing *XDCXListingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCXListing.Contract.contract.Call(opts, result, method, params...) return _XDCXListing.Contract.contract.Call(opts, result, method, params...)
} }
@ -180,7 +180,9 @@ func (_XDCXListing *XDCXListingCaller) GetTokenStatus(opts *bind.CallOpts, token
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCXListing.contract.Call(opts, out, "getTokenStatus", token) err := _XDCXListing.contract.Call(opts, out, "getTokenStatus", token)
return *ret0, err return *ret0, err
} }
@ -206,7 +208,9 @@ func (_XDCXListing *XDCXListingCaller) Tokens(opts *bind.CallOpts) ([]common.Add
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCXListing.contract.Call(opts, out, "tokens") err := _XDCXListing.contract.Call(opts, out, "tokens")
return *ret0, err return *ret0, err
} }

View file

@ -142,7 +142,7 @@ func bindBlockSigner(address common.Address, caller bind.ContractCaller, transac
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_BlockSigner *BlockSignerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_BlockSigner *BlockSignerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _BlockSigner.Contract.BlockSignerCaller.contract.Call(opts, result, method, params...) return _BlockSigner.Contract.BlockSignerCaller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_BlockSigner *BlockSignerRaw) Transact(opts *bind.TransactOpts, method str
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_BlockSigner *BlockSignerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_BlockSigner *BlockSignerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _BlockSigner.Contract.contract.Call(opts, result, method, params...) return _BlockSigner.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_BlockSigner *BlockSignerCaller) EpochNumber(opts *bind.CallOpts) (*big.In
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _BlockSigner.contract.Call(opts, out, "epochNumber") err := _BlockSigner.contract.Call(opts, out, "epochNumber")
return *ret0, err return *ret0, err
} }
@ -209,7 +211,9 @@ func (_BlockSigner *BlockSignerCaller) GetSigners(opts *bind.CallOpts, _blockHas
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _BlockSigner.contract.Call(opts, out, "getSigners", _blockHash) err := _BlockSigner.contract.Call(opts, out, "getSigners", _blockHash)
return *ret0, err return *ret0, err
} }
@ -500,7 +504,7 @@ func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
} }
@ -519,7 +523,7 @@ func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, p
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.contract.Call(opts, result, method, params...) return _SafeMath.Contract.contract.Call(opts, result, method, params...)
} }

View file

@ -142,7 +142,7 @@ func bindMultiSigWallet(address common.Address, caller bind.ContractCaller, tran
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MultiSigWallet *MultiSigWalletRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MultiSigWallet *MultiSigWalletRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MultiSigWallet.Contract.MultiSigWalletCaller.contract.Call(opts, result, method, params...) return _MultiSigWallet.Contract.MultiSigWalletCaller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_MultiSigWallet *MultiSigWalletRaw) Transact(opts *bind.TransactOpts, meth
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MultiSigWallet *MultiSigWalletCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MultiSigWallet *MultiSigWalletCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MultiSigWallet.Contract.contract.Call(opts, result, method, params...) return _MultiSigWallet.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) MAXOWNERCOUNT(opts *bind.CallOpts)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "MAX_OWNER_COUNT") err := _MultiSigWallet.contract.Call(opts, out, "MAX_OWNER_COUNT")
return *ret0, err return *ret0, err
} }
@ -209,7 +211,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) Confirmations(opts *bind.CallOpts,
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "confirmations", arg0, arg1) err := _MultiSigWallet.contract.Call(opts, out, "confirmations", arg0, arg1)
return *ret0, err return *ret0, err
} }
@ -235,7 +239,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) GetConfirmationCount(opts *bind.Cal
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "getConfirmationCount", transactionId) err := _MultiSigWallet.contract.Call(opts, out, "getConfirmationCount", transactionId)
return *ret0, err return *ret0, err
} }
@ -261,7 +267,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) GetConfirmations(opts *bind.CallOpt
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "getConfirmations", transactionId) err := _MultiSigWallet.contract.Call(opts, out, "getConfirmations", transactionId)
return *ret0, err return *ret0, err
} }
@ -287,7 +295,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) GetOwners(opts *bind.CallOpts) ([]c
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "getOwners") err := _MultiSigWallet.contract.Call(opts, out, "getOwners")
return *ret0, err return *ret0, err
} }
@ -313,7 +323,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) GetTransactionCount(opts *bind.Call
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "getTransactionCount", pending, executed) err := _MultiSigWallet.contract.Call(opts, out, "getTransactionCount", pending, executed)
return *ret0, err return *ret0, err
} }
@ -339,7 +351,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) GetTransactionIds(opts *bind.CallOp
var ( var (
ret0 = new([]*big.Int) ret0 = new([]*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "getTransactionIds", from, to, pending, executed) err := _MultiSigWallet.contract.Call(opts, out, "getTransactionIds", from, to, pending, executed)
return *ret0, err return *ret0, err
} }
@ -365,7 +379,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) IsConfirmed(opts *bind.CallOpts, tr
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "isConfirmed", transactionId) err := _MultiSigWallet.contract.Call(opts, out, "isConfirmed", transactionId)
return *ret0, err return *ret0, err
} }
@ -391,7 +407,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) IsOwner(opts *bind.CallOpts, arg0 c
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "isOwner", arg0) err := _MultiSigWallet.contract.Call(opts, out, "isOwner", arg0)
return *ret0, err return *ret0, err
} }
@ -417,7 +435,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) Owners(opts *bind.CallOpts, arg0 *b
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "owners", arg0) err := _MultiSigWallet.contract.Call(opts, out, "owners", arg0)
return *ret0, err return *ret0, err
} }
@ -443,7 +463,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) Required(opts *bind.CallOpts) (*big
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "required") err := _MultiSigWallet.contract.Call(opts, out, "required")
return *ret0, err return *ret0, err
} }
@ -469,7 +491,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) TransactionCount(opts *bind.CallOpt
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MultiSigWallet.contract.Call(opts, out, "transactionCount") err := _MultiSigWallet.contract.Call(opts, out, "transactionCount")
return *ret0, err return *ret0, err
} }
@ -503,7 +527,9 @@ func (_MultiSigWallet *MultiSigWalletCaller) Transactions(opts *bind.CallOpts, a
Data []byte Data []byte
Executed bool Executed bool
}) })
out := ret out := &[]interface{}{
ret,
}
err := _MultiSigWallet.contract.Call(opts, out, "transactions", arg0) err := _MultiSigWallet.contract.Call(opts, out, "transactions", arg0)
return *ret, err return *ret, err
} }

View file

@ -139,7 +139,7 @@ func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
} }
@ -158,7 +158,7 @@ func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, p
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.contract.Call(opts, result, method, params...) return _SafeMath.Contract.contract.Call(opts, result, method, params...)
} }
@ -300,7 +300,7 @@ func bindXDCRandomize(address common.Address, caller bind.ContractCaller, transa
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCRandomize *XDCRandomizeRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCRandomize *XDCRandomizeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCRandomize.Contract.XDCRandomizeCaller.contract.Call(opts, result, method, params...) return _XDCRandomize.Contract.XDCRandomizeCaller.contract.Call(opts, result, method, params...)
} }
@ -319,7 +319,7 @@ func (_XDCRandomize *XDCRandomizeRaw) Transact(opts *bind.TransactOpts, method s
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCRandomize *XDCRandomizeCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCRandomize *XDCRandomizeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCRandomize.Contract.contract.Call(opts, result, method, params...) return _XDCRandomize.Contract.contract.Call(opts, result, method, params...)
} }
@ -341,7 +341,9 @@ func (_XDCRandomize *XDCRandomizeCaller) GetOpening(opts *bind.CallOpts, _valida
var ( var (
ret0 = new([32]byte) ret0 = new([32]byte)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCRandomize.contract.Call(opts, out, "getOpening", _validator) err := _XDCRandomize.contract.Call(opts, out, "getOpening", _validator)
return *ret0, err return *ret0, err
} }
@ -367,7 +369,9 @@ func (_XDCRandomize *XDCRandomizeCaller) GetSecret(opts *bind.CallOpts, _validat
var ( var (
ret0 = new([][32]byte) ret0 = new([][32]byte)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCRandomize.contract.Call(opts, out, "getSecret", _validator) err := _XDCRandomize.contract.Call(opts, out, "getSecret", _validator)
return *ret0, err return *ret0, err
} }

View file

@ -139,7 +139,7 @@ func bindBase1(address common.Address, caller bind.ContractCaller, transactor bi
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Base1 *Base1Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Base1 *Base1Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Base1.Contract.Base1Caller.contract.Call(opts, result, method, params...) return _Base1.Contract.Base1Caller.contract.Call(opts, result, method, params...)
} }
@ -158,7 +158,7 @@ func (_Base1 *Base1Raw) Transact(opts *bind.TransactOpts, method string, params
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Base1 *Base1CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Base1 *Base1CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Base1.Contract.contract.Call(opts, result, method, params...) return _Base1.Contract.contract.Call(opts, result, method, params...)
} }
@ -321,7 +321,7 @@ func bindBase2(address common.Address, caller bind.ContractCaller, transactor bi
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Base2 *Base2Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Base2 *Base2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Base2.Contract.Base2Caller.contract.Call(opts, result, method, params...) return _Base2.Contract.Base2Caller.contract.Call(opts, result, method, params...)
} }
@ -340,7 +340,7 @@ func (_Base2 *Base2Raw) Transact(opts *bind.TransactOpts, method string, params
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Base2 *Base2CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Base2 *Base2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Base2.Contract.contract.Call(opts, result, method, params...) return _Base2.Contract.contract.Call(opts, result, method, params...)
} }
@ -503,7 +503,7 @@ func bindInherited(address common.Address, caller bind.ContractCaller, transacto
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Inherited *InheritedRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Inherited *InheritedRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Inherited.Contract.InheritedCaller.contract.Call(opts, result, method, params...) return _Inherited.Contract.InheritedCaller.contract.Call(opts, result, method, params...)
} }
@ -522,7 +522,7 @@ func (_Inherited *InheritedRaw) Transact(opts *bind.TransactOpts, method string,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_Inherited *InheritedCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_Inherited *InheritedCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Inherited.Contract.contract.Call(opts, result, method, params...) return _Inherited.Contract.contract.Call(opts, result, method, params...)
} }

View file

@ -142,7 +142,7 @@ func bindITRC21(address common.Address, caller bind.ContractCaller, transactor b
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_ITRC21 *ITRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_ITRC21 *ITRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _ITRC21.Contract.ITRC21Caller.contract.Call(opts, result, method, params...) return _ITRC21.Contract.ITRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_ITRC21 *ITRC21Raw) Transact(opts *bind.TransactOpts, method string, param
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_ITRC21 *ITRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_ITRC21 *ITRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _ITRC21.Contract.contract.Call(opts, result, method, params...) return _ITRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_ITRC21 *ITRC21Caller) Allowance(opts *bind.CallOpts, owner common.Address
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "allowance", owner, spender) err := _ITRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -209,7 +211,9 @@ func (_ITRC21 *ITRC21Caller) BalanceOf(opts *bind.CallOpts, who common.Address)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "balanceOf", who) err := _ITRC21.contract.Call(opts, out, "balanceOf", who)
return *ret0, err return *ret0, err
} }
@ -235,7 +239,9 @@ func (_ITRC21 *ITRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int) (*
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "estimateFee", value) err := _ITRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -261,7 +267,9 @@ func (_ITRC21 *ITRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _ITRC21.contract.Call(opts, out, "totalSupply") err := _ITRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }
@ -905,7 +913,7 @@ func bindMyTRC21(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MyTRC21 *MyTRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MyTRC21 *MyTRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MyTRC21.Contract.MyTRC21Caller.contract.Call(opts, result, method, params...) return _MyTRC21.Contract.MyTRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -924,7 +932,7 @@ func (_MyTRC21 *MyTRC21Raw) Transact(opts *bind.TransactOpts, method string, par
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_MyTRC21 *MyTRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_MyTRC21 *MyTRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _MyTRC21.Contract.contract.Call(opts, result, method, params...) return _MyTRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -946,7 +954,9 @@ func (_MyTRC21 *MyTRC21Caller) Allowance(opts *bind.CallOpts, owner common.Addre
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "allowance", owner, spender) err := _MyTRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -972,7 +982,9 @@ func (_MyTRC21 *MyTRC21Caller) BalanceOf(opts *bind.CallOpts, owner common.Addre
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "balanceOf", owner) err := _MyTRC21.contract.Call(opts, out, "balanceOf", owner)
return *ret0, err return *ret0, err
} }
@ -998,7 +1010,9 @@ func (_MyTRC21 *MyTRC21Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
var ( var (
ret0 = new(uint8) ret0 = new(uint8)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "decimals") err := _MyTRC21.contract.Call(opts, out, "decimals")
return *ret0, err return *ret0, err
} }
@ -1024,7 +1038,9 @@ func (_MyTRC21 *MyTRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "estimateFee", value) err := _MyTRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -1050,7 +1066,9 @@ func (_MyTRC21 *MyTRC21Caller) Issuer(opts *bind.CallOpts) (common.Address, erro
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "issuer") err := _MyTRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -1076,7 +1094,9 @@ func (_MyTRC21 *MyTRC21Caller) MinFee(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "minFee") err := _MyTRC21.contract.Call(opts, out, "minFee")
return *ret0, err return *ret0, err
} }
@ -1102,7 +1122,9 @@ func (_MyTRC21 *MyTRC21Caller) Name(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "name") err := _MyTRC21.contract.Call(opts, out, "name")
return *ret0, err return *ret0, err
} }
@ -1128,7 +1150,9 @@ func (_MyTRC21 *MyTRC21Caller) Symbol(opts *bind.CallOpts) (string, error) {
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "symbol") err := _MyTRC21.contract.Call(opts, out, "symbol")
return *ret0, err return *ret0, err
} }
@ -1154,7 +1178,9 @@ func (_MyTRC21 *MyTRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _MyTRC21.contract.Call(opts, out, "totalSupply") err := _MyTRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }
@ -1798,7 +1824,7 @@ func bindTRC21(address common.Address, caller bind.ContractCaller, transactor bi
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21 *TRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21 *TRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21.Contract.TRC21Caller.contract.Call(opts, result, method, params...) return _TRC21.Contract.TRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -1817,7 +1843,7 @@ func (_TRC21 *TRC21Raw) Transact(opts *bind.TransactOpts, method string, params
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21 *TRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21 *TRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21.Contract.contract.Call(opts, result, method, params...) return _TRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -1839,7 +1865,9 @@ func (_TRC21 *TRC21Caller) Allowance(opts *bind.CallOpts, owner common.Address,
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "allowance", owner, spender) err := _TRC21.contract.Call(opts, out, "allowance", owner, spender)
return *ret0, err return *ret0, err
} }
@ -1865,7 +1893,9 @@ func (_TRC21 *TRC21Caller) BalanceOf(opts *bind.CallOpts, owner common.Address)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "balanceOf", owner) err := _TRC21.contract.Call(opts, out, "balanceOf", owner)
return *ret0, err return *ret0, err
} }
@ -1891,7 +1921,9 @@ func (_TRC21 *TRC21Caller) EstimateFee(opts *bind.CallOpts, value *big.Int) (*bi
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "estimateFee", value) err := _TRC21.contract.Call(opts, out, "estimateFee", value)
return *ret0, err return *ret0, err
} }
@ -1917,7 +1949,9 @@ func (_TRC21 *TRC21Caller) Issuer(opts *bind.CallOpts) (common.Address, error) {
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "issuer") err := _TRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -1943,7 +1977,9 @@ func (_TRC21 *TRC21Caller) MinFee(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "minFee") err := _TRC21.contract.Call(opts, out, "minFee")
return *ret0, err return *ret0, err
} }
@ -1969,7 +2005,9 @@ func (_TRC21 *TRC21Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21.contract.Call(opts, out, "totalSupply") err := _TRC21.contract.Call(opts, out, "totalSupply")
return *ret0, err return *ret0, err
} }

View file

@ -142,7 +142,7 @@ func bindAbstractTokenTRC21(address common.Address, caller bind.ContractCaller,
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractTokenTRC21.Contract.AbstractTokenTRC21Caller.contract.Call(opts, result, method, params...) return _AbstractTokenTRC21.Contract.AbstractTokenTRC21Caller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_AbstractTokenTRC21 *AbstractTokenTRC21Raw) Transact(opts *bind.TransactOp
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_AbstractTokenTRC21 *AbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_AbstractTokenTRC21 *AbstractTokenTRC21CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...) return _AbstractTokenTRC21.Contract.contract.Call(opts, result, method, params...)
} }
@ -183,7 +183,9 @@ func (_AbstractTokenTRC21 *AbstractTokenTRC21Caller) Issuer(opts *bind.CallOpts)
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _AbstractTokenTRC21.contract.Call(opts, out, "issuer") err := _AbstractTokenTRC21.contract.Call(opts, out, "issuer")
return *ret0, err return *ret0, err
} }
@ -329,7 +331,7 @@ func bindTRC21Issuer(address common.Address, caller bind.ContractCaller, transac
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21Issuer *TRC21IssuerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21Issuer *TRC21IssuerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21Issuer.Contract.TRC21IssuerCaller.contract.Call(opts, result, method, params...) return _TRC21Issuer.Contract.TRC21IssuerCaller.contract.Call(opts, result, method, params...)
} }
@ -348,7 +350,7 @@ func (_TRC21Issuer *TRC21IssuerRaw) Transact(opts *bind.TransactOpts, method str
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_TRC21Issuer *TRC21IssuerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_TRC21Issuer *TRC21IssuerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _TRC21Issuer.Contract.contract.Call(opts, result, method, params...) return _TRC21Issuer.Contract.contract.Call(opts, result, method, params...)
} }
@ -370,7 +372,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) GetTokenCapacity(opts *bind.CallOpts, tok
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "getTokenCapacity", token) err := _TRC21Issuer.contract.Call(opts, out, "getTokenCapacity", token)
return *ret0, err return *ret0, err
} }
@ -396,7 +400,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) MinCap(opts *bind.CallOpts) (*big.Int, er
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "minCap") err := _TRC21Issuer.contract.Call(opts, out, "minCap")
return *ret0, err return *ret0, err
} }
@ -422,7 +428,9 @@ func (_TRC21Issuer *TRC21IssuerCaller) Tokens(opts *bind.CallOpts) ([]common.Add
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _TRC21Issuer.contract.Call(opts, out, "tokens") err := _TRC21Issuer.contract.Call(opts, out, "tokens")
return *ret0, err return *ret0, err
} }

View file

@ -142,7 +142,7 @@ func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
} }
@ -161,7 +161,7 @@ func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, p
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _SafeMath.Contract.contract.Call(opts, result, method, params...) return _SafeMath.Contract.contract.Call(opts, result, method, params...)
} }
@ -303,7 +303,7 @@ func bindXDCValidator(address common.Address, caller bind.ContractCaller, transa
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCValidator *XDCValidatorRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCValidator *XDCValidatorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCValidator.Contract.XDCValidatorCaller.contract.Call(opts, result, method, params...) return _XDCValidator.Contract.XDCValidatorCaller.contract.Call(opts, result, method, params...)
} }
@ -322,7 +322,7 @@ func (_XDCValidator *XDCValidatorRaw) Transact(opts *bind.TransactOpts, method s
// sets the output to result. The result type might be a single field for simple // sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named // returns, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_XDCValidator *XDCValidatorCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_XDCValidator *XDCValidatorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _XDCValidator.Contract.contract.Call(opts, result, method, params...) return _XDCValidator.Contract.contract.Call(opts, result, method, params...)
} }
@ -344,7 +344,9 @@ func (_XDCValidator *XDCValidatorCaller) KYCString(opts *bind.CallOpts, arg0 com
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "KYCString", arg0, arg1) err := _XDCValidator.contract.Call(opts, out, "KYCString", arg0, arg1)
return *ret0, err return *ret0, err
} }
@ -370,7 +372,9 @@ func (_XDCValidator *XDCValidatorCaller) CandidateCount(opts *bind.CallOpts) (*b
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "candidateCount") err := _XDCValidator.contract.Call(opts, out, "candidateCount")
return *ret0, err return *ret0, err
} }
@ -396,7 +400,9 @@ func (_XDCValidator *XDCValidatorCaller) CandidateWithdrawDelay(opts *bind.CallO
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "candidateWithdrawDelay") err := _XDCValidator.contract.Call(opts, out, "candidateWithdrawDelay")
return *ret0, err return *ret0, err
} }
@ -422,7 +428,9 @@ func (_XDCValidator *XDCValidatorCaller) Candidates(opts *bind.CallOpts, arg0 *b
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "candidates", arg0) err := _XDCValidator.contract.Call(opts, out, "candidates", arg0)
return *ret0, err return *ret0, err
} }
@ -448,7 +456,9 @@ func (_XDCValidator *XDCValidatorCaller) GetCandidateCap(opts *bind.CallOpts, _c
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getCandidateCap", _candidate) err := _XDCValidator.contract.Call(opts, out, "getCandidateCap", _candidate)
return *ret0, err return *ret0, err
} }
@ -474,7 +484,9 @@ func (_XDCValidator *XDCValidatorCaller) GetCandidateOwner(opts *bind.CallOpts,
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getCandidateOwner", _candidate) err := _XDCValidator.contract.Call(opts, out, "getCandidateOwner", _candidate)
return *ret0, err return *ret0, err
} }
@ -500,7 +512,9 @@ func (_XDCValidator *XDCValidatorCaller) GetCandidates(opts *bind.CallOpts) ([]c
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getCandidates") err := _XDCValidator.contract.Call(opts, out, "getCandidates")
return *ret0, err return *ret0, err
} }
@ -526,7 +540,9 @@ func (_XDCValidator *XDCValidatorCaller) GetHashCount(opts *bind.CallOpts, _addr
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getHashCount", _address) err := _XDCValidator.contract.Call(opts, out, "getHashCount", _address)
return *ret0, err return *ret0, err
} }
@ -552,7 +568,9 @@ func (_XDCValidator *XDCValidatorCaller) GetLatestKYC(opts *bind.CallOpts, _addr
var ( var (
ret0 = new(string) ret0 = new(string)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getLatestKYC", _address) err := _XDCValidator.contract.Call(opts, out, "getLatestKYC", _address)
return *ret0, err return *ret0, err
} }
@ -578,7 +596,9 @@ func (_XDCValidator *XDCValidatorCaller) GetOwnerCount(opts *bind.CallOpts) (*bi
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getOwnerCount") err := _XDCValidator.contract.Call(opts, out, "getOwnerCount")
return *ret0, err return *ret0, err
} }
@ -604,7 +624,9 @@ func (_XDCValidator *XDCValidatorCaller) GetVoterCap(opts *bind.CallOpts, _candi
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getVoterCap", _candidate, _voter) err := _XDCValidator.contract.Call(opts, out, "getVoterCap", _candidate, _voter)
return *ret0, err return *ret0, err
} }
@ -630,7 +652,9 @@ func (_XDCValidator *XDCValidatorCaller) GetVoters(opts *bind.CallOpts, _candida
var ( var (
ret0 = new([]common.Address) ret0 = new([]common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getVoters", _candidate) err := _XDCValidator.contract.Call(opts, out, "getVoters", _candidate)
return *ret0, err return *ret0, err
} }
@ -656,7 +680,9 @@ func (_XDCValidator *XDCValidatorCaller) GetWithdrawBlockNumbers(opts *bind.Call
var ( var (
ret0 = new([]*big.Int) ret0 = new([]*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getWithdrawBlockNumbers") err := _XDCValidator.contract.Call(opts, out, "getWithdrawBlockNumbers")
return *ret0, err return *ret0, err
} }
@ -682,7 +708,9 @@ func (_XDCValidator *XDCValidatorCaller) GetWithdrawCap(opts *bind.CallOpts, _bl
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "getWithdrawCap", _blockNumber) err := _XDCValidator.contract.Call(opts, out, "getWithdrawCap", _blockNumber)
return *ret0, err return *ret0, err
} }
@ -708,7 +736,9 @@ func (_XDCValidator *XDCValidatorCaller) HasVotedInvalid(opts *bind.CallOpts, ar
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "hasVotedInvalid", arg0, arg1) err := _XDCValidator.contract.Call(opts, out, "hasVotedInvalid", arg0, arg1)
return *ret0, err return *ret0, err
} }
@ -734,7 +764,9 @@ func (_XDCValidator *XDCValidatorCaller) InvalidKYCCount(opts *bind.CallOpts, ar
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "invalidKYCCount", arg0) err := _XDCValidator.contract.Call(opts, out, "invalidKYCCount", arg0)
return *ret0, err return *ret0, err
} }
@ -760,7 +792,9 @@ func (_XDCValidator *XDCValidatorCaller) InvalidPercent(opts *bind.CallOpts, _in
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "invalidPercent", _invalidCandidate) err := _XDCValidator.contract.Call(opts, out, "invalidPercent", _invalidCandidate)
return *ret0, err return *ret0, err
} }
@ -786,7 +820,9 @@ func (_XDCValidator *XDCValidatorCaller) IsCandidate(opts *bind.CallOpts, _candi
var ( var (
ret0 = new(bool) ret0 = new(bool)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "isCandidate", _candidate) err := _XDCValidator.contract.Call(opts, out, "isCandidate", _candidate)
return *ret0, err return *ret0, err
} }
@ -812,7 +848,9 @@ func (_XDCValidator *XDCValidatorCaller) MaxValidatorNumber(opts *bind.CallOpts)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "maxValidatorNumber") err := _XDCValidator.contract.Call(opts, out, "maxValidatorNumber")
return *ret0, err return *ret0, err
} }
@ -838,7 +876,9 @@ func (_XDCValidator *XDCValidatorCaller) MinCandidateCap(opts *bind.CallOpts) (*
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "minCandidateCap") err := _XDCValidator.contract.Call(opts, out, "minCandidateCap")
return *ret0, err return *ret0, err
} }
@ -864,7 +904,9 @@ func (_XDCValidator *XDCValidatorCaller) MinVoterCap(opts *bind.CallOpts) (*big.
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "minVoterCap") err := _XDCValidator.contract.Call(opts, out, "minVoterCap")
return *ret0, err return *ret0, err
} }
@ -890,7 +932,9 @@ func (_XDCValidator *XDCValidatorCaller) OwnerCount(opts *bind.CallOpts) (*big.I
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "ownerCount") err := _XDCValidator.contract.Call(opts, out, "ownerCount")
return *ret0, err return *ret0, err
} }
@ -916,7 +960,9 @@ func (_XDCValidator *XDCValidatorCaller) OwnerToCandidate(opts *bind.CallOpts, a
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "ownerToCandidate", arg0, arg1) err := _XDCValidator.contract.Call(opts, out, "ownerToCandidate", arg0, arg1)
return *ret0, err return *ret0, err
} }
@ -942,7 +988,9 @@ func (_XDCValidator *XDCValidatorCaller) Owners(opts *bind.CallOpts, arg0 *big.I
var ( var (
ret0 = new(common.Address) ret0 = new(common.Address)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "owners", arg0) err := _XDCValidator.contract.Call(opts, out, "owners", arg0)
return *ret0, err return *ret0, err
} }
@ -968,7 +1016,9 @@ func (_XDCValidator *XDCValidatorCaller) VoterWithdrawDelay(opts *bind.CallOpts)
var ( var (
ret0 = new(*big.Int) ret0 = new(*big.Int)
) )
out := ret0 out := &[]interface{}{
ret0,
}
err := _XDCValidator.contract.Call(opts, out, "voterWithdrawDelay") err := _XDCValidator.contract.Call(opts, out, "voterWithdrawDelay")
return *ret0, err return *ret0, err
} }

View file

@ -83,7 +83,7 @@ func RunContract(chain consensus.ChainContext, statedb *state.StateDB, contractA
return nil, err return nil, err
} }
var unpackResult interface{} var unpackResult interface{}
err = abi.Unpack(&unpackResult, method, result) err = abi.UnpackIntoInterface(&unpackResult, method, result)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -30,7 +30,7 @@ import (
func unpackPack(abi abi.ABI, method string, inputType []interface{}, input []byte) bool { func unpackPack(abi abi.ABI, method string, inputType []interface{}, input []byte) bool {
outptr := reflect.New(reflect.TypeOf(inputType)) outptr := reflect.New(reflect.TypeOf(inputType))
if err := abi.Unpack(outptr.Interface(), method, input); err == nil { if err := abi.UnpackIntoInterface(outptr.Interface(), method, input); err == nil {
output, err := abi.Pack(method, input) output, err := abi.Pack(method, input)
if err != nil { if err != nil {
// We have some false positives as we can unpack these type successfully, but not pack them // We have some false positives as we can unpack these type successfully, but not pack them
@ -51,7 +51,7 @@ func unpackPack(abi abi.ABI, method string, inputType []interface{}, input []byt
func packUnpack(abi abi.ABI, method string, input []interface{}) bool { func packUnpack(abi abi.ABI, method string, input []interface{}) bool {
if packed, err := abi.Pack(method, input); err == nil { if packed, err := abi.Pack(method, input); err == nil {
outptr := reflect.New(reflect.TypeOf(input)) outptr := reflect.New(reflect.TypeOf(input))
err := abi.Unpack(outptr.Interface(), method, packed) err := abi.UnpackIntoInterface(outptr.Interface(), method, packed)
if err != nil { if err != nil {
panic(err) panic(err)
} }