Hardhat
Hardhat 是 Solidity 生态比较早期和成熟的脚手架之一,利用它可以快速的启动一个智能合约项目。下面主要从四个方面介绍 hardhat 的特性,更多资料请参考官网 (opens in a new tab):
初始化
- 安装 yarn 或者 npm
curl -o- -L https://yarnpkg.com/install.sh | bash
- 初始化 node.js 项目
yarn init -y
- 安装 Hardhat
yarn add --dev hardhat
- 初始化项目:
npx hardhat
$ npx hardhat
888 888 888 888 888
888 888 888 888 888
888 888 888 888 888
8888888888 8888b. 888d888 .d88888 88888b. 8888b. 888888
888 888 "88b 888P" d88" 888 888 "88b "88b 888
888 888 .d888888 888 888 888 888 888 .d888888 888
888 888 888 888 888 Y88b 888 888 888 888 888 Y88b.
888 888 "Y888888 888 "Y88888 888 888 "Y888888 "Y888
Welcome to Hardhat v2.10.0
? What do you want to do? …
▸ Create a JavaScript project
Create a TypeScript project
Create an empty hardhat.config.js
Quit
一般推荐选择 Create a TypeScript project
, 选择确认后的目录结构如下: