You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@custom:oz-retyped-from and @custom:oz-renamed-from inside a struct are not recognized because Solidity does not expose the NatSpec of struct members.
A workaround is to specify @custom:oz-retyped-from <V1 contract name>.<V1 struct name> on the variable that uses the struct in the V2 contract. See this forum post for an example.
However, retype of a struct causes storage layout comparison to be skipped inside the struct itself, so users should manually ensure that they are compatible.
When Solidity exposes NatSpec of struct members, or if we can check the NatSpec in a different way, then:
Include the inner type of the struct for layout comparison
Support rename/retype annotations for variables within the struct
Note: Also consider structs used in mappings e.g. mapping(uint256 => S) store_mapping;
@custom:oz-retyped-from
and@custom:oz-renamed-from
inside a struct are not recognized because Solidity does not expose the NatSpec of struct members.A workaround is to specify
@custom:oz-retyped-from <V1 contract name>.<V1 struct name>
on the variable that uses the struct in the V2 contract. See this forum post for an example.However, retype of a struct causes storage layout comparison to be skipped inside the struct itself, so users should manually ensure that they are compatible.
When Solidity exposes NatSpec of struct members, or if we can check the NatSpec in a different way, then:
Note: Also consider structs used in mappings e.g.
mapping(uint256 => S) store_mapping;
Related: #459
The text was updated successfully, but these errors were encountered: