Skip to content

Commit

Permalink
gas-report readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dk1a committed Jul 11, 2023
1 parent 398e6c0 commit 2e701f7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/gas-report/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# Gas Report

Gas reporter for specific lines within forge tests

Add some reports to your forge tests

```solidity
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("Describe what is being gas-reported on");
// do something here
endGasReport();
}
}
```

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

```console
pnpm mud-gas-report --save gas-report.json
```

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

0 comments on commit 2e701f7

Please sign in to comment.