foundry-rs / foundry-rs/foundry

Foundry debugger modify value during execution

Open
#9,409 4 comments 0 reactions 1 assignee Claimed by @publicqi View on GitHub
A-debugger T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
16h 38m
Merged PRs (30d)
511

Description

### Component

Forge

### Describe the feature you would like

## Background

I am working on some small new features on forge debugger. I added a new "control" pane to display misc infos. There's a section called "Command", and I want the user be able to interact with the debugger. For example, it will now show input buffer (i.e. number + action)
![telegram-cloud-photo-size-5-6204038009934954246-y](https://github.com/user-attachments/assets/df720d1b-6475-4976-bce0-3579ac04df2f)

## New feature discussion

Currently forge debugger executes a transaction and collect all execution steps and display them. It lacks dynamic modifying values.

Although this requires a big refactor, it will be easier for debugging for special needs. One can simulate different scenarios and edge cases without altering the source code or redeploying contracts or re-execute with different params.

For refactoring, I think we have two paths to go. One is to change the debugger to a step-wise style, which does not execute the transaction at once. The other is to use an inspector containing an (address, pc, modification) tuple, and when a modification command is input, the transaction will be re-executed.

### Additional context

_No response_

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.