ci(release): publish latest release

parent 7b04a003
IPFS hash of the deployment:
- CIDv0: `QmTFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd`
- CIDv1: `bafybeicjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna`
- CIDv0: `QmPfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr`
- CIDv1: `bafybeiatxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam`
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
......@@ -10,15 +10,15 @@ You can also access the Uniswap Interface from an IPFS gateway.
Your Uniswap settings are never remembered across different URLs.
IPFS gateways:
- https://bafybeicjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna.ipfs.dweb.link/
- https://bafybeicjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna.ipfs.cf-ipfs.com/
- [ipfs://QmTFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd/](ipfs://QmTFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd/)
- https://bafybeiatxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam.ipfs.dweb.link/
- https://bafybeiatxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam.ipfs.cf-ipfs.com/
- [ipfs://QmPfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr/](ipfs://QmPfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr/)
### 5.17.1 (2024-03-07)
### 5.17.2 (2024-03-08)
### Bug Fixes
* **web:** [info] Update PDP TX Table on token order switch (#6772) (#6775) 685bb6d
* **web:** [hotfix] fiatCurrency is undefined (#6811) (#6814) a78d4cc
web/5.17.1
\ No newline at end of file
web/5.17.2
\ No newline at end of file
......@@ -10,8 +10,14 @@ export const USDC_MAINNET = new Token(
'USDC',
'USD//C'
)
const USDC_GOERLI = new Token(ChainId.GOERLI, '0x07865c6e87b9f70255377e024ace6630c1eaa37f', 6, 'USDC', 'USD//C')
const USDC_SEPOLIA = new Token(ChainId.SEPOLIA, '0x6f14C02Fc1F78322cFd7d707aB90f18baD3B54f5', 6, 'USDC', 'USD//C')
export const USDC_GOERLI = new Token(ChainId.GOERLI, '0x07865c6e87b9f70255377e024ace6630c1eaa37f', 6, 'USDC', 'USD//C')
export const USDC_SEPOLIA = new Token(
ChainId.SEPOLIA,
'0x6f14C02Fc1F78322cFd7d707aB90f18baD3B54f5',
6,
'USDC',
'USD//C'
)
export const USDC_OPTIMISM = new Token(
ChainId.OPTIMISM,
'0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
......
......@@ -5,20 +5,27 @@ import { useMemo, useRef } from 'react'
import { ClassicTrade, INTERNAL_ROUTER_PREFERENCE_PRICE } from 'state/routing/types'
import { useRoutingAPITrade } from 'state/routing/useRoutingAPITrade'
import { SupportedInterfaceChain, asSupportedChain } from 'constants/chains'
import {
CUSD_CELO,
CUSD_CELO_ALFAJORES,
DAI_OPTIMISM,
USDC_ARBITRUM,
USDC_ARBITRUM_GOERLI,
USDC_AVALANCHE,
USDC_BASE,
USDC_GOERLI,
USDC_MAINNET,
USDC_OPTIMISM_GOERLI,
USDC_POLYGON,
USDC_POLYGON_MUMBAI,
USDC_SEPOLIA,
USDT_BSC,
} from '../constants/tokens'
// Stablecoin amounts used when calculating spot price for a given currency.
// The amount is large enough to filter low liquidity pairs.
export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> } = {
export const STABLECOIN_AMOUNT_OUT: { [key in SupportedInterfaceChain]: CurrencyAmount<Token> } = {
[ChainId.MAINNET]: CurrencyAmount.fromRawAmount(USDC_MAINNET, 100_000e6),
[ChainId.ARBITRUM_ONE]: CurrencyAmount.fromRawAmount(USDC_ARBITRUM, 10_000e6),
[ChainId.OPTIMISM]: CurrencyAmount.fromRawAmount(DAI_OPTIMISM, 10_000e18),
......@@ -27,6 +34,12 @@ export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> }
[ChainId.BNB]: CurrencyAmount.fromRawAmount(USDT_BSC, 100e18),
[ChainId.AVALANCHE]: CurrencyAmount.fromRawAmount(USDC_AVALANCHE, 10_000e6),
[ChainId.BASE]: CurrencyAmount.fromRawAmount(USDC_BASE, 10_000e6),
[ChainId.GOERLI]: CurrencyAmount.fromRawAmount(USDC_GOERLI, 10_000e6),
[ChainId.SEPOLIA]: CurrencyAmount.fromRawAmount(USDC_SEPOLIA, 10_000e6),
[ChainId.OPTIMISM_GOERLI]: CurrencyAmount.fromRawAmount(USDC_OPTIMISM_GOERLI, 10_000e6),
[ChainId.ARBITRUM_GOERLI]: CurrencyAmount.fromRawAmount(USDC_ARBITRUM_GOERLI, 10_000e6),
[ChainId.POLYGON_MUMBAI]: CurrencyAmount.fromRawAmount(USDC_POLYGON_MUMBAI, 10_000e6),
[ChainId.CELO_ALFAJORES]: CurrencyAmount.fromRawAmount(CUSD_CELO_ALFAJORES, 10_000e6),
}
/**
......@@ -34,7 +47,7 @@ export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> }
* @param currency currency to compute the USDC price of
*/
export default function useStablecoinPrice(currency?: Currency): Price<Currency, Token> | undefined {
const chainId = currency?.chainId
const chainId = asSupportedChain(currency?.chainId)
const amountOut = chainId ? STABLECOIN_AMOUNT_OUT[chainId] : undefined
const stablecoin = amountOut?.currency
......@@ -96,7 +109,8 @@ export function useStablecoinValue(currencyAmount: CurrencyAmount<Currency> | un
*/
export function useStablecoinAmountFromFiatValue(fiatValue: number | null | undefined) {
const { chainId } = useWeb3React()
const stablecoin = chainId ? STABLECOIN_AMOUNT_OUT[chainId]?.currency : undefined
const supportedChainId = asSupportedChain(chainId)
const stablecoin = supportedChainId ? STABLECOIN_AMOUNT_OUT[supportedChainId].currency : undefined
return useMemo(() => {
if (fiatValue === null || fiatValue === undefined || !chainId || !stablecoin) {
......
......@@ -3,6 +3,7 @@ import tryParseCurrencyAmount from 'lib/utils/tryParseCurrencyAmount'
import { useMemo } from 'react'
import { NumberType, useFormatter } from 'utils/formatNumbers'
import { asSupportedChain } from 'constants/chains'
import useStablecoinPrice, { STABLECOIN_AMOUNT_OUT } from './useStablecoinPrice'
const NUM_DECIMALS_USD = 2
......@@ -20,10 +21,10 @@ export function useUSDTokenUpdater(isFiatInput: boolean, exactAmount: string, ex
if (isFiatInput) {
const exactAmountUSD = (parseFloat(exactAmount || '0') / conversionRate).toFixed(NUM_DECIMALS_USD)
const stablecoinAmount = tryParseCurrencyAmount(
exactAmountUSD,
STABLECOIN_AMOUNT_OUT[exactCurrency.chainId]?.currency
)
const supportedChainId = asSupportedChain(exactCurrency.chainId)
const stablecoinAmount = supportedChainId
? tryParseCurrencyAmount(exactAmountUSD, STABLECOIN_AMOUNT_OUT[supportedChainId].currency)
: undefined
const currencyAmount = stablecoinAmount ? price?.invert().quote(stablecoinAmount) : undefined
const formattedCurrencyAmount = formatCurrencyAmount({
......
......@@ -18,7 +18,7 @@ import { LimitPriceInputPanel } from 'components/CurrencyInputPanel/LimitPriceIn
import SwapCurrencyInputPanel from 'components/CurrencyInputPanel/SwapCurrencyInputPanel'
import { Field } from 'components/swap/constants'
import { ArrowContainer, ArrowWrapper, SwapSection } from 'components/swap/styled'
import { isSupportedChain } from 'constants/chains'
import { asSupportedChain, isSupportedChain } from 'constants/chains'
import { ZERO_PERCENT } from 'constants/misc'
import usePermit2Allowance, { AllowanceState } from 'hooks/usePermit2Allowance'
import { STABLECOIN_AMOUNT_OUT } from 'hooks/useStablecoinPrice'
......@@ -187,18 +187,20 @@ function LimitForm({ onCurrencyChange }: LimitFormProps) {
)
useEffect(() => {
if (!outputCurrency && chainId) {
onSelectCurrency('outputCurrency', STABLECOIN_AMOUNT_OUT[chainId].currency)
const supportedChainId = asSupportedChain(chainId)
if (!outputCurrency && supportedChainId) {
onSelectCurrency('outputCurrency', STABLECOIN_AMOUNT_OUT[supportedChainId].currency)
}
}, [chainId, onSelectCurrency, outputCurrency])
useEffect(() => {
if (chainId && inputCurrency && outputCurrency && (inputCurrency.isNative || outputCurrency.isNative)) {
const supportedChainId = asSupportedChain(chainId)
if (supportedChainId && inputCurrency && outputCurrency && (inputCurrency.isNative || outputCurrency.isNative)) {
const [nativeCurrency, nonNativeCurrency] = inputCurrency.isNative
? [inputCurrency, outputCurrency]
: [outputCurrency, inputCurrency]
if (nativeCurrency.wrapped.equals(nonNativeCurrency)) {
onSelectCurrency('outputCurrency', STABLECOIN_AMOUNT_OUT[chainId].currency)
onSelectCurrency('outputCurrency', STABLECOIN_AMOUNT_OUT[supportedChainId].currency)
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
......
......@@ -22,6 +22,7 @@ import { ClickableStyle, ThemedText } from 'theme/components'
import { NumberType, useFormatter } from 'utils/formatNumbers'
import { maxAmountSpend } from 'utils/maxAmountSpend'
import { asSupportedChain, SupportedInterfaceChain } from 'constants/chains'
import useResizeObserver from 'use-resize-observer'
import { ReactComponent as DropDown } from '../../../assets/images/dropdown.svg'
......@@ -237,7 +238,10 @@ export default function SendCurrencyInputForm({
const showMaxButton = Boolean(maxInputAmount?.greaterThan(0) && !parsedTokenAmount?.equalTo(maxInputAmount))
const [tokenSelectorOpen, setTokenSelectorOpen] = useState(false)
const fiatCurrency = useMemo(() => STABLECOIN_AMOUNT_OUT[chainId ?? ChainId.MAINNET].currency, [chainId])
const fiatCurrency = useMemo(
() => STABLECOIN_AMOUNT_OUT[asSupportedChain(chainId) ?? (ChainId.MAINNET as SupportedInterfaceChain)].currency,
[chainId]
)
const fiatCurrencyEqualsTransferCurrency = !!inputCurrency && fiatCurrency.equals(inputCurrency)
const formattedBalance = formatCurrencyAmount({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment