Redundant reserved __gap
space
Description
The reserved __gap
space is unnecessary:
contract MightyNetERC721RestrictedRegistry ... {
...
uint256[50] private __gap;
}
This is because the MightyNetERC721RestrictedRegistry contract is designed to be called directly, rather than through inheritance. As a result, the __gap
storage space at the end of the contract remains unused, as there are no concerns of storage layout conflicts arising from future variable additions.
Impact
The redundant reserved space can lead to some inefficiency, as the contract has allocated resources that are not being used and maintaining unnecessary code in a contract might result in slightly higher deployment and execution gas costs due to the larger bytecode size.
Recommendations
We recommend removing the __gap
array.
Remediation
might Bear Games acknowledges this. They have removed the redundant reserved storage space in the V2
version of the contract.
The following is theire provided response:
We have made this change to MightyNetERC721RestrictedRegistryV2.