Skip to content

Conversation

@DeVikingMark
Copy link
Contributor

Motivation

The decode_traces method had a TODO to restore known_contracts support. Without it, chisel only uses external sources for trace decoding, resulting in lower quality traces compared to other Foundry tools. Local contracts written in the REPL cannot be properly identified in traces.

Solution

Restored known_contracts support by:

  • Adding ContractsByArtifact parameter to decode_traces
  • Extracting compiled artifacts from SessionSource and creating ContractsByArtifact
  • Using with_known_contracts() and with_local() to improve decoder and identifier

This matches the pattern used in cast and forge for consistency.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix format, clippy and the tests, thanks

@DeVikingMark DeVikingMark requested a review from onbjerg January 12, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants