Skip to content

Commit 22a95a0

Browse files
committed
for zk
1 parent 8286840 commit 22a95a0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/thirdweb/src/contract/deployment/zksync/zkDeployDeterministic.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import {
1313
} from "../../../utils/any-evm/zksync/constants.js";
1414
import { isContractDeployed } from "../../../utils/bytecode/is-contract-deployed.js";
1515
import { ensureBytecodePrefix } from "../../../utils/bytecode/prefix.js";
16-
import { type Hex, uint8ArrayToHex } from "../../../utils/encoding/hex.js";
16+
import {
17+
type Hex,
18+
isHex,
19+
uint8ArrayToHex,
20+
} from "../../../utils/encoding/hex.js";
1721
import type { ClientAndChainAndAccount } from "../../../utils/types.js";
1822
import { getContract } from "../../contract.js";
1923
import { zkDeployContract } from "./zkDeployContract.js";
@@ -89,7 +93,11 @@ export async function zkDeployContractDeterministic(
8993
abi: parseAbi(singletonFactoryAbi),
9094
});
9195

92-
const salt = options?.salt ? keccakId(options.salt) : keccakId("thirdweb");
96+
const salt = options?.salt
97+
? isHex(options.salt) && options.salt.length === 66
98+
? options.salt
99+
: keccakId(options.salt)
100+
: keccakId("thirdweb");
93101

94102
await sendAndConfirmTransaction({
95103
account: options.account,

0 commit comments

Comments
 (0)