@@ -28,29 +28,16 @@ import {
2828import Link from "next/link" ;
2929import { useCallback , useMemo } from "react" ;
3030import { FormProvider , type UseFormReturn , useForm } from "react-hook-form" ;
31- import {
32- ZERO_ADDRESS ,
33- eth_getTransactionCount ,
34- getContract ,
35- getRpcClient ,
36- sendTransaction ,
37- waitForReceipt ,
38- } from "thirdweb" ;
31+ import { ZERO_ADDRESS , getContract } from "thirdweb" ;
3932import type { FetchDeployMetadataResult } from "thirdweb/contract" ;
4033import {
4134 deployContractfromDeployMetadata ,
4235 deployMarketplaceContract ,
4336 getRequiredTransactions ,
4437} from "thirdweb/deploys" ;
45- import { installPublishedModule } from "thirdweb/modules" ;
4638import { useActiveAccount , useActiveWalletChain } from "thirdweb/react" ;
4739import { upload } from "thirdweb/storage" ;
48- import {
49- type AbiFunction ,
50- concatHex ,
51- encodeAbiParameters ,
52- padHex ,
53- } from "thirdweb/utils" ;
40+ import { } from "thirdweb/utils" ;
5441import { isZkSyncChain } from "thirdweb/utils" ;
5542import { FormHelperText , FormLabel , Text } from "tw-components" ;
5643import { useCustomFactoryAbi , useFunctionParamsFromABI } from "../hooks" ;
@@ -204,10 +191,6 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
204191 ! isFactoryDeployment &&
205192 ( metadata ?. name . includes ( "AccountFactory" ) || false ) ;
206193
207- const isSuperchainInterop = ! ! modules ?. find (
208- ( m ) => m . name === "SuperChainInterop" ,
209- ) ;
210-
211194 const parsedDeployParams = useMemo (
212195 ( ) => ( {
213196 ...deployParams . reduce (
@@ -482,20 +465,15 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
482465 _contractURI,
483466 } ;
484467
485- const salt = isSuperchainInterop
486- ? concatHex ( [ "0x0101" , padHex ( "0x" , { size : 30 } ) ] ) . toString ( )
487- : params . deployDeterministic
488- ? params . signerAsSalt
489- ? activeAccount . address . concat ( params . saltForCreate2 )
490- : params . saltForCreate2
491- : undefined ;
468+ const salt = params . deployDeterministic
469+ ? params . signerAsSalt
470+ ? activeAccount . address . concat ( params . saltForCreate2 )
471+ : params . saltForCreate2
472+ : undefined ;
492473
493474 const moduleDeployData = modules ?. map ( ( m ) => ( {
494475 deployMetadata : m ,
495- initializeParams :
496- m . name === "SuperChainInterop"
497- ? { superchainBridge : "0x4200000000000000000000000000000000000028" }
498- : params . moduleData [ m . name ] ,
476+ initializeParams : params . moduleData [ m . name ] ,
499477 } ) ) ;
500478
501479 const coreContractAddress = await deployContractfromDeployMetadata ( {
@@ -506,69 +484,8 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
506484 initializeParams,
507485 implementationConstructorParams,
508486 salt,
509- isSuperchainInterop,
510- modules : isSuperchainInterop
511- ? // remove modules for superchain interop in order to deploy deterministically deploy just the core contract
512- [ ]
513- : moduleDeployData ,
487+ modules : moduleDeployData ,
514488 } ) ;
515- const coreContract = getContract ( {
516- client : thirdwebClient ,
517- address : coreContractAddress ,
518- chain : walletChain ,
519- } ) ;
520-
521- if ( isSuperchainInterop && moduleDeployData ) {
522- const rpcRequest = getRpcClient ( {
523- client : thirdwebClient ,
524- chain : walletChain ,
525- } ) ;
526- const currentNonce = await eth_getTransactionCount ( rpcRequest , {
527- address : activeAccount . address as `0x${string } `,
528- } ) ;
529-
530- for ( const [ i , m ] of moduleDeployData . entries ( ) ) {
531- let moduleData : `0x${string } ` | undefined ;
532-
533- const moduleInstallParams = m . deployMetadata . abi . find (
534- ( abiType ) =>
535- ( abiType as AbiFunction ) . name === "encodeBytesOnInstall" ,
536- ) as AbiFunction | undefined ;
537-
538- if ( m . initializeParams && moduleInstallParams ) {
539- moduleData = encodeAbiParameters (
540- (
541- moduleInstallParams . inputs as { name : string ; type : string } [ ]
542- ) . map ( ( p ) => ( {
543- name : p . name ,
544- type : p . type ,
545- } ) ) ,
546- Object . values ( m . initializeParams ) ,
547- ) ;
548- }
549-
550- console . log ( "nonce used: " , currentNonce + i ) ;
551-
552- const installTransaction = installPublishedModule ( {
553- contract : coreContract ,
554- account : activeAccount ,
555- moduleName : m . deployMetadata . name ,
556- publisher : m . deployMetadata . publisher ,
557- version : m . deployMetadata . version ,
558- moduleData,
559- nonce : currentNonce + i ,
560- } ) ;
561-
562- const txResult = await sendTransaction ( {
563- transaction : installTransaction ,
564- account : activeAccount ,
565- } ) ;
566-
567- await waitForReceipt ( txResult ) ;
568- // can't handle parallel transactions, so wait a bit
569- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
570- }
571- }
572489
573490 return coreContractAddress ;
574491 } ,
@@ -899,10 +816,7 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
899816 { isModular && modules && modules . length > 0 && (
900817 < ModularContractDefaultModulesFieldset
901818 form = { form }
902- modules = { modules . filter (
903- // superchain interop will have a default value for it's install param
904- ( mod ) => mod . name !== "SuperChainInterop" ,
905- ) }
819+ modules = { modules }
906820 isTWPublisher = { isTWPublisher }
907821 />
908822 ) }
0 commit comments