@@ -9,51 +9,7 @@ import { resolvePromisedValue } from "../../../utils/promise/resolve-promised-va
99import { randomBytesHex } from "../../../utils/random.js" ;
1010import type { ClientAndChainAndAccount } from "../../../utils/types.js" ;
1111import type { ThirdwebContract } from "../../contract.js" ;
12- import {
13- prepareZkDeployContractDeterministicTransaction ,
14- zkDeployContractDeterministic ,
15- } from "./zkDeployDeterministic.js" ;
16-
17- /**
18- * @internal
19- */
20- export async function prepareZkDeployProxyTransaction (
21- options : ClientAndChainAndAccount & {
22- cloneFactoryContract : ThirdwebContract ;
23- initializeTransaction : PreparedTransaction ;
24- salt ?: string ;
25- } ,
26- ) {
27- const implementationAddress = await resolvePromisedValue (
28- options . initializeTransaction . to ,
29- ) ;
30- if ( ! implementationAddress ) {
31- throw new Error ( "initializeTransaction must have a 'to' field set" ) ;
32- }
33- const deployed = await isContractDeployed ( {
34- address : implementationAddress ,
35- chain : options . chain ,
36- client : options . client ,
37- } ) ;
38- if ( ! deployed ) {
39- throw new Error (
40- `Implementation contract at ${ implementationAddress } is not deployed` ,
41- ) ;
42- }
43- // deploy tw proxy of the implementation
44- return prepareZkDeployContractDeterministicTransaction ( {
45- client : options . client ,
46- chain : options . chain ,
47- account : options . account ,
48- abi : twProxyAbi ,
49- bytecode : twProxyBytecode ,
50- params : {
51- _logic : implementationAddress ,
52- _data : await encode ( options . initializeTransaction ) ,
53- } ,
54- salt : options . salt || randomBytesHex ( 32 ) ,
55- } ) ;
56- }
12+ import { zkDeployContractDeterministic } from "./zkDeployDeterministic.js" ;
5713
5814/**
5915 * @internal
0 commit comments