Skip to content

Commit

Permalink
feat: added network tag and enum
Browse files Browse the repository at this point in the history
  • Loading branch information
capedcrusader21 committed Jul 15, 2024
1 parent 928e56a commit 2320945
Showing 1 changed file with 60 additions and 38 deletions.
98 changes: 60 additions & 38 deletions packages/deploy/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,34 @@ const namedAccounts = {
/**
* TAGS:
* - mainnet -> production networks (you must pay for gas!!!)
* - L1 -> Layer 1 networks
* - L2 -> Layer 2 networks
* - L1, L1-prod, L1-test -> Layer 1 networks
* - L2, L2-prod, L2-test -> Layer 2 networks
*/
enum NETWORKS {
SEPOLIA = 11155111,
MAINNET = 1,
AMOY = 80002,
POLYGON = 137,
BASESEPOLIA = 84532,
BASE = 8453,
BSCTESTNET = 97,
BSCMAINNET = 56,
}

enum DEPLOY_NETWORKS {
SEPOLIA = 'sepolia',
MAINNET = 'mainnet',
BSCTESTNET = 'bscTestnet',
BSCMAINNET = 'bscMainnet',
AMOY = 'amoy',
POLYGON = 'polygon',
BASESEPOLIA = 'baseSepolia',
BASE = 'base',
}

const networks = {
hardhat: {
tags: ['L1', 'L2'],
tags: ['L1', 'L1-prod', 'L1-test', 'L2', 'L2-prod', 'L2-test'],
deploy: ['deploy_mocks/', 'deploy/'],
companionNetworks: {
l1: 'hardhat',
Expand All @@ -344,66 +366,66 @@ const networks = {
l2: 'mumbai',
},
},
sepolia: {
tags: ['L1'],
[DEPLOY_NETWORKS.SEPOLIA]: {
tags: ['L1', 'L1-test'],
companionNetworks: {
l2: 'amoy',
bsc: 'bscTestnet',
base: 'baseSepolia',
[NETWORKS.AMOY]: [DEPLOY_NETWORKS.AMOY],
[NETWORKS.BASESEPOLIA]: [DEPLOY_NETWORKS.BASESEPOLIA],
[NETWORKS.BSCTESTNET]: [DEPLOY_NETWORKS.BSCTESTNET],
},
},
mainnet: {
tags: ['mainnet', 'L1'],
[DEPLOY_NETWORKS.MAINNET]: {
tags: ['mainnet', 'L1', 'L1-prod'],
companionNetworks: {
l2: 'polygon',
bsc: 'bscMainnet',
base: 'base',
[NETWORKS.POLYGON]: [DEPLOY_NETWORKS.POLYGON],
[NETWORKS.BASE]: [DEPLOY_NETWORKS.BASE],
[NETWORKS.BSCMAINNET]: [DEPLOY_NETWORKS.BSCMAINNET],
},
},
baseSepolia: {
tags: ['L2'],
[DEPLOY_NETWORKS.BSCTESTNET]: {
tags: ['L1', 'L1-test'],
companionNetworks: {
ethereum: 'sepolia',
bsc: 'bscTestnet',
[NETWORKS.SEPOLIA]: [DEPLOY_NETWORKS.SEPOLIA],
[NETWORKS.BASESEPOLIA]: [DEPLOY_NETWORKS.BASESEPOLIA],
},
},
base: {
tags: ['L2'],
[DEPLOY_NETWORKS.BSCMAINNET]: {
tags: ['L1', 'L1-prod'],
companionNetworks: {
ethereum: 'mainnet',
bsc: 'bscMainnet',
[NETWORKS.MAINNET]: [DEPLOY_NETWORKS.MAINNET],
[NETWORKS.BASE]: [DEPLOY_NETWORKS.BASE],
},
},
bscTestnet: {
tags: ['L1'],
mumbai: {
tags: ['L2'],
companionNetworks: {
ethereum: 'sepolia',
base: 'baseSepolia',
l1: 'goerli',
},
},
bscMainnet: {
tags: ['L1'],
[DEPLOY_NETWORKS.AMOY]: {
tags: ['L2', 'L2-test'],
companionNetworks: {
ethereum: 'mainnet',
base: 'base',
[NETWORKS.SEPOLIA]: [DEPLOY_NETWORKS.SEPOLIA],
},
},
mumbai: {
tags: ['L2'],
[DEPLOY_NETWORKS.POLYGON]: {
tags: ['L2', 'L2-prod'],
companionNetworks: {
l1: 'goerli',
[NETWORKS.MAINNET]: [DEPLOY_NETWORKS.MAINNET],
},
},
amoy: {
tags: ['L2'],
[DEPLOY_NETWORKS.BASESEPOLIA]: {
tags: ['L2', 'L2-test'],
companionNetworks: {
l1: 'sepolia',
[NETWORKS.SEPOLIA]: [DEPLOY_NETWORKS.SEPOLIA],
[NETWORKS.BSCTESTNET]: [DEPLOY_NETWORKS.BSCTESTNET],
},
},
polygon: {
tags: ['mainnet', 'L2'],
[DEPLOY_NETWORKS.BASE]: {
tags: ['L2', 'L2-prod'],
companionNetworks: {
l1: 'mainnet',
[NETWORKS.MAINNET]: [DEPLOY_NETWORKS.MAINNET],
[NETWORKS.BSCMAINNET]: [DEPLOY_NETWORKS.BSCMAINNET],
},
},
};
Expand Down

1 comment on commit 2320945

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

86.67%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/oft-sand/contracts
   OFTAdapterForSand.sol80%100%75%75%37
   OFTSand.sol90%100%87.50%90%88
packages/oft-sand/contracts/interfaces
   IERC20Extended.sol100%100%100%100%
   IErrors.sol100%100%100%100%
packages/oft-sand/contracts/mock
   EndpointMock.sol100%100%100%100%
   MockTrustedForwarder.sol100%100%100%100%
   SandMock.sol100%100%100%100%
packages/oft-sand/contracts/oft/libraries
   OFTMsgCodec.sol70.59%50%71.43%75%27, 64, 73
packages/oft-sand/contracts/sand
   ERC20Internal.sol100%100%100%100%
   SandBaseToken.sol100%100%100%100%

Please sign in to comment.