forked from Uniswap/v3-periphery
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.ts
75 lines (71 loc) · 2.26 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
import 'hardhat-typechain'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-etherscan'
import 'hardhat-watcher'
import '@matterlabs/hardhat-zksync-solc'
import '@matterlabs/hardhat-zksync-verify'
import { subtask } from 'hardhat/config'
import * as path from 'path'
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names'
const NFT_DESCRIPTOR_PATH = 'contracts/libraries/NFTDescriptor.sol'
const NFT_DESCRIPTOR_NAME = 'NFTDescriptor'
const CONTRACTS_USES_NFT_DESCRIPTOR = ['NonfungibleTokenPositionDescriptor.sol', 'test/NFTDescriptorTest.sol']
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS, async (_, { config }, runSuper) => {
const paths = await runSuper()
if (config.zksolc.settings.libraries !== undefined) {
if (config.zksolc.settings.libraries[NFT_DESCRIPTOR_PATH] !== undefined) {
if (config.zksolc.settings.libraries[NFT_DESCRIPTOR_PATH][NFT_DESCRIPTOR_NAME] !== undefined) {
return paths
}
}
}
return paths.filter((solidityFilePath: any) => {
const relativePath = path.relative(config.paths.sources, solidityFilePath)
return !CONTRACTS_USES_NFT_DESCRIPTOR.includes(relativePath)
})
})
export default {
networks: {
zkSyncTestNode: {
url: 'http://localhost:8011',
ethNetwork: '',
zksync: true,
},
zkSyncTestnet: {
url: 'https://testnet.era.zksync.dev',
ethNetwork: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
zksync: true,
verifyURL: 'https://zksync2-testnet-explorer.zksync.dev/contract_verification',
},
zkSyncMainnet: {
url: 'https://mainnet.era.zksync.io',
ethNetwork: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
zksync: true,
verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification',
},
},
defaultNetwork: 'zkSyncTestNode',
solidity: {
version: '0.7.6',
},
zksolc: {
version: '1.3.13',
compilerSource: 'binary',
settings: {
metadata: {
bytecodeHash: 'none',
},
},
},
watcher: {
test: {
tasks: [{ command: 'test', params: { testFiles: ['{path}'] } }],
files: ['./test/**/*'],
verbose: true,
},
},
mocha: {
timeout: 100000000,
},
}