-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhardhat.config.ts
79 lines (75 loc) · 2.19 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { HardhatUserConfig, task } from "hardhat/config";
import "@typechain/hardhat";
import "@nomicfoundation/hardhat-network-helpers";
import "@nomicfoundation/hardhat-ethers";
import "hardhat-tracer";
import "@nomicfoundation/hardhat-chai-matchers";
import "hardhat-deploy";
import dotenv from "dotenv";
dotenv.config();
const TEST_HDWALLET = {
mnemonic: "test test test test test test test test test test test junk",
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 20,
passphrase: "",
};
const accounts = process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : TEST_HDWALLET;
const config: HardhatUserConfig = {
paths: {
artifacts: "artifacts",
cache: "cache",
deploy: "src/deploy",
sources: "contracts",
tests: "tests",
},
namedAccounts: {
deployer: 0,
smartAccountOwner: 1,
alice: 2,
charlie: 3,
sessionKey: 4,
},
solidity: {
compilers: [
{
version: "0.8.24",
settings: {
optimizer: { enabled: true, runs: 800 },
viaIR: true,
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: "none",
},
},
},
],
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
accounts: TEST_HDWALLET,
tags: ["hardhat"],
initialBaseFeePerGas: 100e9,
saveDeployments: true,
},
sapphire_mainnet: {
url: "https://sapphire.oasis.io",
chainId: 0x5afe,
accounts,
live: true,
tags: ["sapphire-mainnet"],
},
sapphire_testnet: {
url: "https://testnet.sapphire.oasis.io",
chainId: 0x5aff,
accounts,
live: true,
tags: ["sapphire-testnet"],
},
},
};
export default config;