foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(`tracing`): add flag to hide address when label is available

Open AlbertoCentonze opened this issue 3 years ago • 3 comments

Component

Cast

Describe the feature you would like

Hi, I like the label feature for traces! However, I think it would make things even easier to read if there was a flag to hide labelled addresses and just show their names.

AlbertoCentonze avatar Sep 27 '22 13:09 AlbertoCentonze

Could you please add a screenshot to show where there is an address with a label please ?

iFrostizz avatar Oct 08 '22 21:10 iFrostizz

Hey @iFrostizz, thank you for your answer!

image This is a transaction I was checking with cast run.

As you can see the label example is correctly assigned but the address is still shown in the squared brackets, reducing the readability of the stack trace.

Maybe we a flag to modify the verbosity of labels could be added.

AlbertoCentonze avatar Oct 18 '22 11:10 AlbertoCentonze

Can replicate with: cast run 0xdee0e6eb740093f3e56a74afb75c60930363b043920b3434d5f224a8d95935c1 --rpc-url https://eth.merkle.io --label=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2:weth --label=0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80:jaredfromsubway.eth

Outputs

Traces:
  [77921] jaredfromsubway.eth::7f3d8003{value: 2646466202}(4f803afb1c6864e3ca481ef1362c54d094b9f08327000b3bf0bee2a76174521bfeee90c5df0302b8ace8abe3011163365d35aa389b06)
    ├─ [13384] 0x80034F803afb1C6864E3cA481eF1362c54D094b9::transfer(0x8C6369252e4B54C212471303C3a6E6017be9ad62, 67698197937520640 [6.769e16])
    │   ├─ emit Transfer(param0: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param1: 0x8C6369252e4B54C212471303C3a6E6017be9ad62, param2: 67698197937520640 [6.769e16])
    │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001
    ├─ [31380] 0x8C6369252e4B54C212471303C3a6E6017be9ad62::swap(0, 44400335107653632 [4.44e16], jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], 0x)
    │   ├─ [8862] weth::transfer(jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], 44400335107653632 [4.44e16])
    │   │   ├─ emit Transfer(param0: 0x8C6369252e4B54C212471303C3a6E6017be9ad62, param1: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param2: 44400335107653632 [4.44e16])
    │   │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001
    │   ├─ [661] 0x80034F803afb1C6864E3cA481eF1362c54D094b9::balanceOf(0x8C6369252e4B54C212471303C3a6E6017be9ad62) [staticcall]
    │   │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000016cce4f603873e381
    │   ├─ [534] weth::balanceOf(0x8C6369252e4B54C212471303C3a6E6017be9ad62) [staticcall]
    │   │   └─ ← [Return] 0x000000000000000000000000000000000000000000000000ef5cc7d8170a40da
    │   ├─ emit Sync(: 26287035349690737537 [2.628e19], : 17247880403835568346 [1.724e19])
    │   ├─ emit Swap(param0: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param1: 67698197937520640 [6.769e16], param2: 0, param3: 0, param4: 44400335107653632 [4.44e16], param5: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80])
    │   └─ ← [Stop] 
    ├─ [5932] weth::transferFrom(jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], 0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3, 15105333861023744 [1.51e16])
    │   ├─ emit Transfer(param0: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param1: 0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3, param2: 15105333861023744 [1.51e16])
    │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001
    ├─ [31808] 0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3::swap(0, 19699648568676581376 [1.969e19], jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], 0x)
    │   ├─ [9379] 0xF740Def129e67C7F78Aef4F298375Fbc41DbE966::transfer(jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], 19699648568676581376 [1.969e19])
    │   │   ├─ emit Transfer(param0: 0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3, param1: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param2: 19699648568676581376 [1.969e19])
    │   │   └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000000001
    │   ├─ [534] weth::balanceOf(0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3) [staticcall]
    │   │   └─ ← [Return] 0x00000000000000000000000000000000000000000000000338a260f663d85838
    │   ├─ [572] 0xF740Def129e67C7F78Aef4F298375Fbc41DbE966::balanceOf(0xF0beE2a76174521BfEeE90c5df0302b8aCE8ABE3) [staticcall]
    │   │   └─ ← [Return] 0x0000000000000000000000000000000000000000000010748ac01a9f6544fa24
    │   ├─ emit Sync(: 59421163044833089592 [5.942e19], : 77707684058909295049252 [7.77e22])
    │   ├─ emit Swap(param0: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80], param1: 15105333861023744 [1.51e16], param2: 0, param3: 0, param4: 19699648568676581376 [1.969e19], param5: jaredfromsubway.eth: [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80])
    │   └─ ← [Stop] 
    └─ ← [Stop] 


Transaction successfully executed.
Gas used: 170737

Suggestion is to hide [0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80] behind the label, only the case when it is an address passed as a parameter

zerosnacks avatar Jun 26 '24 14:06 zerosnacks