Events that take structs have malformed ABI JSON #2483
Labels
bug
Bug that shouldn't change language semantics when fixed.
Easy Pickings
Used to denote issues that should be easy to implement
help wanted
Version Information
vyper --version
): 0.3.0+commit.8a23febpython --version
): Python 3.8.10What's your issue about?
If you declare an event that takes a struct, the ABI JSON for it will be malformed. Note that unlike the previous encoding bug, this bug is not specific to the case where the input is just a single struct alone; all structs used as event arguments appear to exhibit this bug. Because of this, decoding libraries will fail to decode such events.
As an example, suppose I write a contract with the following declarations:
The ABI JSON I get for this event is:
As you can see, this ABI item is malformed. The first input, rather than having type
"tuple"
and an appropriatecomponents
field, instead has the malformed type"(uint256,uint256)"
. Decoding libraries are unable to handle this.This bug does not apply to function inputs, function outputs, or constructor inputs; those have proper ABI JSON.
How can it be fixed?
Given that structs are handled properly in the ABI JSON for functions and constructors, both on input and on output, whatever code you use for handling those can presumably be applied to event inputs as well.
The text was updated successfully, but these errors were encountered: