Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Including `MondrianWallet2::constructor` is unnecessary and can be left out to save gas.

Including MondrianWallet2::constructor is unnecessary and can be left out to save gas.

Description: In normal EVM code, an upgradable contract needs to disable initialisers to avoid them writing data to storage. In ZkSync, because of the different way contracts are deployed, there is no difference between deployed code and constructor code. In more detail, from the ZKSync documentation:

On Ethereum, the constructor is only part of the initCode that gets executed during the deployment of the contract and returns the deployment code of the contract.
On ZKsync, there is no separation between deployed code and constructor code. The constructor is always a part of the deployment code of the contract.
In order to protect it from being called, the compiler-generated contracts invoke constructor only if the isConstructor flag provided (it is only available for the system contracts).

Impact: Disabling initializers in the constructor is unnecessary.

Recommended Mitigation: Remove the following code:

- constructor() {
- _disableInitializers();
- }
Updates

Lead Judging Commences

bube Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.