Skip to content

Commit

Permalink
patch register method for zksync
Browse files Browse the repository at this point in the history
  • Loading branch information
zZoMROT committed Dec 17, 2024
1 parent 4c13dda commit 860afd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hardhat-setup/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class Networks {
}
}

register(name: string, chainId: number, rpc?: string, privateKey?: string, etherscanNetworkName?: string, etherscanKey?: string, hardfork: string = 'shanghai', zksync: boolean = false) {
register(name: string, chainId: number, rpc?: string, privateKey?: string, etherscanNetworkName?: string, etherscanKey?: string, hardfork: string = 'shanghai', l1Network?: string) {
if (rpc && privateKey && etherscanNetworkName && etherscanKey) {
const { url, authKeyHttpHeader } = parseRpcEnv(rpc);
this.networks[name] = {
Expand All @@ -105,7 +105,7 @@ export class Networks {
chainId,
accounts: [privateKey],
hardfork,
zksync,
...(l1Network && { ethNetwork: l1Network, zksync: true }),
};
this.etherscan.apiKey[etherscanNetworkName] = etherscanKey;
console.log(`Network '${name}' registered`);
Expand Down Expand Up @@ -155,8 +155,8 @@ export class Networks {
this.register('base', 8453, process.env.BASE_RPC_URL, process.env.BASE_PRIVATE_KEY || privateKey, 'base', process.env.BASE_ETHERSCAN_KEY);
this.registerCustom('klaytn', 8217, process.env.KLAYTN_RPC_URL, process.env.KLAYTN_PRIVATE_KEY || privateKey, process.env.KLAYTN_ETHERSCAN_KEY, 'https://scope.klaytn.com/', 'https://scope.klaytn.com/'); // eslint-disable-line max-len
this.registerCustom('linea', 59144, process.env.LINEA_RPC_URL, process.env.LINEA_PRIVATE_KEY || privateKey, process.env.LINEA_ETHERSCAN_KEY, 'https://api.lineascan.build/api', 'https://lineascan.build/', 'london'); // eslint-disable-line max-len
this.register('zksync', 324, process.env.ZKSYNC_RPC_URL, process.env.ZKSYNC_PRIVATE_KEY || privateKey, 'zksyncmainnet', process.env.ZKSYNC_ETHERSCAN_KEY, 'paris', true);
this.register('zksyncTest', 300, process.env.ZKSYNC_TEST_RPC_URL, process.env.ZKSYNC_TEST_PRIVATE_KEY || privateKey, 'zksyncsepolia', process.env.ZKSYNC_TEST_ETHERSCAN_KEY, 'paris', true);
this.register('zksync', 324, process.env.ZKSYNC_RPC_URL, process.env.ZKSYNC_PRIVATE_KEY || privateKey, 'zksyncmainnet', process.env.ZKSYNC_ETHERSCAN_KEY, 'paris', 'mainnet');
this.register('zksyncTest', 300, process.env.ZKSYNC_TEST_RPC_URL, process.env.ZKSYNC_TEST_PRIVATE_KEY || privateKey, 'zksyncsepolia', process.env.ZKSYNC_TEST_ETHERSCAN_KEY, 'paris', 'sepolia');

Check failure on line 159 in hardhat-setup/networks.ts

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 201. Maximum allowed is 200
// For 'zksyncFork' network you should use zksync fork node: https://github.com/matter-labs/era-test-node
this.registerZksync('zksyncFork', 260, process.env.ZKSYNC_FORK_RPC_URL, 'mainnet', process.env.ZKSYNC_FORK_PRIVATE_KEY || privateKey);
this.registerZksync('zksyncLocal', 270, process.env.ZKSYNC_LOCAL_RPC_URL, process.env.ZKSYNC_LOCAL_ETH_NETWORK, process.env.ZKSYNC_PRIVATE_KEY || privateKey);
Expand Down

0 comments on commit 860afd1

Please sign in to comment.