Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
ae6fb88a
Commit
ae6fb88a
authored
Mar 08, 2024
by
Uniswap Labs Service Account
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci(release): publish latest release
parent
7b04a003
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
23 deletions
+50
-23
RELEASE
RELEASE
+7
-7
VERSION
VERSION
+1
-1
tokens.ts
apps/web/src/constants/tokens.ts
+8
-2
useStablecoinPrice.ts
apps/web/src/hooks/useStablecoinPrice.ts
+17
-3
useUSDTokenUpdater.ts
apps/web/src/hooks/useUSDTokenUpdater.ts
+5
-4
LimitForm.tsx
apps/web/src/pages/Swap/Limit/LimitForm.tsx
+7
-5
SendCurrencyInputForm.tsx
apps/web/src/pages/Swap/Send/SendCurrencyInputForm.tsx
+5
-1
No files found.
RELEASE
View file @
ae6fb88a
IPFS hash of the deployment:
IPFS hash of the deployment:
- CIDv0: `Qm
TFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd
`
- CIDv0: `Qm
PfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr
`
- CIDv1: `bafybei
cjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna
`
- CIDv1: `bafybei
atxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam
`
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
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.
...
@@ -10,15 +10,15 @@ You can also access the Uniswap Interface from an IPFS gateway.
Your Uniswap settings are never remembered across different URLs.
Your Uniswap settings are never remembered across different URLs.
IPFS gateways:
IPFS gateways:
- https://bafybei
cjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna
.ipfs.dweb.link/
- https://bafybei
atxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam
.ipfs.dweb.link/
- https://bafybei
cjart6xnqnhn2wxxtaygvl327ad3dtufggocex2pczejucjiwhna
.ipfs.cf-ipfs.com/
- https://bafybei
atxsersz6wkzf75lzpkhxoglubrcqv7uqy6nubdvvjyanidm4vam
.ipfs.cf-ipfs.com/
- [ipfs://Qm
TFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd/](ipfs://QmTFgNJaQqAaTCCyb3Zvz9jyLpQfB9Xh25WcvebZz6G1Pd
/)
- [ipfs://Qm
PfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr/](ipfs://QmPfhCQw4e63hhx4FqWnroACYRcyZHw6f5Nvo6DXHwkEGr
/)
### 5.17.
1 (2024-03-07
)
### 5.17.
2 (2024-03-08
)
### Bug Fixes
### Bug Fixes
* **web:** [
info] Update PDP TX Table on token order switch (#6772) (#6775) 685bb6d
* **web:** [
hotfix] fiatCurrency is undefined (#6811) (#6814) a78d4cc
VERSION
View file @
ae6fb88a
web/5.17.1
web/5.17.2
\ No newline at end of file
\ No newline at end of file
apps/web/src/constants/tokens.ts
View file @
ae6fb88a
...
@@ -10,8 +10,14 @@ export const USDC_MAINNET = new Token(
...
@@ -10,8 +10,14 @@ export const USDC_MAINNET = new Token(
'
USDC
'
,
'
USDC
'
,
'
USD//C
'
'
USD//C
'
)
)
const
USDC_GOERLI
=
new
Token
(
ChainId
.
GOERLI
,
'
0x07865c6e87b9f70255377e024ace6630c1eaa37f
'
,
6
,
'
USDC
'
,
'
USD//C
'
)
export
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_SEPOLIA
=
new
Token
(
ChainId
.
SEPOLIA
,
'
0x6f14C02Fc1F78322cFd7d707aB90f18baD3B54f5
'
,
6
,
'
USDC
'
,
'
USD//C
'
)
export
const
USDC_OPTIMISM
=
new
Token
(
export
const
USDC_OPTIMISM
=
new
Token
(
ChainId
.
OPTIMISM
,
ChainId
.
OPTIMISM
,
'
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
'
,
'
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
'
,
...
...
apps/web/src/hooks/useStablecoinPrice.ts
View file @
ae6fb88a
...
@@ -5,20 +5,27 @@ import { useMemo, useRef } from 'react'
...
@@ -5,20 +5,27 @@ import { useMemo, useRef } from 'react'
import
{
ClassicTrade
,
INTERNAL_ROUTER_PREFERENCE_PRICE
}
from
'
state/routing/types
'
import
{
ClassicTrade
,
INTERNAL_ROUTER_PREFERENCE_PRICE
}
from
'
state/routing/types
'
import
{
useRoutingAPITrade
}
from
'
state/routing/useRoutingAPITrade
'
import
{
useRoutingAPITrade
}
from
'
state/routing/useRoutingAPITrade
'
import
{
SupportedInterfaceChain
,
asSupportedChain
}
from
'
constants/chains
'
import
{
import
{
CUSD_CELO
,
CUSD_CELO
,
CUSD_CELO_ALFAJORES
,
DAI_OPTIMISM
,
DAI_OPTIMISM
,
USDC_ARBITRUM
,
USDC_ARBITRUM
,
USDC_ARBITRUM_GOERLI
,
USDC_AVALANCHE
,
USDC_AVALANCHE
,
USDC_BASE
,
USDC_BASE
,
USDC_GOERLI
,
USDC_MAINNET
,
USDC_MAINNET
,
USDC_OPTIMISM_GOERLI
,
USDC_POLYGON
,
USDC_POLYGON
,
USDC_POLYGON_MUMBAI
,
USDC_SEPOLIA
,
USDT_BSC
,
USDT_BSC
,
}
from
'
../constants/tokens
'
}
from
'
../constants/tokens
'
// Stablecoin amounts used when calculating spot price for a given currency.
// Stablecoin amounts used when calculating spot price for a given currency.
// The amount is large enough to filter low liquidity pairs.
// 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
.
MAINNET
]:
CurrencyAmount
.
fromRawAmount
(
USDC_MAINNET
,
100
_000e6
),
[
ChainId
.
ARBITRUM_ONE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_ARBITRUM
,
10
_000e6
),
[
ChainId
.
ARBITRUM_ONE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_ARBITRUM
,
10
_000e6
),
[
ChainId
.
OPTIMISM
]:
CurrencyAmount
.
fromRawAmount
(
DAI_OPTIMISM
,
10
_000e18
),
[
ChainId
.
OPTIMISM
]:
CurrencyAmount
.
fromRawAmount
(
DAI_OPTIMISM
,
10
_000e18
),
...
@@ -27,6 +34,12 @@ export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> }
...
@@ -27,6 +34,12 @@ export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> }
[
ChainId
.
BNB
]:
CurrencyAmount
.
fromRawAmount
(
USDT_BSC
,
100
e18
),
[
ChainId
.
BNB
]:
CurrencyAmount
.
fromRawAmount
(
USDT_BSC
,
100
e18
),
[
ChainId
.
AVALANCHE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_AVALANCHE
,
10
_000e6
),
[
ChainId
.
AVALANCHE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_AVALANCHE
,
10
_000e6
),
[
ChainId
.
BASE
]:
CurrencyAmount
.
fromRawAmount
(
USDC_BASE
,
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> }
...
@@ -34,7 +47,7 @@ export const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Token> }
* @param currency currency to compute the USDC price of
* @param currency currency to compute the USDC price of
*/
*/
export
default
function
useStablecoinPrice
(
currency
?:
Currency
):
Price
<
Currency
,
Token
>
|
undefined
{
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
amountOut
=
chainId
?
STABLECOIN_AMOUNT_OUT
[
chainId
]
:
undefined
const
stablecoin
=
amountOut
?.
currency
const
stablecoin
=
amountOut
?.
currency
...
@@ -96,7 +109,8 @@ export function useStablecoinValue(currencyAmount: CurrencyAmount<Currency> | un
...
@@ -96,7 +109,8 @@ export function useStablecoinValue(currencyAmount: CurrencyAmount<Currency> | un
*/
*/
export
function
useStablecoinAmountFromFiatValue
(
fiatValue
:
number
|
null
|
undefined
)
{
export
function
useStablecoinAmountFromFiatValue
(
fiatValue
:
number
|
null
|
undefined
)
{
const
{
chainId
}
=
useWeb3React
()
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
(()
=>
{
return
useMemo
(()
=>
{
if
(
fiatValue
===
null
||
fiatValue
===
undefined
||
!
chainId
||
!
stablecoin
)
{
if
(
fiatValue
===
null
||
fiatValue
===
undefined
||
!
chainId
||
!
stablecoin
)
{
...
...
apps/web/src/hooks/useUSDTokenUpdater.ts
View file @
ae6fb88a
...
@@ -3,6 +3,7 @@ import tryParseCurrencyAmount from 'lib/utils/tryParseCurrencyAmount'
...
@@ -3,6 +3,7 @@ import tryParseCurrencyAmount from 'lib/utils/tryParseCurrencyAmount'
import
{
useMemo
}
from
'
react
'
import
{
useMemo
}
from
'
react
'
import
{
NumberType
,
useFormatter
}
from
'
utils/formatNumbers
'
import
{
NumberType
,
useFormatter
}
from
'
utils/formatNumbers
'
import
{
asSupportedChain
}
from
'
constants/chains
'
import
useStablecoinPrice
,
{
STABLECOIN_AMOUNT_OUT
}
from
'
./useStablecoinPrice
'
import
useStablecoinPrice
,
{
STABLECOIN_AMOUNT_OUT
}
from
'
./useStablecoinPrice
'
const
NUM_DECIMALS_USD
=
2
const
NUM_DECIMALS_USD
=
2
...
@@ -20,10 +21,10 @@ export function useUSDTokenUpdater(isFiatInput: boolean, exactAmount: string, ex
...
@@ -20,10 +21,10 @@ export function useUSDTokenUpdater(isFiatInput: boolean, exactAmount: string, ex
if
(
isFiatInput
)
{
if
(
isFiatInput
)
{
const
exactAmountUSD
=
(
parseFloat
(
exactAmount
||
'
0
'
)
/
conversionRate
).
toFixed
(
NUM_DECIMALS_USD
)
const
exactAmountUSD
=
(
parseFloat
(
exactAmount
||
'
0
'
)
/
conversionRate
).
toFixed
(
NUM_DECIMALS_USD
)
const
s
tablecoinAmount
=
tryParseCurrencyAmount
(
const
s
upportedChainId
=
asSupportedChain
(
exactCurrency
.
chainId
)
exactAmountUSD
,
const
stablecoinAmount
=
supportedChainId
STABLECOIN_AMOUNT_OUT
[
exactCurrency
.
chainId
]?.
currency
?
tryParseCurrencyAmount
(
exactAmountUSD
,
STABLECOIN_AMOUNT_OUT
[
supportedChainId
].
currency
)
)
:
undefined
const
currencyAmount
=
stablecoinAmount
?
price
?.
invert
().
quote
(
stablecoinAmount
)
:
undefined
const
currencyAmount
=
stablecoinAmount
?
price
?.
invert
().
quote
(
stablecoinAmount
)
:
undefined
const
formattedCurrencyAmount
=
formatCurrencyAmount
({
const
formattedCurrencyAmount
=
formatCurrencyAmount
({
...
...
apps/web/src/pages/Swap/Limit/LimitForm.tsx
View file @
ae6fb88a
...
@@ -18,7 +18,7 @@ import { LimitPriceInputPanel } from 'components/CurrencyInputPanel/LimitPriceIn
...
@@ -18,7 +18,7 @@ import { LimitPriceInputPanel } from 'components/CurrencyInputPanel/LimitPriceIn
import
SwapCurrencyInputPanel
from
'
components/CurrencyInputPanel/SwapCurrencyInputPanel
'
import
SwapCurrencyInputPanel
from
'
components/CurrencyInputPanel/SwapCurrencyInputPanel
'
import
{
Field
}
from
'
components/swap/constants
'
import
{
Field
}
from
'
components/swap/constants
'
import
{
ArrowContainer
,
ArrowWrapper
,
SwapSection
}
from
'
components/swap/styled
'
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
{
ZERO_PERCENT
}
from
'
constants/misc
'
import
usePermit2Allowance
,
{
AllowanceState
}
from
'
hooks/usePermit2Allowance
'
import
usePermit2Allowance
,
{
AllowanceState
}
from
'
hooks/usePermit2Allowance
'
import
{
STABLECOIN_AMOUNT_OUT
}
from
'
hooks/useStablecoinPrice
'
import
{
STABLECOIN_AMOUNT_OUT
}
from
'
hooks/useStablecoinPrice
'
...
@@ -187,18 +187,20 @@ function LimitForm({ onCurrencyChange }: LimitFormProps) {
...
@@ -187,18 +187,20 @@ function LimitForm({ onCurrencyChange }: LimitFormProps) {
)
)
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
outputCurrency
&&
chainId
)
{
const
supportedChainId
=
asSupportedChain
(
chainId
)
onSelectCurrency
(
'
outputCurrency
'
,
STABLECOIN_AMOUNT_OUT
[
chainId
].
currency
)
if
(
!
outputCurrency
&&
supportedChainId
)
{
onSelectCurrency
(
'
outputCurrency
'
,
STABLECOIN_AMOUNT_OUT
[
supportedChainId
].
currency
)
}
}
},
[
chainId
,
onSelectCurrency
,
outputCurrency
])
},
[
chainId
,
onSelectCurrency
,
outputCurrency
])
useEffect
(()
=>
{
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
const
[
nativeCurrency
,
nonNativeCurrency
]
=
inputCurrency
.
isNative
?
[
inputCurrency
,
outputCurrency
]
?
[
inputCurrency
,
outputCurrency
]
:
[
outputCurrency
,
inputCurrency
]
:
[
outputCurrency
,
inputCurrency
]
if
(
nativeCurrency
.
wrapped
.
equals
(
nonNativeCurrency
))
{
if
(
nativeCurrency
.
wrapped
.
equals
(
nonNativeCurrency
))
{
onSelectCurrency
(
'
outputCurrency
'
,
STABLECOIN_AMOUNT_OUT
[
c
hainId
].
currency
)
onSelectCurrency
(
'
outputCurrency
'
,
STABLECOIN_AMOUNT_OUT
[
supportedC
hainId
].
currency
)
}
}
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
...
...
apps/web/src/pages/Swap/Send/SendCurrencyInputForm.tsx
View file @
ae6fb88a
...
@@ -22,6 +22,7 @@ import { ClickableStyle, ThemedText } from 'theme/components'
...
@@ -22,6 +22,7 @@ import { ClickableStyle, ThemedText } from 'theme/components'
import
{
NumberType
,
useFormatter
}
from
'
utils/formatNumbers
'
import
{
NumberType
,
useFormatter
}
from
'
utils/formatNumbers
'
import
{
maxAmountSpend
}
from
'
utils/maxAmountSpend
'
import
{
maxAmountSpend
}
from
'
utils/maxAmountSpend
'
import
{
asSupportedChain
,
SupportedInterfaceChain
}
from
'
constants/chains
'
import
useResizeObserver
from
'
use-resize-observer
'
import
useResizeObserver
from
'
use-resize-observer
'
import
{
ReactComponent
as
DropDown
}
from
'
../../../assets/images/dropdown.svg
'
import
{
ReactComponent
as
DropDown
}
from
'
../../../assets/images/dropdown.svg
'
...
@@ -237,7 +238,10 @@ export default function SendCurrencyInputForm({
...
@@ -237,7 +238,10 @@ export default function SendCurrencyInputForm({
const
showMaxButton
=
Boolean
(
maxInputAmount
?.
greaterThan
(
0
)
&&
!
parsedTokenAmount
?.
equalTo
(
maxInputAmount
))
const
showMaxButton
=
Boolean
(
maxInputAmount
?.
greaterThan
(
0
)
&&
!
parsedTokenAmount
?.
equalTo
(
maxInputAmount
))
const
[
tokenSelectorOpen
,
setTokenSelectorOpen
]
=
useState
(
false
)
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
fiatCurrencyEqualsTransferCurrency
=
!!
inputCurrency
&&
fiatCurrency
.
equals
(
inputCurrency
)
const
formattedBalance
=
formatCurrencyAmount
({
const
formattedBalance
=
formatCurrencyAmount
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment