Small utility for tracking gas costs of functions over time
MIT License
A simple utility for tracking gas costs of your Solidity contracts.
npm install gastracker --save-dev
const { createProxyContract, storeResults } = require('gastracker')
beforeEach(async () => {
this.token = createProxyContract(await SimpleToken.new(), 'SimpleToken')
})
after(() => {
if (process.env.STORE_GAS_RESULTS === 'true') storeResults('./data.json')
})
$ printGasHistory --help
Usage: printGasHistory [options]
Options:
-V, --version output the version number
-f, --file-name <fileName> data file with stored gas results
-c, --contract-name <contractName> the name of the target contract
-n, --function-name <functionName> the name of the target function
-s, --stats-name <statsName> the statistic name (mean, median, min, max)
-h, --help output usage information
$ printGasHistory -f data.json -c SimpleToken -n transferTest -s mean
Create a proxy for the target contract and store information under given reference name. Can be used in beforeEach
hook.
Append results of the tracking to given file name. Can be used in after
hook.
Receive the current results from the tracking of all proxy contracts.
Please feel free to create PR's or issues.
This project is licensed under the MIT License - see the LICENSE.md file for details