From f73e80a27c71de54cc5c0638d7384b27283ed923 Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo <seabastian.scatularo@xlabs.xyz> Date: Mon, 21 Oct 2024 13:05:11 -0300 Subject: [PATCH] remove aurora support from Advanced tools --- src/components/NFTOriginVerifier.tsx | 12 ---- src/components/ShowTx.tsx | 5 -- src/components/SmartAddress.tsx | 5 -- src/components/Stats/CustodyAddresses.tsx | 7 --- src/components/TransactionProgress.tsx | 2 - src/components/Transfer/Redeem.tsx | 7 --- src/config/transferRules.ts | 13 ---- src/hooks/useGetSourceParsedTokenAccounts.ts | 60 ------------------ src/utils/coinGecko.ts | 2 - src/utils/consts.ts | 65 +------------------- src/utils/metaMaskChainParameters.ts | 14 ----- 11 files changed, 1 insertion(+), 191 deletions(-) diff --git a/src/components/NFTOriginVerifier.tsx b/src/components/NFTOriginVerifier.tsx index 5f99e5214..9bb923cdd 100644 --- a/src/components/NFTOriginVerifier.tsx +++ b/src/components/NFTOriginVerifier.tsx @@ -1,6 +1,5 @@ import { ChainId, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_ETH, @@ -438,17 +437,6 @@ export default function NFTOriginVerifier() { > View on Snowtrace </Button> - ) : originInfo.chainId === CHAIN_ID_AURORA ? ( - <Button - href={`https://aurorascan.dev/token/${readableAddress}?a=${originInfo.tokenId}`} - target="_blank" - rel="noopener noreferrer" - startIcon={<Launch />} - className={classes.viewButton} - variant="outlined" - > - View on Explorer - </Button> ) : originInfo.chainId === CHAIN_ID_FANTOM ? ( <Button href={`https://ftmscan.com/token/${readableAddress}?a=${originInfo.tokenId}`} diff --git a/src/components/ShowTx.tsx b/src/components/ShowTx.tsx index f6eb078de..e7f35b881 100644 --- a/src/components/ShowTx.tsx +++ b/src/components/ShowTx.tsx @@ -1,7 +1,6 @@ import { ChainId, CHAIN_ID_ALGORAND, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_CELO, @@ -94,10 +93,6 @@ export default function ShowTx({ ? `https://${ CLUSTER === "testnet" ? "testnet." : "" }explorer.emerald.oasis.dev/tx/${tx?.id}` - : chainId === CHAIN_ID_AURORA - ? `https://${ - CLUSTER === "testnet" ? "testnet." : "" - }aurorascan.dev/tx/${tx?.id}` : chainId === CHAIN_ID_FANTOM ? `https://${ CLUSTER === "testnet" ? "testnet." : "" diff --git a/src/components/SmartAddress.tsx b/src/components/SmartAddress.tsx index 350502d38..e8eb66290 100644 --- a/src/components/SmartAddress.tsx +++ b/src/components/SmartAddress.tsx @@ -1,7 +1,6 @@ import { ChainId, CHAIN_ID_ALGORAND, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_CELO, @@ -141,10 +140,6 @@ export default function SmartAddress({ }explorer.emerald.oasis.dev/${ isAsset ? "token" : "address" }/${useableAddress}` - : chainId === CHAIN_ID_AURORA - ? `https://${CLUSTER === "testnet" ? "testnet." : ""}aurorascan.dev/${ - isAsset ? "token" : "address" - }/${useableAddress}` : chainId === CHAIN_ID_FANTOM ? `https://${CLUSTER === "testnet" ? "testnet." : ""}ftmscan.com/${ isAsset ? "token" : "address" diff --git a/src/components/Stats/CustodyAddresses.tsx b/src/components/Stats/CustodyAddresses.tsx index d2454b8a6..93c2c5120 100644 --- a/src/components/Stats/CustodyAddresses.tsx +++ b/src/components/Stats/CustodyAddresses.tsx @@ -1,5 +1,4 @@ import { - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_ETH, @@ -100,12 +99,6 @@ const CustodyAddresses: React.FC<any> = () => { tokenAddress: getTokenBridgeAddressForChain(CHAIN_ID_FANTOM), nftAddress: getNFTBridgeAddressForChain(CHAIN_ID_FANTOM), }, - { - chainName: "Aurora", - chainId: CHAIN_ID_AURORA, - tokenAddress: getTokenBridgeAddressForChain(CHAIN_ID_AURORA), - nftAddress: getNFTBridgeAddressForChain(CHAIN_ID_AURORA), - }, { chainName: "Terra", chainId: CHAIN_ID_TERRA2, diff --git a/src/components/TransactionProgress.tsx b/src/components/TransactionProgress.tsx index 4557e9d84..0ef323724 100644 --- a/src/components/TransactionProgress.tsx +++ b/src/components/TransactionProgress.tsx @@ -2,7 +2,6 @@ import { ChainId, CHAIN_ID_ACALA, CHAIN_ID_ARBITRUM, - CHAIN_ID_AURORA, CHAIN_ID_CELO, CHAIN_ID_ETH, CHAIN_ID_FANTOM, @@ -114,7 +113,6 @@ export default function TransactionProgress({ ? 64 : 512 : chainId === CHAIN_ID_OASIS || - chainId === CHAIN_ID_AURORA || chainId === CHAIN_ID_FANTOM || chainId === CHAIN_ID_KARURA || chainId === CHAIN_ID_ACALA || diff --git a/src/components/Transfer/Redeem.tsx b/src/components/Transfer/Redeem.tsx index 633d3ec73..99d6739ae 100644 --- a/src/components/Transfer/Redeem.tsx +++ b/src/components/Transfer/Redeem.tsx @@ -1,7 +1,6 @@ import { CHAIN_ID_ACALA, CHAIN_ID_ARBITRUM, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_ETH, @@ -49,7 +48,6 @@ import { WAVAX_ADDRESS, WBNB_ADDRESS, WETH_ADDRESS, - WETH_AURORA_ADDRESS, WFTM_ADDRESS, WGLMR_ADDRESS, WKLAY_ADDRESS, @@ -182,10 +180,6 @@ function Redeem() { targetChain === CHAIN_ID_OASIS && targetAsset && targetAsset.toLowerCase() === WROSE_ADDRESS.toLowerCase(); - const isAuroraNative = - targetChain === CHAIN_ID_AURORA && - targetAsset && - targetAsset.toLowerCase() === WETH_AURORA_ADDRESS.toLowerCase(); const isFantomNative = targetChain === CHAIN_ID_FANTOM && targetAsset && @@ -216,7 +210,6 @@ function Redeem() { isPolygonNative || isAvaxNative || isOasisNative || - isAuroraNative || isFantomNative || isKlaytnNative || isNeonNative || diff --git a/src/config/transferRules.ts b/src/config/transferRules.ts index 5c0d38160..f02f021c3 100644 --- a/src/config/transferRules.ts +++ b/src/config/transferRules.ts @@ -1,8 +1,6 @@ import { CHAIN_ID_BSC, CHAIN_ID_ETH, - // CHAIN_ID_TERRA, - CHAIN_ID_AURORA, } from "@certusone/wormhole-sdk"; // import { terra } from "@certusone/wormhole-sdk"; import { Rule, PredicateArgs } from "../hooks/useWarningRulesEngine"; @@ -25,10 +23,6 @@ const isPandleFromBsc = ( const PANDLE_MESSAGE = "Pandle transfers are limited to Ethereum to BSC and BSC to Ethereum."; -const AuroraMessage = - "As a precautionary measure, Wormhole Network and Portal have paused Aurora support temporarily."; -/*const TERRA_CLASSIC_MESSAGE = - "Transfers of native tokens to Terra Classic have been temporarily paused.";*/ const transferRules: Rule[] = [ { @@ -38,13 +32,6 @@ const transferRules: Rule[] = [ isPandleFromBsc(source, token?.toUpperCase()), text: PANDLE_MESSAGE, }, - { - id: "aurora", - predicate: ({ source, target }: PredicateArgs) => - source === CHAIN_ID_AURORA || target === CHAIN_ID_AURORA, - text: AuroraMessage, - disableTransfer: true, - }, ]; export default transferRules; diff --git a/src/hooks/useGetSourceParsedTokenAccounts.ts b/src/hooks/useGetSourceParsedTokenAccounts.ts index 9a5209cde..f9217b4c1 100644 --- a/src/hooks/useGetSourceParsedTokenAccounts.ts +++ b/src/hooks/useGetSourceParsedTokenAccounts.ts @@ -3,7 +3,6 @@ import { CHAIN_ID_ACALA, CHAIN_ID_ALGORAND, CHAIN_ID_APTOS, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BSC, CHAIN_ID_CELO, @@ -53,7 +52,6 @@ import { useNearContext } from "../contexts/NearWalletContext"; import { useSolanaWallet } from "../contexts/SolanaWalletContext"; import acalaIcon from "../icons/acala.svg"; import arbitrumIcon from "../icons/arbitrum.svg"; -import auroraIcon from "../icons/aurora.svg"; import avaxIcon from "../icons/avax.svg"; import baseIcon from "../icons/base.svg"; import bnbIcon from "../icons/bnb.svg"; @@ -118,8 +116,6 @@ import { WBNB_ADDRESS, WBNB_DECIMALS, WETH_ADDRESS, - WETH_AURORA_ADDRESS, - WETH_AURORA_DECIMALS, WETH_DECIMALS, WFTM_ADDRESS, WFTM_DECIMALS, @@ -411,29 +407,6 @@ const createNativeOasisParsedTokenAccount = ( }); }; -const createNativeAuroraParsedTokenAccount = ( - provider: Provider, - signerAddress: string | undefined -) => { - return !(provider && signerAddress) - ? Promise.reject() - : provider.getBalance(signerAddress).then((balanceInWei) => { - const balanceInEth = ethers.utils.formatEther(balanceInWei); - return createParsedTokenAccount( - signerAddress, //public key - WETH_AURORA_ADDRESS, //Mint key, On the other side this will be wavax, so this is hopefully a white lie. - balanceInWei.toString(), //amount, in wei - WETH_AURORA_DECIMALS, - parseFloat(balanceInEth), //This loses precision, but is a limitation of the current datamodel. This field is essentially deprecated - balanceInEth.toString(), //This is the actual display field, which has full precision. - "ETH", //A white lie for display purposes - "Aurora ETH", //A white lie for display purposes - auroraIcon, - true //isNativeAsset - ); - }); -}; - const createNativeFantomParsedTokenAccount = ( provider: Provider, signerAddress: string | undefined @@ -1551,39 +1524,6 @@ function useGetAvailableTokens(nft: boolean = false) { }; }, [lookupChain, provider, signerAddress, nft, ethNativeAccount]); - useEffect(() => { - let cancelled = false; - if ( - signerAddress && - lookupChain === CHAIN_ID_AURORA && - !ethNativeAccount && - !nft - ) { - setEthNativeAccountLoading(true); - createNativeAuroraParsedTokenAccount(provider, signerAddress).then( - (result) => { - console.log("create native account returned with value", result); - if (!cancelled) { - setEthNativeAccount(result); - setEthNativeAccountLoading(false); - setEthNativeAccountError(""); - } - }, - (error) => { - if (!cancelled) { - setEthNativeAccount(undefined); - setEthNativeAccountLoading(false); - setEthNativeAccountError("Unable to retrieve your Fantom balance."); - } - } - ); - } - - return () => { - cancelled = true; - }; - }, [lookupChain, provider, signerAddress, nft, ethNativeAccount]); - useEffect(() => { let cancelled = false; if ( diff --git a/src/utils/coinGecko.ts b/src/utils/coinGecko.ts index 4fa2b8a49..db2fec415 100644 --- a/src/utils/coinGecko.ts +++ b/src/utils/coinGecko.ts @@ -71,8 +71,6 @@ export const COIN_GECKO_IMAGE_URLS: CoinGeckoIdToImageUrl = { "https://assets.coingecko.com/coins/images/20077/small/200x200-agf.png?1636452467", augur: "https://assets.coingecko.com/coins/images/309/small/REP.png?1596339859", - "aurora-dao": - "https://assets.coingecko.com/coins/images/2565/small/logomark-purple-286x286.png?1638362736", aurory: "https://assets.coingecko.com/coins/images/19324/small/logo.png?1635076945", "avalanche-2": diff --git a/src/utils/consts.ts b/src/utils/consts.ts index fbd1cddab..8df853c8a 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -4,7 +4,6 @@ import { CHAIN_ID_ALGORAND, CHAIN_ID_APTOS, CHAIN_ID_ARBITRUM, - CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BASE, CHAIN_ID_BSC, @@ -54,7 +53,6 @@ import aptosIcon from "../icons/aptos.svg"; import acalaIcon from "../icons/acala.svg"; import algorandIcon from "../icons/algorand.svg"; import arbitrumIcon from "../icons/arbitrum.svg"; -import auroraIcon from "../icons/aurora.svg"; import avaxIcon from "../icons/avax.svg"; import baseIcon from "../icons/base.svg"; import bscIcon from "../icons/bsc.svg"; @@ -142,11 +140,6 @@ export const CHAINS: ChainInfo[] = name: "Arbitrum", logo: arbitrumIcon, }, - { - id: CHAIN_ID_AURORA, - name: "Aurora", - logo: auroraIcon, - }, { id: CHAIN_ID_AVAX, name: "Avalanche", @@ -290,11 +283,6 @@ export const CHAINS: ChainInfo[] = name: "Arbitrum", logo: arbitrumIcon, }, - { - id: CHAIN_ID_AURORA, - name: "Aurora", - logo: auroraIcon, - }, { id: CHAIN_ID_AVAX, name: "Avalanche", @@ -547,7 +535,6 @@ export const CHAINS_WITH_NFT_SUPPORT = CHAINS.filter( id === CHAIN_ID_POLYGON || id === CHAIN_ID_OASIS || id === CHAIN_ID_SOLANA || - id === CHAIN_ID_AURORA || id === CHAIN_ID_FANTOM || id === CHAIN_ID_KARURA || id === CHAIN_ID_ACALA || @@ -694,8 +681,6 @@ export const getDefaultNativeCurrencySymbol = (chainId: ChainId) => ? "ETH" : chainId === CHAIN_ID_ALGORAND ? "ALGO" - : chainId === CHAIN_ID_AURORA - ? "ETH" : chainId === CHAIN_ID_FANTOM ? "FTM" : chainId === CHAIN_ID_KARURA @@ -735,8 +720,6 @@ export const getDefaultNativeCurrencyAddressEvm = (chainId: ChainId) => { ? WAVAX_ADDRESS : chainId === CHAIN_ID_OASIS ? WROSE_ADDRESS - : chainId === CHAIN_ID_AURORA - ? WETH_AURORA_ADDRESS : chainId === CHAIN_ID_FANTOM ? WFTM_ADDRESS : chainId === CHAIN_ID_KARURA @@ -807,12 +790,6 @@ export const AVAX_NETWORK_CHAIN_ID = CLUSTER === "mainnet" ? 43114 : CLUSTER === "testnet" ? 43113 : 1381; export const OASIS_NETWORK_CHAIN_ID = CLUSTER === "mainnet" ? 42262 : CLUSTER === "testnet" ? 42261 : 1381; -export const AURORA_NETWORK_CHAIN_ID = - CLUSTER === "mainnet" - ? 1313161554 - : CLUSTER === "testnet" - ? 1313161555 - : 1381; export const FANTOM_NETWORK_CHAIN_ID = CLUSTER === "mainnet" ? 250 : CLUSTER === "testnet" ? 4002 : 1381; export const KARURA_NETWORK_CHAIN_ID = @@ -853,8 +830,6 @@ export const getEvmChainId = (chainId: ChainId) => ? AVAX_NETWORK_CHAIN_ID : chainId === CHAIN_ID_OASIS ? OASIS_NETWORK_CHAIN_ID - : chainId === CHAIN_ID_AURORA - ? AURORA_NETWORK_CHAIN_ID : chainId === CHAIN_ID_FANTOM ? FANTOM_NETWORK_CHAIN_ID : chainId === CHAIN_ID_KARURA @@ -1179,27 +1154,7 @@ export const OASIS_TOKEN_BRIDGE_ADDRESS = getAddress( ? "0x88d8004A9BdbfD9D28090A02010C19897a29605c" : "0x0290FB167208Af455bB137780163b7B7a9a10C16" ); -export const AURORA_BRIDGE_ADDRESS = getAddress( - CLUSTER === "mainnet" - ? "0xa321448d90d4e5b0A732867c18eA198e75CAC48E" - : CLUSTER === "testnet" - ? "0xBd07292de7b505a4E803CEe286184f7Acf908F5e" - : "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550" -); -export const AURORA_NFT_BRIDGE_ADDRESS = getAddress( - CLUSTER === "mainnet" - ? "0x6dcC0484472523ed9Cdc017F711Bcbf909789284" - : CLUSTER === "testnet" - ? "0x8F399607E9BA2405D87F5f3e1B78D950b44b2e24" - : "0x26b4afb60d6c903165150c6f0aa14f8016be4aec" -); -export const AURORA_TOKEN_BRIDGE_ADDRESS = getAddress( - CLUSTER === "mainnet" - ? "0x51b5123a7b0F9b2bA265f9c4C8de7D78D52f510F" - : CLUSTER === "testnet" - ? "0xD05eD3ad637b890D68a854d607eEAF11aF456fba" - : "0x0290FB167208Af455bB137780163b7B7a9a10C16" -); + export const FANTOM_BRIDGE_ADDRESS = getAddress( CLUSTER === "mainnet" ? "0x126783A6Cb203a3E35344528B26ca3a0489a1485" @@ -1588,12 +1543,6 @@ export const BLOCKSCOUT_GET_TOKENS_URL = ( : CLUSTER === "testnet" ? "https://testnet.explorer.emerald.oasis.dev" : "" - : chainId === CHAIN_ID_AURORA - ? CLUSTER === "mainnet" - ? "https://explorer.mainnet.aurora.dev" - : CLUSTER === "testnet" - ? "https://explorer.testnet.aurora.dev" - : "" : chainId === CHAIN_ID_ACALA ? CLUSTER === "mainnet" ? "https://blockscout.acala.network" @@ -1681,14 +1630,6 @@ export const WROSE_ADDRESS = : "0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"; export const WROSE_DECIMALS = 18; -export const WETH_AURORA_ADDRESS = - CLUSTER === "mainnet" - ? "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB" - : CLUSTER === "testnet" - ? "0x9D29f395524B3C817ed86e2987A14c1897aFF849" - : "0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"; -export const WETH_AURORA_DECIMALS = 18; - export const WFTM_ADDRESS = CLUSTER === "mainnet" ? "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83" @@ -1989,8 +1930,6 @@ export const VAA_EMITTER_ADDRESSES = [ `${CHAIN_ID_AVAX}:000000000000000000000000f7b6737ca9c4e08ae573f75a97b73d7a813f5de5`, //AVAX nft `${CHAIN_ID_OASIS}:0000000000000000000000005848c791e09901b40a9ef749f2a6735b418d7564`, //Oasis `${CHAIN_ID_OASIS}:00000000000000000000000004952D522Ff217f40B5Ef3cbF659EcA7b952a6c1`, //Oasis nft - `${CHAIN_ID_AURORA}:00000000000000000000000051b5123a7b0F9b2bA265f9c4C8de7D78D52f510F`, //Aurora - `${CHAIN_ID_AURORA}:0000000000000000000000006dcC0484472523ed9Cdc017F711Bcbf909789284`, //Aurora nft `${CHAIN_ID_FANTOM}:0000000000000000000000007C9Fc5741288cDFdD83CeB07f3ea7e22618D79D2`, //Fantom `${CHAIN_ID_FANTOM}:000000000000000000000000A9c7119aBDa80d4a4E0C06C8F4d8cF5893234535`, //Fantom nft `${CHAIN_ID_KARURA}:000000000000000000000000ae9d7fe007b3327AA64A32824Aaac52C42a6E624`, //Karura @@ -2095,7 +2034,6 @@ export const RELAYER_COMPARE_ASSET: RelayerCompareAsset = { [CHAIN_ID_AVAX]: "avalanche-2", [CHAIN_ID_OASIS]: "oasis-network", [CHAIN_ID_FANTOM]: "fantom", - [CHAIN_ID_AURORA]: "ethereum", // Aurora uses bridged ether [CHAIN_ID_KLAYTN]: "klay-token", [CHAIN_ID_CELO]: "celo", } as RelayerCompareAsset; @@ -2138,7 +2076,6 @@ export const COLOR_BY_CHAIN_ID: { [key in ChainId]?: string } = { [CHAIN_ID_POLYGON]: "#8247E5", [CHAIN_ID_AVAX]: "#E84142", [CHAIN_ID_OASIS]: "#0092F6", - [CHAIN_ID_AURORA]: "#23685A", [CHAIN_ID_FANTOM]: "#1969FF", [CHAIN_ID_KARURA]: "#FF4B3B", [CHAIN_ID_ACALA]: "#E00F51", diff --git a/src/utils/metaMaskChainParameters.ts b/src/utils/metaMaskChainParameters.ts index d6988afe8..4bfea1a17 100644 --- a/src/utils/metaMaskChainParameters.ts +++ b/src/utils/metaMaskChainParameters.ts @@ -206,20 +206,6 @@ export const METAMASK_CHAIN_PARAMETERS: { rpcUrls: ["https://proxy.devnet.neonlabs.org/solana"], blockExplorerUrls: ["https://neonscan.org/"], }, - 1313161554: { - chainId: "0x4e454152", - chainName: "Aurora Mainnet", - nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, - rpcUrls: ["https://mainnet.aurora.dev"], - blockExplorerUrls: ["https://aurorascan.dev"], - }, - 1313161555: { - chainId: "0x4e454153", - chainName: "Aurora Testnet", - nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, - rpcUrls: ["https://testnet.aurora.dev"], - blockExplorerUrls: ["https://testnet.aurorascan.dev"], - }, 1284: { chainId: "0x504", chainName: "Moonbeam",