Compare commits

...

6 Commits

Author SHA1 Message Date
Jordan Frankfurt
ae0bedf24b
fix: deep linking behavior for android (#7574)
fix: execute deep link code on both platforms
2023-11-13 16:19:36 -06:00
Kristie Huang
206c999835
fix: disable fees and uniswapx tests + skip localStorage reads for bl… (#7581)
fix: disable fees and uniswapx tests + skip localStorage reads for blocked addresses (#7564)

* fix: disable fees tests

* skip uniswapx tests for now

* turn off uniswapx for classic swap test

* skip local cache reads for blocked accounts

* fix: broken pools test (#7562)

* test: update hardhat blocknumber (#7559)

* init

* fix: remove console log

* fix: add comment

---------

Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
Co-authored-by: cartcrom <cartergcromer@gmail.com>
Co-authored-by: cartcrom <39385577+cartcrom@users.noreply.github.com>
2023-11-13 16:35:57 -05:00
Kristie Huang
3bd0b1c9be
fix: use NativeCurrency for polygon matic (#7579)
fix: use NativeCurrency for polygon matic (#7567)

* fix: use NativeCurrency for polygon matic

* add comment

* update snapshots??

* Revert "update snapshots??"

This reverts commit 280758be118610cc9e13afcd6e420985e8a200d2.
2023-11-13 16:29:46 -05:00
Kristie Huang
3cc7cecf6a
fix: update function tests for 404ing collections (#7576)
fix: update function tests for 404ing collections (#7575)

Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2023-11-13 15:59:40 -05:00
UL Service Account
9620365349 ci: add global CODEOWNERS 2023-11-10 01:07:24 +00:00
UL Service Account
8e4e8a90ab ci(t9n): download translations from crowdin 2023-11-10 01:07:24 +00:00
44 changed files with 126019 additions and 234 deletions

1
CODEOWNERS Normal file
View File

@ -0,0 +1 @@
* @uniswap/web-admins

View File

@ -1,6 +1,7 @@
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { InterfaceSectionName } from '@uniswap/analytics-events' import { InterfaceSectionName } from '@uniswap/analytics-events'
import { CurrencyAmount } from '@uniswap/sdk-core' import { CurrencyAmount } from '@uniswap/sdk-core'
import { FeatureFlag } from 'featureFlags'
import { DEFAULT_DEADLINE_FROM_NOW } from '../../../src/constants/misc' import { DEFAULT_DEADLINE_FROM_NOW } from '../../../src/constants/misc'
import { DAI, USDC_MAINNET } from '../../../src/constants/tokens' import { DAI, USDC_MAINNET } from '../../../src/constants/tokens'
@ -64,7 +65,9 @@ describe('Swap errors', () => {
}) })
it('slippage failure', () => { it('slippage failure', () => {
cy.visit(`/swap?inputCurrency=${USDC_MAINNET.address}&outputCurrency=${DAI.address}`) cy.visit(`/swap?inputCurrency=${USDC_MAINNET.address}&outputCurrency=${DAI.address}`, {
featureFlags: [{ name: FeatureFlag.uniswapXDefaultEnabled, value: false }],
})
cy.hardhat({ automine: false }).then(async (hardhat) => { cy.hardhat({ automine: false }).then(async (hardhat) => {
await hardhat.fund(hardhat.wallet, CurrencyAmount.fromRawAmount(USDC_MAINNET, 500e6)) await hardhat.fund(hardhat.wallet, CurrencyAmount.fromRawAmount(USDC_MAINNET, 500e6))
await hardhat.mine() await hardhat.mine()
@ -87,6 +90,7 @@ describe('Swap errors', () => {
cy.get(getTestSelector('open-settings-dialog-button')).click() cy.get(getTestSelector('open-settings-dialog-button')).click()
cy.get(getTestSelector('max-slippage-settings')).click() cy.get(getTestSelector('max-slippage-settings')).click()
cy.get(getTestSelector('slippage-input')).clear().type('0.01') cy.get(getTestSelector('slippage-input')).clear().type('0.01')
cy.get(getTestSelector('toggle-uniswap-x-button')).click() // turn off uniswapx
cy.get('body').click('topRight') // close modal cy.get('body').click('topRight') // close modal
cy.get(getTestSelector('slippage-input')).should('not.exist') cy.get(getTestSelector('slippage-input')).should('not.exist')

View File

@ -4,7 +4,7 @@ import { FeatureFlag } from 'featureFlags'
import { USDC_MAINNET } from '../../../src/constants/tokens' import { USDC_MAINNET } from '../../../src/constants/tokens'
import { getBalance, getTestSelector } from '../../utils' import { getBalance, getTestSelector } from '../../utils'
describe('Swap with fees', () => { describe.skip('Swap with fees', () => {
describe('Classic swaps', () => { describe('Classic swaps', () => {
beforeEach(() => { beforeEach(() => {
cy.visit('/swap', { featureFlags: [{ name: FeatureFlag.feesEnabled, value: true }] }) cy.visit('/swap', { featureFlags: [{ name: FeatureFlag.feesEnabled, value: true }] })

View File

@ -42,7 +42,8 @@ function stubSwapTxReceipt() {
}) })
} }
describe('UniswapX Toggle', () => { // TODO: FIX THESE TESTS where we should NOT stub for pricing requests
describe.skip('UniswapX Toggle', () => {
beforeEach(() => { beforeEach(() => {
stubNonPriceQuoteWith(QuoteWhereUniswapXIsBetter) stubNonPriceQuoteWith(QuoteWhereUniswapXIsBetter)
cy.visit(`/swap/?inputCurrency=${USDC_MAINNET.address}&outputCurrency=${DAI.address}`, { cy.visit(`/swap/?inputCurrency=${USDC_MAINNET.address}&outputCurrency=${DAI.address}`, {
@ -90,7 +91,7 @@ describe('UniswapX Toggle', () => {
}) })
}) })
describe('UniswapX Orders', () => { describe.skip('UniswapX Orders', () => {
beforeEach(() => { beforeEach(() => {
stubNonPriceQuoteWith(QuoteWhereUniswapXIsBetter) stubNonPriceQuoteWith(QuoteWhereUniswapXIsBetter)
cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' }) cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' })
@ -183,7 +184,7 @@ describe('UniswapX Orders', () => {
}) })
}) })
describe('UniswapX Eth Input', () => { describe.skip('UniswapX Eth Input', () => {
beforeEach(() => { beforeEach(() => {
stubNonPriceQuoteWith(QuoteWithEthInput) stubNonPriceQuoteWith(QuoteWithEthInput)
cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' }) cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' })
@ -277,7 +278,7 @@ describe('UniswapX Eth Input', () => {
}) })
}) })
describe('UniswapX activity history', () => { describe.skip('UniswapX activity history', () => {
beforeEach(() => { beforeEach(() => {
cy.intercept(QuoteEndpoint, { fixture: QuoteWhereUniswapXIsBetter }) cy.intercept(QuoteEndpoint, { fixture: QuoteWhereUniswapXIsBetter })
cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' }) cy.intercept(OrderSubmissionEndpoint, { fixture: 'uniswapx/orderResponse.json' })

View File

@ -7,19 +7,19 @@ const collectionImageUrls = [
'http://127.0.0.1:3000/api/image/nfts/collection/0x49cf6f5d44e70224e2e23fdcdd2c053f30ada28b', 'http://127.0.0.1:3000/api/image/nfts/collection/0x49cf6f5d44e70224e2e23fdcdd2c053f30ada28b',
] ]
const nonexistentImageUrls = [ test.each([...collectionImageUrls])('collectionImageUrl', async (url) => {
'http://127.0.0.1:3000/api/image/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545',
]
test.each([...collectionImageUrls, ...nonexistentImageUrls])('collectionImageUrl', async (url) => {
const response = await fetch(new Request(url)) const response = await fetch(new Request(url))
expect(response.status).toBe(200) expect(response.status).toBe(200)
expect(response.headers.get('content-type')).toBe('image/png') expect(response.headers.get('content-type')).toBe('image/png')
}) })
const nonexistentImageUrls = [
'http://127.0.0.1:3000/api/image/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545',
]
const invalidCollectionImageUrls = ['http://127.0.0.1:3000/api/image/nfts/collection/0xd3adb33f'] const invalidCollectionImageUrls = ['http://127.0.0.1:3000/api/image/nfts/collection/0xd3adb33f']
test.each(invalidCollectionImageUrls)('invalidAssetImageUrl', async (url) => { test.each([...invalidCollectionImageUrls, ...nonexistentImageUrls])('invalidAssetImageUrl', async (url) => {
const response = await fetch(new Request(url)) const response = await fetch(new Request(url))
expect(response.status).toBeOneOf([404, 500]) expect(response.status).toBeOneOf([404, 500])
}) })

View File

@ -443,151 +443,3 @@ exports[`should inject metadata for collections 3`] = `
</html> </html>
" "
`; `;
exports[`should inject metadata for collections 4`] = `
"<!DOCTYPE html>
<html translate="no">
<head>
<meta charset="utf-8" />
<title>Uniswap Interface</title>
<!--
will be replaced with the URL of the \`public\` folder during build.
Only files inside the \`public\` folder can be referenced from the HTML.
-->
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" sizes="192x192" href="/images/192x192_App_Icon.png" />
<link rel="apple-touch-icon" sizes="512x512" href="/images/512x512_App_Icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#fff" />
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline'"
/>
<!--
Apple Smart App Banner for Safari on iOS
https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
-->
<meta name="apple-itunes-app" content="app-id=6443944476">
<!--
manifest.json provides metadata used when the app is installed as a PWA.
See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />
<link rel="preconnect" href="https://api.uniswap.org/" crossorigin/>
<link rel="preconnect" href="https://mainnet.infura.io/" crossorigin/>
<link rel="preload" href="/fonts/Basel-Book.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/fonts/Basel-Book.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/fonts/Basel-Medium.woff" as="font" type="font/woff" crossorigin />
<link rel="preload" href="/fonts/Basel-Medium.woff2" as="font" type="font/woff2" crossorigin />
<style>
* {
font-family: 'Basel', sans-serif;
box-sizing: border-box;
}
/**
Explicitly load Basel var from public/ so it does not block LCP's critical path.
*/
@font-face {
font-family: 'Basel';
font-weight: 535;
font-style: normal;
font-display: block;
src:
url('/fonts/Basel-Medium.woff2') format('woff2'),
url('/fonts/Basel-Medium.woff') format('woff');
}
@font-face {
font-family: 'Basel';
font-weight: 485;
font-style: normal;
font-display: block;
src:
url('/fonts/Basel-Book.woff') format('woff2'),
url('/fonts/Basel-Book.woff') format('woff');
}
@supports (font-variation-settings: normal) {
* {
font-family: 'Basel', sans-serif;
}
}
html,
body {
margin: 0;
padding: 0;
}
button {
user-select: none;
}
html {
font-size: 16px;
font-weight: 485;
font-variant: none;
font-smooth: always;
text-rendering: optimizeLegibility !important;
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Use this to apply network-specific gradient backgrounds, in RadialGradientByChainUpdater.ts */
#background-radial-gradient {
position: fixed;
top: 0;
left: 0;
right: 0;
pointer-events: none;
width: 200vw;
height: 200vh;
transform: translate(-50vw, -100vh);
z-index: -1;
}
html,
body,
#root {
min-height: 100%;
}
@media (prefers-color-scheme: dark) {
html {
background: linear-gradient(rgb(19, 19, 19) 0%, rgb(19, 19, 19) 100%);
}
}
@media (prefers-color-scheme: light) {
html {
background: radial-gradient(100% 100% at 50% 0%, rgba(255, 184, 226, 0) 0%, rgba(255, 255, 255, 0) 100%), rgb(255, 255, 255);
}
}
</style>
<script defer src="/static/js/bundle.js"></script><meta property="og:title" content="0xed5af388653567af2f388e6224dc7c4b3241c545 on Uniswap"/><meta property="og:image" content="http://127.0.0.1:3000/api/image/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:image:alt" content="0xed5af388653567af2f388e6224dc7c4b3241c545 on Uniswap"/><meta property="og:type" content="website"/><meta property="og:url" content="http://127.0.0.1:3000/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545"/><meta property="twitter:card" content="summary_large_image"/><meta property="twitter:title" content="0xed5af388653567af2f388e6224dc7c4b3241c545 on Uniswap"/><meta property="twitter:image" content="http://127.0.0.1:3000/api/image/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545"/><meta property="twitter:image:alt" content="0xed5af388653567af2f388e6224dc7c4b3241c545 on Uniswap"/></head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
<!-- Triggers the font to load immediately and then is replaced by the app -->
<div>&emsp;</div>
</div>
<div id="background-radial-gradient"></div>
</body>
</html>
"
`;

View File

@ -16,15 +16,7 @@ const collections = [
}, },
] ]
const nonexistentCollections = [ test.each([...collections])('should inject metadata for collections', async (collection) => {
{
address: '0xed5af388653567af2f388e6224dc7c4b3241c545',
collectionName: '0xed5af388653567af2f388e6224dc7c4b3241c545',
image: 'http://127.0.0.1:3000/api/image/nfts/collection/0xed5af388653567af2f388e6224dc7c4b3241c545',
},
]
test.each([...collections, ...nonexistentCollections])('should inject metadata for collections', async (collection) => {
const url = 'http://127.0.0.1:3000/nfts/collection/' + collection.address const url = 'http://127.0.0.1:3000/nfts/collection/' + collection.address
const body = await fetch(new Request(url)).then((res) => res.text()) const body = await fetch(new Request(url)).then((res) => res.text())
expect(body).toMatchSnapshot() expect(body).toMatchSnapshot()
@ -42,24 +34,33 @@ test.each([...collections, ...nonexistentCollections])('should inject metadata f
expect(body).toContain(`<meta property="twitter:image:alt" content="${collection.collectionName} on Uniswap"/>`) expect(body).toContain(`<meta property="twitter:image:alt" content="${collection.collectionName} on Uniswap"/>`)
}) })
const nonexistentCollections = [
{
address: '0xed5af388653567af2f388e6224dc7c4b3241c545',
},
]
const invalidCollections = [ const invalidCollections = [
{ {
address: '0xd3adb33f', address: '0xd3adb33f',
}, },
] ]
test.each(invalidCollections)('should not inject metadata for nonexistent collections', async (collection) => { test.each([...invalidCollections, ...nonexistentCollections])(
const url = 'http://127.0.0.1:3000/nfts/collection/' + collection.address 'should not inject metadata for nonexistent collections',
const body = await fetch(new Request(url)).then((res) => res.text()) async (collection) => {
expect(body).not.toContain('og:title') const url = 'http://127.0.0.1:3000/nfts/collection/' + collection.address
expect(body).not.toContain('og:image') const body = await fetch(new Request(url)).then((res) => res.text())
expect(body).not.toContain('og:image:width') expect(body).not.toContain('og:title')
expect(body).not.toContain('og:image:height') expect(body).not.toContain('og:image')
expect(body).not.toContain('og:type') expect(body).not.toContain('og:image:width')
expect(body).not.toContain('og:url') expect(body).not.toContain('og:image:height')
expect(body).not.toContain('og:image:alt') expect(body).not.toContain('og:type')
expect(body).not.toContain('twitter:card') expect(body).not.toContain('og:url')
expect(body).not.toContain('twitter:title') expect(body).not.toContain('og:image:alt')
expect(body).not.toContain('twitter:image') expect(body).not.toContain('twitter:card')
expect(body).not.toContain('twitter:image:alt') expect(body).not.toContain('twitter:title')
}) expect(body).not.toContain('twitter:image')
expect(body).not.toContain('twitter:image:alt')
}
)

View File

@ -3,7 +3,7 @@ import { URI_AVAILABLE, WalletConnect, WalletConnectConstructorArgs } from '@web
import { sendAnalyticsEvent } from 'analytics' import { sendAnalyticsEvent } from 'analytics'
import { L1_CHAIN_IDS, L2_CHAIN_IDS } from 'constants/chains' import { L1_CHAIN_IDS, L2_CHAIN_IDS } from 'constants/chains'
import { Z_INDEX } from 'theme/zIndex' import { Z_INDEX } from 'theme/zIndex'
import { isIOS } from 'utils/userAgent' import { isAndroid, isIOS } from 'utils/userAgent'
import { RPC_URLS } from '../constants/networks' import { RPC_URLS } from '../constants/networks'
@ -83,7 +83,7 @@ export class UniwalletConnect extends WalletConnectV2 {
this.events.emit(UniwalletConnect.UNI_URI_AVAILABLE, `https://uniswap.org/app/wc?uri=${uri}`) this.events.emit(UniwalletConnect.UNI_URI_AVAILABLE, `https://uniswap.org/app/wc?uri=${uri}`)
// Opens deeplink to Uniswap Wallet if on iOS // Opens deeplink to Uniswap Wallet if on iOS
if (isIOS) { if (isIOS || isAndroid) {
// Using window.location.href to open the deep link ensures smooth navigation and leverages OS handling for installed apps, // Using window.location.href to open the deep link ensures smooth navigation and leverages OS handling for installed apps,
// avoiding potential popup blockers or inconsistent behavior associated with window.open // avoiding potential popup blockers or inconsistent behavior associated with window.open
window.location.href = `uniswap://wc?uri=${encodeURIComponent(uri)}` window.location.href = `uniswap://wc?uri=${encodeURIComponent(uri)}`

View File

@ -90,7 +90,13 @@ export const MATIC_MAINNET = new Token(
'MATIC', 'MATIC',
'Polygon Matic' 'Polygon Matic'
) )
const MATIC_POLYGON = new Token(ChainId.POLYGON, '0x0000000000000000000000000000000000001010', 18, 'MATIC', 'Matic') export const MATIC_POLYGON = new Token(
ChainId.POLYGON,
'0x0000000000000000000000000000000000001010',
18,
'MATIC',
'Matic'
)
export const DAI_POLYGON = new Token( export const DAI_POLYGON = new Token(
ChainId.POLYGON, ChainId.POLYGON,
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063', '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
@ -143,13 +149,6 @@ export const WBTC_OPTIMISM = new Token(
'WBTC', 'WBTC',
'Wrapped BTC' 'Wrapped BTC'
) )
const MATIC_POLYGON_MUMBAI = new Token(
ChainId.POLYGON_MUMBAI,
'0x0000000000000000000000000000000000001010',
18,
'MATIC',
'Matic'
)
export const WETH_POLYGON_MUMBAI = new Token( export const WETH_POLYGON_MUMBAI = new Token(
ChainId.POLYGON_MUMBAI, ChainId.POLYGON_MUMBAI,
'0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa', '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa',
@ -359,14 +358,21 @@ export function isPolygon(chainId: number): chainId is ChainId.POLYGON | ChainId
return chainId === ChainId.POLYGON_MUMBAI || chainId === ChainId.POLYGON return chainId === ChainId.POLYGON_MUMBAI || chainId === ChainId.POLYGON
} }
function getPolygonNativeCurrency(chainId: number) { class PolygonNativeCurrency extends NativeCurrency {
switch (chainId) { equals(other: Currency): boolean {
case ChainId.POLYGON: return other.isNative && other.chainId === this.chainId
return MATIC_POLYGON }
case ChainId.POLYGON_MUMBAI:
return MATIC_POLYGON_MUMBAI get wrapped(): Token {
default: if (!isPolygon(this.chainId)) throw new Error('Not Polygon')
throw new Error('Not polygon') const wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId]
invariant(wrapped instanceof Token)
return wrapped
}
public constructor(chainId: number) {
if (!isPolygon(chainId)) throw new Error('Not Polygon')
super(chainId, 18, 'MATIC', 'Matic')
} }
} }
@ -433,7 +439,7 @@ export function nativeOnChain(chainId: number): NativeCurrency | Token {
if (cachedNativeCurrency[chainId]) return cachedNativeCurrency[chainId] if (cachedNativeCurrency[chainId]) return cachedNativeCurrency[chainId]
let nativeCurrency: NativeCurrency | Token let nativeCurrency: NativeCurrency | Token
if (isPolygon(chainId)) { if (isPolygon(chainId)) {
nativeCurrency = getPolygonNativeCurrency(chainId) nativeCurrency = new PolygonNativeCurrency(chainId)
} else if (isCelo(chainId)) { } else if (isCelo(chainId)) {
nativeCurrency = getCeloNativeCurrency(chainId) nativeCurrency = getCeloNativeCurrency(chainId)
} else if (isBsc(chainId)) { } else if (isBsc(chainId)) {

View File

@ -1,4 +1,3 @@
import ms from 'ms'
import { useEffect } from 'react' import { useEffect } from 'react'
import { ApplicationModal, setOpenModal } from 'state/application/reducer' import { ApplicationModal, setOpenModal } from 'state/application/reducer'
import { useAppDispatch } from 'state/hooks' import { useAppDispatch } from 'state/hooks'
@ -7,34 +6,23 @@ export default function useAccountRiskCheck(account: string | null | undefined)
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
useEffect(() => { useEffect(() => {
if (account) { if (!account) return
const riskCheckLocalStorageKey = `risk-check-${account}`
const now = Date.now() // TODO: add back local browser cacheing (revisit 11/13/2023)
try { const headers = new Headers({ 'Content-Type': 'application/json' })
// Check local browser cache fetch('https://api.uniswap.org/v1/screen', {
const storedTime = localStorage.getItem(riskCheckLocalStorageKey) method: 'POST',
const checkExpirationTime = storedTime ? parseInt(storedTime) : now - 1 headers,
if (checkExpirationTime < Date.now()) { body: JSON.stringify({ address: account }),
const headers = new Headers({ 'Content-Type': 'application/json' }) })
fetch('https://api.uniswap.org/v1/screen', { .then((res) => res.json())
method: 'POST', .then((data) => {
headers, if (data.block) {
body: JSON.stringify({ address: account }), dispatch(setOpenModal(ApplicationModal.BLOCKED_ACCOUNT))
})
.then((res) => res.json())
.then((data) => {
if (data.block) {
dispatch(setOpenModal(ApplicationModal.BLOCKED_ACCOUNT))
}
})
.catch(() => {
dispatch(setOpenModal(null))
})
} }
} finally { })
// Set item to have 1 day local cache storage .catch(() => {
localStorage.setItem(riskCheckLocalStorageKey, (now + ms(`1d`)).toString()) dispatch(setOpenModal(null))
} })
}
}, [account, dispatch]) }, [account, dispatch])
} }

3816
src/locales/af-ZA.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ar-SA.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ca-ES.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/cs-CZ.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/da-DK.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/de-DE.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/el-GR.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/es-ES.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/fi-FI.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/fr-FR.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/he-IL.po Normal file

File diff suppressed because it is too large Load Diff

3817
src/locales/hu-HU.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/id-ID.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/it-IT.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ja-JP.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ko-KR.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/nl-NL.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/no-NO.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/pl-PL.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/pt-BR.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/pt-PT.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ro-RO.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/ru-RU.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/sl-SI.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/sr-SP.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/sv-SE.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/sw-TZ.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/th-TH.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/tr-TR.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/uk-UA.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/vi-VN.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/zh-CN.po Normal file

File diff suppressed because it is too large Load Diff

3816
src/locales/zh-TW.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
import { nativeOnChain } from 'constants/tokens' import { MATIC_POLYGON, nativeOnChain } from 'constants/tokens'
import { Chain } from 'graphql/data/__generated__/types-and-hooks' import { Chain } from 'graphql/data/__generated__/types-and-hooks'
import { supportedChainIdFromGQLChain } from 'graphql/data/util' import { supportedChainIdFromGQLChain } from 'graphql/data/util'
@ -10,8 +10,11 @@ export function getNativeTokenDBAddress(chain: Chain): string | undefined {
switch (chain) { switch (chain) {
// Celo & Polygon have precompiles for their native tokens // Celo & Polygon have precompiles for their native tokens
case Chain.Celo: case Chain.Celo:
case Chain.Polygon:
return nativeOnChain(pageChainId).wrapped.address return nativeOnChain(pageChainId).wrapped.address
case Chain.Polygon:
// Like Celo, native MATIC does have a ERC20 precompile, but we use WMATIC in routing/pools
// So instead of returning nativeOnChain().wrapped.address, should directly use the precompile address here
return MATIC_POLYGON.address
case Chain.Ethereum: case Chain.Ethereum:
case Chain.Arbitrum: case Chain.Arbitrum:
case Chain.EthereumGoerli: case Chain.EthereumGoerli: