51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
|
import { config as dotenvConfig } from "dotenv";
|
||
|
import { resolve } from "path";
|
||
|
import type { HardhatUserConfig } from "hardhat/config";
|
||
|
import "@nomicfoundation/hardhat-toolbox-viem";
|
||
|
import { env } from "./lib/common";
|
||
|
|
||
|
[
|
||
|
`.env.${process.env.APP_ENV}.contracts`,
|
||
|
`.env.${process.env.APP_ENV}.data`,
|
||
|
`.env.${process.env.APP_ENV}`
|
||
|
]
|
||
|
.forEach((dotenvConfigPath) => {
|
||
|
const path = resolve(__dirname, dotenvConfigPath);
|
||
|
dotenvConfig({ path, override: true })
|
||
|
});
|
||
|
|
||
|
const TEST_MNEMONIC = "test test test test test test test test test test test junk";
|
||
|
|
||
|
const config: HardhatUserConfig = {
|
||
|
solidity: "0.8.28",
|
||
|
networks: {
|
||
|
localhost: {
|
||
|
url: "http://127.0.0.1:8545",
|
||
|
accounts: {
|
||
|
mnemonic: process.env.MNEMONIC || TEST_MNEMONIC
|
||
|
}
|
||
|
},
|
||
|
mainnet: {
|
||
|
url: env("MAINNET_RPC_URL"),
|
||
|
accounts: {
|
||
|
mnemonic: env("MNEMONIC", TEST_MNEMONIC)
|
||
|
}
|
||
|
},
|
||
|
testnet: {
|
||
|
url: env("TESTNET_RPC_URL"),
|
||
|
accounts: {
|
||
|
mnemonic: env("MNEMONIC", TEST_MNEMONIC)
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
etherscan: {
|
||
|
apiKey: process.env.ETHERSCAN_KEY
|
||
|
},
|
||
|
sourcify: {
|
||
|
enabled: true
|
||
|
},
|
||
|
defaultNetwork: "localhost"
|
||
|
};
|
||
|
|
||
|
export default config;
|