-
Notifications
You must be signed in to change notification settings - Fork 438
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
Added gaps at the end of the storage of each contract. #29
Conversation
The main reason behind 50 is that you'd need 5 in a row in the inheritance tree to go over 256, causing the |
@@ -46,4 +46,6 @@ contract Initializable { | |||
assembly { cs := extcodesize(address) } | |||
return cs == 0; | |||
} | |||
|
|||
uint256[50] private ______gap; |
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.
We will be removing Initializable and loading it from zos-lib afterwards, right?
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.
Yes - should we add this there?
I'd say we are fine with 50 slots per contract :-) |
I'd say the opposite, better keep Initializable as clean as possible
…On Tue, Oct 9, 2018 at 6:34 PM Nicolás Venturo ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In contracts/Initializable.sol
<#29 (comment)>
:
> @@ -46,4 +46,6 @@ contract Initializable {
assembly { cs := extcodesize(address) }
return cs == 0;
}
+
+ uint256[50] private ______gap;
Yes - should we add this there?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAaOJAB2z0lTjWlC_EEnbfmUhy0WBClKks5ujNAlgaJpZM4XNZRq>
.
|
Any specific reason to not add the gap? I wouldn't discount the possibility of |
I was going to suggest backwards compatibility with the Initializable from 1.x, but that one used a single boolean variable, while the current one uses two. And this exactly proves your point. So, can you send a PR to zeppelinos to add the gap there as well? |
Sure thing! Opened OpenZeppelin/openzeppelin-sdk#215 |
Fixes #13.
Despite
IERC721
and friends beingcontracts
and notinterfaces
(due to a Solidity limitation), I kept this out of those, since they should be used as interfaces.