The address derivation for the create2
opcode differs on zkEVM, breaking the factory contracts' functionality.
Note that the protocol is supposed to be compatible with any EVM chain.
The address derivation formula on the zkSync chain differs from that used on other EVM chains. The LibClone
library used in the factory contracts to create deterministic addresses of Nexus contracts uses the standard EVM formula for address prediction.
The zkSync docs explicitly state that the derivation for addresses created using create2
is different from Ethereum Mainnet.
From the docs :
For zkEVM bytecode, ZKsync Era uses a distinct address derivation method compared to Ethereum. The precise formulas can be found in our SDK, as demonstrated below:
Since the bytecode differs from Ethereum as ZKsync uses a modified version of the EVM, the address derived from the bytecode hash will also differ. This means that the same bytecode deployed on Ethereum and ZKsync will have different addresses and the Ethereum address will still be available and unused on ZKsync. If and when the zkEVM reaches parity with the EVM, the address derivation will be updated to match Ethereum and the same bytecode will have the same address on both chains, deployed bytecodes to different addresses on ZKsync could then be deployed to the same the Ethereum-matching addresses on ZKsync.
As you can see above, the prefix "zksyncCreate2" is added to the hash used to compute the address. Therefore, the address on zkEVM will be different from ETH mainnet. This means that the factory contracts will calculate the wrong address on zkSync chain and return the EVM equivalent address to the user in the createAccount()
function call. This means that the user will be unaware of the actual address of the Nexus account.
Since some initial ETH may also be deployed along with the Nexus account, there will be a loss of funds for a naive user as the web2 frontend will return the incorrect address. However, an advanced user can observe the new address on the zkSync explorer and recover their account. Therefore, this issue breaks core functionality and qualifies as medium severity.
Manual Review
Handle address derivation differently on zkSync.
Use a zkEVM compatible cloning library.
Valid medium, since there is non-functionality on zkSync (cannot create accounts) since it is stated as follows > Blockchains: > - Ethereum/Any EVM
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.