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(cheatcodes): improve getStateDiff output and add getStateDiffStruct #9504

Open
grandizzy opened this issue Dec 6, 2024 · 2 comments
Open
Labels
A-cheatcodes Area: cheatcodes T-feature Type: feature T-post-V1 Area: to tackle after V1

Comments

@grandizzy
Copy link
Collaborator

Component

Forge

Describe the feature you would like

follow up of #9435 / #2846
see #9435 (comment)

Tenderly sample
https://api.tenderly.co/api/v1/public-contract/1/trace/0x7abecacd8b1a54db8f0835a5c82edfab96ff922a41d2faa914c339e3e9319b43

  • add Foundry contract name / artifact (along current label)
  • add nonce diffs
  • add sol type / storage labels and decode state diff (by using storage layout)
  • add vm.getStateDiffStruct cheatcode that returns an array of structs to facilitate introspection directly in solidity

Additional context

No response

@sakulstra
Copy link
Contributor

Hey, we just started using this feature and one thing i noticed is that on the returned json there are lots of "empty artifacts".

Not sure if that is by intention or not, but i assume no?

"0x5300a1a15135ea4dc7ad5a167152c01efc9b192a": {
      "label": null,
      "balanceDiff": null,
      "stateDiff": {}
    },

@sakulstra
Copy link
Contributor

Another more severe issue seems to be "wrongly reported storage changes".
When using delegate call (e.g. via an oz proxy), the storage changes will be reported on the address of the implementation although they should be on the proxy calling the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes T-feature Type: feature T-post-V1 Area: to tackle after V1
Projects
Status: Todo
Development

No branches or pull requests

2 participants