foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(`forge create / cast send`): add `--gas-estimate-multiplier` flag

Open mattsse opened this issue 3 years ago • 4 comments

Component

Forge

Describe the feature you would like

For certain networks, gas(price) may be incorrectly estimated, resulting in transactions that are underpriced:

https://github.com/foundry-rs/foundry/issues/1703

in forge create we use the default Provider::{estimate_gas,get_gas_price} functions to fill the transactions, if they're not provided via cli arguments

it would be useful to scale these estimates percentage-wise, perhaps --scale-gas-limit 20 to use a 1.2 multiplier for the gas limit.

Additional context

No response

mattsse avatar Jun 01 '22 13:06 mattsse

I'd like to take a stab at this, will update with pr soon

shawnharmsen avatar Jun 06 '22 10:06 shawnharmsen

awesome! keep 'em coming!

mattsse avatar Jun 06 '22 11:06 mattsse

Note for future reference: forge script implements this functionality under the --gas-estimate-multiplier flag, the goal of the ticket would be to implement this for cast send and forge create.

zerosnacks avatar Aug 01 '24 13:08 zerosnacks

Is it okay if I tackle this?

wengDavo avatar Jan 30 '25 09:01 wengDavo