Contract 0xC9518AF576d13c0121DD5d160c3E87AB8f3E6944

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xcebd5eb33dfc50bf3ab5c007dcd624fd5e7fafb34c6f138be40af1ed387114afSet Subnode Owne...43227542022-08-25 10:16:44553 days 23 hrs agoCronos ID: Deployer IN  Cronos ID: CROID Root0 CRO0.308889770150
0x60d417c685e93f06cab1742cf58a41138a73130b84a08d4bc8edcde6fed04a9dSet Subnode Owne...43227522022-08-25 10:16:33553 days 23 hrs agoCronos ID: Deployer IN  Cronos ID: CROID Root0 CRO0.3089489699760
0x3b2c0cd73889f80c42b5804ccbe69817c068cbd14e55707216fec1137b8d3232Set Controller43227332022-08-25 10:14:45553 days 23 hrs agoCronos ID: Deployer IN  Cronos ID: CROID Root0 CRO0.2434475712740
0x4bdb00d1292f458f3816c2b72129e6bd4833cbebddb74f5cda36c41a67b5f6cb0x6080604043227292022-08-25 10:14:22553 days 23 hrs agoCronos ID: Deployer IN  Create: CROIDRoot0 CRO3.2889842408290
[ Download CSV Export 
Parent Txn Hash Block From To Value
Index Block
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CROIDRoot

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
File 1 of 5 : CROIDRoot.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./CROID.sol";
import "./utils/Controllable.sol";

contract CROIDRoot is Ownable, Controllable {
    bytes32 private constant ROOT_NODE = bytes32(0);

    bytes4 private constant INTERFACE_META_ID =
        bytes4(keccak256("supportsInterface(bytes4)"));

    event TLDLocked(bytes32 indexed label);

    CROID public croid;
    mapping(bytes32 => bool) public locked;

    constructor(CROID _croid) {
        croid = _croid;
    }

    function setSubnodeOwner(bytes32 label, address owner)
        external
        onlyController
    {
        require(!locked[label]);
        croid.setSubnodeOwner(ROOT_NODE, label, owner);
    }

    function setResolver(address resolver) external onlyOwner {
        croid.setResolver(ROOT_NODE, resolver);
    }

    function lock(bytes32 label) external onlyOwner {
        emit TLDLocked(label);
        locked[label] = true;
    }

    function supportsInterface(bytes4 interfaceID)
        external
        pure
        returns (bool)
    {
        return interfaceID == INTERFACE_META_ID;
    }
}

File 2 of 5 : CROID.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface CROID {
    // Logged when the owner of a node assigns a new owner to a subnode.
    event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);

    // Logged when the owner of a node transfers ownership to a new account.
    event Transfer(bytes32 indexed node, address owner);

    // Logged when the resolver for a node changes.
    event NewResolver(bytes32 indexed node, address resolver);

    // Logged when the TTL of a node changes
    event NewTTL(bytes32 indexed node, uint64 ttl);

    // Logged when an operator is added or removed.
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );

    function setRecord(
        bytes32 node,
        address owner,
        address resolver,
        uint64 ttl
    ) external;

    function setSubnodeRecord(
        bytes32 node,
        bytes32 label,
        address owner,
        address resolver,
        uint64 ttl
    ) external;

    function setSubnodeOwner(
        bytes32 node,
        bytes32 label,
        address owner
    ) external returns (bytes32);

    function setResolver(bytes32 node, address resolver) external;

    function setOwner(bytes32 node, address owner) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function setApprovalForAll(address operator, bool approved) external;

    function owner(bytes32 node) external view returns (address);

    function resolver(bytes32 node) external view returns (address);

    function ttl(bytes32 node) external view returns (uint64);

    function recordExists(bytes32 node) external view returns (bool);

    function isApprovedForAll(address owner, address operator)
        external
        view
        returns (bool);
}

File 3 of 5 : Controllable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/Ownable.sol";

contract Controllable is Ownable {
    mapping(address => bool) public controllers;

    event ControllerChanged(address indexed controller, bool enabled);

    modifier onlyController {
        require(
            controllers[msg.sender],
            "Controllable: Caller is not a controller"
        );
        _;
    }

    function setController(address controller, bool enabled) public onlyOwner {
        controllers[controller] = enabled;
        emit ControllerChanged(controller, enabled);
    }
}

File 4 of 5 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 5 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"contract CROID","name":"_croid","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ControllerChanged","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"}],"name":"TLDLocked","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"croid","outputs":[{"internalType":"contract CROID","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"label","type":"bytes32"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610b2e380380610b2e83398101604081905261002f916100ad565b6100383361005d565b600280546001600160a01b0319166001600160a01b03929092169190911790556100dd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100bf57600080fd5b81516001600160a01b03811681146100d657600080fd5b9392505050565b610a42806100ec6000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638cb8ecec11610081578063da8c229e1161005b578063da8c229e14610201578063e0dba60f14610224578063f2fde38b1461023757600080fd5b80638cb8ecec146101ad5780638da5cb5b146101c0578063cbe9e764146101de57600080fd5b80634e543b26116100b25780634e543b261461014d57806362339ae714610160578063715018a6146101a557600080fd5b806301670ba9146100ce57806301ffc9a7146100e3575b600080fd5b6100e16100dc3660046108e5565b61024a565b005b6101386100f13660046108fe565b7fffffffff00000000000000000000000000000000000000000000000000000000167f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b6100e161015b366004610970565b610334565b6002546101809073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610144565b6100e1610444565b6100e16101bb36600461098b565b6104d1565b60005473ffffffffffffffffffffffffffffffffffffffff16610180565b6101386101ec3660046108e5565b60036020526000908152604090205460ff1681565b61013861020f366004610970565b60016020526000908152604090205460ff1681565b6100e16102323660046109b7565b610635565b6100e1610245366004610970565b610740565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60405181907f1764176cfa565853ba1ded547a830a9f9bff95231ef6fd228b3ddd617577756990600090a2600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b6002546040517f1896f70a0000000000000000000000000000000000000000000000000000000081526000600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015290911690631896f70a90604401600060405180830381600087803b15801561042957600080fd5b505af115801561043d573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b6104cf6000610870565b565b3360009081526001602052604090205460ff16610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016102c7565b60008281526003602052604090205460ff161561058c57600080fd5b6002546040517f06ab5923000000000000000000000000000000000000000000000000000000008152600060048201526024810184905273ffffffffffffffffffffffffffffffffffffffff8381166044830152909116906306ab5923906064016020604051808303816000875af115801561060c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063091906109f3565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b73ffffffffffffffffffffffffffffffffffffffff8116610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102c7565b61086d81610870565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156108f757600080fd5b5035919050565b60006020828403121561091057600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094057600080fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461096b57600080fd5b919050565b60006020828403121561098257600080fd5b61094082610947565b6000806040838503121561099e57600080fd5b823591506109ae60208401610947565b90509250929050565b600080604083850312156109ca57600080fd5b6109d383610947565b9150602083013580151581146109e857600080fd5b809150509250929050565b600060208284031215610a0557600080fd5b505191905056fea26469706673582212204acaf335addd178c4c9bd1235eb76d02fc2a052b8e608558d5704505c0ccf9cd64736f6c634300080d00330000000000000000000000007f4c61116729d5b27e5f180062fdfbf32e9283e5

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80638cb8ecec11610081578063da8c229e1161005b578063da8c229e14610201578063e0dba60f14610224578063f2fde38b1461023757600080fd5b80638cb8ecec146101ad5780638da5cb5b146101c0578063cbe9e764146101de57600080fd5b80634e543b26116100b25780634e543b261461014d57806362339ae714610160578063715018a6146101a557600080fd5b806301670ba9146100ce57806301ffc9a7146100e3575b600080fd5b6100e16100dc3660046108e5565b61024a565b005b6101386100f13660046108fe565b7fffffffff00000000000000000000000000000000000000000000000000000000167f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b6100e161015b366004610970565b610334565b6002546101809073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610144565b6100e1610444565b6100e16101bb36600461098b565b6104d1565b60005473ffffffffffffffffffffffffffffffffffffffff16610180565b6101386101ec3660046108e5565b60036020526000908152604090205460ff1681565b61013861020f366004610970565b60016020526000908152604090205460ff1681565b6100e16102323660046109b7565b610635565b6100e1610245366004610970565b610740565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60405181907f1764176cfa565853ba1ded547a830a9f9bff95231ef6fd228b3ddd617577756990600090a2600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b6002546040517f1896f70a0000000000000000000000000000000000000000000000000000000081526000600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015290911690631896f70a90604401600060405180830381600087803b15801561042957600080fd5b505af115801561043d573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b6104cf6000610870565b565b3360009081526001602052604090205460ff16610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016102c7565b60008281526003602052604090205460ff161561058c57600080fd5b6002546040517f06ab5923000000000000000000000000000000000000000000000000000000008152600060048201526024810184905273ffffffffffffffffffffffffffffffffffffffff8381166044830152909116906306ab5923906064016020604051808303816000875af115801561060c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063091906109f3565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b73ffffffffffffffffffffffffffffffffffffffff8116610864576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102c7565b61086d81610870565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156108f757600080fd5b5035919050565b60006020828403121561091057600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094057600080fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461096b57600080fd5b919050565b60006020828403121561098257600080fd5b61094082610947565b6000806040838503121561099e57600080fd5b823591506109ae60208401610947565b90509250929050565b600080604083850312156109ca57600080fd5b6109d383610947565b9150602083013580151581146109e857600080fd5b809150509250929050565b600060208284031215610a0557600080fd5b505191905056fea26469706673582212204acaf335addd178c4c9bd1235eb76d02fc2a052b8e608558d5704505c0ccf9cd64736f6c634300080d0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000007f4c61116729d5b27e5f180062fdfbf32e9283e5

-----Decoded View---------------
Arg [0] : _croid (address): 0x7f4c61116729d5b27e5f180062fdfbf32e9283e5

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f4c61116729d5b27e5f180062fdfbf32e9283e5


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.