hands-on lab

Hardhat Lab: Smart Contract on a Local Network

Difficulty: Beginner
Duration: Up to 1 hour
Students: 11
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Hardhat is an advanced development environment for Solidity smart contracts, offering a user-friendly command-line interface (CLI) and seamless integration with popular tools like TypeScript and JavaScript.  

With its comprehensive testing framework and plugin system, Hardhat enables efficient contract development, testing, and deployment on Ethereum and other compatible blockchains. It fosters a supportive community, making it accessible to developers of all levels, and empowering them to create innovative decentralised applications to contribute to the evolving blockchain landscape.  

This Lab will take you through steps needed to create a local Hardhat node. You will also deploy and interact with a smart contract on it. 

 

Learning objectives

Upon completion of this lab, you will be able to:

  • Create your in-memory network using Hardhat.
  • Use Hardhat to compile the Smart Contract.
  • Utilise Hardhat’s scripts to deploy your compiled Smart Contract to selected network.
  • Interact with the Smart Contract using the Hardhat console. 
  • Interact with the Smart Contract using Hardhat scripts.

Intended audience

  • Individuals studying software engineering.
  • Individuals who have an interest in crypto technologies.

 

Lab steps

Create Local In-memory Hardhat Node
Deploy a Smart Contract
Interact With a Smart Contract via Console
Interact With a Smart Contract via the Script