Skip to content

ethereum.decode does not decode Gnosis Multisig Transactions #5432

Description

@hepnerthomas

Which packages are impacted by your issue?

@graphprotocol/graph-cli, @graphprotocol/graph-ts

Describe the issue

ethereum.decode does not decode the execTransaction function from Gnosis multisig.

ethereum.decode uses ethabi which does not decode execTransaction from Gnosis Multisig.

Reproduction

www.creditcoop.xyz (connected to Sepolia)

Steps to Reproduce the Bug or Issue

Example Transaction: https://sepolia.etherscan.io/tx/0xc0aab967e6f87fed78b6215f7ff02e2b661903f324a115ebc062b9308754002c

Transaction Input:

0x6a761202000000000000000000000000d4f6d393a8299c3b80e03491e2b9cb03c00bdda900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a4cb83620900000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000001bf220b4e6e5eca30d90a12ea369a68633c0065a0000000000000000000000009d6a88aec1b6894df4bcc08e28f6378cb06ad0a70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000001a171a91b4aa1a669e2397d6670746ddcdd4fbbe00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000

execTransaction abi: (address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)

ethabi Code:

ethabi decode params -t '(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)' 000000000000000000000000d4f6d393a8299c3b80e03491e2b9cb03c00bdda900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a4cb83620900000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000001bf220b4e6e5eca30d90a12ea369a68633c0065a0000000000000000000000009d6a88aec1b6894df4bcc08e28f6378cb06ad0a70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000001a171a91b4aa1a669e2397d6670746ddcdd4fbbe00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000

Subgraph Code:

const EXEC_TRANSACTION_ABI = '(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)';
const transactionInput = '000000000000000000000000d4f6d393a8299c3b80e03491e2b9cb03c00bdda900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a4cb83620900000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000001bf220b4e6e5eca30d90a12ea369a68633c0065a0000000000000000000000009d6a88aec1b6894df4bcc08e28f6378cb06ad0a70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000001a171a91b4aa1a669e2397d6670746ddcdd4fbbe00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000';

const decodedData = ethereum.decode(EXEC_TRANSACTION_ABI, transactionInput.toHexString());
// decodedData is null

Error:
Error: Invalid data

Expected behavior

ethereum.decode and ethabi decode ... should produce the same decoded output as the Python Web3 utility.

Code:

ethabi decode params -t '(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)' 000000000000000000000000d4f6d393a8299c3b80e03491e2b9cb03c00bdda900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a4cb83620900000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000001bf220b4e6e5eca30d90a12ea369a68633c0065a0000000000000000000000009d6a88aec1b6894df4bcc08e28f6378cb06ad0a70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000001a171a91b4aa1a669e2397d6670746ddcdd4fbbe00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000

Output:

address 0xD4f6d393A8299c3B80E03491e2B9CB03C00bdda9 
uint256 0 
bytes cb83620900000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000002bc000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000001bf220b4e6e5eca30d90a12ea369a68633c0065a0000000000000000000000009d6a88aec1b6894df4bcc08e28f6378cb06ad0a7 
uint8 0
uint256 0
uint256 0
uint256 0
address 0x0000000000000000000000000000000000000000
address 0x0000000000000000000000000000000000000000
bytes 0000000000000000000000001a171a91b4aa1a669e2397d6670746ddcdd4fbbe000000000000000000000000000000000000000000000000000000000000000001

Screenshots or Videos

No response

Platform

  • OS: Linux
  • NodeJS: v16.20.2
  • @graphprotocol/graph-cli* version(s): 0.49.0
  • @graphprotocol/graph-ts version(s): 0.30.0

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

I was able to decode the Sepolia transaction following the steps in this safe-core StackExchange response.

I was unable to decode the transaction using either ethereum.decode in my subgraph or ethabi decode locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions