Skip to content
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

bool to uint8 variable upgrade is not allowed #640

Closed
jjranalli opened this issue Aug 24, 2022 · 1 comment
Closed

bool to uint8 variable upgrade is not allowed #640

jjranalli opened this issue Aug 24, 2022 · 1 comment

Comments

@jjranalli
Copy link

From this issue it seems like it should be possible upgrading a variable from bool to uint8 without triggering a New storage layout is incompatible error.

However, the error is being triggered and only workaround at the moment seem to be enabling the unsafeSkipStorageCheck flag.

Minimal repo to reproduce the issue: https://github.com/jjranalli/hardhat-upgradeable-storage-issue

@frangio

@frangio
Copy link
Contributor

frangio commented Aug 24, 2022

Changing from bool to uint8 is not allowed by default, you need to enable it with a comment in the source code:

/// @custom:oz-retyped-from bool
uint8 x;

I thought you were asking about Initializable.sol, which includes this flag as seen here.

Make sure to read the entry in the FAQ: How can I rename a variable, or change its type?

@frangio frangio closed this as completed Aug 24, 2022
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

No branches or pull requests

2 participants