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

Addresses encoded in 32 bytes instead of 20 bytes #79

Open
aklenik opened this issue Mar 21, 2019 · 0 comments
Open

Addresses encoded in 32 bytes instead of 20 bytes #79

aklenik opened this issue Mar 21, 2019 · 0 comments

Comments

@aklenik
Copy link

aklenik commented Mar 21, 2019

In the encodeSingle function, addresses are translated to unit160, so far so good.

Then the recursive call hits the uint-like check and the supplied size (i.e., 160) is retrieved. However, BN's toArrayLike function is called with a fix 32 bytes length. Which is fine, since the EVM operates with this word length, except for the addresses.

@axic Can you confirm whether this is the intended behavior? AFAIK, addresses should be 20 bytes, in which case encodeSingle must retain the information during the recursive call that it's encoding an address (or generally, whether it should respect the parsed size). I don't know how this behavior manifests with more exotic function signatures.

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