-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardhat.config.ts
71 lines (68 loc) · 1.99 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
import 'dotenv/config';
import 'hardhat-deploy';
import { ethers } from 'ethers';
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
// Even hardhat-chai-matchers has already imported in the toolbox,
// we still need to import it here so that vscode can recognize the types
import '@nomicfoundation/hardhat-chai-matchers';
import {
importNetworks,
readJSON,
} from '@axelar-network/axelar-contract-deployments/evm/utils';
import testnetChains from '@axelar-network/axelar-contract-deployments/info/testnet.json';
import mainnetChains from '@axelar-network/axelar-contract-deployments/info/mainnet.json';
import './tasks';
const keys = readJSON('./info/keys.json');
const env = process.env.ENV || 'testnet';
const isE2E = process.env.E2E === 'true' ? true : false;
const chains = env === 'testnet' ? testnetChains : mainnetChains;
const { networks, etherscan } = importNetworks(chains, keys);
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
version: '0.8.19',
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: {
enabled: true,
runs: 1000000,
details: {
peephole: process.env.COVERAGE === undefined,
inliner: process.env.COVERAGE === undefined,
jumpdestRemover: true,
orderLiterals: true,
deduplicate: true,
cse: process.env.COVERAGE === undefined,
constantOptimizer: true,
yul: true,
yulDetails: {
stackAllocation: true,
},
},
},
},
},
networks: {
...networks,
hardhat: {
forking: {
enabled: !isE2E,
url: networks['ethereum'].url,
},
},
},
etherscan,
deterministicDeployment: (network: string) => {
return {
deployer: new ethers.Wallet(keys.accounts[0]).address,
factory: '',
funding: '',
signedTx: '',
};
},
typechain: {
target: 'ethers-v5',
},
};
export default config;