@@ -6,6 +6,7 @@ import { sendAndConfirmTransaction } from "../../../transaction/actions/send-and
66import { prepareTransaction } from "../../../transaction/prepare-transaction.js" ;
77import { normalizeFunctionParams } from "../../../utils/abi/normalizeFunctionParams.js" ;
88import { CONTRACT_DEPLOYER_ADDRESS } from "../../../utils/any-evm/zksync/constants.js" ;
9+ import { ensureBytecodePrefix } from "../../../utils/bytecode/prefix.js" ;
910import type { Hex } from "../../../utils/encoding/hex.js" ;
1011import type { ClientAndChainAndAccount } from "../../../utils/types.js" ;
1112import { zkDeployContractDeterministic } from "./zkDeployDeterministic.js" ;
@@ -22,14 +23,16 @@ export async function zkDeployContract(
2223 deploymentType ?: "create" | "create2" ;
2324 } ,
2425) {
26+ const bytecode = ensureBytecodePrefix ( options . bytecode ) ;
27+
2528 if ( options . salt !== undefined ) {
2629 // if a salt is provided, use the deterministic deployer
2730 return zkDeployContractDeterministic ( options ) ;
2831 }
2932
3033 const data = encodeDeployData ( {
3134 abi : options . abi ,
32- bytecode : options . bytecode ,
35+ bytecode,
3336 deploymentType : options . deploymentType ?? "create" ,
3437 args : normalizeFunctionParams (
3538 options . abi . find ( ( abi ) => abi . type === "constructor" ) ,
@@ -45,7 +48,7 @@ export async function zkDeployContract(
4548 to : CONTRACT_DEPLOYER_ADDRESS ,
4649 data,
4750 eip712 : {
48- factoryDeps : [ options . bytecode ] ,
51+ factoryDeps : [ bytecode ] ,
4952 // TODO (zksync): allow passing in a paymaster
5053 } ,
5154 } ) ,
0 commit comments