Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2561 from 0xProject/feat/contracts-zero-ex/unused…
Browse files Browse the repository at this point in the history
…-storage-id

ZeroEx: Add `Unused` to `StorageId` enum
  • Loading branch information
dorothy-zbornak authored Apr 23, 2020
2 parents cac6f52 + f7f0152 commit be2db50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/zero-ex/contracts/src/features/Migrate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion contracts/zero-ex/contracts/src/features/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion contracts/zero-ex/contracts/src/storage/LibStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ library LibStorage {

/// @dev Storage IDs for feature storage buckets.
enum StorageId {
Unused, // Unused buffer for state accidents.
Proxy,
SimpleFunctionRegistry,
Ownable,
Expand All @@ -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;
Expand Down

0 comments on commit be2db50

Please sign in to comment.