cgewecke / hardhat-gas-reporter

Gas Usage Analytics for Hardhat
MIT License
406 stars 55 forks source link

Feature Request: Include sum of deployment gas in output #122

Open wattsyart opened 1 year ago

wattsyart commented 1 year ago

I'm routinely "gas golfing" large projects, and one thing I always need to do is dump out the gas report and manually sum it to get a total gas cost for every deployed contract to check if the experiment is reducing overall cost or not.

I can emit to a file and use regex to do this, but it would be nice to include a configuration switch that adds the total deployment gas usage to the output itself.

andreujuanc commented 1 year ago

Indeeed, it would be a great addition!! Have you found a workaround? besides scripting?

wattsyart commented 1 year ago

@andreujuanc No workaround besides custom scripting, unfortunately.

I wrote a hardhat task for my project that:

Code is here: https://github.com/wattsyart/cryptoadz-chained/blob/main/tasks/tasks.js#L171