11import { useErrors } from 'apps/web/contexts/Errors' ;
22import L2ResolverAbi from 'apps/web/src/abis/L2Resolver' ;
3- import { USERNAME_L2_RESOLVER_ADDRESSES } from 'apps/web/src/addresses/usernames' ;
3+ import {
4+ UPGRADEABLE_L2_RESOLVER_ADDRESSES ,
5+ USERNAME_L2_REVERSE_REGISTRAR_ADDRESSES ,
6+ } from 'apps/web/src/addresses/usernames' ;
47import useBaseEnsName from 'apps/web/src/hooks/useBaseEnsName' ;
58import useBasenameChain from 'apps/web/src/hooks/useBasenameChain' ;
69import useCapabilitiesSafe from 'apps/web/src/hooks/useCapabilitiesSafe' ;
@@ -21,7 +24,6 @@ import { Dispatch, SetStateAction, useCallback, useMemo, useState } from 'react'
2124import { encodeFunctionData , namehash } from 'viem' ;
2225import { useAccount } from 'wagmi' ;
2326import { secondsInYears } from 'apps/web/src/utils/secondsInYears' ;
24- import UpgradeableRegistrarControllerAbi from 'apps/web/src/abis/UpgradeableRegistrarControllerAbi' ;
2527import L2ReverseRegistrarAbi from 'apps/web/src/abis/L2ReverseRegistrarAbi' ;
2628import { encodePacked , getFunctionSelector , keccak256 , type AbiFunction } from 'viem' ;
2729import { usePublicClient , useSignMessage } from 'wagmi' ;
@@ -178,7 +180,7 @@ export function useRegisterNameCallback(
178180 name : normalizedName , // The name being registered.
179181 owner : address , // The address of the owner for the name.
180182 duration : secondsInYears ( years ) , // The duration of the registration in seconds.
181- resolver : USERNAME_L2_RESOLVER_ADDRESSES [ basenameChain . id ] , // The address of the resolver to set for this name.
183+ resolver : UPGRADEABLE_L2_RESOLVER_ADDRESSES [ basenameChain . id ] , // The address of the resolver to set for this name.
182184 data : [ addressData , baseCointypeData , nameData ] , // Multicallable data bytes for setting records in the associated resolver upon registration.
183185 reverseRecord, // Bool to decide whether to set this name as the "primary" name for the `owner`.
184186 coinTypes : coinTypesForRequest ,
@@ -199,7 +201,7 @@ export function useRegisterNameCallback(
199201 await initiateBatchCalls ( {
200202 contracts : [
201203 {
202- abi : UpgradeableRegistrarControllerAbi ,
204+ abi : REGISTER_CONTRACT_ABI ,
203205 address : REGISTER_CONTRACT_ADDRESSES [ basenameChain . id ] ,
204206 functionName : isDiscounted ? 'discountedRegister' : 'register' ,
205207 args : isDiscounted
@@ -211,7 +213,7 @@ export function useRegisterNameCallback(
211213 ? [
212214 {
213215 abi : L2ReverseRegistrarAbi ,
214- address : USERNAME_L2_RESOLVER_ADDRESSES [ basenameChain . id ] ,
216+ address : USERNAME_L2_REVERSE_REGISTRAR_ADDRESSES [ basenameChain . id ] ,
215217 functionName : 'setName' ,
216218 args : [ normalizedName ] ,
217219 } ,
0 commit comments