Recalculate a native ZKsync CREATE2 address after changing constructor data

A deployment planner that uses Ethereum’s CREATE2 formula can consistently predict the wrong address for native EraVM code. The native formula commits separately to a bytecode hash and constructor inputs.

Build the native preimage

Use Keccak-256 of the ASCII text zksyncCreate2 as the 32-byte prefix. Left-pad the deployer address to 32 bytes, keep the salt at 32 bytes, and use the native bytecode hash plus Keccak-256 of the exact constructor bytes.

digest = keccak256(prefix || sender32 || salt32 || bytecodeHash || keccak256(constructorInput))
address = last20(digest)

With unchanged deployer, salt and bytecode, changing a constructor address from A to B changes the last preimage word. Recompute the result before funding a predicted destination. Use the factory executing the deployment as sender when appropriate.

Check whether the contract is native or interpreted

The native formula applies to native EraVM deployment. ZKsync’s EVM interpreter can provide Ethereum-style address derivation for EVM bytecode. Select the actual deployment path before comparing the planner’s result with a trace. docs.zksync.io ZKsync documentation