Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding zksync testnet #115

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 58 additions & 3 deletions src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export enum ChainId {
XDAI = 100,
COSTON2 = 114,
EVMOS_TESTNET = 9000,
EVMOS_MAINNET = 9001
EVMOS_MAINNET = 9001,
ZKSYNC_TESTNET = 280
}

export enum StakingType {
Expand Down Expand Up @@ -1991,6 +1992,58 @@ export const COSTON2_TESTNET: Chain = {
blockExplorerUrls: ['https://coston2-explorer.flare.network']
}

export const ZKSYNC_TESTNET: Chain = {
id: 'zksync_testnet',
chain_id: ChainId.ZKSYNC_TESTNET,
name: 'zkSync Testnet',
symbol: 'ETH',
png_symbol: 'PZKS',
mainnet: false,
evm: true,
logo: 'https://raw.githubusercontent.com/pangolindex/sdk/master/src/images/chains/zksync.png',
pangolin_is_live: true,
tracked_by_debank: false,
supported_by_gelato: false,
supported_by_twap: false,
rpc_uri: 'https://zksync2-testnet.zksync.dev',
contracts: {
png: '0x8D127AF2E8015841508D9a99c320231EB78CD85E',
factory: '0x5eDBAe9fdbE01ba8246e8170E0F3aa4deB080bD3',
router: '0x431082C41C8cd3d7eA09D9aD6c6615011a17349A',
wrapped_native_token: '0x7C36d1a6Cd054eD821E41F12F9d9dd6Fbe2EA48d',
local_multisig: '0xbEf6ec231aA6200569ce84F3fe679F2d2Df7273B',
community_treasury: '0x05eE73ED2AAfC0b39c3A24a0a751E6f989B59dA0',
treasury_vester: '0x90933D8822cC8F75B968EebAf211F0381A3d1604',
mini_chef: {
address: '0xEF18B475Eea636a347D6c71E6F2eDa41e26fB1f6',
active: true,
type: ChefType.PANGO_CHEF
},
airdrop: {
address: '0x6c6D7cEF610eF4e7d73A64c960dF0D098Cd88f83',
active: false,
type: AirdropType.MERKLE_TO_STAKING
},
timelock: '0x41399e0a6a26B08ec0951b89d2253aB08eBc9eB0',
fee_collector: '0x8294278614264A5BfFE6Fc2311e8cD257335DF7d',
multicall: '0xBeCF15F939578a4fe2FE75Cc0A1128Eb3202647a',
staking: [
{
address: '0xBF55A67bd5A1077988a63e817e2C0B8509DfAD08',
active: true,
reward_token: '0x8D127AF2E8015841508D9a99c320231EB78CD85E',
type: StakingType.SAR_POSITIONS
}
]
},
nativeCurrency: {
name: 'Ether',
symbol: 'ETH',
decimals: 18
},
blockExplorerUrls: ['https://zksync2-testnet.zkscan.io']
}

export const CHAINS: { [chainId in ChainId]: Chain } = {
[ChainId.FUJI]: AVALANCHE_FUJI,
[ChainId.AVALANCHE]: AVALANCHE_MAINNET,
Expand Down Expand Up @@ -2019,7 +2072,8 @@ export const CHAINS: { [chainId in ChainId]: Chain } = {
[ChainId.OP]: OP_MAINNET,
[ChainId.COSTON2]: COSTON2_TESTNET,
[ChainId.EVMOS_TESTNET]: EVMOS_TESTNET,
[ChainId.EVMOS_MAINNET]: EVMOS_MAINNET
[ChainId.EVMOS_MAINNET]: EVMOS_MAINNET,
[ChainId.ZKSYNC_TESTNET]: ZKSYNC_TESTNET
}

export const ALL_CHAINS: Chain[] = [
Expand Down Expand Up @@ -2083,5 +2137,6 @@ export const ALL_CHAINS: Chain[] = [
OASIS_TESTNET,
GODWOKEN_MAINNET,
GODWOKEN_TESTNET,
COSTON2_TESTNET
COSTON2_TESTNET,
ZKSYNC_TESTNET
]
6 changes: 4 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export const FACTORY_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.OP]: '',
[ChainId.COSTON2]: CHAINS[ChainId.COSTON2].contracts!.factory,
[ChainId.EVMOS_TESTNET]: CHAINS[ChainId.EVMOS_TESTNET].contracts!.factory,
[ChainId.EVMOS_MAINNET]: CHAINS[ChainId.EVMOS_MAINNET].contracts!.factory
[ChainId.EVMOS_MAINNET]: CHAINS[ChainId.EVMOS_MAINNET].contracts!.factory,
[ChainId.ZKSYNC_TESTNET]: CHAINS[ChainId.ZKSYNC_TESTNET].contracts!.factory
}

export const INIT_CODE_HASH = '0x40231f6b438bce0797c9ada29b718a87ea0a5cea3fe9a771abdd76bd41a3e545'
Expand Down Expand Up @@ -76,7 +77,8 @@ export const INIT_CODE_HASH_MAPPING: { [chainId in ChainId]: string } = {
[ChainId.OP]: '',
[ChainId.COSTON2]: INIT_CODE_HASH,
[ChainId.EVMOS_TESTNET]: INIT_CODE_HASH,
[ChainId.EVMOS_MAINNET]: INIT_CODE_HASH
[ChainId.EVMOS_MAINNET]: INIT_CODE_HASH,
[ChainId.ZKSYNC_TESTNET]: INIT_CODE_HASH
}

export const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)
Expand Down
7 changes: 6 additions & 1 deletion src/entities/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export class Currency {
[ChainId.OP]: new Currency(18, CHAINS[ChainId.OP].symbol, CHAINS[ChainId.OP].name),
[ChainId.COSTON2]: new Currency(18, CHAINS[ChainId.COSTON2].symbol, CHAINS[ChainId.COSTON2].name),
[ChainId.EVMOS_TESTNET]: new Currency(18, CHAINS[ChainId.EVMOS_TESTNET].symbol, CHAINS[ChainId.EVMOS_TESTNET].name),
[ChainId.EVMOS_MAINNET]: new Currency(18, CHAINS[ChainId.EVMOS_MAINNET].symbol, CHAINS[ChainId.EVMOS_MAINNET].name)
[ChainId.EVMOS_MAINNET]: new Currency(18, CHAINS[ChainId.EVMOS_MAINNET].symbol, CHAINS[ChainId.EVMOS_MAINNET].name),
[ChainId.ZKSYNC_TESTNET]: new Currency(
18,
CHAINS[ChainId.ZKSYNC_TESTNET].symbol,
CHAINS[ChainId.ZKSYNC_TESTNET].name
)
}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/entities/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,12 @@ export const WAVAX: { [chainId in ChainId]: Token } = {
18,
'WEVMOS',
'Wrapped Evmos'
),
[ChainId.ZKSYNC_TESTNET]: new Token(
ChainId.ZKSYNC_TESTNET,
CHAINS[ChainId.ZKSYNC_TESTNET].contracts!.wrapped_native_token,
18,
'WAVAX',
'Wrapped AVAX'
)
}
Binary file added src/images/chains/zksync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.