foundry-rs / foundry-rs/foundry
Generate creation code
- 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
Sometimes it's necessary to get a creation code that can be passed into `CREATE` opcode. E.g. Solmate's CREATE3 library requires that. As another example I'm trying to write a generic deployment tool and it too needs to work with creation code, it turns out that there's no way around it. I'm not sure about contract-based wallets, e.g. Safe, they may benefit from that too when used for deployments.
A workaround is to extract `bytecode` from `forge inspect bytecode` and append the ABI-encoded constructor arguments. As a cherry on top one could take a look at the `"type": "constructor"` entry in the ABI file to verify the arguments. It's not trivial and would be much more convenient if `foundry` could do that. E.g. with a new command `forge create-code` similar to `forge create` or by adding a special flag to the latter.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.