-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
102 lines (99 loc) · 3.09 KB
/
hardhat.config.js
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
require("@nomicfoundation/hardhat-toolbox");
require('@openzeppelin/hardhat-upgrades');
require("hardhat-preprocessor");
require("dotenv").config();
const fs = require("fs")
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const REVIEWER_PRIVATE_KEY = process.env.REVIEWER_PRIVATE_KEY;
const OP_API_KEY = process.env.OP_API_KEY;
function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.filter(Boolean)
.map((line) => line.trim().split("="));
}
module.exports = {
solidity: {
compilers: [
{
version: "0.8.21",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
viaIR: true,
evmVersion: "paris",
},
}
],
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
},
goerli: {
url: `https://ethereum-goerli.publicnode.com`,
gas: 15000000,
accounts: [PRIVATE_KEY]
},
op_sepolia: {
url: `https://sepolia.optimism.io`,
gas: 15000000,
accounts: [PRIVATE_KEY, REVIEWER_PRIVATE_KEY]
},
op: {
url: `https://optimism.llamarpc.com`,
gas: 15000000,
accounts: [PRIVATE_KEY]
}
},
paths: {
sources: "./src", // Use ./src rather than ./contracts as Hardhat expects
cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry
},
// This fully resolves paths for imports in the ./lib directory for Hardhat
preprocess: {
eachLine: (hre) => ({
transform: (line) => {
if (line.match(/^\s*import /i)) {
getRemappings().forEach(([find, replace]) => {
if (line.match(find)) {
line = line.replace(find, replace);
}
});
}
return line;
},
}),
},
etherscan: {
apiKey: {
op_sepolia: OP_API_KEY,
optimisticEthereum: OP_API_KEY,
},
customChains: [
{
network: "op_sepolia",
chainId: 11155420,
urls: {
apiURL: "https://api-sepolia-optimistic.etherscan.io/api",
browserURL: "https://sepolia-optimistic.etherscan.io"
}
}
]
},
addresses: {
op_sepolia: {
rootTagger: "0xaA5bE49799b6A71Eda74d22D01F7A808aFf41b3f",
terminusDIDProxy: "0xe2D7c3a9013960E04d4E9F5F9B63fff37eEd97A8",
appMarketReputation: "0xD681657e88225366Def1ab8e7195D3b19314fD10",
},
op: {
rootTagger: "0xE2EABA0979277A90511F8873ae1e8cA26B54E740",
terminusDIDProxy: "0x5DA4Fa8E567d86e52Ef8Da860de1be8f54cae97D",
appMarketReputation: "0x08065353D266121938B93D4B1071Bb52CD0C0EE4",
}
}
};