Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gas inspection plugin #1936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sparrowDom
Copy link
Member

To measure the gas usage of any transaction wrap it into GetGas globally defined function. Example:

	const gas = await GetGas(await cEvilContract.connect(daniel).approveAllTokens());
	console.log('Gas used: ' + gas);

example output:
Screenshot 2023-11-20 at 00 22 16

@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-sparrowdom-rzwmgx November 19, 2023 23:22 Inactive
Copy link

codecov bot commented Nov 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (66fe62b) 67.67% compared to head (40870f1) 64.86%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1936      +/-   ##
==========================================
- Coverage   67.67%   64.86%   -2.81%     
==========================================
  Files          52       52              
  Lines        2741     2741              
  Branches      708      708              
==========================================
- Hits         1855     1778      -77     
- Misses        883      960      +77     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -12,6 +12,7 @@ require("hardhat-deploy-ethers");
require("hardhat-gas-reporter");
require("solidity-coverage");
require("@openzeppelin/hardhat-upgrades");
require("hardhat-gas-trackooor");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this plugin hasn't been updated in about 18 months. The GitHub repo has no activity either. Would be better if we can use something that's being actively maintained

@naddison36
Copy link
Collaborator

How is this better than hardhat-gas-reporter which can be enabled with
export REPORT_GAS=true

Example output from running the OETH Oracle Router fork tests

·----------------------------------------------------|---------------------------|-------------|-----------------------------·
|                Solc version: 0.8.7                 ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 30000000 gas  │
·····················································|···························|·············|······························
|  Methods                                                                                                                   │
································|····················|·············|·············|·············|·············|················
|  Contract                     ·  Method            ·  Min        ·  Max        ·  Avg        ·  # calls    ·  eur (avg)    │
································|····················|·············|·············|·············|·············|················
|  MockOETHOracleRouterNoStale  ·  price             ·      22044  ·      41364  ·      34511  ·          4  ·            -  │
································|····················|·············|·············|·············|·············|················
|  OETHOracle                   ·  latestRoundData   ·          -  ·          -  ·      28373  ·          1  ·            -  │
································|····················|·············|·············|·············|·············|················
|  OETHOracle                   ·  setOracleUpdater  ·          -  ·          -  ·      30157  ·          2  ·            -  │
································|····················|·············|·············|·············|·············|················
|  OETHOracleUpdater            ·  addPrice          ·      77520  ·      89434  ·      87051  ·          5  ·            -  │
·-------------------------------|--------------------|-------------|-------------|-------------|-------------|---------------·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants