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.
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.
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.
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.
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.
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.