2023-07-06 21:44:06 -07:00
|
|
|
import { ChainId } from '@uniswap/sdk-core'
|
2023-07-24 18:00:29 -07:00
|
|
|
import { UNIVERSAL_ROUTER_CREATION_BLOCK } from '@uniswap/universal-router-sdk'
|
2023-06-21 12:15:03 -05:00
|
|
|
|
2023-04-19 10:50:25 -07:00
|
|
|
/* eslint-env node */
|
|
|
|
require('dotenv').config()
|
|
|
|
|
2023-06-21 12:15:03 -05:00
|
|
|
const forkingConfig = {
|
2023-04-19 10:50:25 -07:00
|
|
|
httpHeaders: {
|
|
|
|
Origin: 'localhost:3000', // infura allowlists requests by origin
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-06-21 12:15:03 -05:00
|
|
|
const forks = {
|
2023-07-06 21:44:06 -07:00
|
|
|
[ChainId.MAINNET]: {
|
2023-06-21 12:15:03 -05:00
|
|
|
url: `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
|
2023-11-09 18:43:10 -05:00
|
|
|
// Temporarily hardcoding this to fix e2e tests as we investigate source of swap tests failing on older blocknumbers
|
|
|
|
blockNumber: 18537387,
|
2023-06-21 12:15:03 -05:00
|
|
|
...forkingConfig,
|
|
|
|
},
|
2023-07-06 21:44:06 -07:00
|
|
|
[ChainId.POLYGON]: {
|
2023-06-21 12:15:03 -05:00
|
|
|
url: `https://polygon-mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
|
2023-07-24 18:00:29 -07:00
|
|
|
blockNumber: UNIVERSAL_ROUTER_CREATION_BLOCK(ChainId.POLYGON),
|
2023-06-21 12:15:03 -05:00
|
|
|
...forkingConfig,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-04-19 10:50:25 -07:00
|
|
|
module.exports = {
|
2023-06-21 12:15:03 -05:00
|
|
|
forks,
|
2023-04-19 10:50:25 -07:00
|
|
|
networks: {
|
|
|
|
hardhat: {
|
2023-07-06 21:44:06 -07:00
|
|
|
chainId: ChainId.MAINNET,
|
|
|
|
forking: forks[ChainId.MAINNET],
|
2023-04-19 10:50:25 -07:00
|
|
|
accounts: {
|
2023-05-18 16:32:35 -04:00
|
|
|
count: 2,
|
2023-04-19 10:50:25 -07:00
|
|
|
},
|
2023-04-26 15:16:51 -05:00
|
|
|
mining: {
|
2023-05-04 08:31:53 -07:00
|
|
|
auto: true, // automine to make tests easier to write.
|
|
|
|
interval: 0, // do not interval mine so that tests remain deterministic
|
2023-04-26 15:16:51 -05:00
|
|
|
},
|
2023-04-19 10:50:25 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|