You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't seem like it is currently possible to encodePacked an integer with less than 256 bits?
Additional abi::Token types could be added to handle these values, which would be redundant for abi.encode but not the packed variant.
From packed.rs:
Uint and Int tokens will be encoded using the least number of bits, so no padding will be
added by default.
If I am reading this right, it means that the caller has no control over the number of bits the integer will be encoded as, which doesn't seem ideal as the EVM could be expecting a certain number of bits regardless of the value passed, such as for signature validation.
The text was updated successfully, but these errors were encountered:
Agreed, this implementation is incorrect. When encoding Uint's that are not U256 (ex. U64, U32), into_token within encode_packed does not encode the parameters correctly.
Ex.
For abi.encodePacked(uint64, uint32), this is the expected output:
It doesn't seem like it is currently possible to encodePacked an integer with less than 256 bits?
Additional
abi::Token
types could be added to handle these values, which would be redundant forabi.encode
but not the packed variant.From
packed.rs
:If I am reading this right, it means that the caller has no control over the number of bits the integer will be encoded as, which doesn't seem ideal as the EVM could be expecting a certain number of bits regardless of the value passed, such as for signature validation.
The text was updated successfully, but these errors were encountered: