Test and Deploy with Hardhat


Master Solidity smart contract development with Hardhat. Learn testing, deployment, and network interaction in one comprehensive tutorial.

Get Started

Contracts Code Blob Size Disclaimer

The maximum contract code blob size on Reef Pelagia testnet is 100 kilobytes, significantly larger than Ethereum’s EVM limit of 24 kilobytes.

For detailed comparisons and migration guidelines, see the EVM vs. PolkaVM documentation page.


Overview

Hardhat is a robust development environment for Ethereum-compatible chains that makes smart contract development more efficient. This guide walks you through the essentials of using Hardhat to create, compile, test, and deploy smart contracts on Reef Chain.

Prerequisites

Before getting started, ensure you have:

Set Up Hardhat

  1. Create a new directory for your project and navigate into it:

    mkdir hardhat-example cd hardhat-example

  2. Initialize a new npm project:

    npm init -y

  3. To interact with Reef Chain, Hardhat requires the following plugin to compile contracts to PolkaVM bytecode and to spawn a local node compatible with PolkaVM:

    npm install --save-dev @parity/[email protected]