From 4bbc429e82006703d637c841cbadfc277b2b6b83 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 30 Nov 2020 17:20:13 +0800 Subject: [PATCH] Use named constant instead of magic number --- AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift b/AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift index 91d8bc193..9d5334952 100644 --- a/AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift +++ b/AlphaWallet/Core/SwapToken/Oneinch/Oneinch.swift @@ -20,9 +20,9 @@ class Oneinch: SwapTokenActionsService, SwapTokenURLProviderType { //NOTE: for Oneinch exchange service we need to use two addresses, by default it uses Uptrennd token private static let outputAddress = AlphaWallet.Address(string: "0x07597255910a51509ca469568b048f2597e72504")! private let predefinedTokens: [Oneinch.ERC20Token] = [ - .init(symbol: "ETH", name: "ETH", address: Constants.nativeCryptoAddressInDatabase, decimal: 18) + .init(symbol: "ETH", name: "ETH", address: Constants.nativeCryptoAddressInDatabase, decimal: RPCServer.main.decimals) ] - //NOTE: we use dictionary to improve search tokens + //NOTE: we use dictionary to improve search tokens private var availableTokens: [AlphaWallet.Address: Oneinch.ERC20Token] = [:] func url(token: TokenObject) -> URL? {