Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
hardhat-contract-sizer
Advanced tools
Output Solidity contract sizes with Hardhat.
Versions of this plugin prior to
2.0.0
were released asbuidler-contract-sizer
.
yarn add --dev hardhat-contract-sizer
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 |
strict | whether to throw an error if any contracts exceed the size limit (may cause compatibility issues with solidity-coverage ) | false |
only | Array of String matchers used to select included contracts, defaults to all contracts if length is 0 | [] |
except | Array of String matchers used to exclude contracts | [] |
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: true,
only: [':ERC20$'],
}
Run the included Hardhat task to output compiled contract sizes:
yarn run hardhat size-contracts
By default, the hardhat compile
task is run before sizing contracts. This behavior can be disabled with the --no-compile
flag:
yarn run hardhat size-contracts --no-compile
FAQs
Output Solidity contract sizes with Hardhat
We found that hardhat-contract-sizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.