Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
140ff7a674 | ||
|
|
3fbc4e34f4 | ||
|
|
b964953daf | ||
|
|
649fd9c845 | ||
|
|
6347e63a15 | ||
|
|
bdcb9a8a0a | ||
|
|
8d90bb7a39 | ||
|
|
d70b456855 | ||
|
|
fbb797fa54 | ||
|
|
8ace518311 | ||
|
|
67c776c995 | ||
|
|
719754c46c | ||
|
|
9170af888e |
3
.env
3
.env
@@ -1,2 +1,3 @@
|
||||
REACT_APP_CHAIN_ID="1"
|
||||
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847"
|
||||
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847"
|
||||
REACT_APP_WALLETCONNECT_BRIDGE_URL="https://uniswap.bridge.walletconnect.org"
|
||||
8
.github/workflows/release.yaml
vendored
8
.github/workflows/release.yaml
vendored
@@ -54,6 +54,14 @@ jobs:
|
||||
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
|
||||
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}
|
||||
|
||||
- name: Pin to Crust
|
||||
uses: crustio/ipfs-crust-action@v1.0.8
|
||||
continue-on-error: true
|
||||
timeout-minutes: 2
|
||||
with:
|
||||
cid: ${{ steps.upload.outputs.hash }}
|
||||
seeds: ${{ secrets.CRUST_SEEDS }}
|
||||
|
||||
- name: Convert CIDv0 to CIDv1
|
||||
id: convert_cidv0
|
||||
uses: uniswap/convert-cidv0-cidv1@v1.0.0
|
||||
|
||||
@@ -56,7 +56,7 @@ The interface will not work on other networks.
|
||||
|
||||
## Contributions
|
||||
|
||||
**Please open all pull requests against the `master` branch.**
|
||||
**Please open all pull requests against the `main` branch.**
|
||||
CI checks will run against all PRs.
|
||||
|
||||
## Accessing Uniswap Interface V1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useContext, useRef, useState } from 'react'
|
||||
import { Settings, X } from 'react-feather'
|
||||
import ReactGA from 'react-ga'
|
||||
import { Text } from 'rebass'
|
||||
import styled, { ThemeContext } from 'styled-components'
|
||||
import { useOnClickOutside } from '../../hooks/useOnClickOutside'
|
||||
@@ -236,7 +237,13 @@ export default function SettingsTab() {
|
||||
<Toggle
|
||||
id="toggle-disable-multihop-button"
|
||||
isActive={singleHopOnly}
|
||||
toggle={() => (singleHopOnly ? setSingleHopOnly(false) : setSingleHopOnly(true))}
|
||||
toggle={() => {
|
||||
ReactGA.event({
|
||||
category: 'Routing',
|
||||
action: singleHopOnly ? 'disable single hop' : 'enable single hop'
|
||||
})
|
||||
setSingleHopOnly(!singleHopOnly)
|
||||
}}
|
||||
/>
|
||||
</RowBetween>
|
||||
</AutoColumn>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { Token } from '@uniswap/sdk'
|
||||
import React, { useCallback } from 'react'
|
||||
import React from 'react'
|
||||
import Modal from '../Modal'
|
||||
import { ImportToken } from 'components/SearchModal/ImportToken'
|
||||
|
||||
export default function TokenWarningModal({
|
||||
isOpen,
|
||||
tokens,
|
||||
onConfirm
|
||||
onConfirm,
|
||||
onDismiss
|
||||
}: {
|
||||
isOpen: boolean
|
||||
tokens: Token[]
|
||||
onConfirm: () => void
|
||||
onDismiss: () => void
|
||||
}) {
|
||||
const handleDismiss = useCallback(() => null, [])
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onDismiss={handleDismiss} maxHeight={90}>
|
||||
<Modal isOpen={isOpen} onDismiss={onDismiss} maxHeight={100}>
|
||||
<ImportToken tokens={tokens} handleCurrencySelect={onConfirm} />
|
||||
</Modal>
|
||||
)
|
||||
|
||||
@@ -105,7 +105,7 @@ export function AdvancedSwapDetails({ trade }: AdvancedSwapDetailsProps) {
|
||||
{!showRoute && (
|
||||
<AutoColumn style={{ padding: '12px 16px 0 16px' }}>
|
||||
<InfoLink
|
||||
href={'https://uniswap.info/pair/' + trade.route.pairs[0].liquidityToken.address}
|
||||
href={'https://info.uniswap.org/pair/' + trade.route.pairs[0].liquidityToken.address}
|
||||
target="_blank"
|
||||
>
|
||||
View pair analytics ↗
|
||||
|
||||
@@ -6,10 +6,12 @@ import { PortisConnector } from '@web3-react/portis-connector'
|
||||
|
||||
import { FortmaticConnector } from './Fortmatic'
|
||||
import { NetworkConnector } from './NetworkConnector'
|
||||
import UNISWAP_LOGO_URL from '../assets/svg/logo.svg'
|
||||
|
||||
const NETWORK_URL = process.env.REACT_APP_NETWORK_URL
|
||||
const FORMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY
|
||||
const PORTIS_ID = process.env.REACT_APP_PORTIS_ID
|
||||
const WALLETCONNECT_BRIDGE_URL = process.env.REACT_APP_WALLETCONNECT_BRIDGE_URL
|
||||
|
||||
export const NETWORK_CHAIN_ID: number = parseInt(process.env.REACT_APP_CHAIN_ID ?? '1')
|
||||
|
||||
@@ -33,7 +35,7 @@ export const injected = new InjectedConnector({
|
||||
// mainnet only
|
||||
export const walletconnect = new WalletConnectConnector({
|
||||
rpc: { 1: NETWORK_URL },
|
||||
bridge: 'https://bridge.walletconnect.org',
|
||||
bridge: WALLETCONNECT_BRIDGE_URL,
|
||||
qrcode: true,
|
||||
pollingInterval: 15000
|
||||
})
|
||||
@@ -54,6 +56,5 @@ export const portis = new PortisConnector({
|
||||
export const walletlink = new WalletLinkConnector({
|
||||
url: NETWORK_URL,
|
||||
appName: 'Uniswap',
|
||||
appLogoUrl:
|
||||
'https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg'
|
||||
appLogoUrl: UNISWAP_LOGO_URL
|
||||
})
|
||||
|
||||
@@ -14,12 +14,10 @@ type ChainTokenList = {
|
||||
readonly [chainId in ChainId]: Token[]
|
||||
}
|
||||
|
||||
export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth')
|
||||
export const DAI = new Token(ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin')
|
||||
export const USDC = new Token(ChainId.MAINNET, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 6, 'USDC', 'USD//C')
|
||||
export const USDT = new Token(ChainId.MAINNET, '0xdAC17F958D2ee523a2206206994597C13D831ec7', 6, 'USDT', 'Tether USD')
|
||||
export const COMP = new Token(ChainId.MAINNET, '0xc00e94Cb662C3520282E6f5717214004A7f26888', 18, 'COMP', 'Compound')
|
||||
export const MKR = new Token(ChainId.MAINNET, '0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2', 18, 'MKR', 'Maker')
|
||||
export const AMPL = new Token(ChainId.MAINNET, '0xD46bA6D942050d489DBd938a2C909A5d5039A161', 9, 'AMPL', 'Ampleforth')
|
||||
export const WBTC = new Token(ChainId.MAINNET, '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', 8, 'WBTC', 'Wrapped BTC')
|
||||
|
||||
// Block time here is slightly higher (~1s) than average in order to avoid ongoing proposals past the displayed time
|
||||
@@ -62,7 +60,7 @@ const WETH_ONLY: ChainTokenList = {
|
||||
// used to construct intermediary pairs for trading
|
||||
export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = {
|
||||
...WETH_ONLY,
|
||||
[ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC, USDT, COMP, MKR, WBTC]
|
||||
[ChainId.MAINNET]: [...WETH_ONLY[ChainId.MAINNET], DAI, USDC, USDT, WBTC]
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
"decimals": 6,
|
||||
"chainId": 1,
|
||||
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4922a015c4407F87432B179bb209e125432E4a2A/logo.png"
|
||||
},
|
||||
{
|
||||
"name": "Grump Cat",
|
||||
"address": "0x93B2FfF814FCaEFFB01406e80B4Ecd89Ca6A021b",
|
||||
"symbol": "GRUMPY",
|
||||
"decimals": 9,
|
||||
"chainId": 1,
|
||||
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4922a015c4407F87432B179bb209e125432E4a2A/logo.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -28,8 +28,14 @@ if (!!window.ethereum) {
|
||||
|
||||
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_GOOGLE_ANALYTICS_ID
|
||||
if (typeof GOOGLE_ANALYTICS_ID === 'string') {
|
||||
ReactGA.initialize(GOOGLE_ANALYTICS_ID)
|
||||
ReactGA.initialize(GOOGLE_ANALYTICS_ID, {
|
||||
gaOptions: {
|
||||
storage: 'none',
|
||||
storeGac: false
|
||||
}
|
||||
})
|
||||
ReactGA.set({
|
||||
anonymizeIp: true,
|
||||
customBrowserType: !isMobile ? 'desktop' : 'web3' in window || 'ethereum' in window ? 'mobileWeb3' : 'mobileRegular'
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -48,8 +48,9 @@ import Loader from '../../components/Loader'
|
||||
import { useIsTransactionUnsupported } from 'hooks/Trades'
|
||||
import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter'
|
||||
import { isTradeBetter } from 'utils/trades'
|
||||
import { RouteComponentProps } from 'react-router-dom'
|
||||
|
||||
export default function Swap() {
|
||||
export default function Swap({ history }: RouteComponentProps) {
|
||||
const loadedUrlParams = useDefaultsFromURLSearch()
|
||||
|
||||
// token warning stuff
|
||||
@@ -97,6 +98,7 @@ export default function Swap() {
|
||||
currencies,
|
||||
inputError: swapInputError
|
||||
} = useDerivedSwapInfo()
|
||||
|
||||
const { wrapType, execute: onWrap, inputError: wrapInputError } = useWrapCallback(
|
||||
currencies[Field.INPUT],
|
||||
currencies[Field.OUTPUT],
|
||||
@@ -142,6 +144,12 @@ export default function Swap() {
|
||||
[onUserInput]
|
||||
)
|
||||
|
||||
// reset if they close warning without tokens in params
|
||||
const handleDismissTokenWarning = useCallback(() => {
|
||||
setDismissTokenWarning(true)
|
||||
history.push('/swap/')
|
||||
}, [history])
|
||||
|
||||
// modal and loading
|
||||
const [{ showConfirm, tradeToConfirm, swapErrorMessage, attemptingTxn, txHash }, setSwapState] = useState<{
|
||||
showConfirm: boolean
|
||||
@@ -297,6 +305,7 @@ export default function Swap() {
|
||||
isOpen={importTokensNotInDefault.length > 0 && !dismissTokenWarning}
|
||||
tokens={importTokensNotInDefault}
|
||||
onConfirm={handleConfirmTokenWarning}
|
||||
onDismiss={handleDismissTokenWarning}
|
||||
/>
|
||||
<SwapPoolTabs active={'swap'} />
|
||||
<AppBody>
|
||||
|
||||
@@ -29,18 +29,16 @@ function fetchClaim(account: string, chainId: ChainId): Promise<UserClaimData |
|
||||
|
||||
return (CLAIM_PROMISES[key] =
|
||||
CLAIM_PROMISES[key] ??
|
||||
fetch(`https://gentle-frost-9e74.uniswap.workers.dev/${chainId}/${formatted}`)
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
return res.json()
|
||||
} else {
|
||||
console.debug(`No claim for account ${formatted} on chain ID ${chainId}`)
|
||||
return null
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Failed to get claim data', error)
|
||||
}))
|
||||
fetch('https://merkle-drop-1.uniswap.workers.dev/', {
|
||||
body: JSON.stringify({ chainId, address: formatted }),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Referrer-Policy': 'no-referrer'
|
||||
},
|
||||
method: 'POST'
|
||||
})
|
||||
.then(res => (res.ok ? res.json() : console.log(`No claim for account ${formatted} on chain ID ${chainId}`)))
|
||||
.catch(error => console.error('Failed to get claim data', error)))
|
||||
}
|
||||
|
||||
// parse distributorContract blob and detect if user has claim data
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ChainId, Pair, Token } from '@uniswap/sdk'
|
||||
import flatMap from 'lodash.flatmap'
|
||||
import ReactGA from 'react-ga'
|
||||
import { useCallback, useMemo } from 'react'
|
||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux'
|
||||
import { BASES_TO_TRACK_LIQUIDITY_FOR, PINNED_PAIRS } from '../../constants'
|
||||
@@ -92,10 +91,6 @@ export function useUserSingleHopOnly(): [boolean, (newSingleHopOnly: boolean) =>
|
||||
|
||||
const setSingleHopOnly = useCallback(
|
||||
(newSingleHopOnly: boolean) => {
|
||||
ReactGA.event({
|
||||
category: 'Routing',
|
||||
action: newSingleHopOnly ? 'enable single hop' : 'disable single hop'
|
||||
})
|
||||
dispatch(updateUserSingleHopOnly({ userSingleHopOnly: newSingleHopOnly }))
|
||||
},
|
||||
[dispatch]
|
||||
|
||||
Reference in New Issue
Block a user