graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Codegen for fixed size array solidity parameters incorrect

Open adamgobes opened this issue 4 years ago • 0 comments

Hey all! So I am trying to make a contract call to a solidity method in the Wyvern OpenSea exchange contract. I've linked a gist explaining where I think the codegen is incorrect, but the TLDR is:

  1. For inputs with fixed sized arrays, graph-ts seems to use the wrong ethereum.Value converters when passing in the variables to ethereum.call.
  2. The inputs use the fromArray converter, when I think they should be using the fromFixedSizeArray converter
  3. Additionally, there is a small bug I think where uint8 arrays get converted to i32 values, where they should be getting converted to UnsignedBigInt

Here is the gist, with the solidity method, resulting codegen, and comments describing where I think should be different: https://gist.github.com/adamgobes/6ef7ae141797dc3b789eafab728291c7

FWIW, I manually changed my codegen to what I describe in the comments, and it seems to work (no failures on deploy to studio). However, with the default codegen, i get type mismatches between dynamic arrays and fixed size arrays.

adamgobes avatar Dec 08 '21 16:12 adamgobes