Generates a future-proof contract address using a salt plus bytecode, allowing the determination of an address before deployment.
The sender's address.
The hash of the bytecode, typically the output from zkSolc.
zkSolc
A randomization element used to create the contract address.
The ABI-encoded constructor arguments, if any.
The implementation of create2Address in ZKsync Era may differ slightly from Ethereum.
create2Address
const address = utils.create2Address("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", "0x010001cb6a6e8d5f6829522f19fa9568660e0a9cd53b2e8be4deb0a679452e41", "0x01", "0x01");// address = "0x29bac3E5E8FFE7415F97C956BFA106D70316ad50" Copy
const address = utils.create2Address("0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", "0x010001cb6a6e8d5f6829522f19fa9568660e0a9cd53b2e8be4deb0a679452e41", "0x01", "0x01");// address = "0x29bac3E5E8FFE7415F97C956BFA106D70316ad50"
Generates a future-proof contract address using a salt plus bytecode, allowing the determination of an address before deployment.