{"id":18627287,"url":"https://github.com/itsnickbarry/hardhat-contract-sizer","last_synced_at":"2025-04-06T02:12:00.702Z","repository":{"id":41299734,"uuid":"289771629","full_name":"ItsNickBarry/hardhat-contract-sizer","owner":"ItsNickBarry","description":"Calculate Ethereum contract sizes with Hardhat 📐","archived":false,"fork":false,"pushed_at":"2024-07-30T20:35:19.000Z","size":146,"stargazers_count":76,"open_issues_count":5,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T01:11:14.736Z","etag":null,"topics":["abi","blockchain","buidler","bytecode","ethereum","hardhat","smart-contracts","solc","solidity","wow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItsNickBarry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-23T21:46:17.000Z","updated_at":"2025-03-10T05:53:41.000Z","dependencies_parsed_at":"2024-06-18T13:49:56.772Z","dependency_job_id":"271c94f9-ad72-426f-9971-3dc491b34f33","html_url":"https://github.com/ItsNickBarry/hardhat-contract-sizer","commit_stats":{"total_commits":76,"total_committers":7,"mean_commits":"10.857142857142858","dds":"0.19736842105263153","last_synced_commit":"a464fc0c8f3102efcaad9b210bd249d3bc45d12d"},"previous_names":["itsnickbarry/buidler-contract-sizer"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fhardhat-contract-sizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fhardhat-contract-sizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fhardhat-contract-sizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fhardhat-contract-sizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsNickBarry","download_url":"https://codeload.github.com/ItsNickBarry/hardhat-contract-sizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abi","blockchain","buidler","bytecode","ethereum","hardhat","smart-contracts","solc","solidity","wow"],"created_at":"2024-11-07T04:41:49.366Z","updated_at":"2025-04-06T02:12:00.684Z","avatar_url":"https://github.com/ItsNickBarry.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Contract Sizer\n\nOutput Solidity contract sizes with Hardhat.\n\n\u003e Versions of this plugin prior to `2.0.0` were released as `buidler-contract-sizer`.\n\n## Installation\n\n```bash\nnpm install --save-dev hardhat-contract-sizer\n# or\nyarn add --dev hardhat-contract-sizer\n```\n\n## Usage\n\nLoad plugin in Hardhat config:\n\n```javascript\nrequire('hardhat-contract-sizer');\n```\n\nAdd configuration under the `contractSizer` key:\n\n| option              | description                                                                                                                 | default |\n| ------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- |\n| `alphaSort`         | whether to sort results table alphabetically (default sort is by contract size)                                             | `false` |\n| `runOnCompile`      | whether to output contract sizes automatically after compilation                                                            | `false` |\n| `disambiguatePaths` | whether to output the full path to the compilation artifact (relative to the Hardhat root directory)                        | `false` |\n| `strict`            | whether to throw an error if any contracts exceed the size limit (may cause compatibility issues with `solidity-coverage`)  | `false` |\n| `only`              | `Array` of `String` matchers used to select included contracts, defaults to all contracts if `length` is 0                  | `[]`    |\n| `except`            | `Array` of `String` matchers used to exclude contracts                                                                      | `[]`    |\n| `outputFile`        | file path to write contract size report                                                                                     | `null`  |\n| `unit`              | unit of measurement for the size of contracts, which can be expressed in 'B' (bytes), 'kB' (kilobytes) or 'KiB' (kibibytes) | `KiB`   |\n\n```javascript\ncontractSizer: {\n  alphaSort: true,\n  disambiguatePaths: false,\n  runOnCompile: true,\n  strict: true,\n  only: [':ERC20$'],\n}\n```\n\nRun the included Hardhat task to output compiled contract sizes:\n\n```bash\nnpx hardhat size-contracts\n# or\nyarn run hardhat size-contracts\n```\n\nBy default, the hardhat `compile` task is run before sizing contracts. This behavior can be disabled with the `--no-compile` flag:\n\n```bash\nnpx hardhat size-contracts --no-compile\n# or\nyarn run hardhat size-contracts --no-compile\n```\n\n## Development\n\nInstall dependencies via Yarn:\n\n```bash\nyarn install\n```\n\nSetup Husky to format code on commit:\n\n```bash\nyarn prepare\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsnickbarry%2Fhardhat-contract-sizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsnickbarry%2Fhardhat-contract-sizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsnickbarry%2Fhardhat-contract-sizer/lists"}