Hardhat is a development environment to compile, deploy, test, and debug smart contracts. It has multiple core plugins which can be used to automate & improve the smart contract development experience.
Ethereum development environment for professionals by Nomic Labs
Installation: npm install --save-dev hardhat
Initialisation: npx hardhat
Project structure:
contracts/
scripts/
test/
hardhat.config.js
Details about hardhat.cofig.js
Contract Compilation: npx hardhat compile
More details on the different components of hardhat can be found below as we cover steps for the development of smart contracts. For more hands-on experience join the workshop.
OpenZepplin:
Documentation - OpenZeppelin Docs
Industry-standard, audited several times, battle-tested.
Installation: npm install @openzeppelin/contracts
ERC implementations: https://docs.openzeppelin.com/contracts/4.x/tokens
// contracts/MyNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyNFT is ERC721 {
constructor() ERC721("MyNFT", "MNFT") {
}
}
Access Control: https://docs.openzeppelin.com/contracts/4.x/api/access
<aside> ✨ If you know a project which already does something similar, look for the code in Etherscan/ Github. Fork it, and reuse it!
</aside>