Ethers.js: Bug: Events with arrays as indexed arguments.

Created on 19 Nov 2017  路  3Comments  路  Source: ethers-io/ethers.js

It appears that event parse functions created under Interface.events.SomeEvent() attempt to decode indexed array parameters as their original types.

This is incorrect since the actual event behaviour is to store the keccak256 hash of the array as the topic: http://solidity.readthedocs.io/en/develop/contracts.html#events

This problem leads parse() to attempt to decode bytes32 data as whatever original type it was hashed from. In particular, things crash and burn with indexed dynamic arrays (string, bytes, etc.) when dynamicOffset.value.toNumber() gets called:

Error: Number can only safely store up to 53 bits
bug fixed

All 3 comments

Thanks for the link @GFJHogue!

I'm going to get a bunch of procedural generated test cases ready this week, so I can make sure all the event API features are working correctly.

Fixed in https://github.com/ethers-io/ethers.js/commit/0d106d01af581f31ff77235bccde437dd1c793ea.

Once Travis-CI finishes, I will publish to npm.

Please give it a try, and let me know if there are any more problems. :)

Was this page helpful?
0 / 5 - 0 ratings