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

Invalid result when encoding payload for 0x V3 proxy. #121

Closed
Hajto opened this issue Feb 16, 2023 · 0 comments
Closed

Invalid result when encoding payload for 0x V3 proxy. #121

Hajto opened this issue Feb 16, 2023 · 0 comments

Comments

@Hajto
Copy link

Hajto commented Feb 16, 2023

We are using ExABI to encode calls to 0x V3 proxy. It requires us to encode following piece of data and prepend some prefix manually. Only after manually removing the 32 padding it ate it.

ABI.TypeEncoder.encode_raw(
      [{631839923370317324987270211814122349984664846147, [2], [1], 0}],
      [tuple: [:address, {:array, {:uint, 256}}, {:array, {:uint, 256}}, :bytes]]
    )

It is: 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000006eacae9b5d4f0f952694b2b7eef49bebb210ff43000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Should be: 0000000000000000000000006eacae9b5d4f0f952694b2b7eef49bebb210ff43000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000

Only after removing the padding blockchain ate this.

@Hajto Hajto closed this as completed Feb 16, 2023
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

No branches or pull requests

1 participant