1

I am using Erigon. I am using pendent transactions of swap in goerli, this is an output from trace_call (stateDiff):

{
  "output": "0x",
  "stateDiff": {
    "0x07865c6e87b9f70255377e024ace6630c1eaa37f": {
      "balance": "=",
      "code": "=",
      "nonce": "=",
      "storage": {
        "0x03e5bce0671ceb85a9355530f54e34b1e23f58e03b8a4bb2dac84399d45da206": {
          "*": {
            "from": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "to": "0x0000000000000000000000000000000000000000000000000000000003107bda"
          }
        },
        "0xfb16c5559f3de6ff269cf27b0716d0aae93e66f8a2b0c58671322b7b60443200": {
          "*": {
            "from": "0x000000000000000000000000000000000000000000000000000000029bd018e6",
            "to": "0x0000000000000000000000000000000000000000000000000000000298bf9d0c"
          }
        }
      }
    },...

it is clear that 0x07865c6e87b9f70255377e024ace6630c1eaa37f is the address of USDC token. In the "storage" field, i suppose, are the changes in balances of the trader wallet (0x9a5b87993c80eead6260438149b43eec081483ae) and the pool contract (0xfae941346ac34908b8d7d000f86056a18049146e).

How to decode the values "0x03e5bce0671ceb85a9355530f54e34b1e23f58e03b8a4bb2dac84399d45da206" and "0xfb16c5559f3de6ff269cf27b0716d0aae93e66f8a2b0c58671322b7b60443200", which are fields of "storage"?

OBS: The ABI is publicly available in https://goerli.etherscan.io/address/0x07865c6e87b9f70255377e024ace6630c1eaa37f#code.

Rafael
  • 348
  • 2
  • 10

1 Answers1

1

0x03e5bce0671ceb85a9355530f54e34b1e23f58e03b8a4bb2dac84399d45da206 and 0xfb16c5559f3de6ff269cf27b0716d0aae93e66f8a2b0c58671322b7b60443200 should be the storage slots on the smart contract where the data has been modified so

        "0x03e5bce0671ceb85a9355530f54e34b1e23f58e03b8a4bb2dac84399d45da206": {
          "*": {
            "from": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "to": "0x0000000000000000000000000000000000000000000000000000000003107bda"
          }
        },

would mean that at the storage location 0x03e5bce0671ceb85a9355530f54e34b1e23f58e03b8a4bb2dac84399d45da206 the value has been changed from 0x0000000000000000000000000000000000000000000000000000000000000000 to 0x0000000000000000000000000000000000000000000000000000000003107bda.

That along with the next storage location change (0xfb16c5559f3de6ff269cf27b0716d0aae93e66f8a2b0c58671322b7b60443200) result in the state change of 0x07865c6e87b9f70255377e024ace6630c1eaa37f.

They are hex values and you can write programs in solidity or js that read out the value of a particular storage slot in a contract at a given transaction.

shankar
  • 109
  • 3