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

ZeroEx: Add Unused to StorageId enum #2561

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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