From 993a96adf48cf8abcc015c3c1c76981bea7dced1 Mon Sep 17 00:00:00 2001 From: aplki Date: Mon, 25 Oct 2021 16:05:37 +0800 Subject: [PATCH 1/3] Feature: Re-enable other tokens in swap --- src/constants/tokenLists/halo-tokenlist.ts | 23 ++++++++++++---------- src/pages/Tailwind/Swap/SwapPanel.tsx | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/constants/tokenLists/halo-tokenlist.ts b/src/constants/tokenLists/halo-tokenlist.ts index 583e0ab7..949f7a8e 100644 --- a/src/constants/tokenLists/halo-tokenlist.ts +++ b/src/constants/tokenLists/halo-tokenlist.ts @@ -3,6 +3,7 @@ import { ethers } from 'ethers' import { ChainAddressMap, USDC, ZERO_ADDRESS } from '../../constants' // Supported token symbols +// Adding new pairs step 1: Add tokensymbol enum export enum TokenSymbol { USDC = 'USDC', EURS = 'EURS', @@ -34,13 +35,14 @@ export const haloUSDC: { [chainId in ChainId]?: Token } = { // Token Lists // Add tokens here to support, divided into different networks +// Adding new pairs step 2: Add token in tokenList const mainNetTokenList: Token[] = [ USDC, - new Token(ChainId.MAINNET, '0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96', 6, 'XSGD', 'Xfers SGD') - // new Token(ChainId.MAINNET, '0x00000100F2A2bd000715001920eB70D229700085', 18, 'TCAD', 'True CAD'), - // new Token(ChainId.MAINNET, '0x00006100F7090010005F1bd7aE6122c3C2CF0090', 18, 'TAUD', 'True AUD'), - // new Token(ChainId.MAINNET, '0x00000000441378008EA67F4284A57932B1c000a5', 18, 'TGBP', 'True GBP'), - // new Token(ChainId.MAINNET, '0x0000000000085d4780B73119b644AE5ecd22b376', 18, 'TUSD', 'True USD') + new Token(ChainId.MAINNET, '0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96', 6, 'XSGD', 'Xfers SGD'), + new Token(ChainId.MAINNET, '0x00000100F2A2bd000715001920eB70D229700085', 18, 'TCAD', 'True CAD'), + new Token(ChainId.MAINNET, '0x00006100F7090010005F1bd7aE6122c3C2CF0090', 18, 'TAUD', 'True AUD'), + new Token(ChainId.MAINNET, '0x00000000441378008EA67F4284A57932B1c000a5', 18, 'TGBP', 'True GBP'), + // new Token(ChainId.MAINNET, '0x0000000000085d4780B73119b644AE5ecd22b376', 18, 'TUSD', 'True USD') ] const kovanTokenList: Token[] = [ @@ -52,11 +54,11 @@ const kovanTokenList: Token[] = [ const polygonTokenList: Token[] = [ haloUSDC[ChainId.MATIC] as Token, - new Token(ChainId.MATIC, '0x769434dcA303597C8fc4997Bf3DAB233e961Eda2', 6, 'XSGD', 'Xfers SGD') - // new Token(ChainId.MATIC, '0xe4F7761b541668f88d04fe9F2E9DF10CA613aEf7', 18, 'TAUD', 'Wrapped True AUD'), - // new Token(ChainId.MATIC, '0x6d3cC56DFC016151eE2613BdDe0e03Af9ba885CC', 18, 'TCAD', 'Wrapped True CAD'), - // new Token(ChainId.MATIC, '0x81A123f10C78216d32F8655eb1A88B5E9A3e9f2F', 18, 'TGBP', 'Wrapped True GBP'), - // new Token(ChainId.MATIC, '0x2e1AD108fF1D8C782fcBbB89AAd783aC49586756', 18, 'TUSD', 'Wrapped True USD') + new Token(ChainId.MATIC, '0x769434dcA303597C8fc4997Bf3DAB233e961Eda2', 6, 'XSGD', 'Xfers SGD'), + new Token(ChainId.MATIC, '0xe4F7761b541668f88d04fe9F2E9DF10CA613aEf7', 18, 'TAUD', 'Wrapped True AUD'), + new Token(ChainId.MATIC, '0x6d3cC56DFC016151eE2613BdDe0e03Af9ba885CC', 18, 'TCAD', 'Wrapped True CAD'), + new Token(ChainId.MATIC, '0x81A123f10C78216d32F8655eb1A88B5E9A3e9f2F', 18, 'TGBP', 'Wrapped True GBP'), + new Token(ChainId.MATIC, '0x2e1AD108fF1D8C782fcBbB89AAd783aC49586756', 18, 'TUSD', 'Wrapped True USD') ] // allows switch of token list when changing networks @@ -68,6 +70,7 @@ export const haloTokenList: { [chainId in ChainId]?: Token[] } = { // Assimilators // Add assimilators here to support. These are arranged per base currency per network +// Adding new pairs step 3: Add assimilator const mainNetAssimilators: AssimilatorAddressMap = { [TokenSymbol.USDC]: ZERO_ADDRESS, [TokenSymbol.EURS]: ZERO_ADDRESS, diff --git a/src/pages/Tailwind/Swap/SwapPanel.tsx b/src/pages/Tailwind/Swap/SwapPanel.tsx index 6b2773fa..f3359ebc 100644 --- a/src/pages/Tailwind/Swap/SwapPanel.tsx +++ b/src/pages/Tailwind/Swap/SwapPanel.tsx @@ -334,7 +334,7 @@ const SwapPanel = () => { { if (parseFloat(fromAmountBalance) >= parseFloat(val)) { setButtonState(SwapButtonState.Swap) @@ -385,7 +385,7 @@ const SwapPanel = () => { { if (approveState === ApproveButtonState.Approved) { setButtonState(SwapButtonState.Swap) From 6920037691de116bf6f0ad17c16744028ae855f7 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Mon, 25 Oct 2021 08:10:01 +0000 Subject: [PATCH 2/3] Fix code style issues with ESLint --- src/constants/tokenLists/halo-tokenlist.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants/tokenLists/halo-tokenlist.ts b/src/constants/tokenLists/halo-tokenlist.ts index 949f7a8e..971d05a8 100644 --- a/src/constants/tokenLists/halo-tokenlist.ts +++ b/src/constants/tokenLists/halo-tokenlist.ts @@ -41,8 +41,8 @@ const mainNetTokenList: Token[] = [ new Token(ChainId.MAINNET, '0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96', 6, 'XSGD', 'Xfers SGD'), new Token(ChainId.MAINNET, '0x00000100F2A2bd000715001920eB70D229700085', 18, 'TCAD', 'True CAD'), new Token(ChainId.MAINNET, '0x00006100F7090010005F1bd7aE6122c3C2CF0090', 18, 'TAUD', 'True AUD'), - new Token(ChainId.MAINNET, '0x00000000441378008EA67F4284A57932B1c000a5', 18, 'TGBP', 'True GBP'), - // new Token(ChainId.MAINNET, '0x0000000000085d4780B73119b644AE5ecd22b376', 18, 'TUSD', 'True USD') + new Token(ChainId.MAINNET, '0x00000000441378008EA67F4284A57932B1c000a5', 18, 'TGBP', 'True GBP') + // new Token(ChainId.MAINNET, '0x0000000000085d4780B73119b644AE5ecd22b376', 18, 'TUSD', 'True USD') ] const kovanTokenList: Token[] = [ From c86440c29683cf985870514058a81d1b39f7b16c Mon Sep 17 00:00:00 2001 From: tracy Date: Tue, 26 Oct 2021 17:37:36 +0800 Subject: [PATCH 3/3] Applying this commit will remove TSUD token in Polygon --- src/constants/tokenLists/halo-tokenlist.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants/tokenLists/halo-tokenlist.ts b/src/constants/tokenLists/halo-tokenlist.ts index 971d05a8..07f3c619 100644 --- a/src/constants/tokenLists/halo-tokenlist.ts +++ b/src/constants/tokenLists/halo-tokenlist.ts @@ -57,8 +57,8 @@ const polygonTokenList: Token[] = [ new Token(ChainId.MATIC, '0x769434dcA303597C8fc4997Bf3DAB233e961Eda2', 6, 'XSGD', 'Xfers SGD'), new Token(ChainId.MATIC, '0xe4F7761b541668f88d04fe9F2E9DF10CA613aEf7', 18, 'TAUD', 'Wrapped True AUD'), new Token(ChainId.MATIC, '0x6d3cC56DFC016151eE2613BdDe0e03Af9ba885CC', 18, 'TCAD', 'Wrapped True CAD'), - new Token(ChainId.MATIC, '0x81A123f10C78216d32F8655eb1A88B5E9A3e9f2F', 18, 'TGBP', 'Wrapped True GBP'), - new Token(ChainId.MATIC, '0x2e1AD108fF1D8C782fcBbB89AAd783aC49586756', 18, 'TUSD', 'Wrapped True USD') + new Token(ChainId.MATIC, '0x81A123f10C78216d32F8655eb1A88B5E9A3e9f2F', 18, 'TGBP', 'Wrapped True GBP') + // new Token(ChainId.MATIC, '0x2e1AD108fF1D8C782fcBbB89AAd783aC49586756', 18, 'TUSD', 'Wrapped True USD') ] // allows switch of token list when changing networks