NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

`replace_class_syscall` does not run a constructor

Github

https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/starknet/src/bridge.cairo#L185-L197

Summary

The current upgrade mechanism in Cairo, as implemented in bridge.cairo and erc721_bridgeable.cairo, utilizes the replace_class_syscall function. This syscall does not invoke a constructor, which complicates the process of updating storage variables and may result in a temporary denial of service if storage updates are needed.

Impact

Since replace_class_syscall does not run a constructor, updating storage variables directly in an upgrade process is not feasible, potentially leading to disruptions in contract functionality.

Recommendation

I did some research into StarkNet forums and expert discussions confirms that this issue is a known limitation in Cairo upgrades. My suggestion to address storage updates, consider implementing a temporary class with an initialization function as a workaround to facilitate necessary storage changes during upgrades.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Appeal created

0xtheblackpanther Submitter
10 months ago
n0kto Lead Judge
9 months ago
n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

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