diff --git a/.changeset/shy-waves-hunt.md b/.changeset/shy-waves-hunt.md new file mode 100644 index 00000000..ee8a5662 --- /dev/null +++ b/.changeset/shy-waves-hunt.md @@ -0,0 +1,5 @@ +--- +'ptokens-dapp-v2': major +--- + +v2 EOL: only pegout can be used. diff --git a/SECURITY.md b/SECURITY.md index 81b882d7..19ffa3a3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,7 +1,7 @@ # Security Policy Pnetwork declines any responibilites coming from the use of this repository. Use it use at your own risk. -Please check https://dapp.ptokens.io/#/risks to understand risks involved. +Please check https://dapp.p.network/#/risks to understand risks involved. ## Supported Versions diff --git a/__mocks__/@p.network/react-web3-settings.js b/__mocks__/@p.network/react-web3-settings.js index 616a271d..0a581fc5 100644 --- a/__mocks__/@p.network/react-web3-settings.js +++ b/__mocks__/@p.network/react-web3-settings.js @@ -1,16 +1,15 @@ export const getWeb3Settings = () => ({ eth: 'https://cloudflare-eth.com/', - eos: 'https://corsproxy.ptokens.io/v1/?apiurl=https://eos.greymass.com', + eos: 'https://eos.greymass.com', telos: 'https://telos.eosphere.io', - libre: 'https://libre-node-2.ptokens.io:8889', + libre: 'https://lb.libre.org', bsc: 'https://bsc-dataseed1.binance.org/', gnosis: 'https://rpc.gnosischain.com', polygon: 'https://polygon-rpc.com/', - ultra: 'https://corsproxy.ptokens.io/v1/?apiurl=https://api.ultra.eossweden.org', + ultra: 'https://api.ultra.eossweden.org', arbitrum: 'https://arb1.arbitrum.io/rpc', - luxochain: 'https://corsproxy.ptokens.io/v1/?apiurl=https://lugano.nodes.luxochain.io', + luxochain: 'https://lugano.nodes.luxochain.io', algorand: 'https://mainnet-api.algonode.cloud', ftm: 'https://rpc.ftm.tools/', - ore: 'https://ore-node-1.ptokens.io', btc: 'https://blockstream.info/api/', }) diff --git a/src/App.jsx b/src/App.jsx index 99ad82b9..203c6ea6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -135,18 +135,7 @@ const App = ({ loading, setTheme, loadSwapData, loadSwapOldPntData, loadMigratio } /> - - Now the dApp supports host-to-host swaps! -
- Have a try{' '} - - here. - - - } - /> + Use the settings button to use custom RPC endpoints} /> diff --git a/src/components/molecules/popup/Warning.jsx b/src/components/molecules/popup/Warning.jsx index a37548c5..c1df0a57 100644 --- a/src/components/molecules/popup/Warning.jsx +++ b/src/components/molecules/popup/Warning.jsx @@ -18,7 +18,7 @@ const WarningIcon = styled(Icon)` height: 20px; width: 20px; margin: 5px; - vertical-align: top; + vertical-align: mid; color: #475965; ` @@ -32,15 +32,19 @@ const WarningPopup = ({ show, onClose }) => { return ( - + + PNETWORK V2 HAS REACHED END OF LIFE + +
+ If you want to redeem pTokens proceed at your own risk.
- pNetwork is a new technology, and security audits don't + Please be aware that the pegout tx burns the amount
- eliminate risks completely. Please don't provide assets you + of pTokens selected. Please be patient as completion times
- can't afford to lose. + for redeems are uncertain and may take several days.
diff --git a/src/components/molecules/popup/__test__/RedirectBanner.test.jsx b/src/components/molecules/popup/__test__/RedirectBanner.test.jsx index 822f2563..a8575663 100644 --- a/src/components/molecules/popup/__test__/RedirectBanner.test.jsx +++ b/src/components/molecules/popup/__test__/RedirectBanner.test.jsx @@ -8,9 +8,9 @@ const expectedText = 'You are using an old domain that will be dismissed in the describe('RedirectBanner', async () => { test.each([ - ['http://ptokens.io'], - ['http://dapp.ptokens.io'], - ['https://dapp.ptokens.io/#/swap?asset=btc&from=btc&to=eth'], + ['http://p.network'], + ['http://dapp.p.network'], + ['https://dapp.p.network/#/swap?asset=btc&from=btc&to=eth'], ])('Should show the url popup only on specific url', async (url) => { Object.defineProperty(window, 'location', { value: { diff --git a/src/components/molecules/socials/Socials.jsx b/src/components/molecules/socials/Socials.jsx index 6c1342f0..2dc2470a 100644 --- a/src/components/molecules/socials/Socials.jsx +++ b/src/components/molecules/socials/Socials.jsx @@ -11,9 +11,6 @@ export default function SocialLinks() { - - - diff --git a/src/components/organisms/header/Header.jsx b/src/components/organisms/header/Header.jsx index 705cf6c6..68a9e721 100644 --- a/src/components/organisms/header/Header.jsx +++ b/src/components/organisms/header/Header.jsx @@ -191,8 +191,8 @@ const Header = (_props) => { const onSwap = useCallback(() => { loadSwapData({ asset: 'pbtc', - from: 'btc', - to: 'eth', + from: 'eth', + to: 'btc', }) selectPage('swap') }, [loadSwapData, selectPage]) @@ -208,18 +208,9 @@ const Header = (_props) => { Swap - selectPage('migration')}> - Migration - - selectPage('nfts')}> - NFTs - selectPage('risks')}> Risks - window.open(settings.links.stats, '_blank', 'noopener,noreferrer')}> - Stats - window.open(settings.links.audit, '_blank', 'noopener,noreferrer')}> Audits @@ -235,21 +226,6 @@ const Header = (_props) => { Risks - - selectPage('migration')}> - Migration - - - - selectPage('nfts')}> - NFTs - - - - window.open(settings.links.stats, '_blank', 'noopener,noreferrer')}> - Stats - - window.open(settings.links.audit, '_blank', 'noopener,noreferrer')}> Audits diff --git a/src/components/pages/migrationHome/MigrationHome.jsx b/src/components/pages/migrationHome/MigrationHome.jsx index 69e22d29..1f604a3b 100644 --- a/src/components/pages/migrationHome/MigrationHome.jsx +++ b/src/components/pages/migrationHome/MigrationHome.jsx @@ -111,28 +111,6 @@ const MigrationHome = ({ apys, selectPage, loadMigrationData }) => { A - - - - - - pBTC v1 - - - - - - - - pBTC v2 - - - - onMigrate('pBTC-v1-to-v2')}>Migrate - - - - B {' '} diff --git a/src/components/pages/swap/Swap.jsx b/src/components/pages/swap/Swap.jsx index 70516c3d..0ec8bd23 100644 --- a/src/components/pages/swap/Swap.jsx +++ b/src/components/pages/swap/Swap.jsx @@ -1,5 +1,4 @@ import BigNumber from 'bignumber.js' -import _ from 'lodash' import PropTypes from 'prop-types' import React, { useCallback, useEffect, useState } from 'react' import { Row, Col, Container } from 'react-bootstrap' @@ -7,20 +6,18 @@ import ReactTooltip from 'react-tooltip' import styled from 'styled-components' import TermsOfService from '../../../components/molecules/popup/TermsOfService' -import { MAX_IMPACT, PBTC_ON_ETH_MAINNET_V1_MIGRATION, PUOS_ON_ULTRA_MAINNET } from '../../../constants' +import { PBTC_ON_ETH_MAINNET_V1_MIGRATION } from '../../../constants' import { sendEvent } from '../../../ga4' import { useAssets } from '../../../hooks/use-assets' import { useSwap } from '../../../hooks/use-swap' -import defaultAssets, { dismissedAssets } from '../../../settings/swap-assets' +import defaultAssets, { dismissedChains, dismissedToken } from '../../../settings/swap-assets' import Button from '../../atoms/button/Button' import Icon from '../../atoms/icon/Icon' -import Switch from '../../atoms/switch/Switch' import AddressWarning from '../../molecules/popup/AddressWarning' import Progress from '../../molecules/progress/Progress' import AssetListModal from '../../organisms/assetListModal/AssetListModal' import DepositAddressModal from '../../organisms/depositAddressModal/DepositAddressModal' import InfoModal from '../../organisms/infoModal/InfoModal' -import SwapInfo from '../../organisms/swapInfo/SwapInfo' import SwapLine from '../../organisms/swapLine/SwapLine' export const OuterContainerSwap = styled.div` @@ -128,10 +125,6 @@ const WarningEta = styled.div` text-align: center; ` -const ProvisionalSafemoonBox = styled(InfoEta)`` - -const CurveInfo = styled(InfoEta)`` - const MigrationNotification = styled(InfoEta)` width: 460px; margin-bottom: 30px; @@ -150,23 +143,6 @@ const PnetworkV2Badge = styled.span` padding: 5px 10px 5px 10px; ` -const EnableTelosEvmRow = styled.div` - display: flex; - padding: 0px 6px 0px 6px; - align-items: center; -` - -const EnableTelosEvmText = styled.span` - padding-left: 0px; - text-align: left; - font-weight: 300; - color: ${({ theme }) => theme.text1}; - font-size: 14px; - @media (max-width: 767.98px) { - font-size: 12px; - } -` - const Link = styled.span` color: #007bff; text-decoration: none; @@ -371,186 +347,43 @@ const Swap = ({ onMax={onToMax} /> - {from && - (from.id === 'TLOS_ON_BSC_MAINNET' || from.id === 'TLOS_ON_ETH_MAINNET') && - to && - to.id === 'TLOS' ? ( - - - Receive on a tEVM (Telos EVM) compatible address - - - - - - ) : null} + {progress.show ? ( ) : null} - {(to && to.id === 'PBTC_ON_BSC_MAINNET') || (from && from.id === 'PBTC_ON_BSC_MAINNET') ? ( - - pBTC on BSC has been relaunched on pNetwork v2 in late 2022 (token address - 0x1003d3574ac79303a5fa0951ecb04cc7acba9747) and it is the only official pBTC representation on BSC. - - ) : null} - {to && to.id === 'UOS' ? ( - - By bridging to Ethereum you will get native ERC20 UOS tokens passing through the pUOS pToken - - ) : null} - {to && to.id === PUOS_ON_ULTRA_MAINNET ? ( - By bridging to Ultra you will get native UOS tokens passing through the pUOS pToken - ) : null} - {to && to.id === 'PBTC_ON_ALGORAND_MAINNET' ? ( - - Please make sure that the receiving Algorand account has opted in for pBTC (Asset ID: {to.address}). -
-
- pBTC on Algorand is still experimental and the security audit is ongoing - please proceed with - caution! -
- ) : null} - {from && - from.isNative && - to && - to.notifyDepositAddressWarning && - to.id !== 'PBTC_ON_ARBITRUM_MAINNET' && - to.id !== 'PBTC_ON_TELOS_MAINNET' && - to.id !== 'PBTC_ON_LIBRE_MAINNET' && - !(dismissedAssets.includes(from.id) || dismissedAssets.includes(to.id)) && ( - - Please refrain from using previously generated deposit addresses, as doing so may result in a loss - of funds. - - )} - {from && from.id === 'GALA_ON_BSC_MAINNET' && to && to.id === 'GALA' ? ( - - You are about to pegout (redeem){' '} - - pGALA on BSC - {' '} - for GALA ERC-20. You will receive both{' '} - - GALA v1 - {' '} - and{' '} - - GALA v2 - {' '} - tokens at the same time (Check the official{' '} - - GalaGames channels - {' '} - for more information on GALA v2). Make sure that the destination address you provide is under your - direct control (i.e. not a CEX deposit address). - - ) : null} - {from && to && !dismissedAssets.includes(from.id) && !dismissedAssets.includes(to.id) ? ( - from.isNative ? ( - - {`${from.name} on ${from.blockchain} has been dismissed. Please pegout ASAP if you have pTokens.`} - - ) : to.isNative ? ( - {`Proceed ASAP for a smooth redeem process.`} - ) : ( - - {`${from.name} on ${from.blockchain} and ${to.name} on ${to.blockchain} have been dismissed. - Please pegout to ${from.nativeSymbol} if you have pTokens ASAP.`} - - ) - ) : null} - {to && - (to.id === 'PUSDC_ON_ALGORAND_MAINNET' || - to.id === 'USDC_ON_ALGORAND_MAINNET' || - to.id === 'PUSDT_ON_ALGORAND_MAINNET' || - to.id === 'USDT_ON_ALGORAND_MAINNET') ? ( - - Please make sure that the receiving Algorand account has opted in for {to.name} (Asset ID:{' '} - {to.address}) {to.ptokenAddress ? `and p${to.name} (Asset ID: ${to.ptokenAddress})` : null}. - {to.swapperAddress && ( - <> -
-
- Please note that under certain circumstances (i.e. low liquidity in the stableswap pool), - especially for bigger swaps, you may receive p{to.name} rather than native {to.nativeSymbol}. - - )} -
- ) : null} - {to && to.swapperAddress && _.isNil(poolAmount) ? ( + + {from && to && !to.isNative ? ( - It is currently not possible to check the liquidity pool availability. It is possible the configured - Algorand endpoint is offline, please try with a different one. If the amount exceeds the pool - availability you will likely receive p{to.symbol} rather than native {to.nativeSymbol}. Proceed at - your own risk. + {`pNetwork v2 has been dismissed. Pegin are disabled.`} - ) : null} - {from && from.swapperAddress && _.isNil(poolAmount) ? ( + ) : from && to && (from.blockchain === 'TELOS' || to.blockchain === 'TELOS') ? ( - It is currently not possible to check the liquidity pool availability. It is possible the configured - Algorand endpoint is offline, please try with a different one. If the amount exceeds the pool - availability, the transaction will likely fail. + TELOS pTokens are handled directly by the Telos Foundation.  + + More info + - ) : null} - {to && to.swapperAddress && poolAmount < 1.2 * toAmount ? ( + ) : from && to && (from.blockchain === 'ULTRA' || to.blockchain === 'ULTRA') ? ( - Due to insufficient liquidity it may not be possible to process a swap of this size. Please try with a - smaller amount or try again later. If you decide to proceed anyway, you may receive p{to.symbol}{' '} - instead. - - ) : null} - {from && from.swapperAddress && poolAmount < fromAmount ? ( - - There is not enough liquidity in the stableswap pool to process this swap right now, please try again - later - - ) : null} - {eta === -1 || eta > 15 ? ( - - {eta > 15 && eta < 45 - ? 'Please note that this operation may take longer than usual to get processed as the bridge is experiencing some delays.' - : 'Please note that this operation may take longer than usual to get processed as the bridge is experiencing major delays.'} - - ) : null} - {from && to && (from.symbol.toUpperCase() === 'SAFEMOON' || to.symbol.toUpperCase() === 'SAFEMOON') ? ( - - Using this bridge requires a SFM transfer on BSC so a transfer fee may apply - - ) : null} - {from && from.requiresCurve ? ( - - This swap works using Curve.fi.

- - More info about Curve.fi + ULTRA pTokens are handled directly by the Ultra Team.  + + More info -

- - More info about the used liquidity pool + + ) : from && to && (dismissedToken.includes(to.symbol) || dismissedToken.includes(from.symbol)) ? ( + + EFFECT pTokens are handled directly by Effect AI.  + + More info -
- ) : null} - {from && from.requiresCurve && +curveImpact > MAX_IMPACT ? ( - High price impact! - ) : null} - {!onPnetworkV2 ? ( - This swap is not supported by pNetwork v2. Please write to hello@p.network. - ) : null} + + ) : + + pNetwork v2 has been dismissed. Pegout at your own risk. Please be patient as completion times for redeems are uncertain and may take several days. + Expected return amount is only indicative and actual fees cannot be predicted at swap time. + + } +