-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhardhat.config.ts
54 lines (49 loc) · 1.25 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { config as dotenvConfig } from "dotenv";
import { resolve } from "path";
dotenvConfig({ path: resolve(__dirname, ".env") });
import "@nomiclabs/hardhat-waffle";
import "hardhat-typechain";
import "@nomiclabs/hardhat-ganache";
// Ensure that we have all the environment variables we need.
let mnemonic: string;
if (!process.env.WALLET_SEED_PHRASE) {
throw new Error("Please set your WALLET_SEED_PHRASE in a .env file");
} else {
mnemonic = process.env.WALLET_SEED_PHRASE;
}
function createLocalHostConfig() {
const url: string = "http://localhost:7545";
return {
accounts: {
count: 10,
initialIndex: 0,
mnemonic,
path: "m/44'/60'/0'/0",
},
url,
};
}
const config = {
defaultNetwork: "localhost",
networks: {
localhost: createLocalHostConfig(),
},
solidity: {
version: "0.8.9", // using the same version as tribute-contracts
settings: {
// https://hardhat.org/hardhat-network/#solidity-optimizer-support
optimizer: {
enabled: true,
runs: 200,
},
},
},
// https://hardhat.org/config/#path-configuration
paths: {
tests: "./test",
sources: "./build/contracts",
cache: "./build/cache",
artifacts: "./build/artifacts",
},
};
export default config;