feat(cast): add trace and debug on local contracts #8581
Labels
C-cast
Command: cast
T-feature
Type: feature
T-post-V1
Area: to tackle after V1
T-to-discuss
Type: requires discussion
Component
Cast
Describe the feature you would like
From #6887
Using
cast run
andcast 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 ifetherscan_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:
Additional context
Previously implemented in #6887, contributor is recommended to use that as a reference or build on top
The text was updated successfully, but these errors were encountered: