Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions PATCH_ISSUES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Patch Issues To Address

## 1. Viem Patch Version Mismatch

### Issue

The patch file `patches/viem@2.19.4.patch` was created for viem 2.19.4 but viem has been upgraded to 2.34.0. The patch needs to be updated.

### What the Patch Does

The patch adds an optional `key` parameter to `getEnsAvatar` so it can fetch and parse other ENS image records (like `header` or `banner`), not just the hardcoded `avatar` key.

**Original behavior:** Always fetches the `'avatar'` text record
**Patched behavior:** Fetches `key || 'avatar'`, allowing any image record to use the avatar parsing pipeline

### Why It's Needed

Upstream viem (as of 2.34.0) still does not support this feature. The `getEnsAvatar` function hardcodes `key: 'avatar'` in the call to `getEnsText`.

### Action Required

1. Rename `patches/viem@2.19.4.patch` to `patches/viem@2.34.0.patch`
2. Verify the patch applies cleanly (line numbers may have shifted)
3. If it doesn't apply, regenerate the patch against viem 2.34.0 source files:
- `actions/ens/getEnsAvatar.ts`
- `_esm/actions/ens/getEnsAvatar.js`
- `_cjs/actions/ens/getEnsAvatar.js`
4. Remove the `pnpm-lock.yaml` section from the patch (it was accidentally included)

### Files Modified by Patch

- `actions/ens/getEnsAvatar.ts` - TypeScript source
- `_esm/actions/ens/getEnsAvatar.js` - ESM build output
- `_cjs/actions/ens/getEnsAvatar.js` - CJS build output

---

## 2. Viem Patch May Be Unused

### Issue

The patched `getEnsAvatar` function from viem is **not imported or used anywhere in the codebase**. The app uses a custom `useEnsAvatar` hook in `src/hooks/useEnsAvatar.ts` that fetches from the ENS metadata service (`https://metadata.ens.domains/`) instead of using viem's implementation.

### Investigation Needed

- Determine if the viem patch is actually needed
- If not needed, the patch can be deleted entirely
- If it was intended for future use, document why it exists

---

## 3. Ox Patch (Minor)

### Note

There's also a patch for `ox@0.8.7` (`patches/ox@0.8.7.patch`) which fixes an issue in `Authorization.fromTuple` where spreading an undefined signature would cause issues. This patch appears to be for the correct version currently in use.
41 changes: 16 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@getpara/rainbowkit-wallet": "1.4.0",
"@metamask/post-message-stream": "^6.1.2",
"@metamask/providers": "^14.0.2",
"@noble/hashes": "^1.3.2",
"@noble/hashes": "^1.8.0",
"@splidejs/react-splide": "^0.7.12",
"@svgr/webpack": "^8.1.0",
"@tanstack/query-persist-client-core": "5.22.2",
Expand All @@ -76,7 +76,7 @@
"@tanstack/react-query-devtools": "^5.59.0",
"@tanstack/react-query-persist-client": "5.22.2",
"@thirdweb-dev/wagmi-adapter": "^0.2.151",
"@wagmi/core": "2.13.3",
"@wagmi/core": "2.19.0",
"calendar-link": "^2.8.0",
"dequal": "2.0.3",
"dns-packet": "^5.4.0",
Expand Down Expand Up @@ -108,8 +108,8 @@
"tinyglobby": "^0.2.6",
"ts-pattern": "^4.3.0",
"use-immer": "^0.7.0",
"viem": "2.19.4",
"wagmi": "2.12.4"
"viem": "2.34.0",
"wagmi": "2.16.3"
},
"peerDependencies": {
"react": "*",
Expand Down Expand Up @@ -162,12 +162,11 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.0.2",
"eslint-plugin-vitest": "0.4.x",
"ethers": "^5.7.2",
"hardhat": "^2.22.18",
"hardhat-dependency-compiler": "^1.1.3",
"hardhat-deploy": "^0.12.4",
"jsdom": "^24.1.0",
"knip": "^5.44.0",
"knip": "^5.62.0",
"msw": "^2.7.0",
"next-dev-https": "^0.1.2",
"next-router-mock": "^0.9.10",
Expand All @@ -181,7 +180,7 @@
"stylelint-webpack-plugin": "^5.0.1",
"svgo": "latest",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"typescript": "^5.9.2",
"typescript-styled-plugin": "^0.18.2",
"vite-plugin-magical-svg": "^1.3.0",
"vitest": "^3.0.5",
Expand All @@ -196,30 +195,27 @@
"fsevents"
],
"overrides": {
"ox": "npm:ox@0.8.7",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13",
"@wagmi/core": "2.13.3",
"@walletconnect/ethereum-provider": "2.11.1",
"@walletconnect/modal": "2.6.2",
"bn.js": "npm:bn.js@^5.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shell-quote": "npm:shell-quote@^1",
"wrtc": "https://registry.npmjs.org/@koush/wrtc/-/wrtc-0.5.2.tgz",
"aggregate-error": "npm:@socketregistry/aggregate-error@^1",
"array-buffer-byte-length": "npm:@socketregistry/array-buffer-byte-length@^1",
"array-flatten": "npm:@socketregistry/array-flatten@^1",
"array-includes": "npm:@socketregistry/array-includes@^1",
"array.prototype.findlast": "npm:@socketregistry/array.prototype.findlast@^1",
"array.prototype.findlastindex": "npm:@socketregistry/array.prototype.findlastindex@^1",
"array.prototype.flat": "npm:@socketregistry/array.prototype.flat@^1",
"array.prototype.flatmap": "npm:@socketregistry/array.prototype.flatmap@^1",
"array.prototype.toreversed": "npm:@socketregistry/array.prototype.toreversed@^1",
"array.prototype.tosorted": "npm:@socketregistry/array.prototype.tosorted@^1",
"arraybuffer.prototype.slice": "npm:@socketregistry/arraybuffer.prototype.slice@^1",
"available-typed-arrays": "npm:@socketregistry/available-typed-arrays@^1",
"bn.js": "npm:bn.js@^5.2.0",
"deep-equal": "npm:@socketregistry/deep-equal@^1",
"define-properties": "npm:@socketregistry/define-properties@^1",
"es-define-property": "npm:@socketregistry/es-define-property@^1",
"es-get-iterator": "npm:@socketregistry/es-get-iterator@^1",
"es-iterator-helpers": "npm:@socketregistry/es-iterator-helpers@^1",
"es-set-tostringtag": "npm:@socketregistry/es-set-tostringtag@^1",
"es6-symbol": "npm:@socketregistry/es6-symbol@^1",
"for-each": "npm:@socketregistry/for-each@^1",
"function-bind": "npm:@socketregistry/function-bind@^1",
"function.prototype.name": "npm:@socketregistry/function.prototype.name@^1",
Expand All @@ -241,7 +237,6 @@
"is-core-module": "npm:@socketregistry/is-core-module@^1",
"is-date-object": "npm:@socketregistry/is-date-object@^1",
"is-generator-function": "npm:@socketregistry/is-generator-function@^1",
"is-interactive": "npm:@socketregistry/is-interactive@^1",
"is-map": "npm:@socketregistry/is-map@^1",
"is-negative-zero": "npm:@socketregistry/is-negative-zero@^1",
"is-number-object": "npm:@socketregistry/is-number-object@^1",
Expand All @@ -257,30 +252,26 @@
"is-weakset": "npm:@socketregistry/is-weakset@^1",
"isarray": "npm:@socketregistry/isarray@^1",
"iterator.prototype": "npm:@socketregistry/iterator.prototype@^1",
"number-is-nan": "npm:@socketregistry/number-is-nan@^1",
"object-assign": "npm:@socketregistry/object-assign@^1",
"object-is": "npm:@socketregistry/object-is@^1",
"object-keys": "npm:@socketregistry/object-keys@^1",
"object.assign": "npm:@socketregistry/object.assign@^1",
"object.entries": "npm:@socketregistry/object.entries@^1",
"object.fromentries": "npm:@socketregistry/object.fromentries@^1",
"object.groupby": "npm:@socketregistry/object.groupby@^1",
"object.hasown": "npm:@socketregistry/object.hasown@^1",
"object.values": "npm:@socketregistry/object.values@^1",
"path-parse": "npm:@socketregistry/path-parse@^1",
"querystringify": "npm:@socketregistry/querystringify@^1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"reflect.getprototypeof": "npm:@socketregistry/reflect.getprototypeof@^1",
"regexp.prototype.flags": "npm:@socketregistry/regexp.prototype.flags@^1",
"safe-array-concat": "npm:@socketregistry/safe-array-concat@^1",
"safe-buffer": "npm:@socketregistry/safe-buffer@^1",
"safe-regex-test": "npm:@socketregistry/safe-regex-test@^1",
"safer-buffer": "npm:@socketregistry/safer-buffer@^1",
"set-function-length": "npm:@socketregistry/set-function-length@^1",
"shell-quote": "npm:shell-quote@^1",
"side-channel": "npm:@socketregistry/side-channel@^1",
"string.prototype.includes": "npm:@socketregistry/string.prototype.includes@^1",
"string.prototype.matchall": "npm:@socketregistry/string.prototype.matchall@^1",
"string.prototype.repeat": "npm:@socketregistry/string.prototype.repeat@^1",
"string.prototype.trim": "npm:@socketregistry/string.prototype.trim@^1",
"string.prototype.trimend": "npm:@socketregistry/string.prototype.trimend@^1",
"string.prototype.trimstart": "npm:@socketregistry/string.prototype.trimstart@^1",
Expand All @@ -291,8 +282,7 @@
"unbox-primitive": "npm:@socketregistry/unbox-primitive@^1",
"which-boxed-primitive": "npm:@socketregistry/which-boxed-primitive@^1",
"which-collection": "npm:@socketregistry/which-collection@^1",
"which-typed-array": "npm:@socketregistry/which-typed-array@^1",
"wrtc": "https://registry.npmjs.org/@koush/wrtc/-/wrtc-0.5.2.tgz"
"which-typed-array": "npm:@socketregistry/which-typed-array@^1"
},
"patchedDependencies": {
"next-dev-https@0.1.2": "patches/next-dev-https@0.1.2.patch",
Expand All @@ -301,6 +291,7 @@
"viem@2.19.4": "patches/viem@2.19.4.patch",
"hardhat-deploy@0.12.4": "patches/hardhat-deploy@0.12.4.patch",
"@nomicfoundation/hardhat-viem@2.0.3": "patches/@nomicfoundation%2Fhardhat-viem@2.0.3.patch",
"ox@0.8.7": "patches/ox@0.8.7.patch",
"@ensdomains/dnsprovejs@0.5.1": "patches/@ensdomains__dnsprovejs@0.5.1.patch"
}
},
Expand Down
35 changes: 35 additions & 0 deletions patches/ox@0.8.7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/core/Authorization.ts b/core/Authorization.ts
index b5807b5235191dfcc45bccdca87e497bd36b309c..98f596483bb5db1eccaa2345ef02ae8b2d84db7b 100644
--- a/core/Authorization.ts
+++ b/core/Authorization.ts
@@ -267,14 +267,22 @@ export function fromTuple<const tuple extends Tuple>(
tuple: tuple,
): fromTuple.ReturnType<tuple> {
const [chainId, address, nonce, yParity, r, s] = tuple
- const signature =
- yParity && r && s ? Signature.fromTuple([yParity, r, s]) : undefined
- return from({
- address,
- chainId: chainId === '0x' ? 0 : Number(chainId),
- nonce: nonce === '0x' ? 0n : BigInt(nonce),
- ...signature,
- }) as never
+
+ if (yParity && r && s) {
+ const signature = Signature.fromTuple([yParity, r, s])
+ return from({
+ address,
+ chainId: chainId === '0x' ? 0 : Number(chainId),
+ nonce: nonce === '0x' ? 0n : BigInt(nonce),
+ ...signature,
+ }) as never
+ } else {
+ return from({
+ address,
+ chainId: chainId === '0x' ? 0 : Number(chainId),
+ nonce: nonce === '0x' ? 0n : BigInt(nonce),
+ }) as never
+ }
}

export declare namespace fromTuple {
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion src/components/pages/profile/settings/DevSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useMemo } from 'react'
import { createTestClient, http } from 'viem'
import {
revert as evmRevert,
snapshot as evmSnapshot,
Expand Down Expand Up @@ -40,7 +41,15 @@ type TestConfig = Config<[typeof localhostWithEns]>

export const DevSection = () => {
const client = useClient<TestConfig>()
const testClient = useMemo(() => ({ ...client, mode: 'anvil' }) as const, [client])
const testClient = useMemo(
() =>
createTestClient({
chain: client?.chain,
mode: 'anvil',
transport: http('http://localhost:8545'),
}),
[client],
)

const addTransaction = useAddRecentTransaction()
const { createTransactionFlow } = useTransactionFlow()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const MOONPAY_WORKER_URL: { [key: number]: string } = {

export const FAUCET_WORKER_URL = 'https://ens-faucet.ens-cf.workers.dev'

export const WC_PROJECT_ID = '9b14144d470af1e03ab9d88aaa127332'
export const WC_PROJECT_ID = '6425bc743b6b0417ac4c3ef01b8004c3'

// 102% of price as buffer for fluctuations
export const CURRENCY_FLUCTUATION_BUFFER_PERCENTAGE = 102n
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"skipDefaultLibCheck": true,
"isolatedModules": true,
"jsx": "preserve",
"rootDir": ".",
Expand Down
Loading