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(cast): add trace and debug on local contracts #8581

Open
zerosnacks opened this issue Aug 1, 2024 · 0 comments · May be fixed by #7359
Open

feat(cast): add trace and debug on local contracts #8581

zerosnacks opened this issue Aug 1, 2024 · 0 comments · May be fixed by #7359
Labels
C-cast Command: cast T-feature Type: feature T-post-V1 Area: to tackle after V1 T-to-discuss Type: requires discussion

Comments

@zerosnacks
Copy link
Member

zerosnacks commented Aug 1, 2024

Component

Cast

Describe the feature you would like

From #6887

Using cast run and cast call to trace and debug can currently only fetch abi and source from explorers such as etherscan. In situations where no explorer is available, it would be intuitive to use the abi and source provided by the local files.

Proposed solution:

As with forge debug - using local files is preferred over fetching data from remote explorer. Only if etherscan_api_key is defined, will we fetch abi and source from the explorer.
Without explorer it should now compile solidity files and fetch contract bytecode from build output. To identify contract addresses it should fetch on-chain bytecode via RPC call. Most of the required code change likely happens in handle_traces, where the decoder and debugger is fed with the required data fetched from local files (and RPC).

Points of attention:

  • Debugging on inherited contracts does not resolve to the respective source code.
  • Can we use existing build artifacts instead of running the builder each time? This also solves the problem where the building source requires additional parameters.

Additional context

Previously implemented in #6887, contributor is recommended to use that as a reference or build on top

@zerosnacks zerosnacks added T-feature Type: feature C-cast Command: cast labels Aug 1, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Aug 1, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 1, 2024
@grandizzy grandizzy added the T-to-discuss Type: requires discussion label Oct 1, 2024
@grandizzy grandizzy added the T-post-V1 Area: to tackle after V1 label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-feature Type: feature T-post-V1 Area: to tackle after V1 T-to-discuss Type: requires discussion
Projects
Status: Todo
2 participants