Skip to content

Commit

Permalink
feat: upgrade ethers, sdk-core, universal-router, smart-order-router (U…
Browse files Browse the repository at this point in the history
…niswap#520)

* chore: upgrade sdk-core, universal-router, smart-order-router

* 4.0

* fix namehash issue

* 3.2.0

* 5.7.2
  • Loading branch information
vm authored Mar 1, 2023
1 parent 26e4474 commit 2472354
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 415 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
"@uniswap/permit2-sdk": "^1.2.0",
"@uniswap/redux-multicall": "^1.1.8",
"@uniswap/router-sdk": "^1.3.0",
"@uniswap/sdk-core": "^3.0.1",
"@uniswap/smart-order-router": "^2.10.0",
"@uniswap/sdk-core": "^3.2.0",
"@uniswap/smart-order-router": "^3.6.0",
"@uniswap/token-lists": "^1.0.0-beta.30",
"@uniswap/universal-router-sdk": "^1.3.6",
"@uniswap/universal-router-sdk": "^1.3.8",
"@uniswap/v2-sdk": "^3.0.1",
"@uniswap/v3-sdk": "^3.8.2",
"@web3-react/core": "8.0.35-beta.0",
Expand All @@ -83,7 +83,7 @@
"ajv": "^8.11.0",
"ajv-formats": "^2.1.1",
"cids": "^1.0.0",
"ethers": "^5.6.1",
"ethers": "^5.7.2",
"immer": "^9.0.6",
"jotai": "^1.3.7",
"jsbi": "^3.1.4",
Expand Down Expand Up @@ -113,7 +113,7 @@
},
"peerDependencies": {
"@babel/runtime": ">=7.17.0",
"ethers": "^5.6.1",
"ethers": "^5.7.2",
"react": ">=17.0.1",
"react-dom": ">=17.0.1",
"react-redux": ">=7.2.2",
Expand Down
7 changes: 2 additions & 5 deletions src/hooks/useENSAddress.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { namehash } from 'ethers/lib/utils'
import { useSingleCallResult } from 'hooks/multicall'
import { useMemo } from 'react'
import isZero from 'utils/isZero'
import { safeNamehash } from 'utils/safeNamehash'

import { useENSRegistrarContract, useENSResolverContract } from './useContract'
import useDebounce from './useDebounce'
Expand All @@ -11,10 +11,7 @@ import useDebounce from './useDebounce'
*/
export default function useENSAddress(ensName?: string | null): { loading: boolean; address: string | null } {
const debouncedName = useDebounce(ensName, 200)
const ensNodeArgument = useMemo(
() => [debouncedName === null ? undefined : safeNamehash(debouncedName)],
[debouncedName]
)
const ensNodeArgument = useMemo(() => [!debouncedName ? undefined : namehash(debouncedName)], [debouncedName])
const registrarContract = useENSRegistrarContract(false)
const resolverAddress = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)
const resolverAddressResult = resolverAddress.result?.[0]
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useENSContentHash.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { namehash } from 'ethers/lib/utils'
import { useSingleCallResult } from 'hooks/multicall'
import { useMemo } from 'react'
import isZero from 'utils/isZero'
import { safeNamehash } from 'utils/safeNamehash'

import { useENSRegistrarContract, useENSResolverContract } from './useContract'

/**
* Does a lookup for an ENS name to find its contenthash.
*/
export default function useENSContentHash(ensName?: string | null): { loading: boolean; contenthash: string | null } {
const ensNodeArgument = useMemo(() => [ensName === null ? undefined : safeNamehash(ensName)], [ensName])
const ensNodeArgument = useMemo(() => [!ensName ? undefined : namehash(ensName)], [ensName])
const registrarContract = useENSRegistrarContract(false)
const resolverAddressResult = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)
const resolverAddress = resolverAddressResult.result?.[0]
Expand Down
21 changes: 0 additions & 21 deletions src/utils/safeNamehash.test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/utils/safeNamehash.ts

This file was deleted.

Loading

0 comments on commit 2472354

Please sign in to comment.