We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.encodePacked
The implementation of abi.encodePacked for Uint's that are not U256 (ex. U64, U32) is incorrect.
Specifically into_token within encode_packed does not encode the parameters correctly.
into_token
encode_packed
Ex. For abi.encodePacked(uint64, uint32), this is the expected output:
uint64 authoritySetId = 4; uint32 trustedBlock = 10; bytes memory encodedBytes = abi.encodePacked(authoritySetId,trustedBlock); console.logBytes(encodedBytes); Output: 0x00000000000000040000000a
However, when invoking the same with ethers-rs, this is the output:
ethers-rs
let authority_set_id: u64 = 4; let trusted_block_number: u32 = 10; let input = encode_packed(&[ authority_set_id.into_token(), trusted_block_number.into_token(), ]).expect("Failed to encode packed data."); println!("input {:?}", hex::encode(input)); Output: 0x040a
The reason this is the case is that ethabi is the library that ethers-rs uses for encodePacked, and its implementation is deprecated.
ethabi
encodePacked
Can we move ethers-rs ABI encoding to alloy-rs, which does abi.encodePacked here?
Beyond abi.encodePacked, alloy-rs should be substituted for ethabi as the latter is not actively maintained.
@rellfy Raised a similar issue here: #2494
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The implementation of
abi.encodePacked
for Uint's that are not U256 (ex. U64, U32) is incorrect.Specifically
into_token
withinencode_packed
does not encode the parameters correctly.Ex.
For abi.encodePacked(uint64, uint32), this is the expected output:
However, when invoking the same with
ethers-rs
, this is the output:The reason this is the case is that
ethabi
is the library thatethers-rs
uses forencodePacked
, and its implementation is deprecated.Can we move ethers-rs ABI encoding to alloy-rs, which does
abi.encodePacked
here?Beyond
abi.encodePacked
, alloy-rs should be substituted for ethabi as the latter is not actively maintained.@rellfy Raised a similar issue here: #2494
The text was updated successfully, but these errors were encountered: