Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abi/abigen: incorrect handling of overloaded params in struct #21049

Closed
MariusVanDerWijden opened this issue May 8, 2020 · 0 comments · Fixed by #21060
Closed

abi/abigen: incorrect handling of overloaded params in struct #21049

MariusVanDerWijden opened this issue May 8, 2020 · 0 comments · Fixed by #21060

Comments

@MariusVanDerWijden
Copy link
Member

Running abigen on the following contract blows up:

contract Overloader {
    struct F { uint _f; uint __f; uint f; }
    function f(F memory f) public {}
}

Error:

panic: reflect.StructOf: duplicate field F

goroutine 1 [running]:
reflect.StructOf(0xc0000b4820, 0x3, 0x4, 0x0, 0x0)
        /usr/lib/go/src/reflect/type.go:2541 +0x3067
github.com/ethereum/go-ethereum/accounts/abi.NewType(0xc00064fc70, 0x5, 0xc00048afe0, 0x13, 0xc0000d9b80, 0x3, 0x4, 0x0, 0x19, 0x0, ...)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/accounts/abi/type.go:203 +0x13b7
github.com/ethereum/go-ethereum/accounts/abi.(*Argument).UnmarshalJSON(0xc0002bdb80, 0xc0005a260c, 0xf7, 0x1f4, 0x7fc79199c188, 0xc0002bdb80)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/accounts/abi/argument.go:52 +0x16c
encoding/json.(*decodeState).object(0xc00026f550, 0xc3c300, 0xc0002bdb80, 0x199, 0xcd7184, 0xb)
        /usr/lib/go/src/encoding/json/decode.go:626 +0x2082
encoding/json.(*decodeState).value(0xc00026f550, 0xc3c300, 0xc0002bdb80, 0x199, 0xc3c300, 0xc0002bdb80)
        /usr/lib/go/src/encoding/json/decode.go:387 +0x6d
encoding/json.(*decodeState).array(0xc00026f550, 0xb97900, 0xc0000b46a0, 0x197, 0xc00026f578, 0x5b)
        /usr/lib/go/src/encoding/json/decode.go:575 +0x1a7
encoding/json.(*decodeState).value(0xc00026f550, 0xb97900, 0xc0000b46a0, 0x197, 0x1, 0xc000486dc0)
        /usr/lib/go/src/encoding/json/decode.go:377 +0xfd
encoding/json.(*decodeState).object(0xc00026f550, 0xc82fe0, 0xc0000b4680, 0x199, 0xcd7184, 0xb)
        /usr/lib/go/src/encoding/json/decode.go:782 +0x12e5
encoding/json.(*decodeState).value(0xc00026f550, 0xc82fe0, 0xc0000b4680, 0x199, 0xc82fe0, 0xc0000b4680)
        /usr/lib/go/src/encoding/json/decode.go:387 +0x6d
encoding/json.(*decodeState).array(0xc00026f550, 0xb7eb20, 0xc00000e180, 0x16, 0xc00026f578, 0xc000256c5b)
        /usr/lib/go/src/encoding/json/decode.go:575 +0x1a7
encoding/json.(*decodeState).value(0xc00026f550, 0xb7eb20, 0xc00000e180, 0x16, 0xc00063d790, 0x53b031)
        /usr/lib/go/src/encoding/json/decode.go:377 +0xfd
encoding/json.(*decodeState).unmarshal(0xc00026f550, 0xb7eb20, 0xc00000e180, 0xc00026f578, 0x0)
        /usr/lib/go/src/encoding/json/decode.go:180 +0x1f0
encoding/json.Unmarshal(0xc0005a2600, 0x14f, 0x200, 0xb7eb20, 0xc00000e180, 0xc00064f960, 0xc00063d890)
        /usr/lib/go/src/encoding/json/decode.go:107 +0x112
github.com/ethereum/go-ethereum/accounts/abi.(*ABI).UnmarshalJSON(0xc0000f9b00, 0xc0005a2600, 0x14f, 0x200, 0x7fc79199c168, 0xc0000f9b00)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/accounts/abi/abi.go:135 +0x8b
encoding/json.(*decodeState).array(0xc00025cb28, 0xc73760, 0xc0000f9b00, 0x16, 0xc00025cb50, 0x5b)
        /usr/lib/go/src/encoding/json/decode.go:520 +0xc10
encoding/json.(*decodeState).value(0xc00025cb28, 0xc73760, 0xc0000f9b00, 0x16, 0xc00063df60, 0x53ef1e)
        /usr/lib/go/src/encoding/json/decode.go:377 +0xfd
encoding/json.(*decodeState).unmarshal(0xc00025cb28, 0xc73760, 0xc0000f9b00, 0x0, 0x1)
        /usr/lib/go/src/encoding/json/decode.go:180 +0x1f0
encoding/json.(*Decoder).Decode(0xc00025cb00, 0xc73760, 0xc0000f9b00, 0x20, 0xc45000)
        /usr/lib/go/src/encoding/json/stream.go:73 +0x166
github.com/ethereum/go-ethereum/accounts/abi.JSON(0xe25da0, 0xc00000e060, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/accounts/abi/abi.go:50 +0xb7
github.com/ethereum/go-ethereum/accounts/abi/bind.Bind(0xc000495400, 0x8, 0x8, 0xc000495300, 0x8, 0x8, 0xc000495380, 0x8, 0x8, 0xc00048e380, ...)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/accounts/abi/bind/bind.go:63 +0x1e11
main.abigen(0xc0000fbb80, 0x0, 0x0)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/cmd/abigen/main.go:256 +0x8ef
github.com/ethereum/go-ethereum/cmd/utils.MigrateFlags.func1(0xc0000fbb80, 0xc0000fbb80, 0xc00035fbe7)
        /home/matematik/go/src/github.com/ethereum/go-ethereum/cmd/utils/flags.go:1823 +0xbe
gopkg.in/urfave/cli%2ev1.HandleAction(0xbbb620, 0xc000430fd0, 0xc0000fbb80, 0xc000548900, 0x0)
        /home/matematik/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:490 +0xc8
gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0001e3040, 0xc000032090, 0x9, 0x9, 0x0, 0x0)
        /home/matematik/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:264 +0x5dd
main.main()
        /home/matematik/go/src/github.com/ethereum/go-ethereum/cmd/abigen/main.go:274 +0xe6
generate.go:3: running "abigen": exit status 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants