Your First Size Profiling

Just like in earlier tutorials, you'll start by checking the size of a smart contract—this time, Counter.sol.

Once you’ve installed and configured the hardhat-contract-sizer plugin, run the following command:

npx hardhat size-contracts

This command, added by the plugin, will analyze your contracts and display their compiled bytecode size directly in the terminal.

You’ll then see the size report for Counter, along with any other compiled contracts in your project.

Although the contract is straightforward, the effectiveness of the hardhat-contract-sizer plugin becomes clear right away—it provides instant feedback on the size of your compiled contracts.

Last updated