54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
require("@nomicfoundation/hardhat-toolbox");
|
|
//// Deprecated, below import combined in toolbox import already
|
|
require("@nomiclabs/hardhat-ethers");
|
|
//require("@nomiclabs/hardhat-etherscan");
|
|
//require("@nomicfoundation/hardhat-verify");
|
|
require("dotenv").config();
|
|
require("./tasks/block-number");
|
|
|
|
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;
|
|
|
|
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_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,
|
|
},
|
|
localhost: {
|
|
// Hardhost similar like ganache, can debug the transaction
|
|
// Start in terminal - yarn hardhat node
|
|
url: "http://127.0.0.1:8545/",
|
|
chainId: 31337,
|
|
},
|
|
},
|
|
solidity: "0.8.24",
|
|
etherscan: {
|
|
apiKey: ETHERSCAN_API_KEY,
|
|
},
|
|
sourcify: {
|
|
enabled: false,
|
|
},
|
|
};
|
|
|
|
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);
|
|
}
|
|
});
|