2

This is with:

  • graph-cli v0.34.0
  • graph-ts v0.28.0

I'm trying to decode a function call in my subgraph mapping but it's not working. There is a tuple in the function input that seems to be causing the problem.

So I tried to debug at the command line making sure to prepend for tuples (taken from here). So I tried to debug at the command line using ethabi (example transaction here) with the following:

ethabi decode params -t (address,uint256,uint256,address,address,address,uint256,uint256,uint8,uint256,uint256,bytes32,uint256,bytes32,bytes32,uint256,(uint256,address)[],bytes) 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000192e0b2fd8780000000000000000000000000004384eba91639843cf493361c9d45801654467140000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c00000000000000000000000000ea936a19cbeb645f11b8287249989ea5965d1f52000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062a8dff80000000000000000000000000000000000000000000000000000000062d06cf800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075a9ffbf715f2f0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000b30e8870ae0000000000000000000000000005b3256965e7c3cf26e11fcaf296dfc8807c01073000000000000000000000000000000000000000000000000002192b99520a0000000000000000000000000004384eba91639843cf493361c9d458016544671400000000000000000000000000000000000000000000000000000000000000041ac65054bb4c6e4597bedb543f3eaef24a962df8a42226ba8f8e2742c403f633645aacd4127a8b41e5b9d8009ee5e1eaa13666e762f0946c5d99f205f22d417b11b00000000000000000000000000000000000000000000000000000000000000

This produces

no matches found: (address,uint256,uint256,address,address,address,uint256,uint256,uint8,uint256,uint256,bytes32,uint256,bytes32,bytes32,uint256,(uint256,address)[],bytes)

So I tried breaking the typestring down to individual parameters like this:

ethabi decode params -t address -t uint256 -t uint256 -t address -t address -t address -t uint256 -t uint256 -t uint8 -t uint256 -t uint256 -t bytes32 -t uint256 -t bytes32 -t bytes32 -t uint256 -t (uint256,address)[] -t bytes 0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000192e0b2fd8780000000000000000000000000004384eba91639843cf493361c9d45801654467140000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c00000000000000000000000000ea936a19cbeb645f11b8287249989ea5965d1f52000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062a8dff80000000000000000000000000000000000000000000000000000000062d06cf800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075a9ffbf715f2f0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000b30e8870ae0000000000000000000000000005b3256965e7c3cf26e11fcaf296dfc8807c01073000000000000000000000000000000000000000000000000002192b99520a0000000000000000000000000004384eba91639843cf493361c9d458016544671400000000000000000000000000000000000000000000000000000000000000041ac65054bb4c6e4597bedb543f3eaef24a962df8a42226ba8f8e2742c403f633645aacd4127a8b41e5b9d8009ee5e1eaa13666e762f0946c5d99f205f22d417b11b00000000000000000000000000000000000000000000000000000000000000

This was a bit more promising as it tells me no matches found: (uint256,address)[] so that tuple is causing my problems. Is it possible to create a type string for ethereum.decode that contains tuples? If not is there a work around to so I can map this function call? I know I can map calls directly but that's not recommended as it is VERY slow to index.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.