JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 46690
  • Score
    100M100P100Q164562F
  • License MIT

Output Solidity contract sizes with Hardhat

Package Exports

  • hardhat-contract-sizer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hardhat-contract-sizer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hardhat Contract Sizer

Output Solidity contract sizes with Hardhat.

Versions of this plugin prior to 2.0.0 were released as buidler-contract-sizer.

Installation

yarn add --dev hardhat-contract-sizer

Usage

Load plugin in Hardhat config:

require('hardhat-contract-sizer');

Add configuration under the contractSizer key:

option description default
alphaSort whether to sort results table alphabetically (default sort is by contract size) false
runOnCompile whether to output contract sizes automatically after compilation false
disambiguatePaths whether to output the full path to the compilation artifact (relative to the Hardhat root directory) false
contractSizer: {
  alphaSort: true,
  runOnCompile: true,
  disambiguatePaths: false,
}

Run the included Hardhat task to output compiled contract sizes:

yarn run hardhat size-contracts