foundry-rs / foundry-rs/foundry
feat(`forge script`): accept precompiled artifacts (without sources) as input source
- 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:**
At OP Labs, we use a tool called OP Deployer which functions as an "installer" for our smart contracts. Users configure their chain using a TOML file, then OP Deployer executes Forge scripts to perform the actual deployment. OP Deployer does not execute the scripts using the Forge binary, however. Instead, we reimplemented Forge's scripting engine and cheatcodes in Go. This setup is difficult to maintain, and Forge does what our custom scripting engine does but better. We'd like to move away from this custom scripting engine towards using Forge directly.
**Feature Request**
Forge currently assumes that it runs inside of a project. It always tries to build sources first. We would like to use forge in a "headless" configuration, where we give it a set of precompiled artifacts _without_ sources, and call `forge script` against those artifacts. This would let us distribute precompiled artifacts to our users without worrying about recompilation.
Perhaps some kind of `--headless --artifacts-directory` set of flags would work here?
### Additional context
I'd be happy to have people from my team at Labs contribute here if there's alignment on the best way to approach this.
Contributor guide
Research direction
Start with the `forge script` command entry point and its current project and build-discovery flow. Review how precompiled artifacts are represented and loaded, then define the headless and `--artifacts-directory` behavior and verify that scripts can run from artifacts without source files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, solidity
- Domain
- blockchain, cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100