一、配置hardhat
npx hardhat init
安装插件中…
二、编写合约,在contracts文件夹中 新建一个Counter.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract Counter {
uint256 counts;
constructor () public {
counts = 0;
}
function addCount() public {
counts += 1;</