-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathprepareChainConfig.ts
More file actions
46 lines (43 loc) · 1.22 KB
/
prepareChainConfig.ts
File metadata and controls
46 lines (43 loc) · 1.22 KB
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
import { ChainConfig, ChainConfigArbitrumParams } from './types/ChainConfig';
export const defaults = {
homesteadBlock: 0,
daoForkBlock: null,
daoForkSupport: true,
eip150Block: 0,
eip150Hash: '0x0000000000000000000000000000000000000000000000000000000000000000',
eip155Block: 0,
eip158Block: 0,
byzantiumBlock: 0,
constantinopleBlock: 0,
petersburgBlock: 0,
istanbulBlock: 0,
muirGlacierBlock: 0,
berlinBlock: 0,
londonBlock: 0,
clique: {
period: 0,
epoch: 0,
},
arbitrum: {
EnableArbOS: true,
AllowDebugPrecompiles: false,
DataAvailabilityCommittee: false,
InitialArbOSVersion: 20,
GenesisBlockNum: 0,
MaxCodeSize: 24_576,
MaxInitCodeSize: 49_152,
},
};
export type PrepareChainConfigParams = Pick<ChainConfig, 'chainId'> &
Partial<Omit<ChainConfig, 'chainId' | 'arbitrum'>> & {
arbitrum: Pick<ChainConfigArbitrumParams, 'InitialChainOwner'> &
Partial<Omit<ChainConfigArbitrumParams, 'InitialChainOwner'>>;
};
export function prepareChainConfig(params: PrepareChainConfigParams): ChainConfig {
return {
...defaults,
...params,
clique: { ...defaults.clique, ...params.clique },
arbitrum: { ...defaults.arbitrum, ...params.arbitrum },
};
}