Skip to content

Conversation

@Reinis-FRP
Copy link
Collaborator

#27 introduced storage layout changes against the already deployed pre-audit version. In order to maintain safe upgrade flow we should retain the original structs even when isSet field is not used anymore.

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
struct CustomBond {
uint256 amount;
// isSet is not used anymore as amount cannot be set to 0, but it is kept for storage layout compatibility.
bool isSet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name it something distinct so it's clear it should not be used?

DEPRECATED_isSet;, for example.

See here as an example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upgrade verification check would fail and it is not possible to tag renamed struct member. The other alternative is to use @custom:oz-retyped-from, but that would forego storage layout checks for the whole struct.

@Reinis-FRP Reinis-FRP merged commit 5b33321 into master Aug 20, 2025
2 checks passed
@Reinis-FRP Reinis-FRP deleted the reinis-frp/custom-structs branch August 20, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants