-
Notifications
You must be signed in to change notification settings - Fork 124
fix(l2): set pendingPrivilegedTxIndex in initializer
#5161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the initialization of the pendingPrivilegedTxIndex state variable in the CommonBridge contract to follow best practices for upgradeable contracts. The change removes the inline initialization at declaration and moves it to the initialize function.
- Removes inline initialization (
= 0) from thependingPrivilegedTxIndexstate variable declaration - Adds explicit initialization of
pendingPrivilegedTxIndexin theinitializefunction
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
**Motivation** <!-- Why does this pull request exist? What are its goals? --> OZ's upgrade tools require the variables to be set in initializers and not in constructor/variable declaration. This should not be such a problem as it will always be initialized as 0, but with this change we avoid the tool error **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 -->
**Motivation** <!-- Why does this pull request exist? What are its goals? --> OZ's upgrade tools require the variables to be set in initializers and not in constructor/variable declaration. This should not be such a problem as it will always be initialized as 0, but with this change we avoid the tool error **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 -->
Motivation
OZ's upgrade tools require the variables to be set in initializers and not in constructor/variable declaration. This should not be such a problem as it will always be initialized as 0, but with this change we avoid the tool error
Description