cgewecke / eth-gas-reporter

Gas usage per unit test. Average gas usage per method. A mocha reporter.
MIT License
603 stars 94 forks source link

compiler optimization & runs #286

Closed Gr3it closed 2 years ago

Gr3it commented 2 years ago

I can't find anywhere how to change the compiler settings for the test, I want to run the test with optimization enabled and set the run parameter. I'm using it in hardhat and the compiler setting in the config file do nothing.

cgewecke commented 2 years ago

@Gr3it Are you sure you're configuring it correctly? The gas reporter just reads the information from hardhat. Hardhat's compiler config docs are here:

https://hardhat.org/guides/compile-contracts.html#configuring-the-compiler.

Could you give an example of a compiler config which works but isn't being correctly reported in this plugin's output?

Gr3it commented 2 years ago

Yes, my bad. I was using the hardhat tutorial config option that was

solidity: "0.8.11", settings: { optimizer: { enabled: true, runs: 200,

instead of the docs one

solidity: { version: "0.8.11", settings: { optimizer: { enabled: true, runs: 200, },

cgewecke commented 2 years ago

Ok I will close here then.