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' ;
2628
2729type UseRegisterNameCallbackReturnType = {
@@ -116,7 +118,7 @@ export function useRegisterNameCallback(
116118 name : normalizedName , // The name being registered.
117119 owner : address , // The address of the owner for the name.
118120 duration : secondsInYears ( years ) , // The duration of the registration in seconds.
119- resolver : USERNAME_L2_RESOLVER_ADDRESSES [ basenameChain . id ] , // The address of the resolver to set for this name.
121+ resolver : UPGRADEABLE_L2_RESOLVER_ADDRESSES [ basenameChain . id ] , // The address of the resolver to set for this name.
120122 data : [ addressData , baseCointypeData , nameData ] , // Multicallable data bytes for setting records in the associated resolver upon registration.
121123 reverseRecord, // Bool to decide whether to set this name as the "primary" name for the `owner`.
122124 coinTypes : [ ] ,
@@ -137,7 +139,7 @@ export function useRegisterNameCallback(
137139 await initiateBatchCalls ( {
138140 contracts : [
139141 {
140- abi : UpgradeableRegistrarControllerAbi ,
142+ abi : REGISTER_CONTRACT_ABI ,
141143 address : REGISTER_CONTRACT_ADDRESSES [ basenameChain . id ] ,
142144 functionName : isDiscounted ? 'discountedRegister' : 'register' ,
143145 args : isDiscounted
@@ -149,7 +151,7 @@ export function useRegisterNameCallback(
149151 ? [
150152 {
151153 abi : L2ReverseRegistrarAbi ,
152- address : USERNAME_L2_RESOLVER_ADDRESSES [ basenameChain . id ] ,
154+ address : USERNAME_L2_REVERSE_REGISTRAR_ADDRESSES [ basenameChain . id ] ,
153155 functionName : 'setName' ,
154156 args : [ normalizedName ] ,
155157 } ,
0 commit comments