Skip to content

Encoding Dynamic Arrays missing location #13

Open
@hswick

Description

@hswick

It seems the encoding for dynamic arrays is missing the placeholder for the location. Currently the output is this:

ABI.encode("dynamicUint(uint[])", [[1,2,3,4,5]]) |> Hexate.encode


=> "5d4e0342000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005"

Whereas I believe it should be something like this:

"5d4e03420000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005"

Notice the 0000000000000000000000000000000000000000000000000000000000000020 preceding the length prefix. This is denoting that the dynamic array starts after 32 bytes. Since there is only one argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions