fix: encoding issue with ABI parameters #356
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
II’ve corrected an issue with the data being passed to
encodeAbiParameters
. Previously, we were directly passingthis.calls
, but now eachCall
object is mapped to an array of[to, value, data]
, which aligns with thetuple[]
format expected by the ABI.Additionally, I’ve ensured that the
value
is properly converted to a string before encoding, as the ABI encoder expects a string representation for numbers likeuint256
.This should resolve any issues related to the encoding of ABI parameters and improve compatibility with the expected format.
(Optional) Feedback Focus
Reasons why I am confident in the fixes:
Encoding of the Call[] array: The ABI encoder expects an array of tuples for
tuple[]
. We need to ensure that each element is an array of three values (in your case:to
,value
, anddata
).Converting bigint to string: Typically, ABI expects a string representation for numeric values of type
uint256
. Convertingvalue
to a string ensures that it will be correctly encoded.