Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
OwnableFeature
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol"; import "../fixins/FixinCommon.sol"; import "../errors/LibOwnableRichErrors.sol"; import "../storage/LibOwnableStorage.sol"; import "../migrations/LibBootstrap.sol"; import "../migrations/LibMigrate.sol"; import "./interfaces/IFeature.sol"; import "./interfaces/IOwnableFeature.sol"; import "./SimpleFunctionRegistryFeature.sol"; /// @dev Owner management features. contract OwnableFeature is IFeature, IOwnableFeature, FixinCommon { /// @dev Name of this feature. string public constant override FEATURE_NAME = "Ownable"; /// @dev Version of this feature. uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 0, 0); using LibRichErrorsV06 for bytes; /// @dev Initializes this feature. The intial owner will be set to this (ZeroEx) /// to allow the bootstrappers to call `extend()`. Ownership should be /// transferred to the real owner by the bootstrapper after /// bootstrapping is complete. /// @return success Magic bytes if successful. function bootstrap() external returns (bytes4 success) { // Set the owner to ourselves to allow bootstrappers to call `extend()`. LibOwnableStorage.getStorage().owner = address(this); // Register feature functions. SimpleFunctionRegistryFeature(address(this))._extendSelf(this.transferOwnership.selector, _implementation); SimpleFunctionRegistryFeature(address(this))._extendSelf(this.owner.selector, _implementation); SimpleFunctionRegistryFeature(address(this))._extendSelf(this.migrate.selector, _implementation); return LibBootstrap.BOOTSTRAP_SUCCESS; } /// @dev Change the owner of this contract. /// Only directly callable by the owner. /// @param newOwner New owner address. function transferOwnership(address newOwner) external override onlyOwner { LibOwnableStorage.Storage storage proxyStor = LibOwnableStorage.getStorage(); if (newOwner == address(0)) { LibOwnableRichErrors.TransferOwnerToZeroError().rrevert(); } else { proxyStor.owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } } /// @dev Execute a migration function in the context of the ZeroEx contract. /// The result of the function being called should be the magic bytes /// 0x2c64c5ef (`keccack('MIGRATE_SUCCESS')`). Only callable by the owner. /// Temporarily sets the owner to ourselves so we can perform admin functions. /// Before returning, the owner will be set to `newOwner`. /// @param target The migrator contract address. /// @param data The call data. /// @param newOwner The address of the new owner. function migrate(address target, bytes calldata data, address newOwner) external override onlyOwner { if (newOwner == address(0)) { LibOwnableRichErrors.TransferOwnerToZeroError().rrevert(); } LibOwnableStorage.Storage storage stor = LibOwnableStorage.getStorage(); // The owner will be temporarily set to `address(this)` inside the call. stor.owner = address(this); // Perform the migration. LibMigrate.delegatecallMigrateFunction(target, data); // Update the owner. stor.owner = newOwner; emit Migrated(msg.sender, target, newOwner); } /// @dev Get the owner of this contract. /// @return owner_ The owner of this contract. function owner() external override view returns (address owner_) { return LibOwnableStorage.getStorage().owner; } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; library LibRichErrorsV06 { // bytes4(keccak256("Error(string)")) bytes4 internal constant STANDARD_ERROR_SELECTOR = 0x08c379a0; // solhint-disable func-name-mixedcase /// @dev ABI encode a standard, string revert error payload. /// This is the same payload that would be included by a `revert(string)` /// solidity statement. It has the function signature `Error(string)`. /// @param message The error string. /// @return The ABI encoded error. function StandardError(string memory message) internal pure returns (bytes memory) { return abi.encodeWithSelector( STANDARD_ERROR_SELECTOR, bytes(message) ); } // solhint-enable func-name-mixedcase /// @dev Reverts an encoded rich revert reason `errorData`. /// @param errorData ABI encoded error data. function rrevert(bytes memory errorData) internal pure { assembly { revert(add(errorData, 0x20), mload(errorData)) } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol"; import "../errors/LibCommonRichErrors.sol"; import "../errors/LibOwnableRichErrors.sol"; import "../features/interfaces/IOwnableFeature.sol"; import "../features/interfaces/ISimpleFunctionRegistryFeature.sol"; /// @dev Common feature utilities. abstract contract FixinCommon { using LibRichErrorsV06 for bytes; /// @dev The implementation address of this feature. address internal immutable _implementation; /// @dev The caller must be this contract. modifier onlySelf() virtual { if (msg.sender != address(this)) { LibCommonRichErrors.OnlyCallableBySelfError(msg.sender).rrevert(); } _; } /// @dev The caller of this function must be the owner. modifier onlyOwner() virtual { { address owner = IOwnableFeature(address(this)).owner(); if (msg.sender != owner) { LibOwnableRichErrors.OnlyOwnerError( msg.sender, owner ).rrevert(); } } _; } constructor() internal { // Remember this feature's original address. _implementation = address(this); } /// @dev Registers a function implemented by this feature at `_implementation`. /// Can and should only be called within a `migrate()`. /// @param selector The selector of the function whose implementation /// is at `_implementation`. function _registerFeatureFunction(bytes4 selector) internal { ISimpleFunctionRegistryFeature(address(this)).extend(selector, _implementation); } /// @dev Encode a feature version as a `uint256`. /// @param major The major version number of the feature. /// @param minor The minor version number of the feature. /// @param revision The revision number of the feature. /// @return encodedVersion The encoded version number. function _encodeVersion(uint32 major, uint32 minor, uint32 revision) internal pure returns (uint256 encodedVersion) { return (uint256(major) << 64) | (uint256(minor) << 32) | uint256(revision); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; library LibOwnableRichErrors { // solhint-disable func-name-mixedcase function OnlyOwnerError( address sender, address owner ) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("OnlyOwnerError(address,address)")), sender, owner ); } function TransferOwnerToZeroError() internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("TransferOwnerToZeroError()")) ); } function MigrateCallFailedError(address target, bytes memory resultData) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("MigrateCallFailedError(address,bytes)")), target, resultData ); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "./LibStorage.sol"; /// @dev Storage helpers for the `Ownable` feature. library LibOwnableStorage { /// @dev Storage bucket for this feature. struct Storage { // The owner of this contract. address owner; } /// @dev Get the storage bucket for this contract. function getStorage() internal pure returns (Storage storage stor) { uint256 storageSlot = LibStorage.getStorageSlot( LibStorage.StorageId.Ownable ); // Dip into assembly to change the slot pointed to by the local // variable `stor`. // See https://solidity.readthedocs.io/en/v0.6.8/assembly.html?highlight=slot#access-to-external-variables-functions-and-libraries assembly { stor_slot := storageSlot } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol"; import "../errors/LibProxyRichErrors.sol"; library LibBootstrap { /// @dev Magic bytes returned by the bootstrapper to indicate success. /// This is `keccack('BOOTSTRAP_SUCCESS')`. bytes4 internal constant BOOTSTRAP_SUCCESS = 0xd150751b; using LibRichErrorsV06 for bytes; /// @dev Perform a delegatecall and ensure it returns the magic bytes. /// @param target The call target. /// @param data The call data. function delegatecallBootstrapFunction( address target, bytes memory data ) internal { (bool success, bytes memory resultData) = target.delegatecall(data); if (!success || resultData.length != 32 || abi.decode(resultData, (bytes4)) != BOOTSTRAP_SUCCESS) { LibProxyRichErrors.BootstrapCallFailedError(target, resultData).rrevert(); } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol"; import "../errors/LibOwnableRichErrors.sol"; library LibMigrate { /// @dev Magic bytes returned by a migrator to indicate success. /// This is `keccack('MIGRATE_SUCCESS')`. bytes4 internal constant MIGRATE_SUCCESS = 0x2c64c5ef; using LibRichErrorsV06 for bytes; /// @dev Perform a delegatecall and ensure it returns the magic bytes. /// @param target The call target. /// @param data The call data. function delegatecallMigrateFunction( address target, bytes memory data ) internal { (bool success, bytes memory resultData) = target.delegatecall(data); if (!success || resultData.length != 32 || abi.decode(resultData, (bytes4)) != MIGRATE_SUCCESS) { LibOwnableRichErrors.MigrateCallFailedError(target, resultData).rrevert(); } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; /// @dev Basic interface for a feature contract. interface IFeature { // solhint-disable func-name-mixedcase /// @dev The name of this feature set. function FEATURE_NAME() external view returns (string memory name); /// @dev The version of this feature set. function FEATURE_VERSION() external view returns (uint256 version); }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/interfaces/IOwnableV06.sol"; // solhint-disable no-empty-blocks /// @dev Owner management and migration features. interface IOwnableFeature is IOwnableV06 { /// @dev Emitted when `migrate()` is called. /// @param caller The caller of `migrate()`. /// @param migrator The migration contract. /// @param newOwner The address of the new owner. event Migrated(address caller, address migrator, address newOwner); /// @dev Execute a migration function in the context of the ZeroEx contract. /// The result of the function being called should be the magic bytes /// 0x2c64c5ef (`keccack('MIGRATE_SUCCESS')`). Only callable by the owner. /// The owner will be temporarily set to `address(this)` inside the call. /// Before returning, the owner will be set to `newOwner`. /// @param target The migrator contract address. /// @param newOwner The address of the new owner. /// @param data The call data. function migrate(address target, bytes calldata data, address newOwner) external; }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol"; import "../fixins/FixinCommon.sol"; import "../storage/LibProxyStorage.sol"; import "../storage/LibSimpleFunctionRegistryStorage.sol"; import "../errors/LibSimpleFunctionRegistryRichErrors.sol"; import "../migrations/LibBootstrap.sol"; import "./interfaces/IFeature.sol"; import "./interfaces/ISimpleFunctionRegistryFeature.sol"; /// @dev Basic registry management features. contract SimpleFunctionRegistryFeature is IFeature, ISimpleFunctionRegistryFeature, FixinCommon { /// @dev Name of this feature. string public constant override FEATURE_NAME = "SimpleFunctionRegistry"; /// @dev Version of this feature. uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 0, 0); using LibRichErrorsV06 for bytes; /// @dev Initializes this feature, registering its own functions. /// @return success Magic bytes if successful. function bootstrap() external returns (bytes4 success) { // Register the registration functions (inception vibes). _extend(this.extend.selector, _implementation); _extend(this._extendSelf.selector, _implementation); // Register the rollback function. _extend(this.rollback.selector, _implementation); // Register getters. _extend(this.getRollbackLength.selector, _implementation); _extend(this.getRollbackEntryAtIndex.selector, _implementation); return LibBootstrap.BOOTSTRAP_SUCCESS; } /// @dev Roll back to a prior implementation of a function. /// Only directly callable by an authority. /// @param selector The function selector. /// @param targetImpl The address of an older implementation of the function. function rollback(bytes4 selector, address targetImpl) external override onlyOwner { ( LibSimpleFunctionRegistryStorage.Storage storage stor, LibProxyStorage.Storage storage proxyStor ) = _getStorages(); address currentImpl = proxyStor.impls[selector]; if (currentImpl == targetImpl) { // Do nothing if already at targetImpl. return; } // Walk history backwards until we find the target implementation. address[] storage history = stor.implHistory[selector]; uint256 i = history.length; for (; i > 0; --i) { address impl = history[i - 1]; history.pop(); if (impl == targetImpl) { break; } } if (i == 0) { LibSimpleFunctionRegistryRichErrors.NotInRollbackHistoryError( selector, targetImpl ).rrevert(); } proxyStor.impls[selector] = targetImpl; emit ProxyFunctionUpdated(selector, currentImpl, targetImpl); } /// @dev Register or replace a function. /// Only directly callable by an authority. /// @param selector The function selector. /// @param impl The implementation contract for the function. function extend(bytes4 selector, address impl) external override onlyOwner { _extend(selector, impl); } /// @dev Register or replace a function. /// Only callable from within. /// This function is only used during the bootstrap process and /// should be deregistered by the deployer after bootstrapping is /// complete. /// @param selector The function selector. /// @param impl The implementation contract for the function. function _extendSelf(bytes4 selector, address impl) external onlySelf { _extend(selector, impl); } /// @dev Retrieve the length of the rollback history for a function. /// @param selector The function selector. /// @return rollbackLength The number of items in the rollback history for /// the function. function getRollbackLength(bytes4 selector) external override view returns (uint256 rollbackLength) { return LibSimpleFunctionRegistryStorage.getStorage().implHistory[selector].length; } /// @dev Retrieve an entry in the rollback history for a function. /// @param selector The function selector. /// @param idx The index in the rollback history. /// @return impl An implementation address for the function at /// index `idx`. function getRollbackEntryAtIndex(bytes4 selector, uint256 idx) external override view returns (address impl) { return LibSimpleFunctionRegistryStorage.getStorage().implHistory[selector][idx]; } /// @dev Register or replace a function. /// @param selector The function selector. /// @param impl The implementation contract for the function. function _extend(bytes4 selector, address impl) private { ( LibSimpleFunctionRegistryStorage.Storage storage stor, LibProxyStorage.Storage storage proxyStor ) = _getStorages(); address oldImpl = proxyStor.impls[selector]; address[] storage history = stor.implHistory[selector]; history.push(oldImpl); proxyStor.impls[selector] = impl; emit ProxyFunctionUpdated(selector, oldImpl, impl); } /// @dev Get the storage buckets for this feature and the proxy. /// @return stor Storage bucket for this feature. /// @return proxyStor age bucket for the proxy. function _getStorages() private pure returns ( LibSimpleFunctionRegistryStorage.Storage storage stor, LibProxyStorage.Storage storage proxyStor ) { return ( LibSimpleFunctionRegistryStorage.getStorage(), LibProxyStorage.getStorage() ); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; library LibCommonRichErrors { // solhint-disable func-name-mixedcase function OnlyCallableBySelfError(address sender) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("OnlyCallableBySelfError(address)")), sender ); } function IllegalReentrancyError(bytes4 selector, uint256 reentrancyFlags) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("IllegalReentrancyError(bytes4,uint256)")), selector, reentrancyFlags ); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; /// @dev Basic registry management features. interface ISimpleFunctionRegistryFeature { /// @dev A function implementation was updated via `extend()` or `rollback()`. /// @param selector The function selector. /// @param oldImpl The implementation contract address being replaced. /// @param newImpl The replacement implementation contract address. event ProxyFunctionUpdated(bytes4 indexed selector, address oldImpl, address newImpl); /// @dev Roll back to a prior implementation of a function. /// @param selector The function selector. /// @param targetImpl The address of an older implementation of the function. function rollback(bytes4 selector, address targetImpl) external; /// @dev Register or replace a function. /// @param selector The function selector. /// @param impl The implementation contract for the function. function extend(bytes4 selector, address impl) external; /// @dev Retrieve the length of the rollback history for a function. /// @param selector The function selector. /// @return rollbackLength The number of items in the rollback history for /// the function. function getRollbackLength(bytes4 selector) external view returns (uint256 rollbackLength); /// @dev Retrieve an entry in the rollback history for a function. /// @param selector The function selector. /// @param idx The index in the rollback history. /// @return impl An implementation address for the function at /// index `idx`. function getRollbackEntryAtIndex(bytes4 selector, uint256 idx) external view returns (address impl); }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; interface IOwnableV06 { /// @dev Emitted by Ownable when ownership is transferred. /// @param previousOwner The previous owner of the contract. /// @param newOwner The new owner of the contract. event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @dev Transfers ownership of the contract to a new address. /// @param newOwner The address that will become the owner. function transferOwnership(address newOwner) external; /// @dev The owner of this contract. /// @return ownerAddress The owner address. function owner() external view returns (address ownerAddress); }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Modifications copyright (C) 2022 TheOpenDAO Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6; pragma experimental ABIEncoderV2; /// @dev Common storage helpers library LibStorage { /// @dev What to bit-shift a storage ID by to get its slot. /// This gives us a maximum of 2**128 inline fields in each bucket. uint256 private constant STORAGE_SLOT_EXP = 128; /// @dev Storage IDs for feature storage buckets. /// WARNING: APPEND-ONLY. enum StorageId { Proxy, SimpleFunctionRegistry, Ownable, TokenSpender, TransformERC20, MetaTransactions, ReentrancyGuard, NativeOrders, OtcOrders, ERC721Orders, ERC1155Orders, NFTAuctions } /// @dev Get the storage slot given a storage ID. We assign unique, well-spaced /// slots to storage bucket variables to ensure they do not overlap. /// See: https://solidity.readthedocs.io/en/v0.6.6/assembly.html#access-to-external-variables-functions-and-libraries /// @param storageId An entry in `StorageId` /// @return slot The storage slot. function getStorageSlot(StorageId storageId) internal pure returns (uint256 slot) { // This should never overflow with a reasonable `STORAGE_SLOT_EXP` // because Solidity will do a range check on `storageId` during the cast. return (uint256(storageId) + 1) << STORAGE_SLOT_EXP; } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; library LibProxyRichErrors { // solhint-disable func-name-mixedcase function NotImplementedError(bytes4 selector) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("NotImplementedError(bytes4)")), selector ); } function InvalidBootstrapCallerError(address actual, address expected) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("InvalidBootstrapCallerError(address,address)")), actual, expected ); } function InvalidDieCallerError(address actual, address expected) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("InvalidDieCallerError(address,address)")), actual, expected ); } function BootstrapCallFailedError(address target, bytes memory resultData) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("BootstrapCallFailedError(address,bytes)")), target, resultData ); } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "./LibStorage.sol"; /// @dev Storage helpers for the proxy contract. library LibProxyStorage { /// @dev Storage bucket for proxy contract. struct Storage { // Mapping of function selector -> function implementation mapping(bytes4 => address) impls; // The owner of the proxy contract. address owner; } /// @dev Get the storage bucket for this contract. function getStorage() internal pure returns (Storage storage stor) { uint256 storageSlot = LibStorage.getStorageSlot( LibStorage.StorageId.Proxy ); // Dip into assembly to change the slot pointed to by the local // variable `stor`. // See https://solidity.readthedocs.io/en/v0.6.8/assembly.html?highlight=slot#access-to-external-variables-functions-and-libraries assembly { stor_slot := storageSlot } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; pragma experimental ABIEncoderV2; import "./LibStorage.sol"; /// @dev Storage helpers for the `SimpleFunctionRegistry` feature. library LibSimpleFunctionRegistryStorage { /// @dev Storage bucket for this feature. struct Storage { // Mapping of function selector -> implementation history. mapping(bytes4 => address[]) implHistory; } /// @dev Get the storage bucket for this contract. function getStorage() internal pure returns (Storage storage stor) { uint256 storageSlot = LibStorage.getStorageSlot( LibStorage.StorageId.SimpleFunctionRegistry ); // Dip into assembly to change the slot pointed to by the local // variable `stor`. // See https://solidity.readthedocs.io/en/v0.6.8/assembly.html?highlight=slot#access-to-external-variables-functions-and-libraries assembly { stor_slot := storageSlot } } }
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.6.5; library LibSimpleFunctionRegistryRichErrors { // solhint-disable func-name-mixedcase function NotInRollbackHistoryError(bytes4 selector, address targetImpl) internal pure returns (bytes memory) { return abi.encodeWithSelector( bytes4(keccak256("NotInRollbackHistoryError(bytes4,address)")), selector, targetImpl ); } }
{ "optimizer": { "enabled": true, "runs": 1000000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"migrator","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"Migrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"FEATURE_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEATURE_VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bootstrap","outputs":[{"internalType":"bytes4","name":"success","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c0604052610011600160008061002d565b60a05234801561002057600080fd5b503060601b60805261005f565b6bffffffff0000000000000000604084901b1667ffffffff00000000602084901b161763ffffffff8216179392505050565b60805160601c60a051610cdb61008e6000398060fe52508061054452806105f452806106a45250610cdb6000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80638da5cb5b116100505780638da5cb5b146100bf578063f2fde38b146100d4578063fb969b0a146100e757610072565b8063031b905c14610077578063261fe679146100955780636ae4b4f7146100aa575b600080fd5b61007f6100fc565b60405161008c9190610c4b565b60405180910390f35b6100a86100a33660046109db565b610120565b005b6100b26102ed565b60405161008c9190610c38565b6100c7610326565b60405161008c9190610b14565b6100a86100e236600461099c565b61034c565b6100ef6104a0565b60405161008c9190610bc3565b7f000000000000000000000000000000000000000000000000000000000000000081565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561016857600080fd5b505afa15801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a091906109bf565b90503373ffffffffffffffffffffffffffffffffffffffff8216146101d1576101d16101cc3383610724565b6107df565b5073ffffffffffffffffffffffffffffffffffffffff81166101f8576101f86101cc6107e7565b6000610202610841565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001630178155604080516020601f870181900481028201810190925285815291925061026c918791879087908190840183828082843760009201919091525061085492505050565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161781556040517fe1b831b0e6f3aa16b4b1a6bd526b5cdeab4940744ca6e0251f5fe5f8caf1c81a906102de90339088908690610b35565b60405180910390a15050505050565b6040518060400160405280600781526020017f4f776e61626c650000000000000000000000000000000000000000000000000081525081565b6000610330610841565b5473ffffffffffffffffffffffffffffffffffffffff16905090565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561039457600080fd5b505afa1580156103a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cc91906109bf565b90503373ffffffffffffffffffffffffffffffffffffffff8216146103f8576103f86101cc3383610724565b506000610403610841565b905073ffffffffffffffffffffffffffffffffffffffff82166104305761042b6101cc6107e7565b61049c565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35b5050565b6000306104ab610841565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556040517f0ee8be1b0000000000000000000000000000000000000000000000000000000081523090630ee8be1b9061056c907ff2fde38b00000000000000000000000000000000000000000000000000000000907f000000000000000000000000000000000000000000000000000000000000000090600401610bf0565b600060405180830381600087803b15801561058657600080fd5b505af115801561059a573d6000803e3d6000fd5b50506040517f0ee8be1b000000000000000000000000000000000000000000000000000000008152309250630ee8be1b915061061c907f8da5cb5b00000000000000000000000000000000000000000000000000000000907f000000000000000000000000000000000000000000000000000000000000000090600401610bf0565b600060405180830381600087803b15801561063657600080fd5b505af115801561064a573d6000803e3d6000fd5b50506040517f0ee8be1b000000000000000000000000000000000000000000000000000000008152309250630ee8be1b91506106cc907f261fe67900000000000000000000000000000000000000000000000000000000907f000000000000000000000000000000000000000000000000000000000000000090600401610bf0565b600060405180830381600087803b1580156106e657600080fd5b505af11580156106fa573d6000803e3d6000fd5b507fd150751b00000000000000000000000000000000000000000000000000000000935050505090565b60607f1de45ad18e8a4484220a3ca14f4d977641addbaba5a344b1384dc2aa78a2e34d838360405160240161075a929190610b65565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152905092915050565b805160208201fd5b6040805160048152602481019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe69edc3e0000000000000000000000000000000000000000000000000000000017905290565b60008061084e600261094b565b92915050565b600060608373ffffffffffffffffffffffffffffffffffffffff168360405161087d9190610af8565b600060405180830381855af49150503d80600081146108b8576040519150601f19603f3d011682016040523d82523d6000602084013e6108bd565b606091505b50915091508115806108d157508051602014155b80610933575080517f2c64c5ef000000000000000000000000000000000000000000000000000000009061090e9083016020908101908401610a6e565b7fffffffff000000000000000000000000000000000000000000000000000000001614155b15610945576109456101cc8583610966565b50505050565b6000608082600b81111561095b57fe5b600101901b92915050565b60607ff74b11883dedd9755c2b93d5d172e1ad0300f9d700d2a708ba05e9fd9d4d1528838360405160240161075a929190610b8c565b6000602082840312156109ad578081fd5b81356109b881610c80565b9392505050565b6000602082840312156109d0578081fd5b81516109b881610c80565b600080600080606085870312156109f0578283fd5b84356109fb81610c80565b9350602085013567ffffffffffffffff80821115610a17578485fd5b818701915087601f830112610a2a578485fd5b813581811115610a38578586fd5b886020828501011115610a49578586fd5b6020830195508094505050506040850135610a6381610c80565b939692955090935050565b600060208284031215610a7f578081fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146109b8578182fd5b60008151808452610ac6816020860160208601610c54565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008251610b0a818460208701610c54565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff93841681529183166020830152909116604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff8416825260406020830152610bbb6040830184610aae565b949350505050565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b7fffffffff0000000000000000000000000000000000000000000000000000000092909216825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b6000602082526109b86020830184610aae565b90815260200190565b60005b83811015610c6f578181015183820152602001610c57565b838111156109455750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114610ca257600080fd5b5056fea26469706673582212209c0d3c5ebddfee38ec44598c199f4f167f451014f496fc1df8ac8b3f1800e22664736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c80638da5cb5b116100505780638da5cb5b146100bf578063f2fde38b146100d4578063fb969b0a146100e757610072565b8063031b905c14610077578063261fe679146100955780636ae4b4f7146100aa575b600080fd5b61007f6100fc565b60405161008c9190610c4b565b60405180910390f35b6100a86100a33660046109db565b610120565b005b6100b26102ed565b60405161008c9190610c38565b6100c7610326565b60405161008c9190610b14565b6100a86100e236600461099c565b61034c565b6100ef6104a0565b60405161008c9190610bc3565b7f000000000000000000000000000000000000000000000001000000000000000081565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561016857600080fd5b505afa15801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a091906109bf565b90503373ffffffffffffffffffffffffffffffffffffffff8216146101d1576101d16101cc3383610724565b6107df565b5073ffffffffffffffffffffffffffffffffffffffff81166101f8576101f86101cc6107e7565b6000610202610841565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001630178155604080516020601f870181900481028201810190925285815291925061026c918791879087908190840183828082843760009201919091525061085492505050565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161781556040517fe1b831b0e6f3aa16b4b1a6bd526b5cdeab4940744ca6e0251f5fe5f8caf1c81a906102de90339088908690610b35565b60405180910390a15050505050565b6040518060400160405280600781526020017f4f776e61626c650000000000000000000000000000000000000000000000000081525081565b6000610330610841565b5473ffffffffffffffffffffffffffffffffffffffff16905090565b60003073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561039457600080fd5b505afa1580156103a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cc91906109bf565b90503373ffffffffffffffffffffffffffffffffffffffff8216146103f8576103f86101cc3383610724565b506000610403610841565b905073ffffffffffffffffffffffffffffffffffffffff82166104305761042b6101cc6107e7565b61049c565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35b5050565b6000306104ab610841565b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556040517f0ee8be1b0000000000000000000000000000000000000000000000000000000081523090630ee8be1b9061056c907ff2fde38b00000000000000000000000000000000000000000000000000000000907f00000000000000000000000030a2db8e7dbc4aa0dc8a098e04a5e07a5162ecf490600401610bf0565b600060405180830381600087803b15801561058657600080fd5b505af115801561059a573d6000803e3d6000fd5b50506040517f0ee8be1b000000000000000000000000000000000000000000000000000000008152309250630ee8be1b915061061c907f8da5cb5b00000000000000000000000000000000000000000000000000000000907f00000000000000000000000030a2db8e7dbc4aa0dc8a098e04a5e07a5162ecf490600401610bf0565b600060405180830381600087803b15801561063657600080fd5b505af115801561064a573d6000803e3d6000fd5b50506040517f0ee8be1b000000000000000000000000000000000000000000000000000000008152309250630ee8be1b91506106cc907f261fe67900000000000000000000000000000000000000000000000000000000907f00000000000000000000000030a2db8e7dbc4aa0dc8a098e04a5e07a5162ecf490600401610bf0565b600060405180830381600087803b1580156106e657600080fd5b505af11580156106fa573d6000803e3d6000fd5b507fd150751b00000000000000000000000000000000000000000000000000000000935050505090565b60607f1de45ad18e8a4484220a3ca14f4d977641addbaba5a344b1384dc2aa78a2e34d838360405160240161075a929190610b65565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152905092915050565b805160208201fd5b6040805160048152602481019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe69edc3e0000000000000000000000000000000000000000000000000000000017905290565b60008061084e600261094b565b92915050565b600060608373ffffffffffffffffffffffffffffffffffffffff168360405161087d9190610af8565b600060405180830381855af49150503d80600081146108b8576040519150601f19603f3d011682016040523d82523d6000602084013e6108bd565b606091505b50915091508115806108d157508051602014155b80610933575080517f2c64c5ef000000000000000000000000000000000000000000000000000000009061090e9083016020908101908401610a6e565b7fffffffff000000000000000000000000000000000000000000000000000000001614155b15610945576109456101cc8583610966565b50505050565b6000608082600b81111561095b57fe5b600101901b92915050565b60607ff74b11883dedd9755c2b93d5d172e1ad0300f9d700d2a708ba05e9fd9d4d1528838360405160240161075a929190610b8c565b6000602082840312156109ad578081fd5b81356109b881610c80565b9392505050565b6000602082840312156109d0578081fd5b81516109b881610c80565b600080600080606085870312156109f0578283fd5b84356109fb81610c80565b9350602085013567ffffffffffffffff80821115610a17578485fd5b818701915087601f830112610a2a578485fd5b813581811115610a38578586fd5b886020828501011115610a49578586fd5b6020830195508094505050506040850135610a6381610c80565b939692955090935050565b600060208284031215610a7f578081fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146109b8578182fd5b60008151808452610ac6816020860160208601610c54565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008251610b0a818460208701610c54565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff93841681529183166020830152909116604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff8416825260406020830152610bbb6040830184610aae565b949350505050565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b7fffffffff0000000000000000000000000000000000000000000000000000000092909216825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b6000602082526109b86020830184610aae565b90815260200190565b60005b83811015610c6f578181015183820152602001610c57565b838111156109455750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114610ca257600080fd5b5056fea26469706673582212209c0d3c5ebddfee38ec44598c199f4f167f451014f496fc1df8ac8b3f1800e22664736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.