@@ -6,6 +6,7 @@ import { sendAndConfirmTransaction } from "../../../transaction/actions/send-and
6
6
import { prepareTransaction } from "../../../transaction/prepare-transaction.js" ;
7
7
import { normalizeFunctionParams } from "../../../utils/abi/normalizeFunctionParams.js" ;
8
8
import { CONTRACT_DEPLOYER_ADDRESS } from "../../../utils/any-evm/zksync/constants.js" ;
9
+ import { ensureBytecodePrefix } from "../../../utils/bytecode/prefix.js" ;
9
10
import type { Hex } from "../../../utils/encoding/hex.js" ;
10
11
import type { ClientAndChainAndAccount } from "../../../utils/types.js" ;
11
12
import { zkDeployContractDeterministic } from "./zkDeployDeterministic.js" ;
@@ -22,14 +23,16 @@ export async function zkDeployContract(
22
23
deploymentType ?: "create" | "create2" ;
23
24
} ,
24
25
) {
26
+ const bytecode = ensureBytecodePrefix ( options . bytecode ) ;
27
+
25
28
if ( options . salt !== undefined ) {
26
29
// if a salt is provided, use the deterministic deployer
27
30
return zkDeployContractDeterministic ( options ) ;
28
31
}
29
32
30
33
const data = encodeDeployData ( {
31
34
abi : options . abi ,
32
- bytecode : options . bytecode ,
35
+ bytecode,
33
36
deploymentType : options . deploymentType ?? "create" ,
34
37
args : normalizeFunctionParams (
35
38
options . abi . find ( ( abi ) => abi . type === "constructor" ) ,
@@ -45,7 +48,7 @@ export async function zkDeployContract(
45
48
to : CONTRACT_DEPLOYER_ADDRESS ,
46
49
data,
47
50
eip712 : {
48
- factoryDeps : [ options . bytecode ] ,
51
+ factoryDeps : [ bytecode ] ,
49
52
// TODO (zksync): allow passing in a paymaster
50
53
} ,
51
54
} ) ,
0 commit comments