npm i
修改 hardhat.conf.ts 中的 accounts
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const config: HardhatUserConfig = {
solidity: {
version: "0.6.12",
},
networks: {
goerli: {
url: "https://ethereum-goerli.publicnode.com",
accounts: ["请编写自己私钥"],
},
},
};
export default config;
npx hardhat run ./scripts/deploy.ts --network goerli