Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use explorer to fetch abis for more readable debugging logs #467

Open
dutterbutter opened this issue Dec 3, 2024 · 0 comments
Open
Labels
feature ➕ Feature item

Comments

@dutterbutter
Copy link
Collaborator

dutterbutter commented Dec 3, 2024

🌟 Feature Request

📝 Description

Similar to foundry tracers, we should fetch the abis of contracts, decode the abis and present devs with a more human readable trace for debugging / errors. This is most applicable for replay_tx given it will be a tx on sepolia or mainnet being replayed.

🤔 Rationale

The more human readable, the more efficient debugging.

🖼️ Mockups/Examples

You can review cast run from foundry. Example output:

Executing previous transactions from the block.
Traces:
  [86689] 0x99B1817acb40E76C309e26B2Face9da9EFf55317::5a7b05e8(0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008800000000000000000000000000000000000000000000000010f17f7cc6c7d68000000000000000000000000000000000000000000000327ff664d29242a3d033800000000000000000000000e331de28cd81b768c19a366b0e4e4675c45ec2dadfc33cfe4438e623d46d4a06272dc677838bf94e00000000000000000093c16a28a863ba6a4086c5000000000000000000000000000000000000000000000000)
    ├─ [2696] 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA::slot0() [staticcall]
    │   └─ ← [Return] 0x00000000000000000000000000000000000000000093c16a28a863ba6a4086c5fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe23d10000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
    ├─ [76383] 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA::swap(0xDfC33cfe4438e623D46d4a06272Dc677838bf94E, false, 1220897147881772672 [1.22e18], 1461446703485210103287273052203988822378723970341 [1.461e48], 0x000000000000000000000000ab95799727dfe3431bf4b52d2bafc6f8a6fac2c3)
    │   ├─ [13999] 0x55296f69f40Ea6d20E478533C15A6B08B654E758::transfer(0xDfC33cfe4438e623D46d4a06272Dc677838bf94E, 238481200000000000167989 [2.384e23])
    │   │   ├─ emit Transfer(src: 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA, dst: 0xDfC33cfe4438e623D46d4a06272Dc677838bf94E, wad: 238481200000000000167989 [2.384e23])
    │   │   └─ ← [Stop]
    │   ├─ [2534] WETH9::balanceOf(0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA) [staticcall]
    │   │   └─ ← [Return] 275690035847047211982 [2.756e20]
    │   ├─ [15651] 0x99B1817acb40E76C309e26B2Face9da9EFf55317::uniswapV3SwapCallback(-238481200000000000167989 [-2.384e23], 1220897147881772672 [1.22e18], 0x000000000000000000000000ab95799727dfe3431bf4b52d2bafc6f8a6fac2c3)
    │   │   ├─ [266] 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA::token0() [staticcall]
    │   │   │   └─ ← [Return] 0x00000000000000000000000055296f69f40ea6d20e478533c15a6b08b654e758
    │   │   ├─ [308] 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA::token1() [staticcall]
    │   │   │   └─ ← [Return] 0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
    │   │   ├─ [251] 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA::fee() [staticcall]
    │   │   │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000bb8
    │   │   ├─ [13025] WETH9::transferFrom(0xAb95799727DFe3431BF4B52D2Bafc6F8a6fAC2C3, 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA, 1220897147881772672 [1.22e18])
    │   │   │   ├─ emit Transfer(src: 0xAb95799727DFe3431BF4B52D2Bafc6F8a6fAC2C3, dst: 0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA, wad: 1220897147881772672 [1.22e18])
    │   │   │   └─ ← [Return] true
    │   │   └─ ← [Stop]
    │   ├─ [534] WETH9::balanceOf(0xE331DE28cd81B768C19A366b0e4e4675c45eC2dA) [staticcall]
    │   │   └─ ← [Return] 276910932994928984654 [2.769e20]
    │   ├─ emit Swap(param0: 0x99B1817acb40E76C309e26B2Face9da9EFf55317, param1: 0xDfC33cfe4438e623D46d4a06272Dc677838bf94E, param2: -238481200000000000167989 [-2.384e23], param3: 1220897147881772672 [1.22e18], param4: 179364243816031445391199306 [1.793e26], param5: 130539702943625079783855 [1.305e23], param6: -121820 [-1.218e5])
    │   └─ ← [Return] 0xffffffffffffffffffffffffffffffffffffffffffffcd7fe8829f8cc9456fcb00000000000000000000000000000000000000000000000010f17f7cc6c7d680
    └─ ← [Return] 0x000000000000000000000000000000000000000000003280177d607336ba9035


Transaction successfully executed.
Gas used: 109513

📋 Additional Context

@dutterbutter dutterbutter added the feature ➕ Feature item label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ Feature item
Projects
None yet
Development

No branches or pull requests

1 participant