@0x/contracts-zero-ex: Add Unused to StorageId enum

This commit is contained in:
Lawrence Forman
2020-04-22 15:07:44 -04:00
parent 7df6530f3a
commit f7f0152573
3 changed files with 3 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ contract Migrate is
// If the owner is already set to ourselves then we've reentered.
_rrevert(LibMigrateRichErrors.AlreadyMigratingError());
}
// Temporarily set the owner to ourselves.
// Temporarily set the owner to ourselves to enable admin functions.
ownableStor.owner = address(this);
stor.migrationOwner = prevOwner;

View File

@@ -48,7 +48,7 @@ contract Ownable is
/// @param impl the actual address of this feature contract.
/// @return success Magic bytes if successful.
function bootstrap(address impl) external returns (bytes4 success) {
// Set the owner.
// Set the owner to ourselves to allow bootstrappers to call `extend()`.
LibOwnableStorage.getStorage().owner = address(this);
// Register feature functions.

View File

@@ -30,6 +30,7 @@ library LibStorage {
/// @dev Storage IDs for feature storage buckets.
enum StorageId {
Unused, // Unused buffer for state accidents.
Proxy,
SimpleFunctionRegistry,
Ownable,
@@ -44,7 +45,6 @@ library LibStorage {
pure
returns (uint256 offset)
{
// We don't use safeMul here to save gas.
// This should never overflow with a reasonable `STORAGE_OFFSET_MULTIPLIER`
// because Solidity will do a range check on `storageId` during the cast.
return uint256(storageId) * STORAGE_OFFSET_MULTIPLIER;