Initial Commit

This commit is contained in:
2024-08-02 18:50:02 +08:00
parent dadb9af821
commit d45d7559f7
8 changed files with 187 additions and 4 deletions

View File

@@ -1,6 +1,36 @@
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-ethers");
require("dotenv").config();
const RPC_URL_SEPOLIA = process.env.SEPOLIA_RPC_URL;
const PRIVATE_KEY_SEPOLIA = process.env.SEPOLIA_PRIVATE_KEY;
const RPC_URL_GANACHE = process.env.LOCAL_RPC_URL;
const PRIVATE_KEY_GANACHE = process.env.LOCAL_PRIVATE_KEY;
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
defaultNetwork: "hardhat",
networks: {
sepolia: {
url: RPC_URL_SEPOLIA,
accounts: [PRIVATE_KEY_SEPOLIA],
chainID: 11155111,
},
ganache: {
url: RPC_URL_GANACHE,
accounts: [PRIVATE_KEY_GANACHE],
chainID: 5777,
},
},
solidity: "0.8.24",
};
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});