Skip to content

Commit cfedd4a

Browse files
ci(release): publish latest release
1 parent 448c517 commit cfedd4a

12 files changed

Lines changed: 77 additions & 27 deletions

File tree

RELEASE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IPFS hash of the deployment:
2-
- CIDv0: `QmXvDjMAjd3MsWbZ2mJCejxJnvHKFYDCC3MWqA3RxjT1jT`
3-
- CIDv1: `bafybeieokkx3yqfvw7pewt4sgv4b6rya7zsmqer4iwhw63brwrm6evcdvy`
2+
- CIDv0: `Qmd512P4jHbjz6wx1fXY8XEiQBZfLYVMG5VFfSnwf7pt3F`
3+
- CIDv1: `bafybeig23t5tky3t3o45icjwxe5kxo2ypoxxq6alaha2rp25m2sf6cthey`
44

55
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
66

@@ -10,5 +10,5 @@ You can also access the Uniswap Interface from an IPFS gateway.
1010
Your Uniswap settings are never remembered across different URLs.
1111

1212
IPFS gateways:
13-
- https://bafybeieokkx3yqfvw7pewt4sgv4b6rya7zsmqer4iwhw63brwrm6evcdvy.ipfs.dweb.link/
14-
- [ipfs://QmXvDjMAjd3MsWbZ2mJCejxJnvHKFYDCC3MWqA3RxjT1jT/](ipfs://QmXvDjMAjd3MsWbZ2mJCejxJnvHKFYDCC3MWqA3RxjT1jT/)
13+
- https://bafybeig23t5tky3t3o45icjwxe5kxo2ypoxxq6alaha2rp25m2sf6cthey.ipfs.dweb.link/
14+
- [ipfs://Qmd512P4jHbjz6wx1fXY8XEiQBZfLYVMG5VFfSnwf7pt3F/](ipfs://Qmd512P4jHbjz6wx1fXY8XEiQBZfLYVMG5VFfSnwf7pt3F/)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web/5.148.7
1+
web/5.148.8

apps/web/src/connection/web3reactShim.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { useMemo } from 'react'
22
import { UniverseChainId } from 'uniswap/src/features/chains/types'
33
import { useAccount } from '~/hooks/useAccount'
4-
import { useEthersProvider } from '~/hooks/useEthersProvider'
4+
import { useEthersProvider, useEthersWeb3Provider } from '~/hooks/useEthersProvider'
55

66
export function useWeb3React() {
77
const account = useAccount()
8-
const provider = useEthersProvider({ chainId: account.chainId })
8+
// Legacy shim consumers sign through this provider (claim, offramp), so it keeps
9+
// the historical wallet-when-connected behavior; reads fall back to the app provider.
10+
const walletProvider = useEthersWeb3Provider({ chainId: account.chainId })
11+
const readProvider = useEthersProvider({ chainId: account.chainId })
12+
const provider = walletProvider ?? readProvider
913

1014
return useMemo(
1115
() => ({

apps/web/src/features/Swap/hooks/useSendCallback.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { SendTokenTransactionInfo } from 'uniswap/src/features/transactions
1414
import { TransactionType } from 'uniswap/src/features/transactions/types/transactionDetails'
1515
import { currencyAddress, currencyId, getCurrencyAddressForAnalytics } from 'uniswap/src/utils/currencyId'
1616
import { useAccount } from '~/hooks/useAccount'
17-
import { useEthersProvider } from '~/hooks/useEthersProvider'
17+
import { useEthersWeb3Provider } from '~/hooks/useEthersProvider'
1818
import { useSelectChain } from '~/hooks/useSelectChain'
1919
import { useTransactionAdder } from '~/state/transactions/hooks'
2020
import { toReadableError, UserRejectedRequestError } from '~/utils/errors'
@@ -34,7 +34,8 @@ export function useSendCallback({
3434
const account = useAccount()
3535
const accountRef = useRef(account)
3636
accountRef.current = account
37-
const provider = useEthersProvider({ chainId: account.chainId })
37+
// Sends a transaction via the wallet, so this must be the connector-backed provider.
38+
const provider = useEthersWeb3Provider({ chainId: account.chainId })
3839
const providerRef = useRef(provider)
3940
providerRef.current = provider
4041

apps/web/src/hooks/useContract.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
1414
import { getContract } from 'utilities/src/contracts/getContract'
1515
import { logger } from 'utilities/src/logger/logger'
1616
import { useAccount } from '~/hooks/useAccount'
17-
import { useEthersProvider } from '~/hooks/useEthersProvider'
17+
import { useEthersProvider, useEthersWeb3Provider } from '~/hooks/useEthersProvider'
1818

1919
const { abi: MulticallABI } = UniswapInterfaceMulticallJson
2020
const { abi: NFTPositionManagerABI } = NonfungiblePositionManagerJson
@@ -32,9 +32,15 @@ export function useContract<T extends Contract = Contract>({
3232
chainId?: UniverseChainId
3333
}): T | null {
3434
const account = useAccount()
35-
const provider = useEthersProvider({ chainId: chainId ?? account.chainId })
35+
const readProvider = useEthersProvider({ chainId: chainId ?? account.chainId })
36+
// Signer contracts must use the wallet's provider; read contracts use the app's
37+
// read provider (UniRPC). The signer can only come from the connector client, so
38+
// `account` is attached only when that client exists — never to the read provider.
39+
const walletProvider = useEthersWeb3Provider({ chainId: chainId ?? account.chainId })
3640

3741
return useMemo(() => {
42+
const withSigner = Boolean(withSignerIfPossible && account.address && walletProvider)
43+
const provider = withSigner ? walletProvider : readProvider
3844
if (!address || !ABI || !provider) {
3945
return null
4046
}
@@ -43,7 +49,7 @@ export function useContract<T extends Contract = Contract>({
4349
address,
4450
ABI,
4551
provider,
46-
account: withSignerIfPossible && account.address ? account.address : undefined,
52+
account: withSigner ? account.address : undefined,
4753
})
4854
} catch (error) {
4955
const wrappedError = new Error('failed to get contract', { cause: error })
@@ -54,7 +60,7 @@ export function useContract<T extends Contract = Contract>({
5460
})
5561
return null
5662
}
57-
}, [address, ABI, provider, withSignerIfPossible, account.address]) as T
63+
}, [address, ABI, readProvider, walletProvider, withSignerIfPossible, account.address]) as T
5864
}
5965

6066
export function useTokenContract({

apps/web/src/hooks/useEthersProvider.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Web3Provider } from '@ethersproject/providers'
22
import { useMemo } from 'react'
33
import type { Chain, Client, Transport } from 'viem'
44
import { useClient, useConnectorClient } from 'wagmi'
5-
import { useAccount } from '~/hooks/useAccount'
65

76
const providers = new WeakMap<Client, Web3Provider>()
87

@@ -35,18 +34,19 @@ export function clientToProvider(client?: Client<Transport, Chain>, chainId?: nu
3534
}
3635
}
3736

38-
/** Hook to convert a viem Client to an ethers.js Provider with a default disconnected Network fallback. */
37+
/**
38+
* READ-ONLY provider — always backed by the app's own transport (UniRPC), never the
39+
* connected wallet. Reads must not route through connector providers: connector SDKs
40+
* serve them from `chain.rpcUrls.default` via cookieless HTTP clients, which bypasses
41+
* UniRPC sessions/observability and breaks when the legacy endpoints are disabled.
42+
* Do not call `.getSigner()` on this — for signing use `useEthersWeb3Provider` or `useEthersSigner`.
43+
*/
3944
export function useEthersProvider({ chainId }: { chainId?: number } = {}) {
40-
const account = useAccount()
41-
const { data: client } = useConnectorClient({ chainId })
4245
const disconnectedClient = useClient({ chainId })
43-
return useMemo(
44-
() => clientToProvider(account.chainId !== chainId ? disconnectedClient : (client ?? disconnectedClient), chainId),
45-
[account.chainId, chainId, client, disconnectedClient],
46-
)
46+
return useMemo(() => clientToProvider(disconnectedClient, chainId), [chainId, disconnectedClient])
4747
}
4848

49-
/** Hook to convert a connected viem Client to an ethers.js Provider. */
49+
/** Hook to convert the connected wallet's viem Client to an ethers.js Provider, for signing flows. */
5050
export function useEthersWeb3Provider({ chainId }: { chainId?: number } = {}) {
5151
const { data: client } = useConnectorClient({ chainId })
5252
return useMemo(() => clientToProvider(client, chainId), [chainId, client])

packages/uniswap/src/features/chains/evm/info/mainnet.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ export const MAINNET_CHAIN_INFO = {
7878
[RPCType.Public]: {
7979
http: [getQuicknodeEndpointUrl(UniverseChainId.Mainnet)],
8080
},
81+
// Default is handed to wallet-connector rpc maps (WalletConnect/Binance read
82+
// rpcUrls.default.http[0] into cookieless in-page HTTP clients), so it must
83+
// stay an unkeyed public endpoint — keyed QuickNode/Infura URLs here leak the
84+
// key and break connected users when those endpoints are disabled.
8185
[RPCType.Default]: {
82-
http: [getQuicknodeEndpointUrl(UniverseChainId.Mainnet)],
86+
http: ['https://rpc.ankr.com/eth', 'https://eth-mainnet.public.blastapi.io'],
8387
},
8488
[RPCType.Fallback]: {
8589
http: ['https://rpc.ankr.com/eth', 'https://eth-mainnet.public.blastapi.io'],

packages/uniswap/src/features/chains/evm/info/monad.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export const MONAD_CHAIN_INFO = {
5959
urlParam: CHAIN_ID_TO_URL_PARAM[UniverseChainId.Monad],
6060
rpcUrls: {
6161
[RPCType.Public]: { http: [getQuicknodeEndpointUrl(UniverseChainId.Monad)] },
62-
[RPCType.Default]: { http: [getQuicknodeEndpointUrl(UniverseChainId.Monad)] },
62+
// Default feeds wallet-connector rpc maps (cookieless) — keep it unkeyed/public.
63+
[RPCType.Default]: { http: ['https://rpc.monad.xyz'] },
6364
[RPCType.Interface]: { http: [getQuicknodeEndpointUrl(UniverseChainId.Monad)] },
6465
},
6566
wrappedNativeCurrency: {

packages/uniswap/src/features/chains/evm/info/polygon.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export const POLYGON_CHAIN_INFO = {
6363
rpcUrls: {
6464
[RPCType.Public]: { http: [getQuicknodeEndpointUrl(UniverseChainId.Polygon)] },
6565
[RPCType.PublicAlt]: { http: ['https://polygon-rpc.com/'] },
66-
[RPCType.Default]: { http: [getQuicknodeEndpointUrl(UniverseChainId.Polygon)] },
66+
// Default feeds wallet-connector rpc maps (cookieless) — keep it unkeyed/public.
67+
[RPCType.Default]: { http: ['https://polygon-rpc.com/'] },
6768
[RPCType.Fallback]: { http: ['https://polygon-rpc.com/'] },
6869
[RPCType.Interface]: { http: [`https://polygon-mainnet.infura.io/v3/${config.infuraKey}`] },
6970
},

packages/uniswap/src/features/chains/evm/info/unichain.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ export const UNICHAIN_SEPOLIA_CHAIN_INFO = {
125125
[RPCType.Public]: {
126126
http: [getQuicknodeEndpointUrl(UniverseChainId.UnichainSepolia)],
127127
},
128+
// Default feeds wallet-connector rpc maps (cookieless) — keep it unkeyed/public.
128129
[RPCType.Default]: {
129-
http: [getQuicknodeEndpointUrl(UniverseChainId.UnichainSepolia)],
130+
http: ['https://sepolia.unichain.org'],
130131
},
131132
[RPCType.Interface]: {
132133
http: [getQuicknodeEndpointUrl(UniverseChainId.UnichainSepolia)],

0 commit comments

Comments
 (0)