wealdtech / ethereal

Apache License 2.0
208 stars 41 forks source link

can't execute claimed on EOS token Distribution contract #2

Closed efemero closed 6 years ago

efemero commented 6 years ago

I try to execute the following:

ethereal contract call --contract 0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf --abi ./eos.abi --from 0x1151314c646Ce4E0eFD76d1aF4760aE66a9Fe30F --call 'claimed(159,0x1151314c646Ce4E0eFD76d1aF4760aE66a9Fe30F)'

the result is:

val is 159
val type is *big.Int
val is [17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]
val type is common.Address
methodName is claimed
methodArgs is [159 [17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]]
data is [18 10 168 119 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 159 0 0 0 0 0 0 0 0 0 0 0 0 17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]
panic: reflect: Elem of invalid type

goroutine 1 [running]:
reflect.(*rtype).Elem(0xaa2540, 0xc4204dc0f0, 0x7ffd351cc41b)
    /usr/lib/go/src/reflect/type.go:955 +0x143
github.com/wealdtech/ethereal/cmd.contractUnpack(0x0, 0x0, 0x0, 0xc4200c2240, 0x6, 0x6, 0x0, 0x0, 0x0, 0xc4201bc030, ...)
    /home/fba/go/src/github.com/wealdtech/ethereal/cmd/contract.go:76 +0x46b
github.com/wealdtech/ethereal/cmd.glob..func4(0x120d100, 0xc4200bf700, 0x0, 0x8)
    /home/fba/go/src/github.com/wealdtech/ethereal/cmd/contractcall.go:114 +0x14be
github.com/spf13/cobra.(*Command).execute(0x120d100, 0xc4200bf600, 0x8, 0x8, 0x120d100, 0xc4200bf600)
    /home/fba/go/src/github.com/spf13/cobra/command.go:704 +0x2c6
github.com/spf13/cobra.(*Command).ExecuteC(0x120dfe0, 0x9fc99e, 0x120dfe0, 0xc420203f20)
    /home/fba/go/src/github.com/spf13/cobra/command.go:785 +0x30e
github.com/spf13/cobra.(*Command).Execute(0x120dfe0, 0x0, 0xa1543e)
    /home/fba/go/src/github.com/spf13/cobra/command.go:738 +0x2b
github.com/wealdtech/ethereal/cmd.Execute()
    /home/fba/go/src/github.com/wealdtech/ethereal/cmd/root.go:138 +0x31
main.main()
    /home/fba/go/src/github.com/wealdtech/ethereal/main.go:19 +0x20

While other method on the same contract give:

ethereal contract call --contract 0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf --abi ./eos.abi --from 0x1151314c646Ce4E0eFD76d1aF4760aE66a9Fe30F --call 'userBuys(159,0x1151314c646Ce4E0eFD76d1aF4760aE66a9Fe30F)'
val is 159
val type is *big.Int
val is [17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]
val type is common.Address
methodName is userBuys
methodArgs is [159 [17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]]
data is [57 4 225 191 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 159 0 0 0 0 0 0 0 0 0 0 0 0 17 81 49 76 100 108 228 224 239 215 109 26 244 118 10 230 106 159 227 15]
0

and the claimed method with the same parameters in parity give me the wright result (false).

Thank for your attention and thank for your tool it is very useful.

mcdee commented 6 years ago

Thank you for reporting this issue. It should now be fixed; please try again and let me know if it behaves.

efemero commented 6 years ago

OK it works!

Thank you for your reactivity.