G7DAO / seer

Apache License 2.0
8 stars 5 forks source link

"seer evm generate" does not properly handle nested byte arrays #8

Closed zomglings closed 3 months ago

zomglings commented 9 months ago

Currently, if a method argument or return type is a struct which contains a field that is a byte array (of arbitrary depth), then the code generated by seer evm generate does not properly handle that field.

This is a somewhat deep issue caused by the behavior of encoding/json.

There are a few solutions that come to mind:

  1. Extend the way that seer evm generate handles method arguments which are themselves byte arrays.
  2. Write a drop-in replacement for encoding/json which represents []byte as string when marshaling (and vice versa when unmarshaling).
zomglings commented 9 months ago

You can test this out using the DiamondCutFacet fixture. It may be better to actually use the DiamondLoupeFacet.