foundry-rs / foundry-rs/foundry
feat(`forge script`): add `--gas-buffer` flag to support fixed overhead for Cosmos-integrated EVM chains
- 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
Hi team 👋
I’d like to propose adding a `--gas-buffer` flag to `forge script` to support cases where a fixed amount of gas needs to be added on top of the estimated gas limit.
This is particularly useful for Cosmos-integrated EVM chains (e.g. Evmos, Canto, Cronos, Initia's Minievm etc.), where there’s often a **fixed gas overhead** (e.g. 10,000~30,000 gas) added by the Cosmos layer that isn’t visible to EVM-based gas estimation.
Even with a high `--gas-estimate-multiplier`, transactions can still fail if the base EVM gas usage is low — because the final gas limit doesn't account for the Cosmos-side fixed fee.
### Suggested flag:
```bash
--gas-buffer
```
### Behavior:
```
finalGas = estimatedGas * multiplier + gasBuffer
```
### Benefits:
- Makes Foundry more robust for Cosmos-EVM chains
- Prevents under-gas failures due to fixed gas layers outside the EVM
- Keeps the scripting workflow clean without needing external estimation logic
Thanks for all your work on Foundry — happy to help test or contribute if this feature moves forward!
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.