Skip to content

Commit

Permalink
Add zkLink network (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doctor-Cyclone authored Apr 17, 2024
2 parents fa5c3d0 + 238652c commit 981bda2
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubic-sdk",
"version": "5.15.7",
"version": "5.16.0",
"description": "Simplify dApp creation",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -93,7 +93,7 @@
"ethers": "^5.6.8",
"graphql-request": "^6.1.0",
"grpc-web": "^1.4.2",
"iziswap-sdk": "1.4.9",
"iziswap-sdk": "1.4.11",
"lodash.clonedeep": "^4.5.0",
"rxjs": "7.8.1",
"tronweb": "^5.3.2",
Expand Down
7 changes: 7 additions & 0 deletions src/common/tokens/constants/native-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,5 +446,12 @@ export const nativeTokensList: Record<BlockchainName, Token> = {
name: 'USDC',
symbol: 'USDC',
decimals: 18
}),
[BLOCKCHAIN_NAME.ZK_LINK]: new Token({
blockchain: BLOCKCHAIN_NAME.ZK_LINK,
address: EvmWeb3Pure.nativeTokenAddress,
name: 'ETH',
symbol: 'ETH',
decimals: 18
})
};
1 change: 1 addition & 0 deletions src/common/tokens/constants/wrapped-addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const wrappedAddress: Partial<Record<EvmBlockchainName, string>> = {
[BLOCKCHAIN_NAME.ROOTSTOCK]: '0x542fda317318ebf1d3deaf76e0b632741a7e677d',
[BLOCKCHAIN_NAME.MODE]: '0x4200000000000000000000000000000000000006',
[BLOCKCHAIN_NAME.ZK_FAIR]: '0xD33Db7EC50A98164cC865dfaa64666906d79319C',
[BLOCKCHAIN_NAME.ZK_LINK]: '0x8280a4e7d5b3b658ec4580d3bc30f5e50454f169',
// Testnet
[BLOCKCHAIN_NAME.GOERLI]: '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6',
[BLOCKCHAIN_NAME.SCROLL_SEPOLIA]: '0x5300000000000000000000000000000000000004',
Expand Down
7 changes: 7 additions & 0 deletions src/common/tokens/constants/wrapped-native-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,5 +429,12 @@ export const wrappedNativeTokensList: Partial<Record<EvmBlockchainName, Token>>
name: 'Wrapped USDC',
symbol: 'WUSDC',
decimals: 18
}),
[BLOCKCHAIN_NAME.ZK_LINK]: new Token({
blockchain: BLOCKCHAIN_NAME.ZK_LINK,
address: '0x8280a4e7d5b3b658ec4580d3bc30f5e50454f169',
name: 'Wrapped Ether',
symbol: 'WETH',
decimals: 18
})
};
3 changes: 2 additions & 1 deletion src/core/blockchain/models/blockchain-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const EVM_BLOCKCHAIN_NAME = {
MERLIN: 'MERLIN',
ROOTSTOCK: 'ROOTSTOCK',
MODE: 'MODE',
ZK_FAIR: 'ZK_FAIR'
ZK_FAIR: 'ZK_FAIR',
ZK_LINK: 'ZK_LINK'
} as const;

export const BLOCKCHAIN_NAME = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const blockchainId: Record<BlockchainName, number> = {
[BLOCKCHAIN_NAME.ROOTSTOCK]: 30,
[BLOCKCHAIN_NAME.MODE]: 34443,
[BLOCKCHAIN_NAME.ZK_FAIR]: 42766,
[BLOCKCHAIN_NAME.ZK_LINK]: 810180,
// Tesnents
[BLOCKCHAIN_NAME.GOERLI]: 5,
[BLOCKCHAIN_NAME.BINANCE_SMART_CHAIN_TESTNET]: 87,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ export const MULTICALL_ADDRESSES: Record<Web3PublicSupportedBlockchain, string>
[BLOCKCHAIN_NAME.HORIZEN_EON]: '0x4ea6779581bDAcd376724A52070bE89FfB74eC39',
[BLOCKCHAIN_NAME.MERLIN]: '0x45CFd6FB7999328F189aaD2739Fba4Be6C45E5bf',
[BLOCKCHAIN_NAME.MODE]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[BLOCKCHAIN_NAME.ZK_FAIR]: '0xcA11bde05977b3631167028862bE2a173976CA11'
[BLOCKCHAIN_NAME.ZK_FAIR]: '0xcA11bde05977b3631167028862bE2a173976CA11',
[BLOCKCHAIN_NAME.ZK_LINK]: '0x7E06D0CD8D3fDDBB875345dF389d986f810A49F6'
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const symbiosisCrossChainSupportedBlockchains = [
BLOCKCHAIN_NAME.MERLIN,
BLOCKCHAIN_NAME.ROOTSTOCK,
BLOCKCHAIN_NAME.MODE,
BLOCKCHAIN_NAME.ZK_LINK,
// Testnets
BLOCKCHAIN_NAME.GOERLI,
BLOCKCHAIN_NAME.BINANCE_SMART_CHAIN_TESTNET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IzumiMantleProvider } from 'src/features/on-chain/calculation-manager/p
import { MerlinSwapMerlinProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/merlin/merlin-swap/merlin-swap-merlin-provider';
import { IzumiZetachainProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zetachain/izumi-zetachain/izumi-zetachain-provider';
import { IzumiZkfairProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zkfair/izumi-zkfair/izumi-zkfair-provider';
import { IzumiZkLinkProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zklink/izumi-zklink/izumi-zklink-provider';
import { IzumiZksyncProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zksync/izumi-zksync/izumi-zksync-provider';

import { IzumiArbitrumProvider } from '../../providers/dexes/arbitrum/izumi-arbitrum/izumi-arbitrum-provider';
Expand All @@ -22,6 +23,7 @@ export const izumiTradeProviders = [
IzumiKromaProvider,
IzumiArbitrumProvider,
MerlinSwapMerlinProvider,
IzumiZkfairProvider
IzumiZkfairProvider,
IzumiZkLinkProvider
// IzumiBlastProvider
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { wrappedNativeTokensList } from 'src/common/tokens/constants/wrapped-native-tokens';
import { BLOCKCHAIN_NAME } from 'src/core/blockchain/models/blockchain-name';
import { IzumiProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/common/izumi-abstract/izumi-provider';

export class IzumiZkLinkProvider extends IzumiProvider {
public readonly blockchain = BLOCKCHAIN_NAME.ZK_LINK;

protected readonly dexAddress = '0x377EC7c9ae5a0787F384668788a1654249059dD6';

protected readonly config = {
maxTransitTokens: 2,
quoterAddress: '0x7dEe7de9814ed6C1e20B3E4E2fA9b1B96E15FDe1',
liquidityManagerAddress: '0x936c9A1B8f88BFDbd5066ad08e5d773BC82EB15F',
routingTokenAddresses: [
wrappedNativeTokensList[BLOCKCHAIN_NAME.ZK_LINK]!.address, // WRAP
'0x1a1A3b2ff016332e866787B311fcB63928464509', // USDC
'0x2F8A25ac62179B31D62D7F80884AE57464699059' // USDT
],
multicallAddress: 'fd5f0acaaa666f3d816fe3dd54a96dacd6e7bb16',
supportedFees: [10000, 3000, 500]
};
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7098,10 +7098,10 @@ istanbul-reports@^3.1.3:
html-escaper "^2.0.0"
istanbul-lib-report "^3.0.0"

[email protected].9:
version "1.4.9"
resolved "https://registry.yarnpkg.com/iziswap-sdk/-/iziswap-sdk-1.4.9.tgz#4534081803addc6149d618b5971f715d3db74c89"
integrity sha512-0GkEkDBSksZ4lSSFHZD3ExzwLgffpoVOx3GLkpeKmFqOEn7HISk6IxG35aWI6pv7aRqijAXk8NH07KGoP6y9gQ==
[email protected].11:
version "1.4.11"
resolved "https://registry.yarnpkg.com/iziswap-sdk/-/iziswap-sdk-1.4.11.tgz#730fe48a42e451cb842be91926fea135b6a6adbc"
integrity sha512-ddbzKSLuWtCYOszNUFgMOaBNISo4E4mbz3aWcv78W2k6CKzk4Vvbssd764S4GrifuV15hayttDNKZuGOVE348g==
dependencies:
bignumber.js "^9.0.2"
http "^0.0.1-security"
Expand Down

0 comments on commit 981bda2

Please sign in to comment.