Skip to content

Commit

Permalink
chore: initial setup for zksync, scroll & zkevm
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlilley committed Mar 15, 2023
1 parent d1fa538 commit c352cb8
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ generated
# artifacts
artifacts

# artifacts zk
artifacts-zk

# cache zk
cache-zk

# workers
**/public/sw.js
**/public/workbox-*.js
Expand Down
2 changes: 2 additions & 0 deletions config/hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"preset": "@sushiswap/jest-config/node"
},
"dependencies": {
"@matterlabs/hardhat-zksync-deploy": "0.6.2",
"@matterlabs/hardhat-zksync-solc": "0.3.14",
"@nomiclabs/hardhat-ethers": "npm:[email protected]",
"@nomiclabs/hardhat-etherscan": "3.1.3",
"@nomiclabs/hardhat-solhint": "2.0.1",
Expand Down
25 changes: 25 additions & 0 deletions config/hardhat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import '@tenderly/hardhat-tenderly'
import '@typechain/hardhat'
import 'hardhat-deploy'
import 'hardhat-deploy-ethers'
import '@matterlabs/hardhat-zksync-deploy'
import '@matterlabs/hardhat-zksync-solc'

import { copyFileSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs'
import { HardhatUserConfig, task } from 'hardhat/config'
Expand Down Expand Up @@ -227,6 +229,11 @@ export const defaultConfig: HardhatUserConfig = {
// tsNocheck: boolean;
// externalArtifacts?: string[];
},
zksolc: {
version: '1.3.1',
compilerSource: 'binary',
settings: {},
},
networks: {
localhost: {
live: false,
Expand All @@ -246,6 +253,24 @@ export const defaultConfig: HardhatUserConfig = {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
},
},
'zksync-testnet': {
url: 'https://zksync2-testnet.zksync.dev', // URL of the zkSync network RPC
ethNetwork: 'goerli', // Can also be the RPC URL of the Ethereum network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
zksync: true,
},
'scroll-alpha-testnet': {
url: `https://alpha-rpc.scroll.io/l2`,
chainId: 534353,
live: true,
saveDeployments: true,
},
consensyszkevmgoerli: {
url: `https://consensys-zkevm-goerli-prealpha.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
chainId: 59140,
live: true,
saveDeployments: true,
},
ethereum: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
accounts,
Expand Down
2 changes: 2 additions & 0 deletions packages/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export enum ChainId {
BOBA_BNB = 56288,
BTTC = 199,
// SEPOLIA = 11155111,
CONSENSUS_ZKEVM_TESTNET = 59140,
SCROLL_ALPHA_TESTNET = 534353,
}

export enum ChainKey {
Expand Down
4 changes: 4 additions & 0 deletions packages/currency/src/constants/token-addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ export const WETH9_ADDRESS = {
[ChainId.ARBITRUM_NOVA]: '0x722E8BdD2ce80A4422E880164f2079488e115365',
[ChainId.BOBA]: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000',
// [ChainId.SEPOLIA]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
[ChainId.CONSENSUS_ZKEVM_TESTNET]: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
[ChainId.SCROLL_ALPHA_TESTNET]: '0xa1EA0B2354F5A344110af2b6AD68e75545009a03',
} as const

export const WNATIVE_ADDRESS = {
Expand Down Expand Up @@ -203,6 +205,8 @@ export const WNATIVE_ADDRESS = {
[ChainId.BTTC]: '0x23181F21DEa5936e24163FFABa4Ea3B316B57f3C',
[ChainId.BOBA_BNB]: '0xC58aaD327D6D58D979882601ba8DDa0685B505eA',
// [ChainId.SEPOLIA]: WETH9_ADDRESS[ChainId.SEPOLIA],
[ChainId.CONSENSUS_ZKEVM_TESTNET]: WETH9_ADDRESS[ChainId.CONSENSUS_ZKEVM_TESTNET],
[ChainId.SCROLL_ALPHA_TESTNET]: WETH9_ADDRESS[ChainId.SCROLL_ALPHA_TESTNET],
} as const

export const SUSHI_ADDRESS = {
Expand Down
9 changes: 9 additions & 0 deletions packages/currency/src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,15 @@ export const WNATIVE = {
name: 'Wrapped BitTorrent Token',
}),
// [ChainId.SEPOLIA]: WETH9[ChainId.SEPOLIA],
[ChainId.BTTC]: new Token({
chainId: ChainId.BTTC,
address: WNATIVE_ADDRESS[ChainId.BTTC],
decimals: 18,
symbol: 'WETH',
name: 'Wrapped BitTorrent Token',
}),
[ChainId.CONSENSUS_ZKEVM_TESTNET]: WETH9[ChainId.CONSENSUS_ZKEVM_TESTNET],
[ChainId.SCROLL_ALPHA_TESTNET]: WETH9[ChainId.SCROLL_ALPHA_TESTNET],
} as const

export const SUSHI = addressMapToTokenMap(
Expand Down
Loading

0 comments on commit c352cb8

Please sign in to comment.