Socket
Socket
Sign inDemoInstall

@latticexyz/gas-report

Package Overview
Dependencies
Maintainers
0
Versions
1016
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@latticexyz/gas-report

Gas reporter for specific lines within forge tests


Version published
Weekly downloads
3K
decreased by-10.27%
Maintainers
0
Weekly downloads
 
Created
Source

Gas Report

Measure and report gas usage within forge tests

Add some reports to your forge tests

import { Test } from "forge-std/Test.sol";
import { GasReporter } from "@latticexyz/gas-report/src/GasReporter.sol";

contract ExampleTest is Test, GasReporter {
  function testGas() public {
    startGasReport("description of behavior to measure gas for");
    // do something here
    endGasReport();
  }
}

Then use the cli command to run tests and save the report:

pnpm gas-report --save gas-report.json

Or, if you have your own test command, you can pipe the output to gas-report --stdin:

GAS_REPORTER_ENABLED=true forge test -vvv --isolate | pnpm gas-report --stdin

Run pnpm gas-report --help for more details.

FAQs

Package last updated on 15 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc