ETH Price: $1,615.50 (+1.52%)
Gas: 9 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040135424132021-11-03 6:51:23694 days 1 hr ago1635922283IN
 Create: OwnershipFacet
0 ETH0.02740925122

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OwnershipFacet

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 4 : OwnershipFacet.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;

import "../libraries/LibOwnership.sol";
import "../interfaces/IERC173.sol";

contract OwnershipFacet is IERC173 {
    function transferOwnership(address _newOwner) external override {
        LibOwnership.enforceIsContractOwner();
        LibOwnership.setContractOwner(_newOwner);
    }

    function owner() external override view returns (address owner_) {
        owner_ = LibOwnership.contractOwner();
    }
}

File 2 of 4 : LibOwnership.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import "./LibDiamondStorage.sol";

library LibOwnership {
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    function setContractOwner(address _newOwner) internal {
        LibDiamondStorage.DiamondStorage storage ds = LibDiamondStorage.diamondStorage();

        address previousOwner = ds.contractOwner;
        require(previousOwner != _newOwner, "Previous owner and new owner must be different");

        ds.contractOwner = _newOwner;

        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = LibDiamondStorage.diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() view internal {
        require(msg.sender == LibDiamondStorage.diamondStorage().contractOwner, "Must be contract owner");
    }

    modifier onlyOwner {
        require(msg.sender == LibDiamondStorage.diamondStorage().contractOwner, "Must be contract owner");
        _;
    }
}

File 3 of 4 : IERC173.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

File 4 of 4 : LibDiamondStorage.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

library LibDiamondStorage {
    bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");

    struct Facet {
        address facetAddress;
        uint16 selectorPosition;
    }

    struct DiamondStorage {
        // function selector => facet address and selector position in selectors array
        mapping(bytes4 => Facet) facets;
        bytes4[] selectors;

        // ERC165
        mapping(bytes4 => bool) supportedInterfaces;

        // owner of the contract
        address contractOwner;
    }

    function diamondStorage() internal pure returns (DiamondStorage storage ds) {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 9999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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":"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"}]

608060405234801561001057600080fd5b5061031f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80638da5cb5b1461003b578063f2fde38b1461006c575b600080fd5b6100436100a1565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61009f6004803603602081101561008257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100b0565b005b60006100ab6100c4565b905090565b6100b86100ed565b6100c181610152565b50565b60006100ce610231565b6003015473ffffffffffffffffffffffffffffffffffffffff16919050565b6100f5610231565b6003015473ffffffffffffffffffffffffffffffffffffffff163314610150576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610147906102b2565b60405180910390fd5b565b600061015c610231565b600381015490915073ffffffffffffffffffffffffffffffffffffffff9081169083168114156101b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014790610255565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85811691821790925560405190918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b6020808252602e908201527f50726576696f7573206f776e657220616e64206e6577206f776e6572206d757360408201527f7420626520646966666572656e74000000000000000000000000000000000000606082015260800190565b60208082526016908201527f4d75737420626520636f6e7472616374206f776e65720000000000000000000060408201526060019056fea2646970667358221220b3ef1bdabbaf4b0f7b6d8ba13834cc4fee9dcdb182cd61d491cdb5641108b98f64736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c80638da5cb5b1461003b578063f2fde38b1461006c575b600080fd5b6100436100a1565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61009f6004803603602081101561008257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100b0565b005b60006100ab6100c4565b905090565b6100b86100ed565b6100c181610152565b50565b60006100ce610231565b6003015473ffffffffffffffffffffffffffffffffffffffff16919050565b6100f5610231565b6003015473ffffffffffffffffffffffffffffffffffffffff163314610150576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610147906102b2565b60405180910390fd5b565b600061015c610231565b600381015490915073ffffffffffffffffffffffffffffffffffffffff9081169083168114156101b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014790610255565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85811691821790925560405190918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b6020808252602e908201527f50726576696f7573206f776e657220616e64206e6577206f776e6572206d757360408201527f7420626520646966666572656e74000000000000000000000000000000000000606082015260800190565b60208082526016908201527f4d75737420626520636f6e7472616374206f776e65720000000000000000000060408201526060019056fea2646970667358221220b3ef1bdabbaf4b0f7b6d8ba13834cc4fee9dcdb182cd61d491cdb5641108b98f64736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.