foundry-rs / foundry-rs/foundry
feat(forge/cheatcodes): "server" feature flag to disable sys env var reads
- 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
Tracked by #9012
In order to safely run tests on untrusted contracts in the server setting, currently users *must* fork to disable system env reads.
I propose adding a feature flag to the forge library crate and the cheatcodes crate to use a provided `Hashmap` as an "injected environment".
I think this should be set on the `MultiContractRunnerBuilder` and then passed to the cheat codes config
### Additional context
_No response_
Contributor guide
Research direction
Start by tracing the forge library crate's MultiContractRunnerBuilder into the cheatcodes crate configuration. Define how the server feature flag supplies a Hashmap as the injected environment, and verify that untrusted-contract tests can run without reading system environment variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100