# Installing and Configuring the Hardhat Contract Sizer Plugin

&#x20;         The Hardhat Contract Sizer is a plugin developed by the community that helps you measure the size of your smart contracts by displaying their compiled bytecode size directly in the terminal. This is particularly useful during development, as it allows you to quickly spot contracts that may exceed the permitted size limit.

&#x20;         Keep in mind that, on the Ethereum mainnet, the maximum allowed size for a deployed smart contract is **24 KiB (24,576 bytes)**. Exceeding this limit will cause deployment to fail.

&#x20;         To install the plugin, run the following command:

```bash
npm install --save-dev hardhat-contract-sizer
```

&#x20;         Next, import the plugin in your `hardhat.config.js` file:

```javascript
require("hardhat-contract-sizer");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.icb.network/build-on-icb-network/hardhat/hardhat-reducing-smart-contract-size/installing-and-configuring-the-hardhat-contract-sizer-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
