foundry-rs / foundry-rs/foundry

feat(`debugger`): show generated `yul` when compiled `--via-ir`

Open
#1,252 5 comments 0 reactions 0 assignees View on GitHub
A-debugger C-forge Cmd-forge-build Cmd-forge-debug Cmd-forge-test D-hard P-low T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

I think a good feature to add to the debugger would be to see the optimized yul output if your file was compiled with `--via-ir` option.
This is useful when you want a better view of what the compiler is doing to your code.
My preferred UI would have you able to swap between yul and solidity, like how dapptools' debugger lets you swap between the call trace view and the memory view.
If this is hard to implement then it could be a command line option, and yul would display *instead* of solidity.

### Additional context

Assuming the solidity compiler is consistent, the implementation could follow these steps:

1. Compile solidity `--via ir` which generates a `solidity --> bytecode` sourcemap
2. Compile the generated yul which will output a `yul --> bytecode` sourcemap.

#759 is worth mentioning because yul compilation is required to do those steps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.