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.
Breaking change
abi.encodeParameter
will return complete encoding including the dynamic prefix. Compared with the old version, the result will be the same as abi.encodeParameters with one parameter.Similarly,
abi.decodeParameter
will accept the decoding data including the dynamic prefix.This only affects on dynamic types. e.g. dynamic array(uint256[], bytes32[], address[], tokenId[]… etc.), string and bytes.
<M>
, e.g.int<M>
/uint<M>
/bytes<M>
, decoding of such types will strictly follow the type length, the extra-long data will be cut off.Example:
Decoding ‘fffffffffffff38dd0f10627f5529bdb2c52d4846810af0ac000000000000001’ to int8 will result in 1.
utils.isHexString
will return false for non-string input such as integers.
Example:
isHexString(1) will result in false.
abi.decodeLog
will not be used to decode function data. As the name indicates, it should only decode event logs.New feature
New function export
New module export
Known issue
When calling abi.encodeLogFilter, using arrays (esp. dynamic arrays) as indexed topic may cause different encoding results at the moment. You should avoid using arrays as indexed event parameter in your contract. If an array must be used, use static array.
See test/package/abi.js for more specific usage and examples.
re #77