Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/final version #104

Merged
merged 16 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shy-waves-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ptokens-dapp-v2': major
---

v2 EOL: only pegout can be used.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 4 additions & 5 deletions __mocks__/@p.network/react-web3-settings.js
Original file line number Diff line number Diff line change
@@ -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/',
})
13 changes: 1 addition & 12 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,7 @@ const App = ({ loading, setTheme, loadSwapData, loadSwapOldPntData, loadMigratio
<Route render={() => <Redirect to="swap" />} />
</Switch>
</MainWrapper>
<Popup
content={
<React.Fragment>
Now the dApp supports host-to-host swaps!
<br />
Have a try{' '}
<a href="https://dapp.ptokens.io/swap?asset=btc&from=algorand&to=eth&algorand_from_assetid=744665252">
here.
</a>
</React.Fragment>
}
/>
<Popup content={<React.Fragment>Use the settings button to use custom RPC endpoints</React.Fragment>} />
<SocialLinks />
<Version />
</React.Fragment>
Expand Down
14 changes: 9 additions & 5 deletions src/components/molecules/popup/Warning.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const WarningIcon = styled(Icon)`
height: 20px;
width: 20px;
margin: 5px;
vertical-align: top;
vertical-align: mid;
color: #475965;
`

Expand All @@ -32,15 +32,19 @@ const WarningPopup = ({ show, onClose }) => {
return (
<Row>
<OuterContainerSwap className="mx-auto">
<StyledAlert show={show} onClose={onClose} variant="warning" dismissible>
<StyledAlert show={show} onClose={onClose} variant="warning">
<Paragraph>
<WarningIcon icon="warning" />
PNETWORK V2 HAS REACHED END OF LIFE
<WarningIcon icon="warning" />
<br />
If you want to redeem pTokens proceed at your own risk.
<br />
pNetwork is a new technology, and security audits don't
Please be aware that the pegout tx burns the amount
<br />
eliminate risks completely. Please don't provide assets you
of pTokens selected. Please be patient as completion times
<br />
can't afford to lose.
for redeems are uncertain and may take several days.
</Paragraph>
</StyledAlert>
</OuterContainerSwap>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 0 additions & 3 deletions src/components/molecules/socials/Socials.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export default function SocialLinks() {
<a href={settings.links.github} className="github social">
<img src="./assets/svg/github.svg" alt="" />
</a>
<a href={settings.links['p.network']} className="social pnetwork">
<img src="./assets/svg/PNT.svg" alt="" />
</a>
<a href={settings.links.telegram} className="telegram social">
<FaTelegram size={30} />
</a>
Expand Down
28 changes: 2 additions & 26 deletions src/components/organisms/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -208,18 +208,9 @@ const Header = (_props) => {
<StyledNavLink active={selectedPage === 'swap'} onClick={onSwap}>
Swap
</StyledNavLink>
<StyledNavLink active={selectedPage.includes('migration')} onClick={() => selectPage('migration')}>
Migration
</StyledNavLink>
<StyledNavLink active={selectedPage === 'nfts'} onClick={() => selectPage('nfts')}>
NFTs
</StyledNavLink>
<StyledNavLink active={selectedPage === 'risks'} onClick={() => selectPage('risks')}>
Risks
</StyledNavLink>
<StyledNavLink onClick={() => window.open(settings.links.stats, '_blank', 'noopener,noreferrer')}>
Stats <GoToIcon icon="arrow-diagonal" />
</StyledNavLink>
<StyledNavLink onClick={() => window.open(settings.links.audit, '_blank', 'noopener,noreferrer')}>
Audits <GoToIcon icon="arrow-diagonal" />
</StyledNavLink>
Expand All @@ -235,21 +226,6 @@ const Header = (_props) => {
Risks
</StyledNavLink>
<DropdownMobile title="More">
<NavDropdown.Item>
<StyledNavDown active={selectedPage.includes('migration')} onClick={() => selectPage('migration')}>
Migration
</StyledNavDown>
</NavDropdown.Item>
<NavDropdown.Item>
<StyledNavDown active={selectedPage === 'nfts'} onClick={() => selectPage('nfts')}>
NFTs
</StyledNavDown>
</NavDropdown.Item>
<NavDropdown.Item>
<StyledNavDown onClick={() => window.open(settings.links.stats, '_blank', 'noopener,noreferrer')}>
Stats <GoToIcon icon="arrow-diagonal" />
</StyledNavDown>
</NavDropdown.Item>
<NavDropdown.Item>
<StyledNavDown onClick={() => window.open(settings.links.audit, '_blank', 'noopener,noreferrer')}>
Audits <GoToIcon icon="arrow-diagonal" />
Expand Down
22 changes: 0 additions & 22 deletions src/components/pages/migrationHome/MigrationHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,6 @@ const MigrationHome = ({ apys, selectPage, loadMigrationData }) => {
<Tbody>
<Tr>
<Td>A</Td>
<Td>
<TdContent>
<ContainerImage>
<StyledImage src={'./assets/svg/pBTC_gray.svg'} />
</ContainerImage>
<Text>pBTC v1</Text>
</TdContent>
</Td>
<Td>
<TdContent>
<ContainerImage>
<StyledImage src={'./assets/svg/pBTC.svg'} />
</ContainerImage>
<Text>pBTC v2</Text>
</TdContent>
</Td>
<Td>
<ContinueButton onClick={() => onMigrate('pBTC-v1-to-v2')}>Migrate</ContinueButton>
</Td>
</Tr>
<Tr>
<Td>B</Td>
<Td>
{' '}
<TdContent>
Expand Down
Loading
Loading