-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
130 lines (123 loc) · 3.72 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import "dotenv/config";
import { HardhatUserConfig, extendEnvironment } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-contract-sizer";
import "@openzeppelin/hardhat-upgrades";
import "hardhat-deploy";
import { EthersExternalProvider, LSPFactory } from "@lukso/lsp-factory.js";
import { ERC725 } from "@erc725/erc725.js";
const DEFAULT_PRIVATE_KEY =
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const LSP_FACTORY_PRIVATE_KEY =
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff82";
declare module "hardhat/types/runtime" {
interface HardhatRuntimeEnvironment {
Web3Provider: any;
LSPFactory: typeof LSPFactory;
lspFactory: LSPFactory;
ERC725: typeof ERC725;
}
}
// Add Web3Provider to HRE
extendEnvironment(async (hre) => {
hre.Web3Provider = hre.network.provider;
hre.Web3Provider.chainId = hre.network.config.chainId;
});
// Add LSPFactory to HRE
extendEnvironment(async (hre) => {
hre.LSPFactory = LSPFactory;
hre.lspFactory = new LSPFactory(
hre.Web3Provider as EthersExternalProvider,
LSP_FACTORY_PRIVATE_KEY
);
});
// Add ERC725 to HRE
extendEnvironment(async (hre) => {
hre.ERC725 = ERC725;
});
const config: HardhatUserConfig = {
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
},
},
gasReporter: {
enabled: true,
currency: "USD",
},
networks: {
LuksoMainnet: {
url:
process.env.RPC_URL_MAINNET && process.env.RPC_URL_API_KEY_MAINNET
? `${process.env.RPC_URL_MAINNET}?apiKey=${process.env.RPC_URL_API_KEY_MAINNET}`
: "https://rpc.lukso.gateway.fm",
chainId: 42,
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
LuksoTestnet: {
url:
process.env.RPC_URL_TESTNET && process.env.RPC_URL_API_KEY_TESTNET
? `${process.env.RPC_URL_TESTNET}?apiKey=${process.env.RPC_URL_API_KEY_TESTNET}`
: "https://rpc.testnet.lukso.gateway.fm",
chainId: 4201,
accounts: [process.env.PRIVATE_KEY ?? DEFAULT_PRIVATE_KEY],
},
hardhat: {
chainId: 1337,
accounts: [
{
privateKey: DEFAULT_PRIVATE_KEY,
balance: "10000000000000000000000", // 10000 ETH
},
{
privateKey:
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
balance: "10000000000000000000000", // 10000 ETH
},
{
privateKey:
"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a",
balance: "10000000000000000000000", // 10000 ETH
},
{
privateKey:
"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6",
balance: "10000000000000000000000", // 10000 ETH
},
{
privateKey:
"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a",
balance: "10000000000000000000000", // 10000 ETH
},
{
privateKey: LSP_FACTORY_PRIVATE_KEY,
balance: "10000000000000000000000", // 10000 ETH
},
],
},
localhost: {
chainId: 1337,
accounts: [
DEFAULT_PRIVATE_KEY,
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a",
"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6",
"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a",
LSP_FACTORY_PRIVATE_KEY,
],
},
},
etherscan: {
apiKey: {
//lukso: "lukso api key for lukso-scan"
},
},
namedAccounts: {
deployer: 0,
},
};
export default config;