# Hardhat: Reducing Smart Contract Size

&#x20;         In this tutorial, you’ll discover how to analyze and minimize the size of your smart contracts using Hardhat and the Hardhat Contract Sizer plugin.

## Goals

&#x20;         By the end of this tutorial, you will be able to:

&#x20;         \- Use the Hardhat Contract Sizer plugin to evaluate contract size\
&#x20;         \- Explain common techniques for keeping contract size within limits\
&#x20;         \- Understand how inheritance affects the compiled bytecode size\
&#x20;         \- Identify how external contract references contribute to overall bytecode\
&#x20;         \- Assess how the use of libraries influences contract size\
&#x20;         \- Evaluate the role of the Solidity optimizer in reducing bytecode size

## Overview

&#x20;         In the Ethereum and broader blockchain ecosystem, minimizing smart contract size is essential. Smaller contracts require less gas to deploy and execute, resulting in lower costs for users. Thankfully, Hardhat offers the `hardhat-contract-sizer` plugin, a useful tool for analyzing and optimizing your smart contract sizes efficiently.


---

# 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.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.
