cgewecke / hardhat-gas-reporter

Gas Usage Analytics for Hardhat
MIT License
404 stars 55 forks source link

Report gas usage, balances and cost outcomes for `TASK_RUN` #195

Open cgewecke opened 4 months ago

cgewecke commented 4 months ago

It would be really useful to be able to quickly configure and see the complete cost outcome of a script - gas usage per operation plus national currency value of all native and token balance changes.

Was planned for the initial release of V2 but it has some complexity and will defer for a subsequent minor bump...

A common use case will be to install third-party contracts as dependencies and simulate their use. In principle there might not be any top-level artifacts to query for contract info.

We should get as much info as possible from Etherscan...

Options might look something like:

gasReporter: {
  ...
  ...
  etherscan: <apikey>
  remoteContracts: RemoteContracts[],
  scripts: {
    enabled: boolean,
    accounts: UserAddress[],
    tokens: TokenAddress[] | TokenSymbolNames[],
    interfaces?: DependencyPaths[] | (abis fetched from Etherscan via resolver)
  }
}