2023-07-07 07:44:06 +03:00
|
|
|
import { ChainId } from '@uniswap/sdk-core'
|
2023-06-21 20:15:03 +03:00
|
|
|
|
2023-04-19 20:50:25 +03:00
|
|
|
/* eslint-env node */
|
|
|
|
require('dotenv').config()
|
|
|
|
|
2023-04-26 00:24:57 +03:00
|
|
|
// Block selection is arbitrary, as e2e tests will build up their own state.
|
|
|
|
// The only requirement is that all infrastructure under test (eg Permit2 contracts) are already deployed.
|
2023-06-02 03:57:03 +03:00
|
|
|
// TODO(WEB-2187): Make more dynamic to avoid manually updating
|
|
|
|
const BLOCK_NUMBER = 17388567
|
2023-06-21 20:15:03 +03:00
|
|
|
const POLYGON_BLOCK_NUMBER = 43600000
|
2023-04-26 00:24:57 +03:00
|
|
|
|
2023-06-21 20:15:03 +03:00
|
|
|
const forkingConfig = {
|
2023-04-19 20:50:25 +03:00
|
|
|
httpHeaders: {
|
|
|
|
Origin: 'localhost:3000', // infura allowlists requests by origin
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-06-21 20:15:03 +03:00
|
|
|
const forks = {
|
2023-07-07 07:44:06 +03:00
|
|
|
[ChainId.MAINNET]: {
|
2023-06-21 20:15:03 +03:00
|
|
|
url: `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
|
|
|
|
blockNumber: BLOCK_NUMBER,
|
|
|
|
...forkingConfig,
|
|
|
|
},
|
2023-07-07 07:44:06 +03:00
|
|
|
[ChainId.POLYGON]: {
|
2023-06-21 20:15:03 +03:00
|
|
|
url: `https://polygon-mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
|
|
|
|
blockNumber: POLYGON_BLOCK_NUMBER,
|
|
|
|
...forkingConfig,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-04-19 20:50:25 +03:00
|
|
|
module.exports = {
|
2023-06-21 20:15:03 +03:00
|
|
|
forks,
|
2023-04-19 20:50:25 +03:00
|
|
|
networks: {
|
|
|
|
hardhat: {
|
2023-07-07 07:44:06 +03:00
|
|
|
chainId: ChainId.MAINNET,
|
|
|
|
forking: forks[ChainId.MAINNET],
|
2023-04-19 20:50:25 +03:00
|
|
|
accounts: {
|
2023-05-18 23:32:35 +03:00
|
|
|
count: 2,
|
2023-04-19 20:50:25 +03:00
|
|
|
},
|
2023-04-26 23:16:51 +03:00
|
|
|
mining: {
|
2023-05-04 18:31:53 +03:00
|
|
|
auto: true, // automine to make tests easier to write.
|
|
|
|
interval: 0, // do not interval mine so that tests remain deterministic
|
2023-04-26 23:16:51 +03:00
|
|
|
},
|
2023-04-19 20:50:25 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|