bump addresses
This commit is contained in:
parent
ae76f26501
commit
5b49cedebb
@ -114,8 +114,7 @@ const StyledTokenName = styled.span<{ active?: boolean }>`
|
||||
font-size: ${({ active }) => (active ? '20px' : '18px')};
|
||||
`
|
||||
|
||||
const StyledBalanceMax = styled.button<{ enabled?: boolean }>`
|
||||
/* height: 32px; */
|
||||
const StyledBalanceMax = styled.button<{ disabled?: boolean }>`
|
||||
background-color: ${({ theme }) => theme.primary5};
|
||||
border: 1px solid ${({ theme }) => theme.primary5};
|
||||
border-radius: 0.5rem;
|
||||
@ -125,8 +124,8 @@ const StyledBalanceMax = styled.button<{ enabled?: boolean }>`
|
||||
cursor: pointer;
|
||||
/* margin-left: 0.5rem; */
|
||||
color: ${({ theme }) => theme.primary1};
|
||||
opacity: ${({ enabled }) => (enabled ? 1 : 0.4)};
|
||||
pointer-events: ${({ enabled }) => (enabled ? 'initial' : 'none')};
|
||||
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
|
||||
pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')};
|
||||
|
||||
:hover {
|
||||
border: 1px solid ${({ theme }) => theme.primary1};
|
||||
@ -149,7 +148,6 @@ interface CurrencyInputPanelProps {
|
||||
label?: string
|
||||
onCurrencySelect?: (currency: Currency) => void
|
||||
currency?: Currency | null
|
||||
disableCurrencySelect?: boolean
|
||||
hideBalance?: boolean
|
||||
pair?: Pair | null
|
||||
hideInput?: boolean
|
||||
@ -172,7 +170,6 @@ export default function CurrencyInputPanel({
|
||||
id,
|
||||
showCommonBases,
|
||||
customBalanceText,
|
||||
disableCurrencySelect = false,
|
||||
hideBalance = false,
|
||||
pair = null, // used for double token logo
|
||||
hideInput = false,
|
||||
@ -190,6 +187,8 @@ export default function CurrencyInputPanel({
|
||||
setModalOpen(false)
|
||||
}, [setModalOpen])
|
||||
|
||||
const disableCurrencySelect = typeof onCurrencySelect !== 'function'
|
||||
|
||||
return (
|
||||
<InputPanel id={id} hideInput={hideInput} {...rest}>
|
||||
{locked && (
|
||||
@ -207,25 +206,6 @@ export default function CurrencyInputPanel({
|
||||
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
|
||||
{label}
|
||||
</TYPE.body>
|
||||
|
||||
{/*<RowFixed>
|
||||
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
|
||||
{currency && value ? '$250' + value : '$ -'}
|
||||
</TYPE.body>
|
||||
|
||||
{hideBalance && currency && value && (
|
||||
<span style={{ marginLeft: '4px' }}>
|
||||
<Tooltip
|
||||
text="The estimated difference between the input value and output value due to allowed slippage and trade size."
|
||||
show={showToolTip}
|
||||
>
|
||||
<span onMouseEnter={open} onMouseLeave={close}>
|
||||
<SmallFormattedPriceImpact priceImpact={priceImpactWithoutFee} />
|
||||
</span>
|
||||
</Tooltip>
|
||||
</span>
|
||||
)}
|
||||
</RowFixed>*/}
|
||||
</RowBetween>
|
||||
</LabelRow>
|
||||
)}
|
||||
@ -299,8 +279,8 @@ export default function CurrencyInputPanel({
|
||||
</TYPE.body>
|
||||
</RowFixed>
|
||||
)}
|
||||
{!hideBalance && account && currency && label !== 'To' && (
|
||||
<StyledBalanceMax enabled={showMaxButton} onClick={onMax}>
|
||||
{showMaxButton && (
|
||||
<StyledBalanceMax disabled={!showMaxButton} onClick={onMax}>
|
||||
Max
|
||||
</StyledBalanceMax>
|
||||
)}
|
||||
|
@ -209,7 +209,6 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
|
||||
currency={stakingInfo.stakedAmount.token}
|
||||
pair={dummyPair}
|
||||
label={''}
|
||||
disableCurrencySelect={true}
|
||||
customBalanceText={'Available to deposit: '}
|
||||
id="stake-liquidity-token"
|
||||
/>
|
||||
|
@ -1,37 +1,43 @@
|
||||
import { ChainId } from '@uniswap/sdk-core'
|
||||
|
||||
export const V3_CORE_FACTORY_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0xFeabCc62240297F1e4b238937D68e7516f0918D7',
|
||||
[ChainId.GÖRLI]: '0xA31B47971cdC5376E41CfA2D4378912156ab1F10',
|
||||
[ChainId.KOVAN]: '0x58f6b77148BE49BF7898472268ae8f26377d0AA6',
|
||||
[ChainId.ROPSTEN]: '0x273Edaa13C845F605b5886Dd66C89AB497A6B17b',
|
||||
[ChainId.KOVAN]: '0x74e838ECf981Aaef2523aa5B666175DA319D8D31',
|
||||
[ChainId.RINKEBY]: '0x815BCC87613315327E04e4A3b7c96a79Ae80760c',
|
||||
[ChainId.GÖRLI]: '0x288be1A33bcdfA9A09cCa95CA1eD628A5294e82c',
|
||||
}
|
||||
|
||||
export const QUOTER_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0x91a64CCaead471caFF912314E466D9CF7C55E0E8',
|
||||
[ChainId.GÖRLI]: '0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8',
|
||||
[ChainId.KOVAN]: '0x865F20efC14A5186bF985aD42c64f5e71C055376',
|
||||
[ChainId.ROPSTEN]: '0x2F9e608FD881861B8916257B76613Cb22EE0652c',
|
||||
[ChainId.KOVAN]: '0xE7F35392a478CaAF3a8dA8E777078Fa3aBe0BaEF',
|
||||
[ChainId.RINKEBY]: '0x49B91cc934D63ad7c7FC1abA74B7AebCA413deaD',
|
||||
[ChainId.GÖRLI]: '0xf5Be6D3a408F06F00F2d6D4BB923fa9b695916f5',
|
||||
}
|
||||
|
||||
export const TICK_LENS_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0x3d137e860008BaF6d1c063158e5ec0baBbcFefF8',
|
||||
[ChainId.GÖRLI]: '0x80AacDBEe92DC1c2Fbaa261Fb369696AF1AD9f98',
|
||||
[ChainId.KOVAN]: '0xB79bDE60fc227217f4EE2102dC93fa1264E33DaB',
|
||||
[ChainId.ROPSTEN]: '0xd6852c52B9c97cBfb7e79B6ab4407AA20Ba31439',
|
||||
[ChainId.KOVAN]: '0xe2CE8F6cF0bc1c32605beaD58577ab1f08e086e6',
|
||||
[ChainId.RINKEBY]: '0xf5Be6D3a408F06F00F2d6D4BB923fa9b695916f5',
|
||||
[ChainId.GÖRLI]: '0x6744951a0DD149A31Df7B6d42eA69607eD692029',
|
||||
}
|
||||
|
||||
export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0x2F9e608FD881861B8916257B76613Cb22EE0652c',
|
||||
[ChainId.GÖRLI]: '0xd6852c52B9c97cBfb7e79B6ab4407AA20Ba31439',
|
||||
[ChainId.KOVAN]: '0xA31B47971cdC5376E41CfA2D4378912156ab1F10',
|
||||
[ChainId.ROPSTEN]: '0x74e838ECf981Aaef2523aa5B666175DA319D8D31',
|
||||
[ChainId.KOVAN]: '0x815BCC87613315327E04e4A3b7c96a79Ae80760c',
|
||||
[ChainId.RINKEBY]: '0x3255160392215494bee8B5aBf8C4C40965d0986C',
|
||||
[ChainId.GÖRLI]: '0xa1944Bb261511bB15Ce8CC054d996B3cFfA7f4d6',
|
||||
}
|
||||
|
||||
export const SWAP_ROUTER_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0x273Edaa13C845F605b5886Dd66C89AB497A6B17b',
|
||||
[ChainId.GÖRLI]: '0x91a64CCaead471caFF912314E466D9CF7C55E0E8',
|
||||
[ChainId.KOVAN]: '0x1988F2e49A72C4D73961C7f4Bb896819d3d2F6a3',
|
||||
[ChainId.ROPSTEN]: '0x03782388516e94FcD4c18666303601A12Aa729Ea',
|
||||
[ChainId.KOVAN]: '0x8a0B62Fbcb1B862BbF1ad31c26a72b7b746EdFC1',
|
||||
[ChainId.RINKEBY]: '0x483B27F0cF5AF935371d52A7F810799cD141E3dc',
|
||||
[ChainId.GÖRLI]: '0x49B91cc934D63ad7c7FC1abA74B7AebCA413deaD',
|
||||
}
|
||||
|
||||
export const V2_MIGRATOR_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.RINKEBY]: '0x03782388516e94FcD4c18666303601A12Aa729Ea',
|
||||
[ChainId.GÖRLI]: '0x2F9e608FD881861B8916257B76613Cb22EE0652c',
|
||||
[ChainId.KOVAN]: '0xFeabCc62240297F1e4b238937D68e7516f0918D7',
|
||||
export const V3_MIGRATOR_ADDRESSES: { [chainId in ChainId]?: string } = {
|
||||
[ChainId.ROPSTEN]: '0x764a2557D2af049bd026D382eEE05fBC7C5425E4',
|
||||
[ChainId.KOVAN]: '0x6744951a0DD149A31Df7B6d42eA69607eD692029',
|
||||
[ChainId.RINKEBY]: '0x94D53BC4cb886eDDb9C0426DFc1edB581D2C98B4',
|
||||
[ChainId.GÖRLI]: '0x3255160392215494bee8B5aBf8C4C40965d0986C',
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ import {
|
||||
NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
|
||||
V3_CORE_FACTORY_ADDRESSES,
|
||||
TICK_LENS_ADDRESSES,
|
||||
V2_MIGRATOR_ADDRESSES,
|
||||
V3_MIGRATOR_ADDRESSES,
|
||||
QUOTER_ADDRESSES,
|
||||
} from 'constants/v3'
|
||||
import { useMemo } from 'react'
|
||||
@ -69,7 +69,7 @@ export function useV1MigratorContract(): Contract | null {
|
||||
|
||||
export function useV2MigratorContract(): V3Migrator | null {
|
||||
const { chainId } = useActiveWeb3React()
|
||||
return useContract(chainId && V2_MIGRATOR_ADDRESSES[chainId], V2MigratorABI, true) as V3Migrator | null
|
||||
return useContract(chainId && V3_MIGRATOR_ADDRESSES[chainId], V2MigratorABI, true) as V3Migrator | null
|
||||
}
|
||||
|
||||
export function useTokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null {
|
||||
|
@ -138,8 +138,6 @@ export function useSwapCallback(
|
||||
}
|
||||
}
|
||||
|
||||
const tradeVersion = getTradeVersion(trade)
|
||||
|
||||
return {
|
||||
state: SwapCallbackState.VALID,
|
||||
callback: async function onSwap(): Promise<string> {
|
||||
@ -200,7 +198,7 @@ export function useSwapCallback(
|
||||
if (!successfulEstimation) {
|
||||
const errorCalls = estimatedCalls.filter((call): call is FailedCall => 'error' in call)
|
||||
if (errorCalls.length > 0) throw errorCalls[errorCalls.length - 1].error
|
||||
throw new Error('Unexpected error. Please contact support: none of the calls threw an error')
|
||||
throw new Error('Unexpected error. Please contact support.')
|
||||
}
|
||||
|
||||
const {
|
||||
@ -217,11 +215,12 @@ export function useSwapCallback(
|
||||
gasLimit: calculateGasMargin(gasEstimate),
|
||||
...(value && !isZero(value) ? { value } : {}),
|
||||
})
|
||||
.then((response: any) => {
|
||||
.then((response) => {
|
||||
const inputSymbol = trade.inputAmount.currency.symbol
|
||||
const outputSymbol = trade.outputAmount.currency.symbol
|
||||
const inputAmount = trade.inputAmount.toSignificant(3)
|
||||
const outputAmount = trade.outputAmount.toSignificant(3)
|
||||
const slippageTolerancePercent = new Percent(allowedSlippage)
|
||||
const inputAmount = trade.maximumAmountIn(slippageTolerancePercent).toSignificant(3)
|
||||
const outputAmount = trade.minimumAmountOut(slippageTolerancePercent).toSignificant(3)
|
||||
|
||||
const base = `Swap ${inputAmount} ${inputSymbol} for ${outputAmount} ${outputSymbol}`
|
||||
const withRecipient =
|
||||
@ -233,6 +232,8 @@ export function useSwapCallback(
|
||||
: recipientAddressOrName
|
||||
}`
|
||||
|
||||
const tradeVersion = getTradeVersion(trade)
|
||||
|
||||
const withVersion = tradeVersion === Version.v3 ? withRecipient : `${withRecipient} on ${tradeVersion}`
|
||||
|
||||
addTransaction(response, {
|
||||
@ -241,7 +242,7 @@ export function useSwapCallback(
|
||||
|
||||
return response.hash
|
||||
})
|
||||
.catch((error: any) => {
|
||||
.catch((error) => {
|
||||
// if the user rejected the tx, pass this along
|
||||
if (error?.code === 4001) {
|
||||
throw new Error('Transaction rejected.')
|
||||
@ -254,5 +255,5 @@ export function useSwapCallback(
|
||||
},
|
||||
error: null,
|
||||
}
|
||||
}, [trade, library, account, chainId, recipient, recipientAddressOrName, swapCalls, addTransaction])
|
||||
}, [trade, library, account, chainId, recipient, recipientAddressOrName, swapCalls, allowedSlippage, addTransaction])
|
||||
}
|
||||
|
@ -555,7 +555,6 @@ export default function AddLiquidity({
|
||||
<CurrencyInputPanel
|
||||
value={formattedAmounts[Field.CURRENCY_A]}
|
||||
onUserInput={onFieldAInput}
|
||||
disableCurrencySelect={true}
|
||||
onMax={() => {
|
||||
onFieldAInput(maxAmounts[Field.CURRENCY_A]?.toExact() ?? '')
|
||||
}}
|
||||
@ -573,7 +572,6 @@ export default function AddLiquidity({
|
||||
|
||||
<CurrencyInputPanel
|
||||
value={formattedAmounts[Field.CURRENCY_B]}
|
||||
disableCurrencySelect={true}
|
||||
onUserInput={onFieldBInput}
|
||||
onCurrencySelect={handleCurrencyBSelect}
|
||||
onMax={() => {
|
||||
|
@ -17,7 +17,7 @@ import { useTokenBalance } from '../../state/wallet/hooks'
|
||||
import { BackArrow, ExternalLink, TYPE } from '../../theme'
|
||||
import { getEtherscanLink, isAddress } from '../../utils'
|
||||
import { BodyWrapper } from '../AppBody'
|
||||
import { V2_MIGRATOR_ADDRESSES } from 'constants/v3'
|
||||
import { V3_MIGRATOR_ADDRESSES } from 'constants/v3'
|
||||
import { PoolState, usePool } from 'hooks/usePools'
|
||||
import { FeeAmount, Pool, Position, priceToClosestTick, TickMath } from '@uniswap/v3-sdk'
|
||||
import { LightCard, PinkCard, YellowCard } from 'components/Card'
|
||||
@ -219,7 +219,7 @@ function V2PairMigration({
|
||||
null
|
||||
)
|
||||
|
||||
const migratorAddress = chainId && V2_MIGRATOR_ADDRESSES[chainId]
|
||||
const migratorAddress = chainId && V3_MIGRATOR_ADDRESSES[chainId]
|
||||
const [approval, approveManually] = useApproveCallback(pairBalance, migratorAddress)
|
||||
const isArgentWallet = useIsArgentWallet()
|
||||
|
||||
|
@ -605,7 +605,6 @@ export default function RemoveLiquidity({
|
||||
onUserInput(Field.LIQUIDITY_PERCENT, '100')
|
||||
}}
|
||||
showMaxButton={!atMaxAmount}
|
||||
disableCurrencySelect
|
||||
currency={pair?.liquidityToken}
|
||||
pair={pair}
|
||||
id="liquidity-amount"
|
||||
|
Loading…
Reference in New Issue
Block a user