hardhat项目环境安装:hardhat项目环境安装-CSDN博客
hardhat编写合约、编译合约:hardhat编写合约、编译合约-CSDN博客
hardhat测试合约、编写测试脚本:hardhat测试合约、编写测试脚本-CSDN博客
按照以下步骤在网络中部署合约:
1、开启本地节点:
npx hardhat node
2、 在scripts目录下创建deploy_token.js文件,文件内容如下所示:
const { ethers } = require("hardhat");
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
// 使用ethers.js从Hardhat实例获取余额
const balance = await deployer.provider.getBalance(deployer.address);


1751

被折叠的 条评论
为什么被折叠?



