From 71d3ee64add378470f7550c6561b96172b25553b Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Sat, 20 Apr 2024 14:03:47 +0100 Subject: [PATCH 01/16] (feat) celo network --- src/connectors/uniswap/uniswap.config.ts | 9 + src/services/connection-manager.ts | 4 +- src/templates/celo.yml | 20 + src/templates/ethereum.yml | 14 + src/templates/lists/celo_token.json | 669 +++++++++++++++++++++++ src/templates/uniswap.yml | 4 + 6 files changed, 718 insertions(+), 2 deletions(-) create mode 100644 src/templates/celo.yml create mode 100644 src/templates/lists/celo_token.json diff --git a/src/connectors/uniswap/uniswap.config.ts b/src/connectors/uniswap/uniswap.config.ts index a5a4ca4ba0..ec30f96d92 100644 --- a/src/connectors/uniswap/uniswap.config.ts +++ b/src/connectors/uniswap/uniswap.config.ts @@ -57,6 +57,15 @@ export namespace UniswapConfig { ConfigManagerV2.getInstance().get('polygon.networks') ).includes(network) ), + },{ + chain: 'celo', + networks: Object.keys( + ConfigManagerV2.getInstance().get('uniswap.contractAddresses') + ).filter((network) => + Object.keys( + ConfigManagerV2.getInstance().get('celo.networks') + ).includes(network) + ), }, ], useRouter: ConfigManagerV2.getInstance().get(`uniswap.useRouter`), diff --git a/src/services/connection-manager.ts b/src/services/connection-manager.ts index e2bd6d4866..e8b3292cb3 100644 --- a/src/services/connection-manager.ts +++ b/src/services/connection-manager.ts @@ -191,14 +191,14 @@ export async function getConnector( let connectorInstance: ConnectorUnion; if ( - (chain === 'ethereum' || chain === 'polygon') && + (chain === 'ethereum' || chain === 'polygon' || chain === "celo") && connector === 'uniswap' ) { connectorInstance = Uniswap.getInstance(chain, network); } else if (chain === 'polygon' && connector === 'quickswap') { connectorInstance = Quickswap.getInstance(chain, network); } else if ( - (chain === 'ethereum' || chain === 'polygon') && + (chain === 'ethereum' || chain === 'polygon' || chain === "celo") && connector === 'uniswapLP' ) { connectorInstance = UniswapLP.getInstance(chain, network); diff --git a/src/templates/celo.yml b/src/templates/celo.yml new file mode 100644 index 0000000000..86b0886dec --- /dev/null +++ b/src/templates/celo.yml @@ -0,0 +1,20 @@ +# list the Avalanche networks available to gateway +networks: + mainnet: + chainID: 42220 + nodeURL: https://celo-mainnet.infura.io/v3/ + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' + gasPriceRefreshInterval: 60 + alfajores: + chainID: 44787 + nodeURL: https://celo-alfajores.infura.io/v3/ + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' + gasPriceRefreshInterval: 60 + +# if you use the gas assumptions below, your wallet needs >0.01 AVAX balance for gas +gasLimitTransaction: 3000000 +manualGasPrice: 33 diff --git a/src/templates/ethereum.yml b/src/templates/ethereum.yml index 03469ccbbc..6dae4d3db5 100644 --- a/src/templates/ethereum.yml +++ b/src/templates/ethereum.yml @@ -1,4 +1,18 @@ networks: + celo_mainnet: + chainID: 42220 + nodeURL: https://celo-mainnet.infura.io/v3/ + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' + gasPriceRefreshInterval: 60 + celo_alfajores: + chainID: 44787 + nodeURL: https://celo-alfajores.infura.io/v3/ + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' + gasPriceRefreshInterval: 60 arbitrum: chainID: 42161 nodeURL: https://rpc.ankr.com/arbitrum diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json new file mode 100644 index 0000000000..bba5679f12 --- /dev/null +++ b/src/templates/lists/celo_token.json @@ -0,0 +1,669 @@ +{ + "name": "Celo Token List", + "version": { + "major": 2, + "minor": 5, + "patch": 0 + }, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg", + "keywords": ["celo", "tokens", "refi"], + "timestamp": "2022-05-25T20:37:00.000+00:00", + "tokens": [ + { + "name": "Green CELO", + "address": "0x8a1639098644a229d08f441ea45a63ae050ee018", + "symbol": "gCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gCELO.svg" + }, + { + "name": "Green cUSD", + "address": "0xFB42E2e90fc79CfA6A6B4EBa4877d5Faf4e29287", + "symbol": "gcUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gcUSD.svg" + }, + { + "name": "cRecy", + "address": "0x34C11A932853Ae24E845Ad4B633E3cEf91afE583", + "symbol": "cRecy", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://user-images.githubusercontent.com/101748448/187026740-27f51d9d-e60d-48e9-b378-416c1eda0cb1.svg" + }, + { + "name": "Staked Celo", + "address": "0xC668583dcbDc9ae6FA3CE46462758188adfdfC24", + "symbol": "stCelo", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/token-stcelo.svg" + }, + { + "name": "Nature Carbon Tonne", + "address": "0x02de4766c272abc10bc88c220d214a26960a7e92", + "symbol": "NCT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://toucan.earth/img/icons/nct.svg" + }, + { + "name": "Biochar", + "address": "0x50E85c754929840B58614F48e29C64BC78C58345", + "symbol": "CHAR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://app.toucan.earth/svg/pools/char.svg" + }, + { + "name": "USDC (Portal from Ethereum)", + "address": "0x37f750B7cC259A2f741AF45294f6a16572CF5cAd", + "symbol": "USDCet", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/USDCet_wh_small.png" + }, + { + "name": "DAI Stablecoin (Portal)", + "address": "0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/DAI_wh_small.png" + }, + { + "name": "Portal WETH", + "address": "0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207", + "symbol": "WETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ETH.png" + }, + { + "name": "wrapped.com ETH", + "address": "0x2DEf4285787d58a2f811AF24755A8150622f4361", + "symbol": "cETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cETH.svg" + }, + { + "name": "Ubeswap", + "address": "0x00Be915B9dCf56a3CBE739D9B9c202ca692409EC", + "symbol": "UBE", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_UBE.png" + }, + { + "name": "Celo Moss Carbon Credit", + "address": "0x32A9FE697a32135BFd313a6Ac28792DaE4D9979d", + "symbol": "cMCO2", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cMCO2.png" + }, + { + "name": "Celo", + "address": "0x471EcE3750Da237f93B8E339c536989b8978a438", + "symbol": "CELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg" + }, + { + "name": "Celo Dollar", + "address": "0x765DE816845861e75A25fCA122bb6898B8B1282a", + "symbol": "cUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" + }, + { + "name": "Duniapay West African CFA franc", + "address": "0x832F03bCeE999a577cb592948983E35C048B5Aa4", + "symbol": "cXOF", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cXOF.png" + }, + { + "name": "wrapped.com Bitcoin", + "address": "0xD629eb00dEced2a080B7EC630eF6aC117e614f1b", + "symbol": "cBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cBTC.png" + }, + { + "name": "Celo Euro", + "address": "0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73", + "symbol": "cEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" + }, + { + "name": "Beefy Finance", + "address": "0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C", + "decimals": 18, + "symbol": "BIFI", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/sushiswap/assets/master/blockchains/celo/assets/0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C/logo.png" + }, + { + "name": "Optics v2 WMATIC via Polygon", + "address": "0x2E3487F967DF2Ebc2f236E16f8fCAeac7091324D", + "symbol": "WMATIC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WMATIC.png" + }, + { + "name": "Optics v2 SUSHI", + "address": "0x29dFce9c22003A4999930382Fd00f9Fd6133Acd1", + "symbol": "SUSHI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SUSHI.png" + }, + { + "name": "Optics v2 WETH", + "address": "0x122013fd7dF1C6F636a5bb8f03108E876548b455", + "symbol": "WETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" + }, + { + "name": "Optics v2 WBTC", + "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", + "decimals": 8, + "symbol": "WBTC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" + }, + { + "name": "Optics v2 USDC", + "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", + "decimals": 6, + "symbol": "USDC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" + }, + { + "name": "Optics v2 USDT", + "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", + "decimals": 6, + "symbol": "USDT", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" + }, + { + "name": "Optics v2 DAI", + "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" + }, + { + "name": "Mobius DAO Token", + "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", + "symbol": "MOBI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOBI.png" + }, + { + "name": "impactMarket", + "address": "0x46c9757C5497c5B1f2eb73aE79b6B67D119B0B58", + "symbol": "PACT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PACT.png" + }, + { + "name": "Source", + "address": "0x74c0C58B99b68cF16A717279AC2d056A34ba2bFe", + "symbol": "SOURCE", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOURCE.png" + }, + { + "name": "Poof", + "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", + "symbol": "POOF", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" + }, + { + "name": "Stabilite USD", + "address": "0x0a60c25Ef6021fC3B479914E6bcA7C03c18A97f1", + "symbol": "stabilUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_stabilUSD.png" + }, + { + "name": "Allbridge SOL", + "address": "0x173234922eB27d5138c5e481be9dF5261fAeD450", + "symbol": "SOL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOL.png" + }, + { + "name": "Moola", + "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", + "symbol": "MOO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" + }, + { + "name": "Ariswap", + "address": "0x20677d4f3d0F08e735aB512393524A3CfCEb250C", + "symbol": "ARI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ARI.png" + }, + { + "name": "Anyswap FTM", + "address": "0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0", + "symbol": "FTM", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_FTM.png" + }, + { + "name": "Poof CELO", + "address": "0x301a61D01A63c8D670c2B8a43f37d12eF181F997", + "symbol": "pCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" + }, + { + "name": "CeloStarter", + "address": "0x452EF5a4bD00796e62E5e5758548e0dA6e8CCDF3", + "symbol": "cStar", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cStar.png" + }, + { + "name": "Allbridge SBR", + "address": "0x47264aE1Fc0c8e6418ebe78630718E11a07346A8", + "symbol": "SBR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SBR.png" + }, + { + "name": "Allbridge", + "address": "0x6e512BFC33be36F2666754E996ff103AD1680Cc9", + "symbol": "ABR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ABR.png" + }, + { + "name": "Staked Allbridge", + "address": "0x788BA01f8E2b87c08B142DB46F82094e0bdCad4F", + "symbol": "xABR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_xABR.png" + }, + { + "name": "Moola CELO", + "address": "0x7D00cd74FF385c955EA3d79e47BF06bD7386387D", + "symbol": "mCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" + }, + { + "name": "Symmetric", + "address": "0x8427bD503dd3169cCC9aFF7326c15258Bc305478", + "symbol": "SYMM", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SYMM.png" + }, + { + "name": "Allbridge AVAX", + "address": "0x8E3670FD7B0935d3FE832711deBFE13BB689b690", + "symbol": "AVAX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_AVAX.png" + }, + { + "name": "Moola cUSD", + "address": "0x918146359264C492BD6934071c6Bd31C854EDBc3", + "symbol": "mcUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" + }, + { + "name": "Premio", + "address": "0x94140c2eA9D208D8476cA4E3045254169791C59e", + "symbol": "PREMIO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PREMIO.png" + }, + { + "name": "Moola cREAL", + "address": "0x9802d866fdE4563d088a6619F7CeF82C0B991A55", + "symbol": "mcREAL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" + }, + { + "name": "Anyswap BNB", + "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", + "symbol": "BNB", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_BNB.png" + }, + { + "name": "KnoxEdge", + "address": "0xa81D9a2d29373777E4082d588958678a6Df5645c", + "symbol": "KNX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_KNX.png" + }, + { + "name": "TrueFeedBack New", + "address": "0xbDd31EFfb9E9f7509fEaAc5B4091b31645A47e4b", + "symbol": "TFBX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_TFBX.png" + }, + { + "name": "Moola cEUR", + "address": "0xE273Ad7ee11dCfAA87383aD5977EE1504aC07568", + "symbol": "mcEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" + }, + { + "name": "Immortal", + "address": "0xE685d21b7B0FC7A248a6A8E03b8Db22d013Aa2eE", + "decimals": 9, + "symbol": "IMMO", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_IMMO.png" + }, + { + "name": "Celo Real", + "address": "0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787", + "symbol": "cREAL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cREAL.png" + }, + { + "name": "Poof USD", + "address": "0xEadf4A7168A82D30Ba0619e64d5BCf5B30B45226", + "symbol": "pUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" + }, + { + "name": "Poof v1 EUR", + "address": "0x56072D4832642dB29225dA12d6Fd1290E4744682", + "symbol": "pEURxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pEUR.png" + }, + { + "name": "Marzipan Finance", + "address": "0x9Ee153D4Fdf0E3222eFD092c442ebB21DFd346AC", + "symbol": "MZPN", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" + }, + { + "name": "Poof v1 USD", + "address": "0xB4aa2986622249B1F45eb93F28Cfca2b2606d809", + "symbol": "pUSDxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" + }, + { + "name": "Duino-Coin on Celo", + "address": "0xDB452CC669D3Ae454226AbF232Fe211bAfF2a1F9", + "symbol": "celoDUCO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_celoDUCO.png" + }, + { + "name": "Poof v1 CELO", + "address": "0xE74AbF23E1Fdf7ACbec2F3a30a772eF77f1601E1", + "symbol": "pCELOxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" + }, + { + "name": "Poof Governance Token", + "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", + "symbol": "POOF", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" + }, + { + "name": "Moola cEUR", + "address": "0x0D9B4311657003251d1eFa085e74f761185F271c", + "symbol": "mcEUR", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" + }, + { + "name": "Celo Euro", + "address": "0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F", + "symbol": "cEUR", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" + }, + { + "name": "NetM Token", + "address": "0x123ED050805E0998EBEf43671327139224218e50", + "symbol": "NTMX", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_NTMX.png" + }, + { + "name": "Moola", + "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", + "symbol": "MOO", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" + }, + { + "name": "Moola cUSD", + "address": "0x3a0EA4e0806805527C750AB9b34382642448468D", + "symbol": "mcUSD", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" + }, + { + "name": "Moola cREAL", + "address": "0x3D0EDA535ca4b15c739D46761d24E42e37664Ad7", + "symbol": "mcREAL", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" + }, + { + "name": "Marzipan Finance", + "address": "0x4d8BF8347600f5207bfdad57363fBa802C9C2031", + "symbol": "MZPN", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" + }, + { + "name": "Moola CELO", + "address": "0x653cC2Cc0Be398614BAd5d5328336dc79281e246", + "symbol": "mCELO", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" + }, + { + "name": "Celo Dollar", + "address": "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", + "symbol": "cUSD", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" + }, + { + "name": "Celo", + "address": "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9", + "symbol": "CELO", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_CELO.png" + }, + { + "name": "AtlasX Carbon Credits", + "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", + "symbol": "ATLASX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" + }, + { + "name": "PLASTIK Token", + "address": "0x27cd006548dF7C8c8e9fdc4A67fa05C2E3CA5CF9", + "symbol": "PLASTIK", + "decimals": 9, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PLASTIK.png" + }, + { + "name": "Curve DAO Token", + "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", + "symbol": "CRV", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" + }, + { + "name": "Axelar Wrapped Bitcoin", + "address": "0x1a35EE4640b0A3B87705B0A4B45D227Ba60Ca2ad", + "symbol": "axlWBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_wbtc.svg" + }, + { + "name": "Wormhole Wrapped Bitcoin", + "address": "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF", + "symbol": "WBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/wormhole_wbtc.png" + }, + { + "name": "Good Dollar", + "address": "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A", + "symbol": "G$", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/GoodDollar/GoodDAPP/master/src/assets/Splash/logo.svg" + }, + { + "name": "Axelar WETH", + "address": "0xb829b68f57cc546da7e5806a929e53be32a4625d", + "symbol": "axlEth", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_eth.png" + }, + { + "name": "JumpToken", + "address": "0x1d18d0386f51ab03e7e84e71bda1681eba865f1f", + "symbol": "JMPT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/jumpToken.png" + }, + { + "name": "Glo Dollar", + "address": "0x4f604735c1cf31399c6e711d5962b2b3e0225ad3", + "symbol": "USDGLO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://app.glodollar.org/glo-logo.svg" + }, + { + "name": "Curve DAO Token", + "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", + "symbol": "CRV", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" + }, + { + "name": "AtlasX Carbon Credits", + "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", + "symbol": "ATLASX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" + }, + { + "name": "agEUR", + "address": "0xC16B81Af351BA9e64C1a069E3Ab18c244A1E3049", + "symbol": "agEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/AngleProtocol/angle-assets/main/0_tokens/agEUR/cross-chain/agEUR-celo.svg" + }, + { + "name": "EURC (Wormhole)", + "address": "0xBddC3554269053544bE0d6d027a73271225E9859", + "symbol": "EURC", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/wormhole-foundation/wormhole-token-list/main/assets/EURC_wh.png" + }, + { + "name": "USD Coin", + "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", + "symbol": "USDC", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" + } + ] + } \ No newline at end of file diff --git a/src/templates/uniswap.yml b/src/templates/uniswap.yml index 4e0f1df623..2559025665 100644 --- a/src/templates/uniswap.yml +++ b/src/templates/uniswap.yml @@ -24,6 +24,10 @@ useRouter: false feeTier: 'MEDIUM' contractAddresses: + celo: + uniswapV3SmartOrderRouterAddress: '0x5615CDAb10dc425a742d643d949a7F474C01abc4' + uniswapV3NftManagerAddress: '0x644023b316bB65175C347DE903B60a756F6dd554' + uniswapV3QuoterV2ContractAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8' mainnet: uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' From 823e19a1d1939377b08972d5df5c9e3b37dc644a Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Sat, 20 Apr 2024 14:27:10 +0100 Subject: [PATCH 02/16] (feat) celo network --- src/templates/ethereum.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/ethereum.yml b/src/templates/ethereum.yml index 6dae4d3db5..cb88523d60 100644 --- a/src/templates/ethereum.yml +++ b/src/templates/ethereum.yml @@ -1,5 +1,5 @@ networks: - celo_mainnet: + celo: chainID: 42220 nodeURL: https://celo-mainnet.infura.io/v3/ tokenListType: 'FILE' From 2d17d4ddfbfe81ee1b00b6a34ccc959eb0e59eac Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Sat, 20 Apr 2024 14:41:41 +0100 Subject: [PATCH 03/16] (feat) celo network --- src/templates/celo.yml | 8 ++++---- src/templates/ethereum.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/templates/celo.yml b/src/templates/celo.yml index 86b0886dec..b9c6f1e14f 100644 --- a/src/templates/celo.yml +++ b/src/templates/celo.yml @@ -2,17 +2,17 @@ networks: mainnet: chainID: 42220 - nodeURL: https://celo-mainnet.infura.io/v3/ + nodeURL: https://celo-mainnet.infura.io/v3 tokenListType: 'FILE' tokenListSource: '/home/gateway/conf/lists/celo_token.json' - nativeCurrencySymbol: 'CELO' + nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 alfajores: chainID: 44787 - nodeURL: https://celo-alfajores.infura.io/v3/ + nodeURL: https://celo-alfajores.infura.io/v3 tokenListType: 'FILE' tokenListSource: '/home/gateway/conf/lists/celo_token.json' - nativeCurrencySymbol: 'CELO' + nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 # if you use the gas assumptions below, your wallet needs >0.01 AVAX balance for gas diff --git a/src/templates/ethereum.yml b/src/templates/ethereum.yml index cb88523d60..ba2133278a 100644 --- a/src/templates/ethereum.yml +++ b/src/templates/ethereum.yml @@ -1,17 +1,17 @@ networks: celo: chainID: 42220 - nodeURL: https://celo-mainnet.infura.io/v3/ + nodeURL: https://celo-mainnet.infura.io/v3 tokenListType: 'FILE' tokenListSource: '/home/gateway/conf/lists/celo_token.json' - nativeCurrencySymbol: 'CELO' + nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 celo_alfajores: chainID: 44787 - nodeURL: https://celo-alfajores.infura.io/v3/ + nodeURL: https://celo-alfajores.infura.io/v3 tokenListType: 'FILE' tokenListSource: '/home/gateway/conf/lists/celo_token.json' - nativeCurrencySymbol: 'CELO' + nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 arbitrum: chainID: 42161 From 28ea3872f38087ed535d67483736c2911fd44d6d Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Sun, 21 Apr 2024 14:27:58 +0100 Subject: [PATCH 04/16] (feat) celo nft refactor --- src/connectors/uniswap/uniswap.config.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/connectors/uniswap/uniswap.config.ts b/src/connectors/uniswap/uniswap.config.ts index ec30f96d92..a5a4ca4ba0 100644 --- a/src/connectors/uniswap/uniswap.config.ts +++ b/src/connectors/uniswap/uniswap.config.ts @@ -57,15 +57,6 @@ export namespace UniswapConfig { ConfigManagerV2.getInstance().get('polygon.networks') ).includes(network) ), - },{ - chain: 'celo', - networks: Object.keys( - ConfigManagerV2.getInstance().get('uniswap.contractAddresses') - ).filter((network) => - Object.keys( - ConfigManagerV2.getInstance().get('celo.networks') - ).includes(network) - ), }, ], useRouter: ConfigManagerV2.getInstance().get(`uniswap.useRouter`), From 4d7e47b17579cf5509a6606aabf3f7c4c6fff579 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Mon, 22 Apr 2024 23:56:44 +0100 Subject: [PATCH 05/16] (fix) update uniswap packages --- package.json | 12 +- src/templates/celo.yml | 12 +- src/templates/ethereum.yml | 10 +- src/templates/lists/celo_token.json | 1328 +++++++++++++-------------- src/templates/uniswap.yml | 2 +- 5 files changed, 678 insertions(+), 686 deletions(-) diff --git a/package.json b/package.json index 36e62763c5..b65e2376be 100644 --- a/package.json +++ b/package.json @@ -60,12 +60,12 @@ "@types/minimist": "^1.2.2", "@types/morgan": "^1.9.3", "@types/uuid": "^8.3.4", - "@uniswap/sdk": "3.0.2", - "@uniswap/sdk-core": "^3.0.0", - "@uniswap/smart-order-router": "^2.5.26", - "@uniswap/v3-core": "^1.0.0", - "@uniswap/v3-periphery": "^1.1.1", - "@uniswap/v3-sdk": "^3.7.0", + "@uniswap/sdk": "^3.0.3", + "@uniswap/sdk-core": "^4.2.0", + "@uniswap/smart-order-router": "^3.28.7", + "@uniswap/v3-core": "^1.0.1", + "@uniswap/v3-periphery": "^1.4.4", + "@uniswap/v3-sdk": "^3.11.0", "abi-decoder": "^2.4.0", "ajv": "^8.6.3", "algosdk": "^2.2.0", diff --git a/src/templates/celo.yml b/src/templates/celo.yml index b9c6f1e14f..4acca5cdf1 100644 --- a/src/templates/celo.yml +++ b/src/templates/celo.yml @@ -2,16 +2,16 @@ networks: mainnet: chainID: 42220 - nodeURL: https://celo-mainnet.infura.io/v3 - tokenListType: 'FILE' - tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nodeURL: https://rpc.ankr.com/celo + tokenListType: FILE + tokenListSource: /home/gateway/conf/lists/celo_token.json nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 - alfajores: + celo_alfajores: chainID: 44787 nodeURL: https://celo-alfajores.infura.io/v3 - tokenListType: 'FILE' - tokenListSource: '/home/gateway/conf/lists/celo_token.json' + tokenListType: FILE + tokenListSource: /home/gateway/conf/lists/celo_token.json nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 diff --git a/src/templates/ethereum.yml b/src/templates/ethereum.yml index ba2133278a..1d1d03c16f 100644 --- a/src/templates/ethereum.yml +++ b/src/templates/ethereum.yml @@ -1,16 +1,16 @@ networks: celo: chainID: 42220 - nodeURL: https://celo-mainnet.infura.io/v3 - tokenListType: 'FILE' - tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nodeURL: https://rpc.ankr.com/celo + tokenListType: FILE + tokenListSource: /home/gateway/conf/lists/celo_token.json nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 celo_alfajores: chainID: 44787 nodeURL: https://celo-alfajores.infura.io/v3 - tokenListType: 'FILE' - tokenListSource: '/home/gateway/conf/lists/celo_token.json' + tokenListType: FILE + tokenListSource: /home/gateway/conf/lists/celo_token.json nativeCurrencySymbol: CELO gasPriceRefreshInterval: 60 arbitrum: diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index bba5679f12..3652531e17 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -1,669 +1,661 @@ { - "name": "Celo Token List", - "version": { - "major": 2, - "minor": 5, - "patch": 0 - }, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg", - "keywords": ["celo", "tokens", "refi"], - "timestamp": "2022-05-25T20:37:00.000+00:00", - "tokens": [ - { - "name": "Green CELO", - "address": "0x8a1639098644a229d08f441ea45a63ae050ee018", - "symbol": "gCELO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gCELO.svg" - }, - { - "name": "Green cUSD", - "address": "0xFB42E2e90fc79CfA6A6B4EBa4877d5Faf4e29287", - "symbol": "gcUSD", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gcUSD.svg" - }, - { - "name": "cRecy", - "address": "0x34C11A932853Ae24E845Ad4B633E3cEf91afE583", - "symbol": "cRecy", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://user-images.githubusercontent.com/101748448/187026740-27f51d9d-e60d-48e9-b378-416c1eda0cb1.svg" - }, - { - "name": "Staked Celo", - "address": "0xC668583dcbDc9ae6FA3CE46462758188adfdfC24", - "symbol": "stCelo", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/token-stcelo.svg" - }, - { - "name": "Nature Carbon Tonne", - "address": "0x02de4766c272abc10bc88c220d214a26960a7e92", - "symbol": "NCT", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://toucan.earth/img/icons/nct.svg" - }, - { - "name": "Biochar", - "address": "0x50E85c754929840B58614F48e29C64BC78C58345", - "symbol": "CHAR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://app.toucan.earth/svg/pools/char.svg" - }, - { - "name": "USDC (Portal from Ethereum)", - "address": "0x37f750B7cC259A2f741AF45294f6a16572CF5cAd", - "symbol": "USDCet", - "decimals": 6, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/USDCet_wh_small.png" - }, - { - "name": "DAI Stablecoin (Portal)", - "address": "0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF", - "symbol": "DAI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/DAI_wh_small.png" - }, - { - "name": "Portal WETH", - "address": "0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207", - "symbol": "WETH", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ETH.png" - }, - { - "name": "wrapped.com ETH", - "address": "0x2DEf4285787d58a2f811AF24755A8150622f4361", - "symbol": "cETH", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cETH.svg" - }, - { - "name": "Ubeswap", - "address": "0x00Be915B9dCf56a3CBE739D9B9c202ca692409EC", - "symbol": "UBE", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_UBE.png" - }, - { - "name": "Celo Moss Carbon Credit", - "address": "0x32A9FE697a32135BFd313a6Ac28792DaE4D9979d", - "symbol": "cMCO2", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cMCO2.png" - }, - { - "name": "Celo", - "address": "0x471EcE3750Da237f93B8E339c536989b8978a438", - "symbol": "CELO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg" - }, - { - "name": "Celo Dollar", - "address": "0x765DE816845861e75A25fCA122bb6898B8B1282a", - "symbol": "cUSD", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" - }, - { - "name": "Duniapay West African CFA franc", - "address": "0x832F03bCeE999a577cb592948983E35C048B5Aa4", - "symbol": "cXOF", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cXOF.png" - }, - { - "name": "wrapped.com Bitcoin", - "address": "0xD629eb00dEced2a080B7EC630eF6aC117e614f1b", - "symbol": "cBTC", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cBTC.png" - }, - { - "name": "Celo Euro", - "address": "0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73", - "symbol": "cEUR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" - }, - { - "name": "Beefy Finance", - "address": "0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C", - "decimals": 18, - "symbol": "BIFI", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/sushiswap/assets/master/blockchains/celo/assets/0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C/logo.png" - }, - { - "name": "Optics v2 WMATIC via Polygon", - "address": "0x2E3487F967DF2Ebc2f236E16f8fCAeac7091324D", - "symbol": "WMATIC", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WMATIC.png" - }, - { - "name": "Optics v2 SUSHI", - "address": "0x29dFce9c22003A4999930382Fd00f9Fd6133Acd1", - "symbol": "SUSHI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SUSHI.png" - }, - { - "name": "Optics v2 WETH", - "address": "0x122013fd7dF1C6F636a5bb8f03108E876548b455", - "symbol": "WETH", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" - }, - { - "name": "Optics v2 WBTC", - "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", - "decimals": 8, - "symbol": "WBTC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" - }, - { - "name": "Optics v2 USDC", - "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", - "decimals": 6, - "symbol": "USDC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" - }, - { - "name": "Optics v2 USDT", - "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", - "decimals": 6, - "symbol": "USDT", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" - }, - { - "name": "Optics v2 DAI", - "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", - "symbol": "DAI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" - }, - { - "name": "Mobius DAO Token", - "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", - "symbol": "MOBI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOBI.png" - }, - { - "name": "impactMarket", - "address": "0x46c9757C5497c5B1f2eb73aE79b6B67D119B0B58", - "symbol": "PACT", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PACT.png" - }, - { - "name": "Source", - "address": "0x74c0C58B99b68cF16A717279AC2d056A34ba2bFe", - "symbol": "SOURCE", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOURCE.png" - }, - { - "name": "Poof", - "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", - "symbol": "POOF", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" - }, - { - "name": "Stabilite USD", - "address": "0x0a60c25Ef6021fC3B479914E6bcA7C03c18A97f1", - "symbol": "stabilUSD", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_stabilUSD.png" - }, - { - "name": "Allbridge SOL", - "address": "0x173234922eB27d5138c5e481be9dF5261fAeD450", - "symbol": "SOL", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOL.png" - }, - { - "name": "Moola", - "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", - "symbol": "MOO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" - }, - { - "name": "Ariswap", - "address": "0x20677d4f3d0F08e735aB512393524A3CfCEb250C", - "symbol": "ARI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ARI.png" - }, - { - "name": "Anyswap FTM", - "address": "0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0", - "symbol": "FTM", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_FTM.png" - }, - { - "name": "Poof CELO", - "address": "0x301a61D01A63c8D670c2B8a43f37d12eF181F997", - "symbol": "pCELO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" - }, - { - "name": "CeloStarter", - "address": "0x452EF5a4bD00796e62E5e5758548e0dA6e8CCDF3", - "symbol": "cStar", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cStar.png" - }, - { - "name": "Allbridge SBR", - "address": "0x47264aE1Fc0c8e6418ebe78630718E11a07346A8", - "symbol": "SBR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SBR.png" - }, - { - "name": "Allbridge", - "address": "0x6e512BFC33be36F2666754E996ff103AD1680Cc9", - "symbol": "ABR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ABR.png" - }, - { - "name": "Staked Allbridge", - "address": "0x788BA01f8E2b87c08B142DB46F82094e0bdCad4F", - "symbol": "xABR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_xABR.png" - }, - { - "name": "Moola CELO", - "address": "0x7D00cd74FF385c955EA3d79e47BF06bD7386387D", - "symbol": "mCELO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" - }, - { - "name": "Symmetric", - "address": "0x8427bD503dd3169cCC9aFF7326c15258Bc305478", - "symbol": "SYMM", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SYMM.png" - }, - { - "name": "Allbridge AVAX", - "address": "0x8E3670FD7B0935d3FE832711deBFE13BB689b690", - "symbol": "AVAX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_AVAX.png" - }, - { - "name": "Moola cUSD", - "address": "0x918146359264C492BD6934071c6Bd31C854EDBc3", - "symbol": "mcUSD", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" - }, - { - "name": "Premio", - "address": "0x94140c2eA9D208D8476cA4E3045254169791C59e", - "symbol": "PREMIO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PREMIO.png" - }, - { - "name": "Moola cREAL", - "address": "0x9802d866fdE4563d088a6619F7CeF82C0B991A55", - "symbol": "mcREAL", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" - }, - { - "name": "Anyswap BNB", - "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", - "symbol": "BNB", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_BNB.png" - }, - { - "name": "KnoxEdge", - "address": "0xa81D9a2d29373777E4082d588958678a6Df5645c", - "symbol": "KNX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_KNX.png" - }, - { - "name": "TrueFeedBack New", - "address": "0xbDd31EFfb9E9f7509fEaAc5B4091b31645A47e4b", - "symbol": "TFBX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_TFBX.png" - }, - { - "name": "Moola cEUR", - "address": "0xE273Ad7ee11dCfAA87383aD5977EE1504aC07568", - "symbol": "mcEUR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" - }, - { - "name": "Immortal", - "address": "0xE685d21b7B0FC7A248a6A8E03b8Db22d013Aa2eE", - "decimals": 9, - "symbol": "IMMO", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_IMMO.png" - }, - { - "name": "Celo Real", - "address": "0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787", - "symbol": "cREAL", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cREAL.png" - }, - { - "name": "Poof USD", - "address": "0xEadf4A7168A82D30Ba0619e64d5BCf5B30B45226", - "symbol": "pUSD", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" - }, - { - "name": "Poof v1 EUR", - "address": "0x56072D4832642dB29225dA12d6Fd1290E4744682", - "symbol": "pEURxV1", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pEUR.png" - }, - { - "name": "Marzipan Finance", - "address": "0x9Ee153D4Fdf0E3222eFD092c442ebB21DFd346AC", - "symbol": "MZPN", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" - }, - { - "name": "Poof v1 USD", - "address": "0xB4aa2986622249B1F45eb93F28Cfca2b2606d809", - "symbol": "pUSDxV1", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" - }, - { - "name": "Duino-Coin on Celo", - "address": "0xDB452CC669D3Ae454226AbF232Fe211bAfF2a1F9", - "symbol": "celoDUCO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_celoDUCO.png" - }, - { - "name": "Poof v1 CELO", - "address": "0xE74AbF23E1Fdf7ACbec2F3a30a772eF77f1601E1", - "symbol": "pCELOxV1", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" - }, - { - "name": "Poof Governance Token", - "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", - "symbol": "POOF", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" - }, - { - "name": "Moola cEUR", - "address": "0x0D9B4311657003251d1eFa085e74f761185F271c", - "symbol": "mcEUR", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" - }, - { - "name": "Celo Euro", - "address": "0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F", - "symbol": "cEUR", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" - }, - { - "name": "NetM Token", - "address": "0x123ED050805E0998EBEf43671327139224218e50", - "symbol": "NTMX", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_NTMX.png" - }, - { - "name": "Moola", - "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", - "symbol": "MOO", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" - }, - { - "name": "Moola cUSD", - "address": "0x3a0EA4e0806805527C750AB9b34382642448468D", - "symbol": "mcUSD", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" - }, - { - "name": "Moola cREAL", - "address": "0x3D0EDA535ca4b15c739D46761d24E42e37664Ad7", - "symbol": "mcREAL", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" - }, - { - "name": "Marzipan Finance", - "address": "0x4d8BF8347600f5207bfdad57363fBa802C9C2031", - "symbol": "MZPN", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" - }, - { - "name": "Moola CELO", - "address": "0x653cC2Cc0Be398614BAd5d5328336dc79281e246", - "symbol": "mCELO", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" - }, - { - "name": "Celo Dollar", - "address": "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", - "symbol": "cUSD", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" - }, - { - "name": "Celo", - "address": "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9", - "symbol": "CELO", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_CELO.png" - }, - { - "name": "AtlasX Carbon Credits", - "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", - "symbol": "ATLASX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" - }, - { - "name": "PLASTIK Token", - "address": "0x27cd006548dF7C8c8e9fdc4A67fa05C2E3CA5CF9", - "symbol": "PLASTIK", - "decimals": 9, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PLASTIK.png" - }, - { - "name": "Curve DAO Token", - "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", - "symbol": "CRV", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" - }, - { - "name": "Axelar Wrapped Bitcoin", - "address": "0x1a35EE4640b0A3B87705B0A4B45D227Ba60Ca2ad", - "symbol": "axlWBTC", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_wbtc.svg" - }, - { - "name": "Wormhole Wrapped Bitcoin", - "address": "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF", - "symbol": "WBTC", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/wormhole_wbtc.png" - }, - { - "name": "Good Dollar", - "address": "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A", - "symbol": "G$", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/GoodDollar/GoodDAPP/master/src/assets/Splash/logo.svg" - }, - { - "name": "Axelar WETH", - "address": "0xb829b68f57cc546da7e5806a929e53be32a4625d", - "symbol": "axlEth", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_eth.png" - }, - { - "name": "JumpToken", - "address": "0x1d18d0386f51ab03e7e84e71bda1681eba865f1f", - "symbol": "JMPT", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/jumpToken.png" - }, - { - "name": "Glo Dollar", - "address": "0x4f604735c1cf31399c6e711d5962b2b3e0225ad3", - "symbol": "USDGLO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://app.glodollar.org/glo-logo.svg" - }, - { - "name": "Curve DAO Token", - "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", - "symbol": "CRV", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" - }, - { - "name": "AtlasX Carbon Credits", - "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", - "symbol": "ATLASX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" - }, - { - "name": "agEUR", - "address": "0xC16B81Af351BA9e64C1a069E3Ab18c244A1E3049", - "symbol": "agEUR", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/AngleProtocol/angle-assets/main/0_tokens/agEUR/cross-chain/agEUR-celo.svg" - }, - { - "name": "EURC (Wormhole)", - "address": "0xBddC3554269053544bE0d6d027a73271225E9859", - "symbol": "EURC", - "decimals": 6, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/wormhole-foundation/wormhole-token-list/main/assets/EURC_wh.png" - }, - { - "name": "USD Coin", - "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", - "symbol": "USDC", - "decimals": 6, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" - } - ] - } \ No newline at end of file + "name": "Celo Token List", + "version": { + "major": 2, + "minor": 5, + "patch": 0 + }, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg", + "keywords": ["celo", "tokens", "refi"], + "timestamp": "2022-05-25T20:37:00.000+00:00", + "tokens": [ + { + "name": "Green CELO", + "address": "0x8a1639098644a229d08f441ea45a63ae050ee018", + "symbol": "gCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gCELO.svg" + }, + { + "name": "Green cUSD", + "address": "0xFB42E2e90fc79CfA6A6B4EBa4877d5Faf4e29287", + "symbol": "gcUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/spiralsprotocol/spirals-brand/main/gcUSD.svg" + }, + { + "name": "cRecy", + "address": "0x34C11A932853Ae24E845Ad4B633E3cEf91afE583", + "symbol": "cRecy", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://user-images.githubusercontent.com/101748448/187026740-27f51d9d-e60d-48e9-b378-416c1eda0cb1.svg" + }, + { + "name": "Staked Celo", + "address": "0xC668583dcbDc9ae6FA3CE46462758188adfdfC24", + "symbol": "stCelo", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/token-stcelo.svg" + }, + { + "name": "Nature Carbon Tonne", + "address": "0x02de4766c272abc10bc88c220d214a26960a7e92", + "symbol": "NCT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://toucan.earth/img/icons/nct.svg" + }, + { + "name": "Biochar", + "address": "0x50E85c754929840B58614F48e29C64BC78C58345", + "symbol": "CHAR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://app.toucan.earth/svg/pools/char.svg" + }, + { + "name": "USDC (Portal from Ethereum)", + "address": "0x37f750B7cC259A2f741AF45294f6a16572CF5cAd", + "symbol": "USDCet", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/USDCet_wh_small.png" + }, + { + "name": "DAI Stablecoin (Portal)", + "address": "0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/DAI_wh_small.png" + }, + { + "name": "Portal WETH", + "address": "0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207", + "symbol": "WETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ETH.png" + }, + { + "name": "wrapped.com ETH", + "address": "0x2DEf4285787d58a2f811AF24755A8150622f4361", + "symbol": "cETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cETH.svg" + }, + { + "name": "Ubeswap", + "address": "0x00Be915B9dCf56a3CBE739D9B9c202ca692409EC", + "symbol": "UBE", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_UBE.png" + }, + { + "name": "Celo Moss Carbon Credit", + "address": "0x32A9FE697a32135BFd313a6Ac28792DaE4D9979d", + "symbol": "cMCO2", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cMCO2.png" + }, + { + "name": "Celo", + "address": "0x471EcE3750Da237f93B8E339c536989b8978a438", + "symbol": "CELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/celo_logo.svg" + }, + { + "name": "Celo Dollar", + "address": "0x765DE816845861e75A25fCA122bb6898B8B1282a", + "symbol": "cUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" + }, + { + "name": "Duniapay West African CFA franc", + "address": "0x832F03bCeE999a577cb592948983E35C048B5Aa4", + "symbol": "cXOF", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cXOF.png" + }, + { + "name": "wrapped.com Bitcoin", + "address": "0xD629eb00dEced2a080B7EC630eF6aC117e614f1b", + "symbol": "cBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cBTC.png" + }, + { + "name": "Celo Euro", + "address": "0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73", + "symbol": "cEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" + }, + { + "name": "Beefy Finance", + "address": "0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C", + "decimals": 18, + "symbol": "BIFI", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/sushiswap/assets/master/blockchains/celo/assets/0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C/logo.png" + }, + { + "name": "Optics v2 WMATIC via Polygon", + "address": "0x2E3487F967DF2Ebc2f236E16f8fCAeac7091324D", + "symbol": "WMATIC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WMATIC.png" + }, + { + "name": "Optics v2 SUSHI", + "address": "0x29dFce9c22003A4999930382Fd00f9Fd6133Acd1", + "symbol": "SUSHI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SUSHI.png" + }, + { + "name": "Optics v2 WETH", + "address": "0x122013fd7dF1C6F636a5bb8f03108E876548b455", + "symbol": "WETH", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" + }, + { + "name": "Optics v2 WBTC", + "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", + "decimals": 8, + "symbol": "WBTC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" + }, + { + "name": "Optics v2 USDC", + "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", + "decimals": 6, + "symbol": "USDC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" + }, + { + "name": "Optics v2 USDT", + "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", + "decimals": 6, + "symbol": "USDT", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" + }, + { + "name": "Optics v2 DAI", + "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" + }, + { + "name": "Mobius DAO Token", + "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", + "symbol": "MOBI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOBI.png" + }, + { + "name": "impactMarket", + "address": "0x46c9757C5497c5B1f2eb73aE79b6B67D119B0B58", + "symbol": "PACT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PACT.png" + }, + { + "name": "Source", + "address": "0x74c0C58B99b68cF16A717279AC2d056A34ba2bFe", + "symbol": "SOURCE", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOURCE.png" + }, + { + "name": "Poof", + "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", + "symbol": "POOF", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" + }, + { + "name": "Stabilite USD", + "address": "0x0a60c25Ef6021fC3B479914E6bcA7C03c18A97f1", + "symbol": "stabilUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_stabilUSD.png" + }, + { + "name": "Allbridge SOL", + "address": "0x173234922eB27d5138c5e481be9dF5261fAeD450", + "symbol": "SOL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOL.png" + }, + { + "name": "Moola", + "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", + "symbol": "MOO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" + }, + { + "name": "Ariswap", + "address": "0x20677d4f3d0F08e735aB512393524A3CfCEb250C", + "symbol": "ARI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ARI.png" + }, + { + "name": "Anyswap FTM", + "address": "0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0", + "symbol": "FTM", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_FTM.png" + }, + { + "name": "Poof CELO", + "address": "0x301a61D01A63c8D670c2B8a43f37d12eF181F997", + "symbol": "pCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" + }, + { + "name": "CeloStarter", + "address": "0x452EF5a4bD00796e62E5e5758548e0dA6e8CCDF3", + "symbol": "cStar", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cStar.png" + }, + { + "name": "Allbridge SBR", + "address": "0x47264aE1Fc0c8e6418ebe78630718E11a07346A8", + "symbol": "SBR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SBR.png" + }, + { + "name": "Allbridge", + "address": "0x6e512BFC33be36F2666754E996ff103AD1680Cc9", + "symbol": "ABR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_ABR.png" + }, + { + "name": "Staked Allbridge", + "address": "0x788BA01f8E2b87c08B142DB46F82094e0bdCad4F", + "symbol": "xABR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_xABR.png" + }, + { + "name": "Moola CELO", + "address": "0x7D00cd74FF385c955EA3d79e47BF06bD7386387D", + "symbol": "mCELO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" + }, + { + "name": "Symmetric", + "address": "0x8427bD503dd3169cCC9aFF7326c15258Bc305478", + "symbol": "SYMM", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SYMM.png" + }, + { + "name": "Allbridge AVAX", + "address": "0x8E3670FD7B0935d3FE832711deBFE13BB689b690", + "symbol": "AVAX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_AVAX.png" + }, + { + "name": "Moola cUSD", + "address": "0x918146359264C492BD6934071c6Bd31C854EDBc3", + "symbol": "mcUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" + }, + { + "name": "Premio", + "address": "0x94140c2eA9D208D8476cA4E3045254169791C59e", + "symbol": "PREMIO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PREMIO.png" + }, + { + "name": "Moola cREAL", + "address": "0x9802d866fdE4563d088a6619F7CeF82C0B991A55", + "symbol": "mcREAL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" + }, + { + "name": "Anyswap BNB", + "address": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F", + "symbol": "BNB", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_BNB.png" + }, + { + "name": "KnoxEdge", + "address": "0xa81D9a2d29373777E4082d588958678a6Df5645c", + "symbol": "KNX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_KNX.png" + }, + { + "name": "TrueFeedBack New", + "address": "0xbDd31EFfb9E9f7509fEaAc5B4091b31645A47e4b", + "symbol": "TFBX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_TFBX.png" + }, + { + "name": "Moola cEUR", + "address": "0xE273Ad7ee11dCfAA87383aD5977EE1504aC07568", + "symbol": "mcEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" + }, + { + "name": "Immortal", + "address": "0xE685d21b7B0FC7A248a6A8E03b8Db22d013Aa2eE", + "decimals": 9, + "symbol": "IMMO", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_IMMO.png" + }, + { + "name": "Celo Real", + "address": "0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787", + "symbol": "cREAL", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cREAL.png" + }, + { + "name": "Poof USD", + "address": "0xEadf4A7168A82D30Ba0619e64d5BCf5B30B45226", + "symbol": "pUSD", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" + }, + { + "name": "Poof v1 EUR", + "address": "0x56072D4832642dB29225dA12d6Fd1290E4744682", + "symbol": "pEURxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pEUR.png" + }, + { + "name": "Marzipan Finance", + "address": "0x9Ee153D4Fdf0E3222eFD092c442ebB21DFd346AC", + "symbol": "MZPN", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" + }, + { + "name": "Poof v1 USD", + "address": "0xB4aa2986622249B1F45eb93F28Cfca2b2606d809", + "symbol": "pUSDxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pUSD.png" + }, + { + "name": "Duino-Coin on Celo", + "address": "0xDB452CC669D3Ae454226AbF232Fe211bAfF2a1F9", + "symbol": "celoDUCO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_celoDUCO.png" + }, + { + "name": "Poof v1 CELO", + "address": "0xE74AbF23E1Fdf7ACbec2F3a30a772eF77f1601E1", + "symbol": "pCELOxV1", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" + }, + { + "name": "Poof Governance Token", + "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", + "symbol": "POOF", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" + }, + { + "name": "Moola cEUR", + "address": "0x0D9B4311657003251d1eFa085e74f761185F271c", + "symbol": "mcEUR", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" + }, + { + "name": "Celo Euro", + "address": "0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F", + "symbol": "cEUR", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" + }, + { + "name": "NetM Token", + "address": "0x123ED050805E0998EBEf43671327139224218e50", + "symbol": "NTMX", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_NTMX.png" + }, + { + "name": "Moola", + "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", + "symbol": "MOO", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" + }, + { + "name": "Moola cUSD", + "address": "0x3a0EA4e0806805527C750AB9b34382642448468D", + "symbol": "mcUSD", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" + }, + { + "name": "Moola cREAL", + "address": "0x3D0EDA535ca4b15c739D46761d24E42e37664Ad7", + "symbol": "mcREAL", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" + }, + { + "name": "Marzipan Finance", + "address": "0x4d8BF8347600f5207bfdad57363fBa802C9C2031", + "symbol": "MZPN", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" + }, + { + "name": "Moola CELO", + "address": "0x653cC2Cc0Be398614BAd5d5328336dc79281e246", + "symbol": "mCELO", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" + }, + { + "name": "Celo Dollar", + "address": "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", + "symbol": "cUSD", + "decimals": 18, + "chainId": 44787, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" + }, + { + "name": "AtlasX Carbon Credits", + "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", + "symbol": "ATLASX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" + }, + { + "name": "PLASTIK Token", + "address": "0x27cd006548dF7C8c8e9fdc4A67fa05C2E3CA5CF9", + "symbol": "PLASTIK", + "decimals": 9, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PLASTIK.png" + }, + { + "name": "Curve DAO Token", + "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", + "symbol": "CRV", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" + }, + { + "name": "Axelar Wrapped Bitcoin", + "address": "0x1a35EE4640b0A3B87705B0A4B45D227Ba60Ca2ad", + "symbol": "axlWBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_wbtc.svg" + }, + { + "name": "Wormhole Wrapped Bitcoin", + "address": "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF", + "symbol": "WBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/wormhole_wbtc.png" + }, + { + "name": "Good Dollar", + "address": "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A", + "symbol": "G$", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/GoodDollar/GoodDAPP/master/src/assets/Splash/logo.svg" + }, + { + "name": "Axelar WETH", + "address": "0xb829b68f57cc546da7e5806a929e53be32a4625d", + "symbol": "axlEth", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_eth.png" + }, + { + "name": "JumpToken", + "address": "0x1d18d0386f51ab03e7e84e71bda1681eba865f1f", + "symbol": "JMPT", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/jumpToken.png" + }, + { + "name": "Glo Dollar", + "address": "0x4f604735c1cf31399c6e711d5962b2b3e0225ad3", + "symbol": "USDGLO", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://app.glodollar.org/glo-logo.svg" + }, + { + "name": "Curve DAO Token", + "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", + "symbol": "CRV", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" + }, + { + "name": "AtlasX Carbon Credits", + "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", + "symbol": "ATLASX", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" + }, + { + "name": "agEUR", + "address": "0xC16B81Af351BA9e64C1a069E3Ab18c244A1E3049", + "symbol": "agEUR", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/AngleProtocol/angle-assets/main/0_tokens/agEUR/cross-chain/agEUR-celo.svg" + }, + { + "name": "EURC (Wormhole)", + "address": "0xBddC3554269053544bE0d6d027a73271225E9859", + "symbol": "EURC", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/wormhole-foundation/wormhole-token-list/main/assets/EURC_wh.png" + }, + { + "name": "USD Coin", + "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", + "symbol": "USDC", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" + } + ] +} \ No newline at end of file diff --git a/src/templates/uniswap.yml b/src/templates/uniswap.yml index 2559025665..51781ff1a9 100644 --- a/src/templates/uniswap.yml +++ b/src/templates/uniswap.yml @@ -26,7 +26,7 @@ feeTier: 'MEDIUM' contractAddresses: celo: uniswapV3SmartOrderRouterAddress: '0x5615CDAb10dc425a742d643d949a7F474C01abc4' - uniswapV3NftManagerAddress: '0x644023b316bB65175C347DE903B60a756F6dd554' + uniswapV3NftManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A' uniswapV3QuoterV2ContractAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8' mainnet: uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' From c50671a106804777fd21eafa71ccd73966cc034e Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Tue, 23 Apr 2024 00:36:33 +0100 Subject: [PATCH 06/16] (fix) update uniswap packages --- src/services/connection-manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/connection-manager.ts b/src/services/connection-manager.ts index e8b3292cb3..e2bd6d4866 100644 --- a/src/services/connection-manager.ts +++ b/src/services/connection-manager.ts @@ -191,14 +191,14 @@ export async function getConnector( let connectorInstance: ConnectorUnion; if ( - (chain === 'ethereum' || chain === 'polygon' || chain === "celo") && + (chain === 'ethereum' || chain === 'polygon') && connector === 'uniswap' ) { connectorInstance = Uniswap.getInstance(chain, network); } else if (chain === 'polygon' && connector === 'quickswap') { connectorInstance = Quickswap.getInstance(chain, network); } else if ( - (chain === 'ethereum' || chain === 'polygon' || chain === "celo") && + (chain === 'ethereum' || chain === 'polygon') && connector === 'uniswapLP' ) { connectorInstance = UniswapLP.getInstance(chain, network); From 2323d0470fa2f5d9d32f6e34a0439c4b75308547 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Tue, 23 Apr 2024 01:15:57 +0100 Subject: [PATCH 07/16] (fix) update uniswap packages --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b65e2376be..0554f121e8 100644 --- a/package.json +++ b/package.json @@ -60,12 +60,12 @@ "@types/minimist": "^1.2.2", "@types/morgan": "^1.9.3", "@types/uuid": "^8.3.4", - "@uniswap/sdk": "^3.0.3", - "@uniswap/sdk-core": "^4.2.0", + "@uniswap/sdk": "3.0.2", + "@uniswap/sdk-core": "^3.0.0", "@uniswap/smart-order-router": "^3.28.7", - "@uniswap/v3-core": "^1.0.1", - "@uniswap/v3-periphery": "^1.4.4", - "@uniswap/v3-sdk": "^3.11.0", + "@uniswap/v3-core": "^1.0.0", + "@uniswap/v3-periphery": "^1.1.1", + "@uniswap/v3-sdk": "^3.7.0", "abi-decoder": "^2.4.0", "ajv": "^8.6.3", "algosdk": "^2.2.0", From bd4f89190e2657ec43a51c5cfe51ede63fb94701 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Sun, 5 May 2024 06:22:55 +0100 Subject: [PATCH 08/16] (feat) Update FactoryAddress impllementation --- src/connectors/uniswap/uniswap.config.ts | 28 +++++---- src/connectors/uniswap/uniswap.ts | 76 ++++++++++++------------ src/services/schema/uniswap-schema.json | 2 + src/templates/uniswap.yml | 14 +++-- 4 files changed, 68 insertions(+), 52 deletions(-) diff --git a/src/connectors/uniswap/uniswap.config.ts b/src/connectors/uniswap/uniswap.config.ts index a5a4ca4ba0..a117548b01 100644 --- a/src/connectors/uniswap/uniswap.config.ts +++ b/src/connectors/uniswap/uniswap.config.ts @@ -14,48 +14,54 @@ export namespace UniswapConfig { useRouter?: boolean; feeTier?: string; quoterContractAddress: (network: string) => string; + uniswapV3FactoryAddress: (network: string) => string; } export const config: NetworkConfig = { allowedSlippage: ConfigManagerV2.getInstance().get( - `uniswap.allowedSlippage` + `uniswap.allowedSlippage`, ), gasLimitEstimate: ConfigManagerV2.getInstance().get( - `uniswap.gasLimitEstimate` + `uniswap.gasLimitEstimate`, ), ttl: ConfigManagerV2.getInstance().get(`uniswap.ttl`), maximumHops: ConfigManagerV2.getInstance().get(`uniswap.maximumHops`), uniswapV3SmartOrderRouterAddress: (network: string) => ConfigManagerV2.getInstance().get( - `uniswap.contractAddresses.${network}.uniswapV3SmartOrderRouterAddress` + `uniswap.contractAddresses.${network}.uniswapV3SmartOrderRouterAddress`, ), uniswapV3NftManagerAddress: (network: string) => ConfigManagerV2.getInstance().get( - `uniswap.contractAddresses.${network}.uniswapV3NftManagerAddress` + `uniswap.contractAddresses.${network}.uniswapV3NftManagerAddress`, ), tradingTypes: (type: string) => { return type === 'swap' ? ['AMM'] : ['AMM_LP']; }, + uniswapV3FactoryAddress: (network: string) => { + return ConfigManagerV2.getInstance().get( + `uniswap.contractAddresses.${network}.uniswapV3FactoryAddress`, + ); + }, chainType: 'EVM', availableNetworks: [ { chain: 'ethereum', networks: Object.keys( - ConfigManagerV2.getInstance().get('uniswap.contractAddresses') + ConfigManagerV2.getInstance().get('uniswap.contractAddresses'), ).filter((network) => Object.keys( - ConfigManagerV2.getInstance().get('ethereum.networks') - ).includes(network) + ConfigManagerV2.getInstance().get('ethereum.networks'), + ).includes(network), ), }, { chain: 'polygon', networks: Object.keys( - ConfigManagerV2.getInstance().get('uniswap.contractAddresses') + ConfigManagerV2.getInstance().get('uniswap.contractAddresses'), ).filter((network) => Object.keys( - ConfigManagerV2.getInstance().get('polygon.networks') - ).includes(network) + ConfigManagerV2.getInstance().get('polygon.networks'), + ).includes(network), ), }, ], @@ -63,7 +69,7 @@ export namespace UniswapConfig { feeTier: ConfigManagerV2.getInstance().get(`uniswap.feeTier`), quoterContractAddress: (network: string) => ConfigManagerV2.getInstance().get( - `uniswap.contractAddresses.${network}.uniswapV3QuoterV2ContractAddress` + `uniswap.contractAddresses.${network}.uniswapV3QuoterV2ContractAddress`, ), }; } diff --git a/src/connectors/uniswap/uniswap.ts b/src/connectors/uniswap/uniswap.ts index 4501f489fc..936420d11b 100644 --- a/src/connectors/uniswap/uniswap.ts +++ b/src/connectors/uniswap/uniswap.ts @@ -15,7 +15,6 @@ import { SwapQuoter, Trade as UniswapV3Trade, Route, - FACTORY_ADDRESS, } from '@uniswap/v3-sdk'; import { abi as IUniswapV3PoolABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json'; import { abi as IUniswapV3FactoryABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Factory.sol/IUniswapV3Factory.json'; @@ -46,6 +45,7 @@ export class Uniswap implements Uniswapish { private chain: Ethereum | Polygon; private _alphaRouter: AlphaRouter; private _router: string; + private _v3Factory: string; private _routerAbi: ContractInterface; private _gasLimitEstimate: number; private _ttl: number; @@ -74,13 +74,14 @@ export class Uniswap implements Uniswapish { this._routerAbi = routerAbi.abi; this._gasLimitEstimate = UniswapConfig.config.gasLimitEstimate; this._router = config.uniswapV3SmartOrderRouterAddress(network); + this._v3Factory = config.uniswapV3FactoryAddress(network); if (config.useRouter === false && config.feeTier == null) { throw new Error('Must specify fee tier if not using router'); } if (config.useRouter === false && config.quoterContractAddress == null) { throw new Error( - 'Must specify quoter contract address if not using router' + 'Must specify quoter contract address if not using router', ); } this._useRouter = config.useRouter ?? true; @@ -121,7 +122,7 @@ export class Uniswap implements Uniswapish { token.address, token.decimals, token.symbol, - token.name + token.name, ); } this._ready = true; @@ -189,7 +190,7 @@ export class Uniswap implements Uniswapish { const nd = allowedSlippage.match(percentRegexp); if (nd) return new Percent(nd[1], nd[2]); throw new Error( - 'Encountered a malformed percent string in the config for ALLOWED_SLIPPAGE.' + 'Encountered a malformed percent string in the config for ALLOWED_SLIPPAGE.', ); } @@ -207,13 +208,13 @@ export class Uniswap implements Uniswapish { baseToken: Token, quoteToken: Token, amount: BigNumber, - allowedSlippage?: string + allowedSlippage?: string, ): Promise { const nativeTokenAmount: CurrencyAmount = CurrencyAmount.fromRawAmount(baseToken, amount.toString()); logger.info( - `Fetching trade data for ${baseToken.address}-${quoteToken.address}.` + `Fetching trade data for ${baseToken.address}-${quoteToken.address}.`, ); if (this._useRouter) { @@ -224,28 +225,28 @@ export class Uniswap implements Uniswapish { undefined, { maxSwapsPerPath: this.maximumHops, - } + }, ); if (!route) { throw new UniswapishPriceError( - `priceSwapIn: no trade pair found for ${baseToken.address} to ${quoteToken.address}.` + `priceSwapIn: no trade pair found for ${baseToken.address} to ${quoteToken.address}.`, ); } logger.info( `Best trade for ${baseToken.address}-${quoteToken.address}: ` + `${route.trade.executionPrice.toFixed(6)}` + - `${baseToken.symbol}.` + `${baseToken.symbol}.`, ); const expectedAmount = route.trade.minimumAmountOut( - this.getAllowedSlippage(allowedSlippage) + this.getAllowedSlippage(allowedSlippage), ); return { trade: route.trade, expectedAmount }; } else { const pool = await this.getPool(baseToken, quoteToken, this._feeTier); if (!pool) { throw new UniswapishPriceError( - `priceSwapIn: no trade pair found for ${baseToken.address} to ${quoteToken.address}.` + `priceSwapIn: no trade pair found for ${baseToken.address} to ${quoteToken.address}.`, ); } const swapRoute = new Route([pool], baseToken, quoteToken); @@ -253,7 +254,7 @@ export class Uniswap implements Uniswapish { swapRoute, quoteToken, nativeTokenAmount, - TradeType.EXACT_INPUT + TradeType.EXACT_INPUT, ); const trade = UniswapV3Trade.createUncheckedTrade({ route: swapRoute, @@ -264,10 +265,10 @@ export class Uniswap implements Uniswapish { logger.info( `Best trade for ${baseToken.address}-${quoteToken.address}: ` + `${trade.executionPrice.toFixed(6)}` + - `${baseToken.symbol}.` + `${baseToken.symbol}.`, ); const expectedAmount = trade.minimumAmountOut( - this.getAllowedSlippage(allowedSlippage) + this.getAllowedSlippage(allowedSlippage), ); return { trade, expectedAmount }; } @@ -287,15 +288,16 @@ export class Uniswap implements Uniswapish { quoteToken: Token, baseToken: Token, amount: BigNumber, - allowedSlippage?: string + allowedSlippage?: string, ): Promise { const nativeTokenAmount: CurrencyAmount = CurrencyAmount.fromRawAmount(baseToken, amount.toString()); logger.info( - `Fetching pair data for ${quoteToken.address}-${baseToken.address}.` + `Fetching pair data for ${quoteToken.address}-${baseToken.address}.`, ); if (this._useRouter) { + console.log('using router'); const route = await this._alphaRouter.route( nativeTokenAmount, quoteToken, @@ -303,28 +305,28 @@ export class Uniswap implements Uniswapish { undefined, { maxSwapsPerPath: this.maximumHops, - } + }, ); if (!route) { throw new UniswapishPriceError( - `priceSwapOut: no trade pair found for ${quoteToken.address} to ${baseToken.address}.` + `priceSwapOut: no trade pair found for ${quoteToken.address} to ${baseToken.address}.`, ); } logger.info( `Best trade for ${quoteToken.address}-${baseToken.address}: ` + `${route.trade.executionPrice.invert().toFixed(6)} ` + - `${baseToken.symbol}.` + `${baseToken.symbol}.`, ); const expectedAmount = route.trade.maximumAmountIn( - this.getAllowedSlippage(allowedSlippage) + this.getAllowedSlippage(allowedSlippage), ); return { trade: route.trade, expectedAmount }; } else { const pool = await this.getPool(quoteToken, baseToken, this._feeTier); if (!pool) { throw new UniswapishPriceError( - `priceSwapOut: no trade pair found for ${quoteToken.address} to ${baseToken.address}.` + `priceSwapOut: no trade pair found for ${quoteToken.address} to ${baseToken.address}.`, ); } const swapRoute = new Route([pool], quoteToken, baseToken); @@ -332,7 +334,7 @@ export class Uniswap implements Uniswapish { swapRoute, quoteToken, nativeTokenAmount, - TradeType.EXACT_OUTPUT + TradeType.EXACT_OUTPUT, ); const trade = UniswapV3Trade.createUncheckedTrade({ route: swapRoute, @@ -343,10 +345,10 @@ export class Uniswap implements Uniswapish { logger.info( `Best trade for ${baseToken.address}-${quoteToken.address}: ` + `${trade.executionPrice.invert().toFixed(6)}` + - `${baseToken.symbol}.` + `${baseToken.symbol}.`, ); const expectedAmount = trade.maximumAmountIn( - this.getAllowedSlippage(allowedSlippage) + this.getAllowedSlippage(allowedSlippage), ); return { trade, expectedAmount }; } @@ -377,7 +379,7 @@ export class Uniswap implements Uniswapish { nonce?: number, maxFeePerGas?: BigNumber, maxPriorityFeePerGas?: BigNumber, - allowedSlippage?: string + allowedSlippage?: string, ): Promise { const methodParameters: MethodParameters = SwapRouter.swapCallParameters( trade, @@ -385,7 +387,7 @@ export class Uniswap implements Uniswapish { deadlineOrPreviousBlockhash: Math.floor(Date.now() / 1000 + ttl), recipient: wallet.address, slippageTolerance: this.getAllowedSlippage(allowedSlippage), - } + }, ); return this.chain.nonceManager.provideNonce( @@ -415,25 +417,25 @@ export class Uniswap implements Uniswapish { } logger.info(JSON.stringify(tx)); return tx; - } + }, ); } private async getPool( tokenA: Token, tokenB: Token, - feeTier: FeeAmount + feeTier: FeeAmount, ): Promise { const uniswapFactory = new Contract( - FACTORY_ADDRESS, + this._v3Factory, IUniswapV3FactoryABI, - this.chain.provider + this.chain.provider, ); // Use Uniswap V3 factory to get pool address instead of `Pool.getAddress` to check if pool exists. const poolAddress = await uniswapFactory.getPool( tokenA.address, tokenB.address, - feeTier + feeTier, ); if (poolAddress === constants.AddressZero) { return null; @@ -441,7 +443,7 @@ export class Uniswap implements Uniswapish { const poolContract = new Contract( poolAddress, IUniswapV3PoolABI, - this.chain.provider + this.chain.provider, ); const [liquidity, slot0] = await Promise.all([ @@ -456,7 +458,7 @@ export class Uniswap implements Uniswapish { this._feeTier, sqrtPriceX96, liquidity, - tick + tick, ); return pool; @@ -466,13 +468,13 @@ export class Uniswap implements Uniswapish { swapRoute: Route, quoteToken: Token, amount: CurrencyAmount, - tradeType: TradeType + tradeType: TradeType, ) { const { calldata } = await SwapQuoter.quoteCallParameters( swapRoute, amount, tradeType, - { useQuoterV2: true } + { useQuoterV2: true }, ); const quoteCallReturnData = await this.chain.provider.call({ to: this._quoterContractAddress, @@ -480,11 +482,11 @@ export class Uniswap implements Uniswapish { }); const quoteTokenRawAmount = utils.defaultAbiCoder.decode( ['uint256'], - quoteCallReturnData + quoteCallReturnData, ); const qouteTokenAmount = CurrencyAmount.fromRawAmount( quoteToken, - quoteTokenRawAmount.toString() + quoteTokenRawAmount.toString(), ); return qouteTokenAmount; } diff --git a/src/services/schema/uniswap-schema.json b/src/services/schema/uniswap-schema.json index 3585d376b4..0aa2ef99ed 100644 --- a/src/services/schema/uniswap-schema.json +++ b/src/services/schema/uniswap-schema.json @@ -16,11 +16,13 @@ "^\\w+$": { "type": "object", "properties": { + "uniswapV3FactoryAddress": {"type": "string"}, "uniswapV3SmartOrderRouterAddress": { "type": "string" }, "uniswapV3NftManagerAddress": { "type": "string" }, "uniswapV3QuoterV2ContractAddress": { "type": "string" } }, "required": [ + "uniswapV3FactoryAddress", "uniswapV3SmartOrderRouterAddress", "uniswapV3NftManagerAddress" ], diff --git a/src/templates/uniswap.yml b/src/templates/uniswap.yml index 51781ff1a9..dce686b65f 100644 --- a/src/templates/uniswap.yml +++ b/src/templates/uniswap.yml @@ -24,27 +24,33 @@ useRouter: false feeTier: 'MEDIUM' contractAddresses: - celo: - uniswapV3SmartOrderRouterAddress: '0x5615CDAb10dc425a742d643d949a7F474C01abc4' - uniswapV3NftManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A' - uniswapV3QuoterV2ContractAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8' mainnet: + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' + celo: + uniswapV3FactoryAddress: '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc' + uniswapV3SmartOrderRouterAddress: '0x5615CDAb10dc425a742d643d949a7F474C01abc4' + uniswapV3NftManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A' + uniswapV3QuoterV2ContractAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8' goerli: + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' arbitrum: + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' optimism: + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' mumbai: + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' From f721dd8b4e4919c8ec7287482023409fbe674705 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Wed, 8 May 2024 22:27:18 +0100 Subject: [PATCH 09/16] (feat) Update celo tokenlist --- src/templates/lists/celo_token.json | 112 ---------------------------- 1 file changed, 112 deletions(-) diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index 3652531e17..1b3cb1a5fb 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -177,22 +177,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" }, - { - "name": "Optics v2 WBTC", - "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", - "decimals": 8, - "symbol": "WBTC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" - }, - { - "name": "Optics v2 USDC", - "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", - "decimals": 6, - "symbol": "USDC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" - }, { "name": "Optics v2 USDT", "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", @@ -201,14 +185,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" }, - { - "name": "Optics v2 DAI", - "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", - "symbol": "DAI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" - }, { "name": "Mobius DAO Token", "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", @@ -257,14 +233,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SOL.png" }, - { - "name": "Moola", - "address": "0x17700282592D6917F6A73D0bF8AcCf4D578c131e", - "symbol": "MOO", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" - }, { "name": "Ariswap", "address": "0x20677d4f3d0F08e735aB512393524A3CfCEb250C", @@ -465,30 +433,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_pCELO.png" }, - { - "name": "Poof Governance Token", - "address": "0x00400FcbF0816bebB94654259de7273f4A05c762", - "symbol": "POOF", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_POOF.png" - }, - { - "name": "Moola cEUR", - "address": "0x0D9B4311657003251d1eFa085e74f761185F271c", - "symbol": "mcEUR", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcEUR.png" - }, - { - "name": "Celo Euro", - "address": "0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F", - "symbol": "cEUR", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cEUR.png" - }, { "name": "NetM Token", "address": "0x123ED050805E0998EBEf43671327139224218e50", @@ -505,46 +449,6 @@ "chainId": 44787, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MOO.png" }, - { - "name": "Moola cUSD", - "address": "0x3a0EA4e0806805527C750AB9b34382642448468D", - "symbol": "mcUSD", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcUSD.png" - }, - { - "name": "Moola cREAL", - "address": "0x3D0EDA535ca4b15c739D46761d24E42e37664Ad7", - "symbol": "mcREAL", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mcREAL.png" - }, - { - "name": "Marzipan Finance", - "address": "0x4d8BF8347600f5207bfdad57363fBa802C9C2031", - "symbol": "MZPN", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_MZPN.png" - }, - { - "name": "Moola CELO", - "address": "0x653cC2Cc0Be398614BAd5d5328336dc79281e246", - "symbol": "mCELO", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_mCELO.png" - }, - { - "name": "Celo Dollar", - "address": "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", - "symbol": "cUSD", - "decimals": 18, - "chainId": 44787, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_cUSD.png" - }, { "name": "AtlasX Carbon Credits", "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", @@ -561,14 +465,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_PLASTIK.png" }, - { - "name": "Curve DAO Token", - "address": "0x173fd7434B8B50dF08e3298f173487ebDB35FD14", - "symbol": "CRV", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" - }, { "name": "Axelar Wrapped Bitcoin", "address": "0x1a35EE4640b0A3B87705B0A4B45D227Ba60Ca2ad", @@ -625,14 +521,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/curvefi/curve-assets/main/branding/logo.svg" }, - { - "name": "AtlasX Carbon Credits", - "address": "0xc3377Ea71F1dc8e55Ba360724eff2d7aD62a8670", - "symbol": "ATLASX", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://myterrablobs.blob.core.windows.net/public/token-icon.png" - }, { "name": "agEUR", "address": "0xC16B81Af351BA9e64C1a069E3Ab18c244A1E3049", From a5d08bedb226ba884dc1304accbbb60d9c093ed0 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Wed, 8 May 2024 23:07:32 +0100 Subject: [PATCH 10/16] (feat) Update celo tokenlist --- src/templates/lists/celo_token.json | 48 +++++++++---------- test-helpers/curl/requests/price_uniswap.json | 6 +-- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index 1b3cb1a5fb..fefc31f903 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -65,14 +65,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/USDCet_wh_small.png" }, - { - "name": "DAI Stablecoin (Portal)", - "address": "0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF", - "symbol": "DAI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/DAI_wh_small.png" - }, { "name": "Portal WETH", "address": "0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207", @@ -177,6 +169,22 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" }, +{ + "name": "Optics v2 WBTC", + "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", + "decimals": 8, + "symbol": "WBTC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" + }, + { + "name": "Optics v2 USDC", + "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", + "decimals": 6, + "symbol": "USDC", + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" + }, { "name": "Optics v2 USDT", "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", @@ -185,6 +193,14 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" }, +{ + "name": "Optics v2 DAI", + "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" + }, { "name": "Mobius DAO Token", "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", @@ -473,14 +489,6 @@ "chainId": 42220, "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_wbtc.svg" }, - { - "name": "Wormhole Wrapped Bitcoin", - "address": "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF", - "symbol": "WBTC", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://celo-org.github.io/celo-token-list/assets/wormhole_wbtc.png" - }, { "name": "Good Dollar", "address": "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A", @@ -536,14 +544,6 @@ "decimals": 6, "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/wormhole-foundation/wormhole-token-list/main/assets/EURC_wh.png" - }, - { - "name": "USD Coin", - "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", - "symbol": "USDC", - "decimals": 6, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" } ] } \ No newline at end of file diff --git a/test-helpers/curl/requests/price_uniswap.json b/test-helpers/curl/requests/price_uniswap.json index 3d0b5ebb4e..6e668bb354 100644 --- a/test-helpers/curl/requests/price_uniswap.json +++ b/test-helpers/curl/requests/price_uniswap.json @@ -1,9 +1,9 @@ { "connector": "uniswap", "chain": "ethereum", - "network": "goerli", - "quote": "WETH", - "base": "DAI", + "network": "celo", + "quote": "CELO", + "base": "USDC", "amount": "1", "side": "BUY" } From 12312968c284cdbf432c0b7014aad4190188e384 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Wed, 8 May 2024 23:10:53 +0100 Subject: [PATCH 11/16] (feat) remove changes to test --- test-helpers/curl/requests/price_uniswap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-helpers/curl/requests/price_uniswap.json b/test-helpers/curl/requests/price_uniswap.json index 6e668bb354..3d0b5ebb4e 100644 --- a/test-helpers/curl/requests/price_uniswap.json +++ b/test-helpers/curl/requests/price_uniswap.json @@ -1,9 +1,9 @@ { "connector": "uniswap", "chain": "ethereum", - "network": "celo", - "quote": "CELO", - "base": "USDC", + "network": "goerli", + "quote": "WETH", + "base": "DAI", "amount": "1", "side": "BUY" } From 04bf8a04fd23eb2b314e7f569da7847c5b9f7959 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Tue, 21 May 2024 04:02:21 +0100 Subject: [PATCH 12/16] (refactor) token list --- test-helpers/curl/requests/network_balances.json | 8 ++++---- test-helpers/curl/requests/price_uniswap.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test-helpers/curl/requests/network_balances.json b/test-helpers/curl/requests/network_balances.json index 8c6c198643..b6e70aa926 100644 --- a/test-helpers/curl/requests/network_balances.json +++ b/test-helpers/curl/requests/network_balances.json @@ -1,8 +1,8 @@ { - "chain": "avalanche", - "network": "avalanche", - "address": "$AVALANCHE_ADDRESS", + "chain": "ethereum", + "network": "celo", + "address": "0x0a0CdC90CC16A0f3E67c296c8C0f7207cbdC0F4E", "tokenSymbols": [ - "USDC" + "USDC", "cETH" ] } diff --git a/test-helpers/curl/requests/price_uniswap.json b/test-helpers/curl/requests/price_uniswap.json index 3d0b5ebb4e..6e668bb354 100644 --- a/test-helpers/curl/requests/price_uniswap.json +++ b/test-helpers/curl/requests/price_uniswap.json @@ -1,9 +1,9 @@ { "connector": "uniswap", "chain": "ethereum", - "network": "goerli", - "quote": "WETH", - "base": "DAI", + "network": "celo", + "quote": "CELO", + "base": "USDC", "amount": "1", "side": "BUY" } From 1132790494db516a5f57910e8cd57d9fb8c8b2b0 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Tue, 21 May 2024 04:03:28 +0100 Subject: [PATCH 13/16] (refactor) test file --- test-helpers/curl/requests/network_balances.json | 8 ++++---- test-helpers/curl/requests/price_uniswap.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test-helpers/curl/requests/network_balances.json b/test-helpers/curl/requests/network_balances.json index b6e70aa926..8c6c198643 100644 --- a/test-helpers/curl/requests/network_balances.json +++ b/test-helpers/curl/requests/network_balances.json @@ -1,8 +1,8 @@ { - "chain": "ethereum", - "network": "celo", - "address": "0x0a0CdC90CC16A0f3E67c296c8C0f7207cbdC0F4E", + "chain": "avalanche", + "network": "avalanche", + "address": "$AVALANCHE_ADDRESS", "tokenSymbols": [ - "USDC", "cETH" + "USDC" ] } diff --git a/test-helpers/curl/requests/price_uniswap.json b/test-helpers/curl/requests/price_uniswap.json index 6e668bb354..3d0b5ebb4e 100644 --- a/test-helpers/curl/requests/price_uniswap.json +++ b/test-helpers/curl/requests/price_uniswap.json @@ -1,9 +1,9 @@ { "connector": "uniswap", "chain": "ethereum", - "network": "celo", - "quote": "CELO", - "base": "USDC", + "network": "goerli", + "quote": "WETH", + "base": "DAI", "amount": "1", "side": "BUY" } From 296cf6e0772ae142b57ede3f529fdec9c9ae54ad Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Tue, 21 May 2024 04:06:52 +0100 Subject: [PATCH 14/16] (refactor) token list file --- src/templates/lists/celo_token.json | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index fefc31f903..1b3cb1a5fb 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -65,6 +65,14 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/USDCet_wh_small.png" }, + { + "name": "DAI Stablecoin (Portal)", + "address": "0x97926a82930bb7B33178E3c2f4ED1BFDc91A9FBF", + "symbol": "DAI", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/certusone/wormhole-token-list/main/assets/DAI_wh_small.png" + }, { "name": "Portal WETH", "address": "0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207", @@ -169,22 +177,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" }, -{ - "name": "Optics v2 WBTC", - "address": "0xBAAB46E28388d2779e6E31Fd00cF0e5Ad95E327B", - "decimals": 8, - "symbol": "WBTC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png" - }, - { - "name": "Optics v2 USDC", - "address": "0xef4229c8c3250C675F21BCefa42f58EfbfF6002a", - "decimals": 6, - "symbol": "USDC", - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDC.png" - }, { "name": "Optics v2 USDT", "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0", @@ -193,14 +185,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_USDT.png" }, -{ - "name": "Optics v2 DAI", - "address": "0x90Ca507a5D4458a4C6C6249d186b6dCb02a5BCCd", - "symbol": "DAI", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_DAI.png" - }, { "name": "Mobius DAO Token", "address": "0x73a210637f6F6B7005512677Ba6B3C96bb4AA44B", @@ -489,6 +473,14 @@ "chainId": 42220, "logoURI": "https://celo-org.github.io/celo-token-list/assets/axelar_wbtc.svg" }, + { + "name": "Wormhole Wrapped Bitcoin", + "address": "0xd71Ffd0940c920786eC4DbB5A12306669b5b81EF", + "symbol": "WBTC", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://celo-org.github.io/celo-token-list/assets/wormhole_wbtc.png" + }, { "name": "Good Dollar", "address": "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A", @@ -544,6 +536,14 @@ "decimals": 6, "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/wormhole-foundation/wormhole-token-list/main/assets/EURC_wh.png" + }, + { + "name": "USD Coin", + "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", + "symbol": "USDC", + "decimals": 6, + "chainId": 42220, + "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" } ] } \ No newline at end of file From cafc86f4155cf7cc21e5e2bb83d84fff651e02b9 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Mon, 3 Jun 2024 15:11:45 +0100 Subject: [PATCH 15/16] (refactor) celo chain --- jest.config.js | 1 + package.json | 4 +- src/chains/celo/celo.ts | 129 ++++++++++++++++++ src/chains/celo/celo.validators.ts | 41 ++++++ src/connectors/uniswap/uniswap.config.ts | 10 ++ src/connectors/uniswap/uniswap.lp.helper.ts | 34 +++-- src/connectors/uniswap/uniswap.lp.ts | 10 +- src/connectors/uniswap/uniswap.ts | 11 +- src/network/network.controllers.ts | 6 + src/services/connection-manager.ts | 7 +- src/services/wallet/wallet.validators.ts | 6 + src/templates/celo.yml | 16 +-- src/templates/ethereum.yml | 14 -- src/templates/lists/celo_token.json | 8 ++ src/templates/root.yml | 4 + src/templates/uniswap.yml | 4 +- .../data/config-manager-v2/test1/root.yml | 6 +- .../services/wallet/wallet.validators.test.ts | 10 ++ 18 files changed, 269 insertions(+), 52 deletions(-) create mode 100644 src/chains/celo/celo.ts create mode 100644 src/chains/celo/celo.validators.ts diff --git a/jest.config.js b/jest.config.js index 5c7ce4a695..33e5f31305 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,6 +13,7 @@ module.exports = { 'src/chains/binance-smart-chain/binance-smart-chain.ts', 'src/chains/ethereum/ethereum.ts', 'src/chains/avalanche/avalanche.ts', + 'src/chains/celo/celo.ts', 'src/chains/avalanche/pangolin/pangolin.ts', 'src/chains/cosmos/cosmos.ts', 'src/chains/near/near.ts', diff --git a/package.json b/package.json index 4b656a6b8a..096435d8c1 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@uniswap/sdk": "3.0.2", "@uniswap/sdk-core": "^3.0.0", "@uniswap/smart-order-router": "^3.28.7", - "@uniswap/v3-core": "^1.0.0", + "@uniswap/v3-core": "^1.0.1", "@uniswap/v3-periphery": "^1.1.1", "@uniswap/v3-sdk": "^3.7.0", "abi-decoder": "^2.4.0", @@ -78,7 +78,7 @@ "coinalpha-ref-sdk": "1.1.0", "dayjs": "^1.10.6", "decimal.js-light": "^2.5.1", - "ethers": "^5.6.2", + "ethers": "^5.7.2", "ethers-xdc": "file:./vendor/ethers-xdc", "express": "^4.17.1", "express-winston": "^4.1.0", diff --git a/src/chains/celo/celo.ts b/src/chains/celo/celo.ts new file mode 100644 index 0000000000..ed9436b29e --- /dev/null +++ b/src/chains/celo/celo.ts @@ -0,0 +1,129 @@ +import abi from '../ethereum/ethereum.abi.json'; +import { logger } from '../../services/logger'; +import { Contract, Transaction, Wallet } from 'ethers'; +import { EthereumBase } from '../ethereum/ethereum-base'; +import { getEthereumConfig as getCeloConfig } from '../ethereum/ethereum.config'; +import { Provider } from '@ethersproject/abstract-provider'; +import { Ethereumish } from '../../services/common-interfaces'; +import { ConfigManagerV2 } from '../../services/config-manager-v2'; +import { EVMController } from '../ethereum/evm.controllers'; +import { UniswapConfig } from '../../connectors/uniswap/uniswap.config'; + +export class Celo extends EthereumBase implements Ethereumish { + private static _instances: { [name: string]: Celo }; + private _gasPrice: number; + private _gasPriceRefreshInterval: number | null; + private _nativeTokenSymbol: string; + private _chain: string; + public controller; + + private constructor(network: string) { + const config = getCeloConfig('celo', network); + super( + 'celo', + config.network.chainID, + config.network.nodeURL, + config.network.tokenListSource, + config.network.tokenListType, + config.manualGasPrice, + config.gasLimitTransaction, + ConfigManagerV2.getInstance().get('server.nonceDbPath'), + ConfigManagerV2.getInstance().get('server.transactionDbPath') + ); + this._chain = config.network.name; + this._nativeTokenSymbol = config.nativeCurrencySymbol; + + this._gasPrice = config.manualGasPrice; + + this._gasPriceRefreshInterval = + config.network.gasPriceRefreshInterval !== undefined + ? config.network.gasPriceRefreshInterval + : null; + + this.updateGasPrice(); + this.controller = EVMController; + } + + public static getInstance(network: string): Celo { + if (Celo._instances === undefined) { + Celo._instances = {}; + } + if (!(network in Celo._instances)) { + Celo._instances[network] = new Celo(network); + } + + return Celo._instances[network]; + } + + public static getConnectedInstances(): { [name: string]: Celo } { + return Celo._instances; + } + + // getters + + public get gasPrice(): number { + return this._gasPrice; + } + + public get nativeTokenSymbol(): string { + return this._nativeTokenSymbol; + } + + public get chain(): string { + return this._chain; + } + + getContract(tokenAddress: string, signerOrProvider?: Wallet | Provider) { + return new Contract(tokenAddress, abi.ERC20Abi, signerOrProvider); + } + + getSpender(reqSpender: string): string { + let spender: string; + if (reqSpender === 'uniswap') { + spender = UniswapConfig.config.uniswapV3SmartOrderRouterAddress( + this._chain + ); + } else if (reqSpender === 'uniswapLP') { + spender = UniswapConfig.config.uniswapV3NftManagerAddress(this._chain); + } else { + spender = reqSpender; + } + return spender; + } + + // cancel transaction + async cancelTx(wallet: Wallet, nonce: number): Promise { + logger.info( + 'Canceling any existing transaction(s) with nonce number ' + nonce + '.' + ); + return super.cancelTxWithGasPrice(wallet, nonce, this._gasPrice * 2); + } + + /** + * Automatically update the prevailing gas price on the network. + */ + async updateGasPrice(): Promise { + if (this._gasPriceRefreshInterval === null) { + return; + } + + const gasPrice = await this.getGasPrice(); + if (gasPrice !== null) { + this._gasPrice = gasPrice; + } else { + logger.info('gasPrice is unexpectedly null.'); + } + + setTimeout( + this.updateGasPrice.bind(this), + this._gasPriceRefreshInterval * 1000 + ); + } + + async close() { + await super.close(); + if (this._chain in Celo._instances) { + delete Celo._instances[this._chain]; + } + } +} diff --git a/src/chains/celo/celo.validators.ts b/src/chains/celo/celo.validators.ts new file mode 100644 index 0000000000..a017aef071 --- /dev/null +++ b/src/chains/celo/celo.validators.ts @@ -0,0 +1,41 @@ +import { + mkRequestValidator, + mkValidator, + RequestValidator, + Validator, + validateAmount, + validateToken, + validateTokenSymbols, + } from '../../services/validators'; + import { + isAddress, + validateNonce, + validateAddress, + } from '../ethereum/ethereum.validators'; + + export const invalidSpenderError: string = + 'The spender param is not a valid Celo address (0x followed by 40 hexidecimal characters).'; + + // given a request, look for a key called spender that is 'uniswap' or an Ethereum address + export const validateSpender: Validator = mkValidator( + 'spender', + invalidSpenderError, + + (val) => + typeof val === 'string' && + (val === 'uniswap' || + val === 'uniswapLP' || + isAddress(val)) + ); + + export const validateCeloApproveRequest: RequestValidator = + mkRequestValidator([ + validateAddress, + validateSpender, + validateToken, + validateAmount, + validateNonce, + ]); + + export const validateCeloAllowancesRequest: RequestValidator = + mkRequestValidator([validateAddress, validateSpender, validateTokenSymbols]); diff --git a/src/connectors/uniswap/uniswap.config.ts b/src/connectors/uniswap/uniswap.config.ts index a117548b01..e62c4fa3cd 100644 --- a/src/connectors/uniswap/uniswap.config.ts +++ b/src/connectors/uniswap/uniswap.config.ts @@ -54,6 +54,16 @@ export namespace UniswapConfig { ).includes(network), ), }, + { + chain: 'celo', + networks: Object.keys( + ConfigManagerV2.getInstance().get('uniswap.contractAddresses'), + ).filter((network) => + Object.keys( + ConfigManagerV2.getInstance().get('celo.networks'), + ).includes(network), + ), + }, { chain: 'polygon', networks: Object.keys( diff --git a/src/connectors/uniswap/uniswap.lp.helper.ts b/src/connectors/uniswap/uniswap.lp.helper.ts index b59dd78b0f..412cd73fdc 100644 --- a/src/connectors/uniswap/uniswap.lp.helper.ts +++ b/src/connectors/uniswap/uniswap.lp.helper.ts @@ -19,11 +19,13 @@ import { } from './uniswap.lp.interfaces'; import * as math from 'mathjs'; import { getAddress } from 'ethers/lib/utils'; +import { Celo } from '../../chains/celo/celo'; export class UniswapLPHelper { - protected ethereum: Ethereum; + protected chain: Ethereum | Celo; protected chainId; private _router: string; + private _factory: string; private _nftManager: string; private _ttl: number; private _routerAbi: ContractInterface; @@ -31,20 +33,23 @@ export class UniswapLPHelper { private _poolAbi: ContractInterface; private _alphaRouter: AlphaRouter; private tokenList: Record = {}; - private _chain: string; private _ready: boolean = false; public abiDecoder: any; constructor(chain: string, network: string) { - this.ethereum = Ethereum.getInstance(network); - this._chain = chain; - this.chainId = this.ethereum.chainId; + if (chain === 'ethereum') { + this.chain = Ethereum.getInstance(network); + } else { + this.chain = Celo.getInstance(network); + } + this.chainId = this.chain.chainId; this._alphaRouter = new AlphaRouter({ chainId: this.chainId, - provider: this.ethereum.provider, + provider: this.chain.provider, }); this._router = UniswapConfig.config.uniswapV3SmartOrderRouterAddress(network); + this._factory = UniswapConfig.config.uniswapV3FactoryAddress(network); this._nftManager = UniswapConfig.config.uniswapV3NftManagerAddress(network); this._ttl = UniswapConfig.config.ttl; this._routerAbi = @@ -101,12 +106,13 @@ export class UniswapLPHelper { } public async init() { - if (this._chain == 'ethereum' && !this.ethereum.ready()) + let chainName = this.chain.chainName.toString() + if (!this.chain.ready()) throw new InitializationError( - SERVICE_UNITIALIZED_ERROR_MESSAGE('ETH'), + SERVICE_UNITIALIZED_ERROR_MESSAGE(chainName), SERVICE_UNITIALIZED_ERROR_CODE ); - for (const token of this.ethereum.storedTokenList) { + for (const token of this.chain.storedTokenList) { this.tokenList[token.address] = new Token( this.chainId, token.address, @@ -156,7 +162,7 @@ export class UniswapLPHelper { ): Promise { const poolContract = this.getPoolContract( poolAddress, - this.ethereum.provider + this.chain.provider ); const minTick = uniV3.nearestUsableTick( uniV3.TickMath.MIN_TICK, @@ -221,9 +227,9 @@ export class UniswapLPHelper { const prices = []; const fee = uniV3.FeeAmount[tier as keyof typeof uniV3.FeeAmount]; const poolContract = new Contract( - uniV3.Pool.getAddress(token0, token1, fee), + uniV3.Pool.getAddress(token0, token1, fee, undefined, this._factory), this.poolAbi, - this.ethereum.provider + this.chain.provider ); for ( let x = Math.ceil(period / interval) * interval; @@ -311,7 +317,7 @@ export class UniswapLPHelper { const lowerPriceInFraction = math.fraction(lowerPrice) as math.Fraction; const upperPriceInFraction = math.fraction(upperPrice) as math.Fraction; const poolData = await this.getPoolState( - uniV3.Pool.getAddress(token0, token1, fee), + uniV3.Pool.getAddress(token0, token1, fee, undefined, this._factory), fee ); const pool = new uniV3.Pool( @@ -398,7 +404,7 @@ export class UniswapLPHelper { `One of the tokens in this position isn't recognized. $token0: ${token0}, $token1: ${token1}` ); } - const poolAddress = uniV3.Pool.getAddress(token0, token1, fee); + const poolAddress = uniV3.Pool.getAddress(token0, token1, fee, undefined, this._factory); const poolData = await this.getPoolState(poolAddress, fee); const position = new uniV3.Position({ pool: new uniV3.Pool( diff --git a/src/connectors/uniswap/uniswap.lp.ts b/src/connectors/uniswap/uniswap.lp.ts index 274591e6bd..b32924f85b 100644 --- a/src/connectors/uniswap/uniswap.lp.ts +++ b/src/connectors/uniswap/uniswap.lp.ts @@ -53,10 +53,10 @@ export class UniswapLP extends UniswapLPHelper implements UniswapLPish { } async getPosition(tokenId: number): Promise { - const contract = this.getContract('nft', this.ethereum.provider); + const contract = this.getContract('nft', this.chain.provider); const requests = [ contract.positions(tokenId), - this.collectFees(this.ethereum.provider, tokenId), // static call to calculate earned fees + this.collectFees(this.chain.provider, tokenId), // static call to calculate earned fees ]; const positionInfoReq = await Promise.allSettled(requests); const rejected = positionInfoReq.filter( @@ -141,7 +141,7 @@ export class UniswapLP extends UniswapLPHelper implements UniswapLPish { ); if (nonce === undefined) { - nonce = await this.ethereum.nonceManager.getNextNonce(wallet.address); + nonce = await this.chain.nonceManager.getNextNonce(wallet.address); } const tx = await wallet.sendTransaction({ @@ -179,7 +179,7 @@ export class UniswapLP extends UniswapLPHelper implements UniswapLPish { ); if (nonce === undefined) { - nonce = await this.ethereum.nonceManager.getNextNonce(wallet.address); + nonce = await this.chain.nonceManager.getNextNonce(wallet.address); } const tx = await contract.multicall( @@ -219,7 +219,7 @@ export class UniswapLP extends UniswapLPHelper implements UniswapLPish { } else { collectData.recipient = wallet.address; if (nonce === undefined) { - nonce = await this.ethereum.nonceManager.getNextNonce(wallet.address); + nonce = await this.chain.nonceManager.getNextNonce(wallet.address); } return await contract.collect( collectData, diff --git a/src/connectors/uniswap/uniswap.ts b/src/connectors/uniswap/uniswap.ts index 936420d11b..2c30c2da3f 100644 --- a/src/connectors/uniswap/uniswap.ts +++ b/src/connectors/uniswap/uniswap.ts @@ -39,13 +39,14 @@ import { Ethereum } from '../../chains/ethereum/ethereum'; import { Polygon } from '../../chains/polygon/polygon'; import { ExpectedTrade, Uniswapish } from '../../services/common-interfaces'; import { getAddress } from 'ethers/lib/utils'; +import { Celo } from '../../chains/celo/celo'; export class Uniswap implements Uniswapish { private static _instances: { [name: string]: Uniswap }; - private chain: Ethereum | Polygon; + private chain: Ethereum | Celo | Polygon; private _alphaRouter: AlphaRouter; private _router: string; - private _v3Factory: string; + private _factory: string; private _routerAbi: ContractInterface; private _gasLimitEstimate: number; private _ttl: number; @@ -61,6 +62,8 @@ export class Uniswap implements Uniswapish { const config = UniswapConfig.config; if (chain === 'ethereum') { this.chain = Ethereum.getInstance(network); + } else if (chain === 'celo') { + this.chain = Celo.getInstance(network); } else { this.chain = Polygon.getInstance(network); } @@ -74,7 +77,7 @@ export class Uniswap implements Uniswapish { this._routerAbi = routerAbi.abi; this._gasLimitEstimate = UniswapConfig.config.gasLimitEstimate; this._router = config.uniswapV3SmartOrderRouterAddress(network); - this._v3Factory = config.uniswapV3FactoryAddress(network); + this._factory = config.uniswapV3FactoryAddress(network); if (config.useRouter === false && config.feeTier == null) { throw new Error('Must specify fee tier if not using router'); @@ -427,7 +430,7 @@ export class Uniswap implements Uniswapish { feeTier: FeeAmount, ): Promise { const uniswapFactory = new Contract( - this._v3Factory, + this._factory, IUniswapV3FactoryABI, this.chain.provider, ); diff --git a/src/network/network.controllers.ts b/src/network/network.controllers.ts index bb4b165158..220d8d2a61 100644 --- a/src/network/network.controllers.ts +++ b/src/network/network.controllers.ts @@ -4,6 +4,7 @@ import { BinanceSmartChain } from '../chains/binance-smart-chain/binance-smart-c import { Ethereum } from '../chains/ethereum/ethereum'; import { Harmony } from '../chains/harmony/harmony'; import { Polygon } from '../chains/polygon/polygon'; +import { Celo } from '../chains/celo/celo'; import { Xdc } from '../chains/xdc/xdc'; import { Tezos } from '../chains/tezos/tezos'; import { Kujira } from '../chains/kujira/kujira'; @@ -85,6 +86,11 @@ export async function getStatus( cronosConnections ? Object.values(cronosConnections) : [] ); + const celoConnections = Celo.getConnectedInstances(); + connections = connections.concat( + celoConnections ? Object.values(celoConnections) : [] + ); + const nearConnections = Near.getConnectedInstances(); connections = connections.concat( nearConnections ? Object.values(nearConnections) : [] diff --git a/src/services/connection-manager.ts b/src/services/connection-manager.ts index e2bd6d4866..a0617f3ff7 100644 --- a/src/services/connection-manager.ts +++ b/src/services/connection-manager.ts @@ -1,4 +1,5 @@ import { Avalanche } from '../chains/avalanche/avalanche'; +import { Celo } from '../chains/celo/celo'; import { Cronos } from '../chains/cronos/cronos'; import { Ethereum } from '../chains/ethereum/ethereum'; import { BinanceSmartChain } from '../chains/binance-smart-chain/binance-smart-chain'; @@ -126,6 +127,8 @@ export async function getChainInstance( connection = Cronos.getInstance(network); } else if (chain === 'cosmos') { connection = Cosmos.getInstance(network); + } else if (chain === 'celo') { + connection = Celo.getInstance(network); } else if (chain === 'osmosis') { connection = Osmosis.getInstance(network); } else if (chain === 'near') { @@ -191,14 +194,14 @@ export async function getConnector( let connectorInstance: ConnectorUnion; if ( - (chain === 'ethereum' || chain === 'polygon') && + (chain === 'ethereum' || chain === 'celo' || chain === 'polygon') && connector === 'uniswap' ) { connectorInstance = Uniswap.getInstance(chain, network); } else if (chain === 'polygon' && connector === 'quickswap') { connectorInstance = Quickswap.getInstance(chain, network); } else if ( - (chain === 'ethereum' || chain === 'polygon') && + (chain === 'ethereum' || chain === 'celo' || chain === 'polygon') && connector === 'uniswapLP' ) { connectorInstance = UniswapLP.getInstance(chain, network); diff --git a/src/services/wallet/wallet.validators.ts b/src/services/wallet/wallet.validators.ts index d58a0db605..06007a51c9 100644 --- a/src/services/wallet/wallet.validators.ts +++ b/src/services/wallet/wallet.validators.ts @@ -108,6 +108,11 @@ export const validatePrivateKey: Validator = mkSelectingValidator( invalidCosmosPrivateKeyError, (val) => typeof val === 'string' && isCosmosPrivateKey(val) ), + celo: mkValidator( + 'privateKey', + invalidEthPrivateKeyError, + (val) => typeof val === 'string' && isEthPrivateKey(val) + ), osmosis: mkValidator( 'privateKey', invalidCosmosPrivateKeyError, @@ -168,6 +173,7 @@ export const validateChain: Validator = mkValidator( val === 'ethereum' || val === 'avalanche' || val === 'polygon' || + val === 'celo' || val === 'xdc' || val === 'near' || val === 'harmony' || diff --git a/src/templates/celo.yml b/src/templates/celo.yml index 4acca5cdf1..b4ab9616f6 100644 --- a/src/templates/celo.yml +++ b/src/templates/celo.yml @@ -1,18 +1,18 @@ -# list the Avalanche networks available to gateway +# list the Celo networks available to gateway networks: - mainnet: + celo: chainID: 42220 nodeURL: https://rpc.ankr.com/celo - tokenListType: FILE - tokenListSource: /home/gateway/conf/lists/celo_token.json - nativeCurrencySymbol: CELO + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' gasPriceRefreshInterval: 60 celo_alfajores: chainID: 44787 nodeURL: https://celo-alfajores.infura.io/v3 - tokenListType: FILE - tokenListSource: /home/gateway/conf/lists/celo_token.json - nativeCurrencySymbol: CELO + tokenListType: 'FILE' + tokenListSource: '/home/gateway/conf/lists/celo_token.json' + nativeCurrencySymbol: 'CELO' gasPriceRefreshInterval: 60 # if you use the gas assumptions below, your wallet needs >0.01 AVAX balance for gas diff --git a/src/templates/ethereum.yml b/src/templates/ethereum.yml index 1d1d03c16f..03469ccbbc 100644 --- a/src/templates/ethereum.yml +++ b/src/templates/ethereum.yml @@ -1,18 +1,4 @@ networks: - celo: - chainID: 42220 - nodeURL: https://rpc.ankr.com/celo - tokenListType: FILE - tokenListSource: /home/gateway/conf/lists/celo_token.json - nativeCurrencySymbol: CELO - gasPriceRefreshInterval: 60 - celo_alfajores: - chainID: 44787 - nodeURL: https://celo-alfajores.infura.io/v3 - tokenListType: FILE - tokenListSource: /home/gateway/conf/lists/celo_token.json - nativeCurrencySymbol: CELO - gasPriceRefreshInterval: 60 arbitrum: chainID: 42161 nodeURL: https://rpc.ankr.com/arbitrum diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index 1b3cb1a5fb..1d9f049af1 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -544,6 +544,14 @@ "decimals": 6, "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/asset_USDC.svg" + }, + { + "name": "Celo Kenyan Shilling", + "address": "0x456a3D042C0DbD3db53D5489e98dFb038553B0d0", + "symbol": "cKES", + "decimals": 18, + "chainId": 42220, + "logoURI": "https://github.com/mento-protocol/mento-web/blob/main/src/images/tokens/cKES.svg" } ] } \ No newline at end of file diff --git a/src/templates/root.yml b/src/templates/root.yml index 748ec134b2..be7e83d5b0 100644 --- a/src/templates/root.yml +++ b/src/templates/root.yml @@ -28,6 +28,10 @@ configurations: configurationPath: polygon.yml schemaPath: ethereum-schema.json + $namespace celo: + configurationPath: celo.yml + schemaPath: ethereum-schema.json + $namespace near: configurationPath: near.yml schemaPath: ethereum-schema.json diff --git a/src/templates/uniswap.yml b/src/templates/uniswap.yml index dce686b65f..07890afc7d 100644 --- a/src/templates/uniswap.yml +++ b/src/templates/uniswap.yml @@ -9,7 +9,7 @@ gasLimitEstimate: 150688 # perform the trade, but the gas will still be sent. ttl: 600 -# For each swap, the maximum number of hops to consider. +# For each swap, the maximum number of hops to consider. # Note: More hops will increase latency of the algorithm. maximumHops: 4 @@ -35,7 +35,7 @@ contractAddresses: uniswapV3NftManagerAddress: '0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A' uniswapV3QuoterV2ContractAddress: '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8' goerli: - uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' + uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984' uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45' uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' diff --git a/test/services/data/config-manager-v2/test1/root.yml b/test/services/data/config-manager-v2/test1/root.yml index b15c278c49..229791ae5c 100644 --- a/test/services/data/config-manager-v2/test1/root.yml +++ b/test/services/data/config-manager-v2/test1/root.yml @@ -19,7 +19,11 @@ configurations: $namespace polygon: configurationPath: polygon.yml schemaPath: ethereum-schema.json - + + $namespace celo: + configurationPath: celo.yml + schemaPath: ethereum-schema.json + $namespace pangolin: configurationPath: pangolin.yml schemaPath: pangolin-schema.json diff --git a/test/services/wallet/wallet.validators.test.ts b/test/services/wallet/wallet.validators.test.ts index 2d4a71c3d6..db06fe86f4 100644 --- a/test/services/wallet/wallet.validators.test.ts +++ b/test/services/wallet/wallet.validators.test.ts @@ -124,6 +124,16 @@ describe('validatePrivateKey', () => { ).toEqual([]); }); + it('valid when req.privateKey is a celo key', () => { + expect( + validatePrivateKey({ + chain: 'celo', + privateKey: + 'da857cbda0ba96757fed842617a40693d06d00001e55aa972955039ae747bac4', // noqa: mock + }) + ).toEqual([]); + }); + it('valid when req.privateKey is a avalanche key', () => { expect( validatePrivateKey({ From 8fbcb2ecbc4f017200074662d903ecd6ad367731 Mon Sep 17 00:00:00 2001 From: elijahsnoz Date: Thu, 27 Jun 2024 23:16:34 +0100 Subject: [PATCH 16/16] (fix) duplicate token --- src/templates/lists/celo_token.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/templates/lists/celo_token.json b/src/templates/lists/celo_token.json index 1d9f049af1..b907770f67 100644 --- a/src/templates/lists/celo_token.json +++ b/src/templates/lists/celo_token.json @@ -169,14 +169,6 @@ "chainId": 42220, "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_SUSHI.png" }, - { - "name": "Optics v2 WETH", - "address": "0x122013fd7dF1C6F636a5bb8f03108E876548b455", - "symbol": "WETH", - "decimals": 18, - "chainId": 42220, - "logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WETH.png" - }, { "name": "Optics v2 USDT", "address": "0x88eeC49252c8cbc039DCdB394c0c2BA2f1637EA0",