diff --git a/src/components/common/AddressInput/index.tsx b/src/components/common/AddressInput/index.tsx index d4789d5976..a72a2e950e 100644 --- a/src/components/common/AddressInput/index.tsx +++ b/src/components/common/AddressInput/index.tsx @@ -117,7 +117,7 @@ const AddressInput = ({ className={inputCss.input} autoComplete="off" autoFocus={props.focused} - label={<>{error?.message || props.label}} + label={<>{error?.message || props.label || `Recipient address${isDomainLookupEnabled ? ' or ENS' : ''}`}} error={!!error} fullWidth spellCheck={false} diff --git a/src/components/tx-flow/flows/NftTransfer/SendNftBatch.tsx b/src/components/tx-flow/flows/NftTransfer/SendNftBatch.tsx index f60583c5e7..9f2bb7977c 100644 --- a/src/components/tx-flow/flows/NftTransfer/SendNftBatch.tsx +++ b/src/components/tx-flow/flows/NftTransfer/SendNftBatch.tsx @@ -113,7 +113,7 @@ const SendNftBatch = ({ params, onSubmit }: SendNftBatchProps) => {
- + diff --git a/src/components/tx-flow/flows/TokenTransfer/CreateTokenTransfer.tsx b/src/components/tx-flow/flows/TokenTransfer/CreateTokenTransfer.tsx index f312db8aaf..6900b3c3ed 100644 --- a/src/components/tx-flow/flows/TokenTransfer/CreateTokenTransfer.tsx +++ b/src/components/tx-flow/flows/TokenTransfer/CreateTokenTransfer.tsx @@ -103,11 +103,7 @@ export const CreateTokenTransfer = ({ - + diff --git a/src/components/tx-flow/flows/TokenTransfer/__tests__/CreateTokenTransfer.test.tsx b/src/components/tx-flow/flows/TokenTransfer/__tests__/CreateTokenTransfer.test.tsx index af351c4fa9..01c52de3bd 100644 --- a/src/components/tx-flow/flows/TokenTransfer/__tests__/CreateTokenTransfer.test.tsx +++ b/src/components/tx-flow/flows/TokenTransfer/__tests__/CreateTokenTransfer.test.tsx @@ -29,7 +29,7 @@ describe('CreateTokenTransfer', () => { , ) - expect(getAllByText('Recipient address or ENS')[0]).toBeInTheDocument() + expect(getAllByText('Recipient address')[0]).toBeInTheDocument() }) it('should disable the submit button and display a warning if $SAFE token is selected and not transferable', () => { diff --git a/src/services/ens/config.ts b/src/services/ens/config.ts deleted file mode 100644 index 7f96cde9f6..0000000000 --- a/src/services/ens/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @see https://docs.ens.domains/ens-deployments - */ -export const CUSTOM_REGISTRIES: Record = { - '11155111': '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', // ENS on Sepolia -} diff --git a/src/services/ens/custom.ts b/src/services/ens/custom.ts deleted file mode 100644 index ca6d629596..0000000000 --- a/src/services/ens/custom.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Contract, namehash, ZeroAddress, type Provider } from 'ethers' - -// ENS Registry ABI (simplified version) -const ensRegistryAbi = ['function resolver(bytes32 node) external view returns (address)'] -const resolverAbi = ['function addr(bytes32 node) external view returns (address)'] - -export const customResolveName = async ( - registryAddress: string, - rpcProvider: Provider, - name: string, -): Promise => { - const ensRegistry = new Contract(registryAddress, ensRegistryAbi, rpcProvider) - const nhash = namehash(name) - const resolverAddress = await ensRegistry.resolver(nhash) - - if (resolverAddress === ZeroAddress) { - return undefined - } - - const resolver = new Contract(resolverAddress, resolverAbi, rpcProvider) - const address = await resolver.addr(nhash) - - return address || undefined -} diff --git a/src/services/ens/index.test.ts b/src/services/ens/index.test.ts index 42ac92a54a..c66abf42d8 100644 --- a/src/services/ens/index.test.ts +++ b/src/services/ens/index.test.ts @@ -4,7 +4,7 @@ import { logError } from '../exceptions' // mock rpcProvider const rpcProvider = { - resolveName: jest.fn(() => Promise.resolve('0x0000000000000000000000000000000000000000')), + resolveName: jest.fn(() => Promise.resolve('0x0000000000000000000000000000000000000001')), lookupAddress: jest.fn(() => Promise.resolve('safe.eth')), getNetwork: jest.fn(() => Promise.resolve({ chainId: 1 })), } as unknown as JsonRpcProvider @@ -20,10 +20,6 @@ jest.mock('../exceptions', () => ({ logError: jest.fn(), })) -jest.mock('./custom', () => ({ - customResolveName: jest.fn(() => Promise.resolve('0x0000001111111111111111111111111111111111')), -})) - describe('domains', () => { describe('isDomain', () => { it('should check the domain format', async () => { @@ -37,7 +33,7 @@ describe('domains', () => { describe('resolveName', () => { it('should resolve names', async () => { - expect(await resolveName(rpcProvider, 'test.eth')).toBe('0x0000000000000000000000000000000000000000') + expect(await resolveName(rpcProvider, 'test.eth')).toBe('0x0000000000000000000000000000000000000001') }) it('should return undefined and log on error', async () => { @@ -45,15 +41,6 @@ describe('domains', () => { expect(address).toBe(undefined) expect(logError).toHaveBeenCalledWith('101: Failed to resolve the address', 'bad resolveName') }) - - it('should look up names on Sepolia', async () => { - // mock rpcProvider - const rpcProvider = { - getNetwork: jest.fn(() => Promise.resolve({ chainId: 11155111 })), - } as unknown as JsonRpcProvider - - expect(await resolveName(rpcProvider, 'sepolia.eth')).toBe('0x0000001111111111111111111111111111111111') - }) }) describe('lookupAddress', () => { diff --git a/src/services/ens/index.ts b/src/services/ens/index.ts index 60b98da554..295f1368fc 100644 --- a/src/services/ens/index.ts +++ b/src/services/ens/index.ts @@ -1,8 +1,6 @@ import { type Provider } from 'ethers' import { logError } from '../exceptions' import ErrorCodes from '../exceptions/ErrorCodes' -import { CUSTOM_REGISTRIES } from './config' -import { customResolveName } from './custom' type EthersError = Error & { reason?: string @@ -22,12 +20,6 @@ export const resolveName = async (rpcProvider: Provider, name: string): Promise< } catch {} try { - // Try custom resolvers first - if (chainId && CUSTOM_REGISTRIES[chainId]) { - return await customResolveName(CUSTOM_REGISTRIES[chainId], rpcProvider, name) - } - - // The default ENS resolver return (await rpcProvider.resolveName(name)) || undefined } catch (e) { const err = e as EthersError