Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { prepareTransaction } from "../../../transaction/prepare-transaction.js";
import { normalizeFunctionParams } from "../../../utils/abi/normalizeFunctionParams.js";
import { CONTRACT_DEPLOYER_ADDRESS } from "../../../utils/any-evm/zksync/constants.js";
import { ensureBytecodePrefix } from "../../../utils/bytecode/prefix.js";
import type { Hex } from "../../../utils/encoding/hex.js";
import type { ClientAndChainAndAccount } from "../../../utils/types.js";
import { zkDeployContractDeterministic } from "./zkDeployDeterministic.js";
Expand All @@ -22,14 +23,16 @@
deploymentType?: "create" | "create2";
},
) {
const bytecode = ensureBytecodePrefix(options.bytecode);

Check warning on line 26 in packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts#L26

Added line #L26 was not covered by tests

if (options.salt !== undefined) {
// if a salt is provided, use the deterministic deployer
return zkDeployContractDeterministic(options);
}

const data = encodeDeployData({
abi: options.abi,
bytecode: options.bytecode,
bytecode,

Check warning on line 35 in packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts#L35

Added line #L35 was not covered by tests
deploymentType: options.deploymentType ?? "create",
args: normalizeFunctionParams(
options.abi.find((abi) => abi.type === "constructor"),
Expand All @@ -45,7 +48,7 @@
to: CONTRACT_DEPLOYER_ADDRESS,
data,
eip712: {
factoryDeps: [options.bytecode],
factoryDeps: [bytecode],

Check warning on line 51 in packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts#L51

Added line #L51 was not covered by tests
// TODO (zksync): allow passing in a paymaster
},
}),
Expand Down
Loading