ZK deterministic address #30
-
I tried to deploy contracts on mainnet eth and zksync era, Im using same address and nonce but my deployment contracts end up different contract address? but when I deployed to eth and polygon and bsc it generate same contract address is there any difference on zkSync era why its not generating same deterministic address? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hey @johnpaulcas 👋 Yes there are differences. You can review this part of the docs that describes how zkSync employs a unique account model and method for generating contract addresses. Instead of just relying on the sender's address and nonce like Ethereum, BSC, or Polygon, zkSync splits the nonce into two parts: the deployment nonce and the transaction nonce. This is in order to facilitate support for account abstraction. To have a deterministic address, you should use the |
Beta Was this translation helpful? Give feedback.
Hey @johnpaulcas 👋 Yes there are differences. You can review this part of the docs that describes how zkSync employs a unique account model and method for generating contract addresses. Instead of just relying on the sender's address and nonce like Ethereum, BSC, or Polygon, zkSync splits the nonce into two parts: the deployment nonce and the transaction nonce. This is in order to facilitate support for account abstraction.
To have a deterministic address, you should use the
create2
method from ContractDeployer. It is available for EOAs as well.