Skip to content

Commit 2995645

Browse files
committed
store environment variables as local constants
1 parent ef41aff commit 2995645

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

hardhat.config.ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import Dotenv from 'dotenv';
99

1010
Dotenv.config();
1111

12+
const {
13+
NODE_URL_MAINNET,
14+
NODE_URL_TESTNET,
15+
PKEY_MAINNET,
16+
PKEY_TESTNET,
17+
REPORT_GAS,
18+
} = process.env;
19+
1220
export default {
1321
solidity: {
1422
version: '0.8.11',
@@ -22,13 +30,13 @@ export default {
2230

2331
networks: {
2432
mainnet: {
25-
url: `${process.env.NODE_URL_MAINNET}`,
26-
accounts: [`${process.env.PKEY_MAINNET}`],
33+
url: NODE_URL_MAINNET,
34+
accounts: [PKEY_MAINNET],
2735
},
2836

2937
testnet: {
30-
url: `${process.env.NODE_URL_TESTNET}`,
31-
accounts: [`${process.env.PKEY_TESTNET}`],
38+
url: NODE_URL_TESTNET,
39+
accounts: [PKEY_TESTNET],
3240
},
3341
},
3442

@@ -38,7 +46,7 @@ export default {
3846
},
3947

4048
gasReporter: {
41-
enabled: process.env.REPORT_GAS === 'true',
49+
enabled: REPORT_GAS === 'true',
4250
},
4351

4452
spdxLicenseIdentifier: {

0 commit comments

Comments
 (0)