The tillIn function, designed to handle native token transfers by wrapping them and sending the wrapped tokens to a capital pool, fails when deployed on the zkSync Era platform due to zkSync's unique method of handling native tokens.
The current implementation of the tillIn function attempts to wrap native tokens (e.g., Ether) into their ERC-20 equivalent (e.g., WETH) before transferring them to a capital pool. However, zkSync Era requires a different approach for native token transfers using the MsgValueSimulator system contract. This discrepancy leads to failures when the function is executed on zkSync Era.
When deployed on zkSync Era, the tillIn function will fail to process native token transfers correctly. This can cause transaction failures, leading to a poor user experience and potential disruption of the intended financial operations within the smart contract.
The root cause of this issue is the reliance on a wrapping mechanism for native tokens that is incompatible with zkSync Era's handling of native token transfers. The function does not account for zkSync's MsgValueSimulator, which is required to manage native tokens on that platform.
**reference: ** Zksync docs :: https://docs.zksync.io/zk-stack/components/compiler/specification/system-contracts
Manual Review
To resolve this issue, the tillIn function should be adapted to include support for zkSync Era's native token transfer mechanism via the MsgValueSimulator. This can be achieved by:
Implementing a check to determine if the contract is deployed on zkSync Era.
Utilizing the MsgValueSimulator for native token transfers when the contract is on zkSync Era.
Retaining the original wrapping and transfer logic for deployments on other EVM-compatible chains.
I would require a more explicit example on zkSync mainnet to prove that such a low level call is indeed an issue, i.e. a example live contract on zkSync that shows the usual low level `call()` cannot be utilized.
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.