Skip to content

Commit

Permalink
Add ZKsync blockchain support
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Feb 20, 2025
1 parent 28d0beb commit 423d5cb
Show file tree
Hide file tree
Showing 28 changed files with 171 additions and 93 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/deploy_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,26 @@ jobs:
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

XCCONFIG_PROD_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_ETHERSCAN_API_KEYS }}
XCCONFIG_PROD_ARBISCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_ARBISCAN_API_KEYS }}
XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEYS }}
XCCONFIG_PROD_BASESCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_BASESCAN_API_KEYS }}
XCCONFIG_PROD_BSCSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_BSCSCAN_API_KEYS }}
XCCONFIG_PROD_POLYGONSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_POLYGONSCAN_API_KEYS }}
XCCONFIG_PROD_SNOWTRACE_API_KEYS: ${{ secrets.XCCONFIG_PROD_SNOWTRACE_API_KEYS }}
XCCONFIG_PROD_GNOSISSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_GNOSISSCAN_API_KEYS }}
XCCONFIG_PROD_FTMSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_FTMSCAN_API_KEYS }}
XCCONFIG_PROD_DEFIYIELD_API_KEY: ${{ secrets.XCCONFIG_PROD_DEFIYIELD_API_KEY }}
XCCONFIG_PROD_TWITTER_BEARER_TOKEN: ${{ secrets.XCCONFIG_PROD_TWITTER_BEARER_TOKEN }}
XCCONFIG_PROD_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_PROD_HS_PROVIDER_API_KEY }}
XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY }}
XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }}
XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }}
XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_PROD_CHAINALYSIS_API_KEY: ${{ secrets.XCCONFIG_PROD_CHAINALYSIS_API_KEY }}
XCCONFIG_PROD_DEFIYIELD_API_KEY: ${{ secrets.XCCONFIG_PROD_DEFIYIELD_API_KEY }}
XCCONFIG_PROD_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_ETHERSCAN_API_KEYS }}
XCCONFIG_PROD_ERA_ZKSYNC_API_KEYS: ${{ secrets.XCCONFIG_PROD_ERA_ZKSYNC_API_KEYS }}
XCCONFIG_PROD_FTMSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_FTMSCAN_API_KEYS }}
XCCONFIG_PROD_GNOSISSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_GNOSISSCAN_API_KEYS }}
XCCONFIG_PROD_HASHDIT_API_KEY: ${{ secrets.XCCONFIG_PROD_HASHDIT_API_KEY }}
XCCONFIG_PROD_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_PROD_HS_PROVIDER_API_KEY }}
XCCONFIG_PROD_ONE_INCH_API_KEY: ${{ secrets.XCCONFIG_PROD_ONE_INCH_API_KEY }}
XCCONFIG_PROD_ONE_INCH_COMMISSION: ${{ secrets.XCCONFIG_PROD_ONE_INCH_COMMISSION }}
XCCONFIG_PROD_ONE_INCH_COMMISSION_ADDRESS: ${{ secrets.XCCONFIG_PROD_ONE_INCH_COMMISSION_ADDRESS }}
XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }}
XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEYS }}
XCCONFIG_PROD_POLYGONSCAN_API_KEYS: ${{ secrets.XCCONFIG_PROD_POLYGONSCAN_API_KEYS }}
XCCONFIG_PROD_REFERRAL_APP_SERVER_URL: ${{ secrets.XCCONFIG_PROD_REFERRAL_APP_SERVER_URL }}
XCCONFIG_PROD_SNOWTRACE_API_KEYS: ${{ secrets.XCCONFIG_PROD_SNOWTRACE_API_KEYS }}
XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }}
XCCONFIG_PROD_TWITTER_BEARER_TOKEN: ${{ secrets.XCCONFIG_PROD_TWITTER_BEARER_TOKEN }}
XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY }}
30 changes: 16 additions & 14 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,27 @@ jobs:
APP_CENTER_API_TOKEN: ${{ secrets.APP_CENTER_API_TOKEN }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

XCCONFIG_DEV_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_ETHERSCAN_API_KEYS }}
XCCONFIG_DEV_ARBISCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_ARBISCAN_API_KEYS }}
XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEYS }}
XCCONFIG_DEV_BASESCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_BASESCAN_API_KEYS }}
XCCONFIG_DEV_BSCSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_BSCSCAN_API_KEYS }}
XCCONFIG_DEV_POLYGONSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_POLYGONSCAN_API_KEYS }}
XCCONFIG_DEV_SNOWTRACE_API_KEYS: ${{ secrets.XCCONFIG_DEV_SNOWTRACE_API_KEYS }}
XCCONFIG_DEV_GNOSISSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_GNOSISSCAN_API_KEYS }}
XCCONFIG_DEV_FTMSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_FTMSCAN_API_KEYS }}
XCCONFIG_DEV_DEFIYIELD_API_KEY: ${{ secrets.XCCONFIG_DEV_DEFIYIELD_API_KEY }}
XCCONFIG_DEV_TWITTER_BEARER_TOKEN: ${{ secrets.XCCONFIG_DEV_TWITTER_BEARER_TOKEN }}
XCCONFIG_DEV_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_DEV_HS_PROVIDER_API_KEY }}
XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY }}
XCCONFIG_DEV_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_DEV_OPEN_SEA_API_KEY }}
XCCONFIG_DEV_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_DEV_TRONGRID_API_KEY }}
XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_DEV_CHAINALYSIS_API_KEY: ${{ secrets.XCCONFIG_DEV_CHAINALYSIS_API_KEY }}
XCCONFIG_DEV_DEFIYIELD_API_KEY: ${{ secrets.XCCONFIG_DEV_DEFIYIELD_API_KEY }}
XCCONFIG_DEV_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_ETHERSCAN_API_KEYS }}
XCCONFIG_DEV_ERA_ZKSYNC_API_KEYS: ${{ secrets.XCCONFIG_DEV_ERA_ZKSYNC_API_KEYS }}
XCCONFIG_DEV_FTMSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_FTMSCAN_API_KEYS }}
XCCONFIG_DEV_GNOSISSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_GNOSISSCAN_API_KEYS }}
XCCONFIG_DEV_HASHDIT_API_KEY: ${{ secrets.XCCONFIG_DEV_HASHDIT_API_KEY }}
XCCONFIG_DEV_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_DEV_HS_PROVIDER_API_KEY }}
XCCONFIG_DEV_ONE_INCH_API_KEY: ${{ secrets.XCCONFIG_DEV_ONE_INCH_API_KEY }}
XCCONFIG_DEV_ONE_INCH_COMMISSION: ${{ secrets.XCCONFIG_DEV_ONE_INCH_COMMISSION }}
XCCONFIG_DEV_ONE_INCH_COMMISSION_ADDRESS: ${{ secrets.XCCONFIG_DEV_ONE_INCH_COMMISSION_ADDRESS }}
XCCONFIG_DEV_REFERRAL_APP_SERVER_URL: ${{ secrets.XCCONFIG_DEV_REFERRAL_APP_SERVER_URL }}
XCCONFIG_DEV_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_DEV_OPEN_SEA_API_KEY }}
XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_OPTIMISM_ETHERSCAN_API_KEYS }}
XCCONFIG_DEV_POLYGONSCAN_API_KEYS: ${{ secrets.XCCONFIG_DEV_POLYGONSCAN_API_KEYS }}
XCCONFIG_DEV_REFERRAL_APP_SERVER_URL: ${{ secrets.XCCONFIG_DEV_REFERRAL_APP_SERVER_URL }}
XCCONFIG_DEV_SNOWTRACE_API_KEYS: ${{ secrets.XCCONFIG_DEV_SNOWTRACE_API_KEYS }}
XCCONFIG_DEV_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_DEV_TRONGRID_API_KEY }}
XCCONFIG_DEV_TWITTER_BEARER_TOKEN: ${{ secrets.XCCONFIG_DEV_TWITTER_BEARER_TOKEN }}
XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY }}

6 changes: 3 additions & 3 deletions UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13170,7 +13170,7 @@
repositoryURL = "https://github.com/horizontalsystems/EvmKit.Swift";
requirement = {
kind = exactVersion;
version = 2.2.0;
version = 2.3.0;
};
};
D3604E4828F02A8B0066C366 /* XCRemoteSwiftPackageReference "Eip20Kit" */ = {
Expand All @@ -13194,7 +13194,7 @@
repositoryURL = "https://github.com/horizontalsystems/UniswapKit.Swift";
requirement = {
kind = exactVersion;
version = 3.0.2;
version = 3.1.0;
};
};
D3604E5128F02B150066C366 /* XCRemoteSwiftPackageReference "OneInchKit" */ = {
Expand Down Expand Up @@ -13234,7 +13234,7 @@
repositoryURL = "https://github.com/horizontalsystems/MarketKit.Swift";
requirement = {
kind = exactVersion;
version = 3.2.0;
version = 3.3.0;
};
};
D3604E7D28F03C1D0066C366 /* XCRemoteSwiftPackageReference "Chart" */ = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ etherscan_api_keys =
arbiscan_api_keys =
optimism_etherscan_api_keys =
basescan_api_keys =
era_zksync_api_keys =
bscscan_api_keys =
polygonscan_api_keys =
gnosisscan_api_keys =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ etherscan_api_keys =
arbiscan_api_keys =
optimism_etherscan_api_keys =
basescan_api_keys =
era_zksync_api_keys =
bscscan_api_keys =
polygonscan_api_keys =
gnosisscan_api_keys =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ extension UdnAddressParserItem {
case .solana: return "SOL"
case .ton: return "TON"
case .base: return "ETH"
case .zkSync: return "ETH"
case let .unsupported(uid): return uid
}
}

static func chain(token: Token) -> String? {
switch (token.blockchainType, token.type) {
case (.ethereum, .eip20), (.optimism, .eip20), (.arbitrumOne, .eip20), (.gnosis, .eip20), (.fantom, .eip20), (.base, .eip20): return "ERC20"
case (.ethereum, .eip20), (.optimism, .eip20), (.arbitrumOne, .eip20), (.gnosis, .eip20), (.fantom, .eip20), (.base, .eip20), (.zkSync, .eip20): return "ERC20"
case (.binanceSmartChain, .native), (.binanceSmartChain, .eip20): return "BEP20"
case (.polygon, .native), (.polygon, .eip20): return "MATIC"
case (.avalanche, .native), (.avalanche, .eip20): return "AVAX"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ extension AdapterFactory {
let restoreSettings = restoreSettingsManager.settings(accountId: wallet.account.id, blockchainType: .zcash)
return try? ZcashAdapter(wallet: wallet, restoreSettings: restoreSettings)

case (.native, .ethereum), (.native, .binanceSmartChain), (.native, .polygon), (.native, .avalanche), (.native, .optimism), (.native, .arbitrumOne), (.native, .gnosis), (.native, .fantom), (.native, .base):
case (.native, .ethereum), (.native, .binanceSmartChain), (.native, .polygon), (.native, .avalanche), (.native, .optimism), (.native, .arbitrumOne), (.native, .gnosis), (.native, .fantom), (.native, .base), (.native, .zkSync):
return evmAdapter(wallet: wallet)

case let (.eip20(address), .ethereum), let (.eip20(address), .binanceSmartChain), let (.eip20(address), .polygon), let (.eip20(address), .avalanche), let (.eip20(address), .optimism), let (.eip20(address), .arbitrumOne), let (.eip20(address), .gnosis), let (.eip20(address), .fantom), let (.eip20(address), .base):
case let (.eip20(address), .ethereum), let (.eip20(address), .binanceSmartChain), let (.eip20(address), .polygon), let (.eip20(address), .avalanche), let (.eip20(address), .optimism), let (.eip20(address), .arbitrumOne), let (.eip20(address), .gnosis), let (.eip20(address), .fantom), let (.eip20(address), .base), let (.eip20(address), .zkSync):
return eip20Adapter(address: address, wallet: wallet, coinManager: coinManager)

case (.native, .tron):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum AddressParserFactory {
}

return handlers
case .ethereum, .gnosis, .fantom, .polygon, .arbitrumOne, .avalanche, .optimism, .binanceSmartChain, .base:
case .ethereum, .gnosis, .fantom, .polygon, .arbitrumOne, .avalanche, .optimism, .binanceSmartChain, .base, .zkSync:
let evmAddressParserItem = EvmAddressParser(blockchainType: blockchainType)

var handlers = [IAddressParserItem]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EvmBlockchainManager {
.gnosis,
.fantom,
.base,
.zkSync,
]

private let syncSourceManager: EvmSyncSourceManager
Expand Down Expand Up @@ -105,6 +106,7 @@ extension EvmBlockchainManager {
case .gnosis: return .gnosis
case .fantom: return .fantom
case .base: return .base
case .zkSync: return .zkSync
default: fatalError("Unsupported blockchain type")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class EvmSyncSourceManager {
case .gnosis: return .gnosis(apiKeys: AppConfig.gnosisscanKeys)
case .fantom: return .fantom(apiKeys: AppConfig.ftmscanKeys)
case .base: return .basescan(apiKeys: AppConfig.basescanKeys)
case .zkSync: return .eraZkSync(apiKeys: AppConfig.eraZkSyncKeys)
default: fatalError("Non-supported EVM blockchain")
}
}
Expand Down Expand Up @@ -203,6 +204,14 @@ extension EvmSyncSourceManager {
transactionSource: defaultTransactionSource(blockchainType: blockchainType)
),
]
case .zkSync:
return [
EvmSyncSource(
name: "ZKsync",
rpcSource: .zkSyncRpcHttp(),
transactionSource: defaultTransactionSource(blockchainType: blockchainType)
),
]
default:
return []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum AppConfig {
.avalanche: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.optimism: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.base: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.zkSync: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.arbitrumOne: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.gnosis: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
.fantom: "0xA24c159C7f1E4A04dab7c364C2A8b87b3dBa4cd1",
Expand Down Expand Up @@ -97,6 +98,10 @@ enum AppConfig {
((Bundle.main.object(forInfoDictionaryKey: "BasescanApiKeys") as? String) ?? "").components(separatedBy: ",")
}

static var eraZkSyncKeys: [String] {
((Bundle.main.object(forInfoDictionaryKey: "EraZkSyncApiKeys") as? String) ?? "").components(separatedBy: ",")
}

static var bscscanKeys: [String] {
((Bundle.main.object(forInfoDictionaryKey: "BscscanApiKeys") as? String) ?? "").components(separatedBy: ",")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ extension BlockchainType {
.gnosis,
.fantom,
.base,
.zkSync,
.binanceSmartChain,
.tron,
.ton,
Expand Down Expand Up @@ -55,6 +56,7 @@ extension BlockchainType {
.polygon,
.base,
.avalanche,
.zkSync,
.zcash,
.bitcoinCash,
.ecash,
Expand Down Expand Up @@ -114,7 +116,7 @@ extension BlockchainType {
}
case .evmPrivateKey, .evmAddress:
switch self {
case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base: return true
case .ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base, .zkSync: return true
default: return false
}
case .tronAddress:
Expand Down Expand Up @@ -144,6 +146,7 @@ extension BlockchainType {
case .fantom: return "FTM, ERC20 tokens"
case .optimism: return "L2 chain"
case .base: return "L2 chain"
case .zkSync: return "L2 chain"
case .arbitrumOne: return "L2 chain"
case .zcash: return "ZEC"
case .dash: return "DASH"
Expand Down
1 change: 1 addition & 0 deletions UnstoppableWallet/UnstoppableWallet/Extensions/Token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extension Token {
case .gnosis: return true
case .fantom: return true
case .base: return true
case .zkSync: return true
default: return false
}
}
Expand Down
2 changes: 2 additions & 0 deletions UnstoppableWallet/UnstoppableWallet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
<string>$(defiyield_api_key)</string>
<key>DonateEnabled</key>
<string>${donate_enabled}</string>
<key>EraZkSyncApiKeys</key>
<string>${era_zksync_api_keys}</string>
<key>EtherscanApiKeys</key>
<string>${etherscan_api_keys}</string>
<key>FtmscanApiKeys</key>
Expand Down
2 changes: 2 additions & 0 deletions UnstoppableWallet/UnstoppableWallet/Models/AccountType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ enum AccountType {
case (.arbitrumOne, .native), (.arbitrumOne, .eip20): return true
case (.optimism, .native), (.optimism, .eip20): return true
case (.base, .native), (.base, .eip20): return true
case (.zkSync, .native), (.zkSync, .eip20): return true
case (.tron, .native), (.tron, .eip20): return true
case (.ton, .native), (.ton, .jetton): return true
default: return false
Expand Down Expand Up @@ -114,6 +115,7 @@ enum AccountType {
case (.arbitrumOne, .native), (.arbitrumOne, .eip20): return true
case (.optimism, .native), (.optimism, .eip20): return true
case (.base, .native), (.base, .eip20): return true
case (.zkSync, .native), (.zkSync, .eip20): return true
default: return false
}
case .tronAddress:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PancakeV3MultiSwapProvider: BaseUniswapV3MultiSwapProvider {
}

switch tokenIn.blockchainType {
case .ethereum, .binanceSmartChain, .base: return true
case .ethereum, .binanceSmartChain, .base, .zkSync: return true
default: return false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UniswapV3MultiSwapProvider: BaseUniswapV3MultiSwapProvider {
}

switch tokenIn.blockchainType {
case .ethereum, .binanceSmartChain, .polygon, .arbitrumOne, .base: return true
case .ethereum, .binanceSmartChain, .polygon, .arbitrumOne, .base, .zkSync: return true
default: return false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ extension BlockchainType {
case .gnosis: return [.oneInch]
case .fantom: return [.oneInch]
case .base: return [.oneInch, .uniswap, .uniswapV3]
case .zkSync: return [.uniswapV3, .pancakeV3]
default: return []
}
}
Expand Down Expand Up @@ -184,10 +185,10 @@ extension SwapModule.Dex {
var allowedBlockchainTypes: [BlockchainType] {
switch self {
case .uniswap: return [.ethereum, .base]
case .uniswapV3: return [.ethereum, .binanceSmartChain, .arbitrumOne, .polygon, .base]
case .uniswapV3: return [.ethereum, .binanceSmartChain, .arbitrumOne, .polygon, .base, .zkSync]
case .oneInch: return [.ethereum, .binanceSmartChain, .polygon, .avalanche, .optimism, .arbitrumOne, .gnosis, .fantom, .base]
case .pancake: return [.binanceSmartChain]
case .pancakeV3: return [.ethereum, .binanceSmartChain]
case .pancakeV3: return [.ethereum, .binanceSmartChain, .base, .zkSync]
case .quickSwap: return [.polygon]
}
}
Expand Down
Loading

0 comments on commit 423d5cb

Please sign in to comment.