Deploy Smart Contracts with Hardhat on Rootstock
Whether you’re a seasoned developer or just starting your journey into smart contract development, the hardhat starter kit provides a solid foundation for building decentralized applications (dApps) on the Rootstock network.
Rootstock is fully EVM (Ethereum Virtual Machine) compatible. It brings the power of smart contracts to Bitcoin, allowing developers to leverage Bitcoin’s security while benefiting from Ethereum’s ecosystem.
What you'll achieve
- Clone and configure the Hardhat starter kit for Rootstock testnet
- Deploy ERC-20, ERC-721, and ERC-1155 smart contract examples
- Run tests and verify contracts on Rootstock Explorer
Prerequisites
Before starting the dApp, make sure to have the following prerequisites:
-
Familiarity with Smart Contracts:
- If you’re new to smart contracts, consider learning the basics. Understanding how smart contracts work will enhance your experience with Rootstock development.
-
Node.js and Hardhat Installed:
- Ensure you have Node.js installed on your system. See the prerequisites section.
-
MetaMask set up for Rootstock:
- Install the MetaMask browser extension if you haven’t already.
- Configure MetaMask to connect to the Rootstock network. See MetaMask integration.
-
Basic knowledge of Hardhat:
- Familiarity with Hardhat's core concepts and functionalities is recommended. If you're new to Hardhat, refer to the Rootstock Hardhat Guide.
Learn how to write, test, secure, deploy and verify smart contracts on the Rootstock blockchain network. Enroll for the Rootstock Blockchain Developer Course.
Setting Up the Sample dApp
Clone the Repository
Open your terminal or command prompt and run the following command to clone the repository from GitHub:
git clone https://github.com/rsksmart/rootstock-hardhat-starterkit.git
Install Dependencies
Navigate to the cloned repository folder:
cd rootstock-hardhat-starterkit
Install all required dependencies using npm:
npm install