ETH Price: $3,311.48 (-3.16%)
Gas: 14 Gwei

Contract

0x78D47E6Ceca8d20B1DB1B831B84244a5D7871A64
 

Overview

ETH Balance

4.107926686915528854 ETH

Eth Value

$13,603.31 (@ $3,311.48/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Register With Co...186873312023-11-30 22:15:23215 days ago1701382523IN
0x78D47E6C...5D7871A64
0.02685996 ETH0.0256685779.23476616
Commit186873142023-11-30 22:11:59215 days ago1701382319IN
0x78D47E6C...5D7871A64
0 ETH0.0033529672.38703763
Renew183863012023-10-19 18:54:59257 days ago1697741699IN
0x78D47E6C...5D7871A64
0.00704278 ETH0.001014039.1817238
Release To Owner183732252023-10-17 22:59:11259 days ago1697583551IN
0x78D47E6C...5D7871A64
0 ETH0.000635476.34855182
Release To Owner183212932023-10-10 16:37:11267 days ago1696955831IN
0x78D47E6C...5D7871A64
0 ETH0.0010114210.10561675
Renew182847272023-10-05 13:52:11272 days ago1696513931IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.0012384411.09388544
Renew182846812023-10-05 13:42:59272 days ago1696513379IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.001092449.83855411
Renew182846722023-10-05 13:41:11272 days ago1696513271IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.0011465110.43860388
Renew182846612023-10-05 13:38:59272 days ago1696513139IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.0011396510.26370037
Renew182846472023-10-05 13:36:11272 days ago1696512971IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.001066879.60828529
Renew182846422023-10-05 13:35:11272 days ago1696512911IN
0x78D47E6C...5D7871A64
0.00669462 ETH0.0011871210.66263242
Renew182685432023-10-03 7:32:47274 days ago1696318367IN
0x78D47E6C...5D7871A64
0.00658761 ETH0.000710646.41731852
Renew182483982023-09-30 12:03:23277 days ago1696075403IN
0x78D47E6C...5D7871A64
0.00655925 ETH0.000842877.67404382
Renew182330842023-09-28 8:36:11279 days ago1695890171IN
0x78D47E6C...5D7871A64
0.00679929 ETH0.0014079210.50315437
Renew181003472023-09-09 17:33:47297 days ago1694280827IN
0x78D47E6C...5D7871A64
0.13455237 ETH0.001041499.53421378
Release To Owner177694362023-07-25 10:12:11344 days ago1690279931IN
0x78D47E6C...5D7871A64
0 ETH0.0015488223.5080144
Release To Owner177648802023-07-24 18:54:47344 days ago1690224887IN
0x78D47E6C...5D7871A64
0 ETH0.0027896740.79367546
Renew177541932023-07-23 7:01:23346 days ago1690095683IN
0x78D47E6C...5D7871A64
0.01760417 ETH0.0016142914.57906148
Register With Co...169801702023-04-05 4:14:59455 days ago1680668099IN
0x78D47E6C...5D7871A64
0.01733839 ETH0.0095840530.99159618
Commit169791332023-04-05 0:44:47455 days ago1680655487IN
0x78D47E6C...5D7871A64
0 ETH0.0021192345.75213175
Release To Owner167940622023-03-10 0:00:11481 days ago1678406411IN
0x78D47E6C...5D7871A64
0 ETH0.0028899528.87154527
Commit167867982023-03-08 23:29:47482 days ago1678318187IN
0x78D47E6C...5D7871A64
0 ETH0.0018996641.01167366
Register Reserve...167829362023-03-08 10:25:47483 days ago1678271147IN
0x78D47E6C...5D7871A64
0.00353559 ETH0.0061262118.6020612
Commit167157072023-02-26 23:34:59492 days ago1677454499IN
0x78D47E6C...5D7871A64
0 ETH0.0010879523.48784543
Release To Owner167145002023-02-26 19:31:23492 days ago1677439883IN
0x78D47E6C...5D7871A64
0 ETH0.0022575722.55384466
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
190133082024-01-15 15:54:47170 days ago1705334087
0x78D47E6C...5D7871A64
0.00398352 ETH
186873312023-11-30 22:15:23215 days ago1701382523
0x78D47E6C...5D7871A64
0.00244181 ETH
183863012023-10-19 18:54:59257 days ago1697741699
0x78D47E6C...5D7871A64
0.00064025 ETH
183732252023-10-17 22:59:11259 days ago1697583551
0x78D47E6C...5D7871A64
0.00052939 ETH
183212932023-10-10 16:37:11267 days ago1696955831
0x78D47E6C...5D7871A64
0.06306163 ETH
182847272023-10-05 13:52:11272 days ago1696513931
0x78D47E6C...5D7871A64
0.0006086 ETH
182846812023-10-05 13:42:59272 days ago1696513379
0x78D47E6C...5D7871A64
0.0006086 ETH
182846722023-10-05 13:41:11272 days ago1696513271
0x78D47E6C...5D7871A64
0.0006086 ETH
182846612023-10-05 13:38:59272 days ago1696513139
0x78D47E6C...5D7871A64
0.0006086 ETH
182846472023-10-05 13:36:11272 days ago1696512971
0x78D47E6C...5D7871A64
0.0006086 ETH
182846422023-10-05 13:35:11272 days ago1696512911
0x78D47E6C...5D7871A64
0.0006086 ETH
182685432023-10-03 7:32:47274 days ago1696318367
0x78D47E6C...5D7871A64
0.00059887 ETH
182483982023-09-30 12:03:23277 days ago1696075403
0x78D47E6C...5D7871A64
0.00059629 ETH
182330842023-09-28 8:36:11279 days ago1695890171
0x78D47E6C...5D7871A64
0.00061811 ETH
181003472023-09-09 17:33:47297 days ago1694280827
0x78D47E6C...5D7871A64
0.01223203 ETH
177694362023-07-25 10:12:11344 days ago1690279931
0x78D47E6C...5D7871A64
0.02535954 ETH
177648802023-07-24 18:54:47344 days ago1690224887
0x78D47E6C...5D7871A64
0.00486224 ETH
177541932023-07-23 7:01:23346 days ago1690095683
0x78D47E6C...5D7871A64
0.00160037 ETH
169801702023-04-05 4:14:59455 days ago1680668099
0x78D47E6C...5D7871A64
0.00164276 ETH
169602182023-04-02 8:27:23458 days ago1680424043
0x78D47E6C...5D7871A64
0.00164679 ETH
168749852023-03-21 8:59:11470 days ago1679389151
0x78D47E6C...5D7871A64
0.00573937 ETH
168686752023-03-20 11:45:47471 days ago1679312747
0x78D47E6C...5D7871A64
0.00558792 ETH
167940622023-03-10 0:00:11481 days ago1678406411
0x78D47E6C...5D7871A64
0.00937267 ETH
167829362023-03-08 10:25:47483 days ago1678271147
0x78D47E6C...5D7871A64
0.00032141 ETH
167145002023-02-26 19:31:23492 days ago1677439883
0x78D47E6C...5D7871A64
0.00717977 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UniversalRegistrarControllerV2

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 43 : UniversalRegistrarControllerV2.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

import "@ensdomains/ens-contracts/contracts/resolvers/Resolver.sol";
import "../common/StringUtils.sol";
import "../common/PremiumPriceOracle.sol";
import "./NameStore.sol";
import "./BaseUniversalRegistrarControllerV2.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @dev A registrar controller for registering and renewing second level domains.
 */
contract UniversalRegistrarControllerV2 is Ownable, BaseUniversalRegistrarControllerV2 {
    using StringUtils for *;

    uint constant public MIN_REGISTRATION_DURATION = 28 days;

    bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
    bytes4 constant private COMMITMENT_CONTROLLER_ID = bytes4(
        keccak256("rentPrice(bytes32,string,uint256)") ^
        keccak256("available(bytes32,string)") ^
        keccak256("makeCommitment(bytes32,string,address,bytes32)") ^
        keccak256("commit(bytes32)") ^
        keccak256("register(bytes32,string,address,uint256,bytes32)") ^
        keccak256("renew(bytes32,string,uint256)")
    );

    bytes4 constant private COMMITMENT_WITH_CONFIG_CONTROLLER_ID = bytes4(
        keccak256("registerWithConfig(bytes32,string,address,uint256,bytes32,address,address)") ^
        keccak256("makeCommitmentWithConfig(bytes32,string,address,bytes32,address,address)")
    );

    bytes4 constant private RESERVED_NAMES_CONTROLLER_ID = bytes4(
        keccak256("registerReservedWithConfig(bytes32,string,address,uint256,address,address)") ^
        keccak256("availabilityInfo(bytes32,string)")
    );

    PremiumPriceOracle prices;
    NameStore store;
    uint public minCommitmentAge;
    uint public maxCommitmentAge;

    mapping(bytes32 => uint) public commitments;

    event NameRegistered(bytes32 indexed tld, string name, bytes32 indexed label, address indexed owner, uint cost, uint expires);
    event NameRenewed(bytes32 indexed tld, string name, bytes32 indexed label, uint cost, uint expires);
    event NewPriceOracle(address indexed oracle);

    constructor(
        UniversalRegistrar base_,
        PremiumPriceOracle prices_,
        NameStore store_,
        uint minCommitmentAge_,
        uint maxCommitmentAge_,
        uint256 ownerShare_,
        uint256 registryShare_
    ) BaseUniversalRegistrarControllerV2(base_, ownerShare_, registryShare_) {
        require(maxCommitmentAge_ > minCommitmentAge_);

        store = store_;
        prices = prices_;
        minCommitmentAge = minCommitmentAge_;
        maxCommitmentAge = maxCommitmentAge_;
    }

    function _tokenID(bytes32 node, bytes32 label) internal pure returns (uint256) {
        return uint256(keccak256(abi.encodePacked(node, label)));
    }

    function rentPrice(bytes32 node, string memory name, uint duration) view public returns (uint) {
        bytes32 label = keccak256(bytes(name));
        return prices.price(node, name, base.nameExpires(_tokenID(node, label)), duration);
    }

    function valid(string memory name) public pure returns (bool) {
        return name.strlen() >= 1;
    }

    function available(bytes32 node, string memory name) public view returns (bool) {
        bytes32 label = keccak256(bytes(name));
        return _available(node, name, label) && store.available(node, label);
    }

    function _available(bytes32 node, string memory name, bytes32 label) internal view returns(bool) {
        return valid(name) && base.available(_tokenID(node, label));
    }

    // 0 - unavailable, 1 - available, 2 - reserved, 3 - paused
    function availabilityInfo(bytes32 node, string memory name) public view returns (uint8, address) {
        bytes32 label = keccak256(bytes(name));

        if (!valid(name) ||
            !base.available(_tokenID(node, label))) {
            return (0, address(0));
        }
        if (store.reserved(node, label) != address(0)) {
            return (2, store.reserved(node, label));
        }
        if (store.registrationsPaused(node)) {
            return (3, address(0));
        }
        return (1, address(0));
    }

    function makeCommitment(bytes32 node, string memory name, address owner, bytes32 secret) pure public returns (bytes32) {
        return makeCommitmentWithConfig(node, name, owner, secret, address(0), address(0));
    }

    function makeCommitmentWithConfig(bytes32 node, string memory name,
        address owner, bytes32 secret, address resolver, address addr) pure public returns (bytes32) {
        bytes32 label = keccak256(bytes(name));
        return _makeCommitmentWithConfig(node, label, owner, secret, resolver, addr);
    }

    function _makeCommitmentWithConfig(bytes32 node, bytes32 label,
        address owner, bytes32 secret, address resolver, address addr) pure internal returns (bytes32) {
        if (resolver == address(0) && addr == address(0)) {
            return keccak256(abi.encodePacked(node, label, owner, secret));
        }
        require(resolver != address(0));
        return keccak256(abi.encodePacked(node, label, owner, resolver, addr, secret));
    }

    function commit(bytes32 commitment) public {
        require(commitments[commitment] + maxCommitmentAge < block.timestamp);
        commitments[commitment] = block.timestamp;
    }

    function register(bytes32 node, string calldata name, address owner, uint duration, bytes32 secret) external payable {
        registerWithConfig(node, name, owner, duration, secret, address(0), address(0));
    }

    function registerWithConfig(bytes32 node, string memory name, address owner,
        uint duration, bytes32 secret, address resolver, address addr) public payable {

        bytes32 label = keccak256(bytes(name));
        uint cost = _consumeCommitment
        (
            node,
            name,
            label,
            duration,
            _makeCommitmentWithConfig(node, label, owner, secret, resolver, addr)
        );

        store.adopt(node, label);

        uint expires;
        if (resolver != address(0)) {
            // Set this contract as the (temporary) owner, giving it
            // permission to set up the resolver.
            expires = base.register(node, label, address(this), duration);

            // The nodehash of this label
            bytes32 nodehash = keccak256(abi.encodePacked(node, label));

            // Set the resolver
            base.ens().setResolver(nodehash, resolver);

            // Configure the resolver
            if (addr != address(0)) {
                Resolver(resolver).setAddr(nodehash, addr);
            }

            // Now transfer full ownership to the expeceted owner
            base.reclaim(node, label, owner);
            base.transferFrom(address(this), owner, uint256(nodehash));
        } else {
            require(addr == address(0));
            expires = base.register(node, label, owner, duration);
        }

        // Record revenue generated by this node
        _addPayment(node, cost);

        emit NameRegistered(node, name, label, owner, cost, expires);

        // Refund any extra payment
        if (msg.value > cost) {
            payable(msg.sender).transfer(msg.value - cost);
        }
    }

    function registerReservedWithConfig(bytes32 node, string memory name, address owner,
        uint duration, address resolver, address addr) public payable {
        bytes32 label = keccak256(bytes(name));
        require(_available(node, name, label) && !store.registrationsPaused(node));
        require(store.reserved(node, label) == msg.sender, "unauthorised to register reserved name");

        uint cost = rentPrice(node, name, duration);
        require(duration >= MIN_REGISTRATION_DURATION);
        require(msg.value >= cost);

        store.adopt(node, label);

        // address is no longer reserved once registered
        store.reserve(node, name, address(0));

        uint expires;
        if (resolver != address(0)) {
            // Set this contract as the (temporary) owner, giving it
            // permission to set up the resolver.
            expires = base.register(node, label, address(this), duration);

            // The nodehash of this label
            bytes32 nodehash = keccak256(abi.encodePacked(node, label));

            // Set the resolver
            base.ens().setResolver(nodehash, resolver);

            // Configure the resolver
            if (addr != address(0)) {
                Resolver(resolver).setAddr(nodehash, addr);
            }

            // Now transfer full ownership to the expeceted owner
            base.reclaim(node, label, owner);
            base.transferFrom(address(this), owner, uint256(nodehash));
        } else {
            require(addr == address(0));
            expires = base.register(node, label, owner, duration);
        }

        // Record revenue generated by this node
        _addPayment(node, cost);

        emit NameRegistered(node, name, label, owner, cost, expires);

        // Refund any extra payment
        if (msg.value > cost) {
            payable(msg.sender).transfer(msg.value - cost);
        }
    }

    function renew(bytes32 node, string calldata name, uint duration) external payable {
        uint cost = rentPrice(node, name, duration);
        require(msg.value >= cost);

        bytes32 label = keccak256(bytes(name));
        uint expires = base.renew(node, label, duration);

        // Record revenue generated by this node
        _addPayment(node, cost);

        if (msg.value > cost) {
            payable(msg.sender).transfer(msg.value - cost);
        }

        emit NameRenewed(node, name, label, cost, expires);
    }

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

    function _consumeCommitment(bytes32 node, string memory name, bytes32 label, uint duration, bytes32 commitment) internal returns (uint256) {
        // Require a valid commitment
        require(commitments[commitment] + minCommitmentAge <= block.timestamp);

        // If the commitment is too old, or the name is registered, stop
        require(commitments[commitment] + maxCommitmentAge > block.timestamp);
        require(_available(node, name, label) && store.available(node, label));

        delete (commitments[commitment]);

        uint cost = rentPrice(node, name, duration);
        require(duration >= MIN_REGISTRATION_DURATION);
        require(msg.value >= cost);

        return cost;
    }
}

File 2 of 43 : ENS.sol
pragma solidity >=0.8.4;

interface ENS {

    // 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 virtual;
    function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external virtual;
    function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external virtual returns(bytes32);
    function setResolver(bytes32 node, address resolver) external virtual;
    function setOwner(bytes32 node, address owner) external virtual;
    function setTTL(bytes32 node, uint64 ttl) external virtual;
    function setApprovalForAll(address operator, bool approved) external virtual;
    function owner(bytes32 node) external virtual view returns (address);
    function resolver(bytes32 node) external virtual view returns (address);
    function ttl(bytes32 node) external virtual view returns (uint64);
    function recordExists(bytes32 node) external virtual view returns (bool);
    function isApprovedForAll(address owner, address operator) external virtual view returns (bool);
}

File 3 of 43 : ENSRegistry.sol
pragma solidity >=0.8.4;

import "./ENS.sol";

/**
 * The ENS registry contract.
 */
contract ENSRegistry is ENS {

    struct Record {
        address owner;
        address resolver;
        uint64 ttl;
    }

    mapping (bytes32 => Record) records;
    mapping (address => mapping(address => bool)) operators;

    // Permits modifications only by the owner of the specified node.
    modifier authorised(bytes32 node) {
        address owner = records[node].owner;
        require(owner == msg.sender || operators[owner][msg.sender]);
        _;
    }

    /**
     * @dev Constructs a new ENS registrar.
     */
    constructor() public {
        records[0x0].owner = msg.sender;
    }

    /**
     * @dev Sets the record for a node.
     * @param node The node to update.
     * @param owner The address of the new owner.
     * @param resolver The address of the resolver.
     * @param ttl The TTL in seconds.
     */
    function setRecord(bytes32 node, address owner, address resolver, uint64 ttl) external virtual override {
        setOwner(node, owner);
        _setResolverAndTTL(node, resolver, ttl);
    }

    /**
     * @dev Sets the record for a subnode.
     * @param node The parent node.
     * @param label The hash of the label specifying the subnode.
     * @param owner The address of the new owner.
     * @param resolver The address of the resolver.
     * @param ttl The TTL in seconds.
     */
    function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external virtual override {
        bytes32 subnode = setSubnodeOwner(node, label, owner);
        _setResolverAndTTL(subnode, resolver, ttl);
    }

    /**
     * @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.
     * @param node The node to transfer ownership of.
     * @param owner The address of the new owner.
     */
    function setOwner(bytes32 node, address owner) public virtual override authorised(node) {
        _setOwner(node, owner);
        emit Transfer(node, owner);
    }

    /**
     * @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.
     * @param node The parent node.
     * @param label The hash of the label specifying the subnode.
     * @param owner The address of the new owner.
     */
    function setSubnodeOwner(bytes32 node, bytes32 label, address owner) public virtual override authorised(node) returns(bytes32) {
        bytes32 subnode = keccak256(abi.encodePacked(node, label));
        _setOwner(subnode, owner);
        emit NewOwner(node, label, owner);
        return subnode;
    }

    /**
     * @dev Sets the resolver address for the specified node.
     * @param node The node to update.
     * @param resolver The address of the resolver.
     */
    function setResolver(bytes32 node, address resolver) public virtual override authorised(node) {
        emit NewResolver(node, resolver);
        records[node].resolver = resolver;
    }

    /**
     * @dev Sets the TTL for the specified node.
     * @param node The node to update.
     * @param ttl The TTL in seconds.
     */
    function setTTL(bytes32 node, uint64 ttl) public virtual override authorised(node) {
        emit NewTTL(node, ttl);
        records[node].ttl = ttl;
    }

    /**
     * @dev Enable or disable approval for a third party ("operator") to manage
     *  all of `msg.sender`'s ENS records. Emits the ApprovalForAll event.
     * @param operator Address to add to the set of authorized operators.
     * @param approved True if the operator is approved, false to revoke approval.
     */
    function setApprovalForAll(address operator, bool approved) external virtual override {
        operators[msg.sender][operator] = approved;
        emit ApprovalForAll(msg.sender, operator, approved);
    }

    /**
     * @dev Returns the address that owns the specified node.
     * @param node The specified node.
     * @return address of the owner.
     */
    function owner(bytes32 node) public virtual override view returns (address) {
        address addr = records[node].owner;
        if (addr == address(this)) {
            return address(0x0);
        }

        return addr;
    }

    /**
     * @dev Returns the address of the resolver for the specified node.
     * @param node The specified node.
     * @return address of the resolver.
     */
    function resolver(bytes32 node) public virtual override view returns (address) {
        return records[node].resolver;
    }

    /**
     * @dev Returns the TTL of a node, and any records associated with it.
     * @param node The specified node.
     * @return ttl of the node.
     */
    function ttl(bytes32 node) public virtual override view returns (uint64) {
        return records[node].ttl;
    }

    /**
     * @dev Returns whether a record has been imported to the registry.
     * @param node The specified node.
     * @return Bool if record exists
     */
    function recordExists(bytes32 node) public virtual override view returns (bool) {
        return records[node].owner != address(0x0);
    }

    /**
     * @dev Query if an address is an authorized operator for another address.
     * @param owner The address that owns the records.
     * @param operator The address that acts on behalf of the owner.
     * @return True if `operator` is an approved operator for `owner`, false otherwise.
     */
    function isApprovedForAll(address owner, address operator) external virtual override view returns (bool) {
        return operators[owner][operator];
    }

    function _setOwner(bytes32 node, address owner) internal virtual {
        records[node].owner = owner;
    }

    function _setResolverAndTTL(bytes32 node, address resolver, uint64 ttl) internal {
        if(resolver != records[node].resolver) {
            records[node].resolver = resolver;
            emit NewResolver(node, resolver);
        }

        if(ttl != records[node].ttl) {
            records[node].ttl = ttl;
            emit NewTTL(node, ttl);
        }
    }
}

File 4 of 43 : ISupportsInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ISupportsInterface {
    function supportsInterface(bytes4 interfaceID) external pure returns(bool);
}

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

import "./profiles/IABIResolver.sol";
import "./profiles/IAddressResolver.sol";
import "./profiles/IAddrResolver.sol";
import "./profiles/IContentHashResolver.sol";
import "./profiles/IDNSRecordResolver.sol";
import "./profiles/IDNSZoneResolver.sol";
import "./profiles/IInterfaceResolver.sol";
import "./profiles/INameResolver.sol";
import "./profiles/IPubkeyResolver.sol";
import "./profiles/ITextResolver.sol";
import "./ISupportsInterface.sol";
/**
 * A generic resolver interface which includes all the functions including the ones deprecated
 */
interface Resolver is ISupportsInterface, IABIResolver, IAddressResolver, IAddrResolver, IContentHashResolver, IDNSRecordResolver, IDNSZoneResolver, IInterfaceResolver, INameResolver, IPubkeyResolver, ITextResolver {
    /* Deprecated events */
    event ContentChanged(bytes32 indexed node, bytes32 hash);

    function setABI(bytes32 node, uint256 contentType, bytes calldata data) external;
    function setAddr(bytes32 node, address addr) external;
    function setAddr(bytes32 node, uint coinType, bytes calldata a) external;
    function setContenthash(bytes32 node, bytes calldata hash) external;
    function setDnsrr(bytes32 node, bytes calldata data) external;
    function setName(bytes32 node, string calldata _name) external;
    function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;
    function setText(bytes32 node, string calldata key, string calldata value) external;
    function setInterface(bytes32 node, bytes4 interfaceID, address implementer) external;
    function multicall(bytes[] calldata data) external returns(bytes[] memory results);

    /* Deprecated functions */
    function content(bytes32 node) external view returns (bytes32);
    function multihash(bytes32 node) external view returns (bytes memory);
    function setContent(bytes32 node, bytes32 hash) external;
    function setMultihash(bytes32 node, bytes calldata hash) external;
}

File 6 of 43 : ResolverBase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "./SupportsInterface.sol";

abstract contract ResolverBase is SupportsInterface {
    function isAuthorised(bytes32 node) internal virtual view returns(bool);

    modifier authorised(bytes32 node) {
        require(isAuthorised(node));
        _;
    }
}

File 7 of 43 : SupportsInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./ISupportsInterface.sol";

abstract contract SupportsInterface is ISupportsInterface {
    function supportsInterface(bytes4 interfaceID) virtual override public pure returns(bool) {
        return interfaceID == type(ISupportsInterface).interfaceId;
    }
}

File 8 of 43 : IABIResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "./IABIResolver.sol";
import "../ResolverBase.sol";

interface IABIResolver {
    event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
    /**
     * Returns the ABI associated with an ENS node.
     * Defined in EIP205.
     * @param node The ENS node to query
     * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
     * @return contentType The content type of the return value
     * @return data The ABI data
     */
    function ABI(bytes32 node, uint256 contentTypes) external view returns (uint256, bytes memory);
}

File 9 of 43 : IAddrResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

/**
 * Interface for the legacy (ETH-only) addr function.
 */
interface IAddrResolver {
    event AddrChanged(bytes32 indexed node, address a);

    /**
     * Returns the address associated with an ENS node.
     * @param node The ENS node to query.
     * @return The associated address.
     */
    function addr(bytes32 node) external view returns (address payable);
}

File 10 of 43 : IAddressResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

/**
 * Interface for the new (multicoin) addr function.
 */
interface IAddressResolver {
    event AddressChanged(bytes32 indexed node, uint coinType, bytes newAddress);

    function addr(bytes32 node, uint coinType) external view returns(bytes memory);
}

File 11 of 43 : IContentHashResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IContentHashResolver {
    event ContenthashChanged(bytes32 indexed node, bytes hash);

    /**
     * Returns the contenthash associated with an ENS node.
     * @param node The ENS node to query.
     * @return The associated contenthash.
     */
    function contenthash(bytes32 node) external view returns (bytes memory);
}

File 12 of 43 : IDNSRecordResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IDNSRecordResolver {
    // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.
    event DNSRecordChanged(bytes32 indexed node, bytes name, uint16 resource, bytes record);
    // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.
    event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);
    // DNSZoneCleared is emitted whenever a given node's zone information is cleared.
    event DNSZoneCleared(bytes32 indexed node);

    /**
     * Obtain a DNS record.
     * @param node the namehash of the node for which to fetch the record
     * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record
     * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types
     * @return the DNS record in wire format if present, otherwise empty
     */
    function dnsRecord(bytes32 node, bytes32 name, uint16 resource) external view returns (bytes memory);
}

File 13 of 43 : IDNSZoneResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IDNSZoneResolver {
    // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.
    event DNSZonehashChanged(bytes32 indexed node, bytes lastzonehash, bytes zonehash);

    /**
     * zonehash obtains the hash for the zone.
     * @param node The ENS node to query.
     * @return The associated contenthash.
     */
    function zonehash(bytes32 node) external view returns (bytes memory);
}

File 14 of 43 : IInterfaceResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IInterfaceResolver {
    event InterfaceChanged(bytes32 indexed node, bytes4 indexed interfaceID, address implementer);

    /**
     * Returns the address of a contract that implements the specified interface for this name.
     * If an implementer has not been set for this interfaceID and name, the resolver will query
     * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that
     * contract implements EIP165 and returns `true` for the specified interfaceID, its address
     * will be returned.
     * @param node The ENS node to query.
     * @param interfaceID The EIP 165 interface ID to check for.
     * @return The address that implements this interface, or 0 if the interface is unsupported.
     */
    function interfaceImplementer(bytes32 node, bytes4 interfaceID) external view returns (address);
}

File 15 of 43 : INameResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface INameResolver {
    event NameChanged(bytes32 indexed node, string name);

    /**
     * Returns the name associated with an ENS node, for reverse records.
     * Defined in EIP181.
     * @param node The ENS node to query.
     * @return The associated name.
     */
    function name(bytes32 node) external view returns (string memory);
}

File 16 of 43 : IPubkeyResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IPubkeyResolver {
    event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);

    /**
     * Returns the SECP256k1 public key associated with an ENS node.
     * Defined in EIP 619.
     * @param node The ENS node to query
     * @return x The X coordinate of the curve point for the public key.
     * @return y The Y coordinate of the curve point for the public key.
     */
    function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);
}

File 17 of 43 : ITextResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface ITextResolver {
    event TextChanged(bytes32 indexed node, string indexed indexedKey, string key);

    /**
     * Returns the text data associated with an ENS node and key.
     * @param node The ENS node to query.
     * @param key The text data key to query.
     * @return The associated text data.
     */
    function text(bytes32 node, string calldata key) external view returns (string memory);
}

File 18 of 43 : 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 19 of 43 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 20 of 43 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 21 of 43 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 22 of 43 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 23 of 43 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 24 of 43 : 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;
    }
}

File 25 of 43 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 26 of 43 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 27 of 43 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 28 of 43 : IPriceOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

interface IPriceOracle {
    /**
     * @dev Returns the price to register or renew a name.
     * @param name The name being registered or renewed.
     * @param expires When the name presently expires (0 if this is a new registration).
     * @param duration How long the name is being registered or extended for, in seconds.
     * @return The price of this renewal or registration, in wei.
     */
    function price(string calldata name, uint expires, uint duration) external view returns(uint);
}

File 29 of 43 : PremiumPriceOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "./SafeMath.sol";
import "./StringUtils.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./StablePriceOracle.sol";
import "../universal/UniversalRegistrar.sol";
import "./SLDPriceOracle.sol";
import "../universal_v2/Access.sol";

// PremiumPriceOracle a price oracle with support for setting different prices for premium names.
contract PremiumPriceOracle is Ownable, Access {
    using SafeMath for *;
    using StringUtils for *;

    AggregatorInterface public immutable usdOracle;
    SLDPriceOracle public sldPriceOracle;

    // Rent in base price units by length. Element 0 is for 1-length names, and so on.
    uint256[] public defaultPrices;
    mapping(bytes32 => uint256[]) public rentPrices;
    mapping(bytes32 => uint256) public rentPricesUpdated;

    mapping(uint256 => mapping(bytes32 => mapping(bytes32 => uint256))) public premiumPrices;
    mapping(bytes32 => uint256) public premiumPricesVersion;

    event NamePremium(bytes32 indexed node, string name, uint256 price);
    event PremiumsCleared(bytes32 indexed node);
    event RentPriceChanged(bytes32 node, uint256[] prices);
    event DefaultRentPriceChanged(uint256[] prices);

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

    bytes4 private constant ORACLE_ID =
    bytes4(keccak256("price(bytes32,string,uint256,uint256)"));

    constructor(SLDPriceOracle _sldPriceOracle, uint256[] memory _defaultPrices) Access(_sldPriceOracle.registrar()) {
        usdOracle = _sldPriceOracle.usdOracle();
        sldPriceOracle = _sldPriceOracle;
        _setDefaultPrices(_defaultPrices);
    }

    function price(bytes32 node, string calldata name, uint256 expires, uint256 duration) external view returns (uint256) {
        bytes32 label = keccak256(bytes(name));

        // if a premium price exists, return it
        if (premiumPrices[premiumPricesVersion[node]][node][label] != 0) {
            uint256 basePremium = premiumPrices[premiumPricesVersion[node]][node][label];
            return attoUSDToWei(basePremium.mul(duration));
        }

        // fallback to SLDPriceOracle if no prices set
        if (rentPricesUpdated[node] == 0) {
            return sldPriceOracle.price(node, name, expires, duration);
        }

        uint256 len = name.strlen();
        uint256[] memory prices = rentPrices[node].length > 0 ? rentPrices[node] : defaultPrices;

        if (len > prices.length) {
            len = prices.length;
        }
        require(len > 0);

        uint256 basePrice = prices[len - 1].mul(duration);
        return attoUSDToWei(basePrice);
    }

    function attoUSDToWei(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer()); //2
        return amount.mul(1e8).div(ethPrice);
    }

    function weiToAttoUSD(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer());
        return amount.mul(ethPrice).div(1e8);
    }

    function premium(bytes32 node, bytes32 label) external view returns (uint256) {
        return premiumPrices[premiumPricesVersion[node]][node][label];
    }

    /**
     * @dev Sets the rent price for a specific name.
     * @param node The node to set the rent price for.
     * @param name The name to set the rent price for.
     * @param _price The rent price. Values are in base
     * price units, equal to one attodollar (1e-18 dollar)
     * each (zero values will clear the price premium).
     */
    function setPremium(bytes32 node, string calldata name, uint256 _price) external nodeOperator(node) {
        bytes32 label = keccak256(bytes(name));
        premiumPrices[premiumPricesVersion[node]][node][label] = _price;
        emit NamePremium(node, name, _price);
    }

    function setPremiums(bytes32 node, string[] calldata names, uint256[] calldata prices) external nodeOperator(node) {
        require(names.length == prices.length, "names and prices must have the same length");
        for (uint i = 0; i < names.length; i++) {
            bytes32 label = keccak256(bytes(names[i]));
            premiumPrices[premiumPricesVersion[node]][node][label] = prices[i];
            emit NamePremium(node, names[i], prices[i]);
        }
    }

    function clearPremiums(bytes32 node) external nodeOperator(node) {
        premiumPricesVersion[node]++;
        emit PremiumsCleared(node);
    }

    /**
     * @dev Sets rent prices for the specified node (can only be called by the node owner)
     * @param _rentPrices The price array. Each element corresponds to a specific
     *                    name length; names longer than the length of the array
     *                    default to the price of the last element. Values are
     *                    in base price units, equal to one attodollar (1e-18
     *                    dollar) each.
     */
    function setPrices(bytes32 node, uint256[] memory _rentPrices) public nodeOperator(node) {
        require(block.timestamp - rentPricesUpdated[node] > 5 minutes);

        rentPrices[node] = _rentPrices;
        rentPricesUpdated[node] = block.timestamp;
        emit RentPriceChanged(node, _rentPrices);
    }

    /**
     * @dev Sets default rent prices to be used by nodes that don't have pricing set.
     * @param _defaultPrices The price array. Each element corresponds to a specific
     *                    name length; names longer than the length of the array
     *                    default to the price of the last element. Values are
     *                    in base price units, equal to one attodollar (1e-18
     *                    dollar) each.
     */
    function setDefaultPrices(uint256[] memory _defaultPrices) public onlyOwner {
        _setDefaultPrices(_defaultPrices);
    }

    function _setDefaultPrices(uint256[] memory _defaultPrices) internal {
        defaultPrices = _defaultPrices;
        emit DefaultRentPriceChanged(_defaultPrices);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual returns (bool)
    {
        return interfaceID == INTERFACE_META_ID || interfaceID == ORACLE_ID;
    }
}

File 30 of 43 : SLDPriceOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "./SafeMath.sol";
import "./StringUtils.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./StablePriceOracle.sol";
import "../universal/UniversalRegistrar.sol";

// SLDPriceOracle sets a price in USD, based on an oracle for each node.
// The registry can set and change default prices. However, if the node owner
// sets their own price, they will override the default.
contract SLDPriceOracle is Ownable {
    using SafeMath for *;
    using StringUtils for *;

    // Rent in base price units by length. Element 0 is for 1-length names, and so on.
    mapping(bytes32 => uint256[]) public rentPrices;
    uint256[] public defaultPrices;

    // Oracle address
    AggregatorInterface public immutable usdOracle;
    // Registrar address
    UniversalRegistrar public registrar;

    /**
     * @dev Throws if called by any account other than the node owner.
     */
    modifier onlyNodeOwner(bytes32 node) {
        require(registrar.ownerOfNode(node) == _msgSender(), "caller is not the node owner");
        _;
    }

    event OracleChanged(address oracle);

    event RentPriceChanged(bytes32 node, uint256[] prices);
    event DefaultRentPriceChanged(uint256[] prices);

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

    bytes4 private constant ORACLE_ID =
    bytes4(keccak256("price(bytes32,string,uint256,uint256)"));

    constructor(UniversalRegistrar _registrar, AggregatorInterface _usdOracle, uint256[] memory _defaultPrices) {
        registrar = _registrar;
        usdOracle = _usdOracle;
        defaultPrices = _defaultPrices;
    }

    function price(bytes32 node, string calldata name, uint256 expires, uint256 duration) external view returns (uint256) {
        uint256 len = name.strlen();
        uint256[] memory prices = rentPrices[node].length > 0 ? rentPrices[node] : defaultPrices;

        if (len > prices.length) {
            len = prices.length;
        }
        require(len > 0);

        uint256 basePrice = prices[len - 1].mul(duration);
        return attoUSDToWei(basePrice);
    }

    /**
     * @dev Sets rent prices for the specified node (can only be called by the node owner)
     * @param _rentPrices The price array. Each element corresponds to a specific
     *                    name length; names longer than the length of the array
     *                    default to the price of the last element. Values are
     *                    in base price units, equal to one attodollar (1e-18
     *                    dollar) each.
     */
    function setPrices(bytes32 node, uint256[] memory _rentPrices) public onlyNodeOwner(node) {
        rentPrices[node] = _rentPrices;
        emit RentPriceChanged(node, _rentPrices);
    }

    /**
     * @dev Sets default rent prices to be used by nodes that don't have pricing set.
     * @param _defaultPrices The price array. Each element corresponds to a specific
     *                    name length; names longer than the length of the array
     *                    default to the price of the last element. Values are
     *                    in base price units, equal to one attodollar (1e-18
     *                    dollar) each.
     */
    function setDefaultPrices(uint256[] memory _defaultPrices) public onlyOwner {
        defaultPrices = _defaultPrices;
        emit DefaultRentPriceChanged(_defaultPrices);
    }

    function attoUSDToWei(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer()); //2
        return amount.mul(1e8).div(ethPrice);
    }

    function weiToAttoUSD(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer());
        return amount.mul(ethPrice).div(1e8);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual returns (bool)
    {
        return interfaceID == INTERFACE_META_ID || interfaceID == ORACLE_ID;
    }
}

File 31 of 43 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
    * @dev Multiplies two unsigned integers, reverts on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
    * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
    * @dev Adds two unsigned integers, reverts on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
    * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
    * reverts when dividing by zero.
    */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

File 32 of 43 : StablePriceOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "./IPriceOracle.sol";
import "./SafeMath.sol";
import "./StringUtils.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

interface AggregatorInterface {
    function latestAnswer() external view returns (int256);
}

// StablePriceOracle sets a price in USD, based on an oracle.
contract StablePriceOracle is Ownable, IPriceOracle {
    using SafeMath for *;
    using StringUtils for *;

    // Rent in base price units by length. Element 0 is for 1-length names, and so on.
    uint256[] public rentPrices;

    // Oracle address
    AggregatorInterface public immutable usdOracle;

    event OracleChanged(address oracle);

    event RentPriceChanged(uint256[] prices);

    bytes4 private constant INTERFACE_META_ID =
    bytes4(keccak256("supportsInterface(bytes4)"));
    bytes4 private constant ORACLE_ID =
    bytes4(
        keccak256("price(string,uint256,uint256)") ^
        keccak256("premium(string,uint256,uint256)")
    );

    constructor(AggregatorInterface _usdOracle, uint256[] memory _rentPrices) {
        usdOracle = _usdOracle;
        setPrices(_rentPrices);
    }

    function price(string calldata name, uint256 expires, uint256 duration) external view override returns (uint256) {
        uint256 len = name.strlen();
        if (len > rentPrices.length) {
            len = rentPrices.length;
        }
        require(len > 0);

        uint256 basePrice = rentPrices[len - 1].mul(duration);
        basePrice = basePrice.add(_premium(name, expires, duration));

        return attoUSDToWei(basePrice);
    }

    /**
     * @dev Sets rent prices.
     * @param _rentPrices The price array. Each element corresponds to a specific
     *                    name length; names longer than the length of the array
     *                    default to the price of the last element. Values are
     *                    in base price units, equal to one attodollar (1e-18
     *                    dollar) each.
     */
    function setPrices(uint256[] memory _rentPrices) public onlyOwner {
        rentPrices = _rentPrices;
        emit RentPriceChanged(_rentPrices);
    }

    /**
     * @dev Returns the pricing premium in wei.
     */
    function premium(
        string calldata name,
        uint256 expires,
        uint256 duration
    ) external view returns (uint256) {
        uint256 weiPrice = attoUSDToWei(_premium(name, expires, duration));
        return weiPrice;
    }

    /**
     * @dev Returns the pricing premium in internal base units.
     */
    function _premium(
        string memory name,
        uint256 expires,
        uint256 duration
    ) internal view virtual returns (uint256) {
        return 0;
    }

    function attoUSDToWei(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer()); //2
        return amount.mul(1e8).div(ethPrice);
    }

    function weiToAttoUSD(uint256 amount) internal view returns (uint256) {
        uint256 ethPrice = uint256(usdOracle.latestAnswer());
        return amount.mul(ethPrice).div(1e8);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual returns (bool)
    {
        return interfaceID == INTERFACE_META_ID || interfaceID == ORACLE_ID;
    }
}

File 33 of 43 : StringUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

library StringUtils {
    /**
     * @dev Returns the length of a given string
     *
     * @param s The string to measure the length of
     * @return The length of the input string
     */
    function strlen(string memory s) internal pure returns (uint) {
        uint len;
        uint i = 0;
        uint bytelength = bytes(s).length;
        for(len = 0; i < bytelength; len++) {
            bytes1 b = bytes(s)[i];
            if(b < 0x80) {
                i += 1;
            } else if (b < 0xE0) {
                i += 2;
            } else if (b < 0xF0) {
                i += 3;
            } else if (b < 0xF8) {
                i += 4;
            } else if (b < 0xFC) {
                i += 5;
            } else {
                i += 6;
            }
        }
        return len;
    }
}

File 34 of 43 : 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 35 of 43 : Root.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@ensdomains/ens-contracts/contracts/registry/ENS.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Controllable.sol";

contract Root 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);

    ENS public ens;
    mapping(bytes32 => bool) public locked;

    constructor(ENS _ens) {
        ens = _ens;
    }

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

    function setResolver(address resolver) external onlyController {
        ens.setResolver(ROOT_NODE, resolver);
    }

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

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

File 36 of 43 : IUniversalRegistrar.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IUniversalRegistrar is IERC721 {
    event ControllerAdded(bytes32 node, address indexed controller);
    event ControllerRemoved(bytes32 node, address indexed controller);

    event NameRegistered(
        bytes32 node,
        bytes32 indexed label,
        address indexed owner,
        uint256 expires
    );
    event NameRenewed(bytes32 node, bytes32 indexed label, uint256 expires);

    // Authorises a controller, who can register and renew domains.
    function addController(bytes32 node, address controller) external;

    // Revoke controller permission for an address.
    function removeController(bytes32 node, address controller) external;

    // Set the resolver for the TLD this registrar manages.
    function setResolver(bytes32 node, address resolver) external;

    // Returns the expiration timestamp of the specified label hash.
    function nameExpires(uint256 id) external view returns (uint256);

    // Returns true iff the specified name is available for registration.
    function available(uint256 id) external view returns (bool);

    /**
     * @dev Register a name.
     */
    function register(
        bytes32 node,
        bytes32 label,
        address owner,
        uint256 duration
    ) external returns (uint256);

    function renew(bytes32 node, bytes32 label, uint256 duration) external returns (uint256);

    /**
     * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
     */
    function reclaim(bytes32 node, bytes32 label, address owner) external;
}

File 37 of 43 : RegistrarAccess.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "../root/Root.sol";

contract RegistrarAccess {
    event NodeOwnerChanged(bytes32 node, address indexed oldOwner, address indexed newOwner);
    event RegistryControllersChanged(address indexed controller, bool approved);
    event RegistryNodeControllersChanged(bytes32 node, address indexed controller, bool approved);

    Root public root;

    constructor(Root _root) {
        root = _root;
    }

    // A map of top level domains and their authorised owner
    mapping(bytes32 => address) private nodeOwners;

    // A map specifying which controller addresses TLD owners are allowed to use.
    mapping(address => bool) private registryControllers;

    // A map specifying which controller addresses a specific TLD owner is allowed to use.
    mapping(bytes32 => mapping(address => bool)) private registryNodeControllers;

    modifier onlyNodeOwner(bytes32 node) {
        require(nodeOwners[node] == msg.sender);
        _;
    }

    modifier onlyRegistry {
        require(root.controllers(msg.sender));
        _;
    }

    modifier onlyRegistryControllers(bytes32 node, address controller) {
        require(registryNodeControllers[node][controller] ||
            registryControllers[controller], "controller not approved by registry");
        _;
    }

    // Transfers ownership of a TLD to a new owner
    // can only be called by existing node owner.
    function transferNodeOwnership(bytes32 node, address newOwner) public onlyNodeOwner(node) {
        require(newOwner != address(0));
        emit NodeOwnerChanged(node, nodeOwners[node], newOwner);
        nodeOwners[node] = newOwner;
    }

    // Gives up ownership of a TLD to a burn address. All functionality marked with onlyNodeOwner
    // will be disabled for the specified TLD. It will also affect any contracts
    // that rely on {ownerOfNode}. Use with extreme caution.
    function renounceNodeOwnership(bytes32 node) public onlyNodeOwner(node) {
        emit NodeOwnerChanged(node, nodeOwners[node], address(0));
        nodeOwners[node] = address(0);
    }

    function ownerOfNode(bytes32 node) public view returns (address) {
        return nodeOwners[node];
    }

    // Sets ownership of a name in the registrar. If the name
    // is locked, only the owner can transfer ownership by
    // calling transferNodeOwnership.
    function setSubnodeOwner(bytes32 label, address owner) public onlyRegistry returns(bytes32) {
        require(!root.locked(label), "name locked");
        bytes32 node = keccak256(abi.encodePacked(bytes32(0), label));
        emit NodeOwnerChanged(node, nodeOwners[node], owner);
        nodeOwners[node] = owner;
        return node;
    }

    // Whitelists a controller address to be used by the specified node.
    function approveControllerForNode(bytes32 node, address controller, bool approved) external onlyRegistry {
        registryNodeControllers[node][controller] = approved;
        emit RegistryNodeControllersChanged(node, controller, approved);
    }

    // Whitelists a controller address to be used by any node.
    function approveController(address controller, bool approved) external onlyRegistry {
        registryControllers[controller] = approved;
        emit RegistryControllersChanged(controller, approved);
    }
}

File 38 of 43 : UniversalRegistrar.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@ensdomains/ens-contracts/contracts/registry/ENS.sol";
import "@ensdomains/ens-contracts/contracts/registry/ENSRegistry.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IUniversalRegistrar.sol";
import "./RegistrarAccess.sol";

contract UniversalRegistrar is ERC721, RegistrarAccess, IUniversalRegistrar, Ownable {
    // A map of expiry times
    mapping(uint256 => uint) expiries;
    ENS public ens;

    // ERC721 Metadata URI
    string private metadataUri;

    // A map of addresses that are authorised to register and renew
    // names for the given top level node.
    mapping(bytes32 => mapping(address => bool)) public controllers;

    uint256 public constant GRACE_PERIOD = 90 days;

    bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
    bytes4 constant private ERC721_ID = bytes4(
        keccak256("balanceOf(address)") ^
        keccak256("ownerOf(uint256)") ^
        keccak256("approve(address,uint256)") ^
        keccak256("getApproved(uint256)") ^
        keccak256("setApprovalForAll(address,bool)") ^
        keccak256("isApprovedForAll(address,address)") ^
        keccak256("transferFrom(address,address,uint256)") ^
        keccak256("safeTransferFrom(address,address,uint256)") ^
        keccak256("safeTransferFrom(address,address,uint256,bytes)")
    );
    bytes4 constant private RECLAIM_ID = bytes4(keccak256("reclaim(bytes32,uint256,address)"));

    /**
     * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);
     * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187
     * @dev Returns whether the given spender can transfer a given token ID
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     *    is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view override returns (bool) {
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    constructor(ENS _ens, Root _root) ERC721("Impervious Registry", "IR") RegistrarAccess(_root) {
        ens = _ens;
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`.
     */
    function _baseURI() internal view virtual override returns (string memory) {
        return metadataUri;
    }

    modifier live(bytes32 node) {
        require(ens.owner(node) == address(this));
        _;
    }

    modifier onlyController(bytes32 node) {
        require(controllers[node][msg.sender]);
        _;
    }

    /**
     * @dev Gets the owner of the specified token ID. Names become unowned
     *      when their registration expires.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view override(IERC721, ERC721) returns (address) {
        require(expiries[tokenId] > block.timestamp);
        return super.ownerOf(tokenId);
    }

    // Change metadata uri
    function setUri(string memory _uri) external onlyOwner {
        metadataUri = _uri;
    }

    // Authorises a controller, who can register and renew domains.
    // can only be called by the node owner.
    function addController(
        bytes32 node,
        address controller
    ) external override onlyNodeOwner(node) onlyRegistryControllers(node, controller) {
        controllers[node][controller] = true;
        emit ControllerAdded(node, controller);
    }

    // Revoke controller permission for an address.
    // can only be called by the node owner.
    function removeController(bytes32 node, address controller) external override onlyNodeOwner(node) {
        controllers[node][controller] = false;
        emit ControllerRemoved(node, controller);
    }

    // Set the resolver for the TLD this registrar manages.
    // can only be called by the node owner.
    function setResolver(bytes32 node, address resolver) external override onlyNodeOwner(node) {
        ens.setResolver(node, resolver);
    }

    // Returns the expiration timestamp of the specified id.
    function nameExpires(uint256 id) external view override returns (uint) {
        return expiries[id];
    }

    // Returns true iff the specified name is available for registration.
    function available(uint256 id) public view override returns (bool) {
        // Not available if it's registered here or in its grace period.
        return expiries[id] + GRACE_PERIOD < block.timestamp;
    }

    /**
     * @dev Register a name.
     * @param node The node hash.
     * @param label The token ID (keccak256 of the label).
     * @param owner The address that should own the registration.
     * @param duration Duration in seconds for the registration.
     */
    function register(bytes32 node, bytes32 label, address owner, uint duration) external override returns (uint) {
        return _register(node, label, owner, duration, true);
    }

    /**
     * @dev Register a name, without modifying the registry.
     * @param node The node hash.
     * @param label The token ID (keccak256 of the label).
     * @param owner The address that should own the registration.
     * @param duration Duration in seconds for the registration.
     */
    function registerOnly(bytes32 node, bytes32 label, address owner, uint duration) external returns (uint) {
        return _register(node, label, owner, duration, false);
    }

    function _register(bytes32 node, bytes32 label, address owner,
        uint duration, bool updateRegistry) internal live(node) onlyController(node) returns (uint) {
        require(block.timestamp + duration + GRACE_PERIOD > block.timestamp + GRACE_PERIOD); // Prevent future overflow

        uint256 id = _tokenID(node, label);
        require(available(id));

        expiries[id] = block.timestamp + duration;
        if (_exists(id)) {
            // Name was previously owned, and expired
            _burn(id);
        }
        _mint(owner, id);
        if (updateRegistry) {
            ens.setSubnodeOwner(node, label, owner);
        }

        emit NameRegistered(node, label, owner, block.timestamp + duration);

        return block.timestamp + duration;
    }

    function renew(bytes32 node, bytes32 label, uint duration) external override live(node) onlyController(node) returns (uint) {
        uint256 id = _tokenID(node, label);
        require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period
        require(expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD); // Prevent future overflow

        expiries[id] += duration;
        emit NameRenewed(node, label, expiries[id]);
        return expiries[id];
    }

    /**
     * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
     */
    function reclaim(bytes32 node, bytes32 label, address owner) external override live(node) {
        uint256 id = _tokenID(node, label);
        require(_isApprovedOrOwner(msg.sender, id));
        ens.setSubnodeOwner(node, label, owner);
    }

    function supportsInterface(bytes4 interfaceID) public override(ERC721, IERC165) view returns (bool) {
        return interfaceID == INTERFACE_META_ID ||
        interfaceID == ERC721_ID ||
        interfaceID == RECLAIM_ID;
    }

    function _tokenID(bytes32 node, bytes32 label) internal pure returns (uint256) {
        return uint256(keccak256(abi.encodePacked(node, label)));
    }
}

File 39 of 43 : Access.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

import "../universal/UniversalRegistrar.sol";
import "./IExtensionAccess.sol";

abstract contract Access {
    UniversalRegistrar public registrar;

    constructor(UniversalRegistrar _registrar) {
        registrar = _registrar;
    }

    modifier nodeOperator(bytes32 node) {
        require(_isNodeOperator(node, msg.sender), "Caller is not a node operator");
        _;
    }

    modifier nodeApprovedOrOwner(bytes32 node) {
        require(_isNodeApprovedOrOwner(node, msg.sender), "Caller is not a node owner nor approved by owner");
        _;
    }

    function isNodeOperator(bytes32 node, address operator) public view returns (bool) {
        return _isNodeOperator(node, operator);
    }

    function isNodeApprovedOrOwner(bytes32 node, address operator) public view returns (bool) {
        return _isNodeApprovedOrOwner(node, operator);
    }

    function _isNodeOperator(bytes32 node, address addr) internal view returns (bool) {
        address owner = registrar.ownerOfNode(node);
        if (!Address.isContract(owner)) {
            return owner == addr;
        }

        try IERC165(owner).supportsInterface(type(IExtensionAccess).interfaceId) returns (bool supported) {
            if (supported) {
                return IExtensionAccess(owner).isApprovedOrOwner(addr, uint256(node)) ||
                 IExtensionAccess(owner).getOperator(uint256(node)) == addr;
            }
        } catch {}

        return owner == addr;
    }

    function _isNodeApprovedOrOwner(bytes32 node, address addr) internal view returns (bool) {
        address owner = registrar.ownerOfNode(node);
        if (!Address.isContract(owner)) {
            return owner == addr;
        }

        try IERC165(owner).supportsInterface(type(IExtensionAccess).interfaceId) returns (bool supported) {
            if (supported) {
                return IExtensionAccess(owner).isApprovedOrOwner(addr, uint256(node));
            }
        } catch {}

        return owner == addr;
    }
}

File 40 of 43 : BaseUniversalRegistrarControllerV2.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (finance/PaymentSplitter.sol)
// Adapted for use by the registry

pragma solidity >=0.8.4;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "../universal/UniversalRegistrar.sol";
import "./IExtensionPayee.sol";

/**
 * @title BaseUniversalRegistrarControllerV2
 * @dev This contract allows to split Ether payments among an owner (a staker) and the registry.
 *
 * `BaseUniversalRegistrarControllerV2` follows a _pull payment_ model. This means that payments are not automatically
 * forwarded to the accounts but kept in this contract, and the actual transfer is triggered as a separate step by
 * calling the {releaseToOwner} and {releaseToRegistry} functions.
 *
 */
abstract contract BaseUniversalRegistrarControllerV2 {
    event PaymentReleased(bytes32 node, address to, uint256 amount);

    // The total number of shares
    uint256 private _totalShares;

    // Number of shares the registry owns
    uint256 private _registryShare;

    // Number of shares a staker owns
    uint256 private _ownerShare;

    // Amount of Ether available for release to share holders.
    mapping(bytes32 => uint256) private _balances;

    // Total amount of Ether already released to share holders.
    mapping(bytes32 => uint256) private _totalReleased;

    // Amount of Ether already released to the registry.
    mapping(bytes32 => uint256) private _registryReleased;

    // Amount of Ether already released to the TLD owner.
    mapping(bytes32 => uint256) private _ownerReleased;

    UniversalRegistrar public base;

    // Owner payee address for the specified TLD
    function ownerPayee(bytes32 node) public view returns (address) {
        address owner = base.ownerOfNode(node);

        // if the owner is a contract and supports the IExtensionPayee interface, return the payee address
        // to send the payment to instead.
        if (Address.isContract(owner)) {
            try IERC165(owner).supportsInterface(type(IExtensionPayee).interfaceId) returns (bool supported) {
                if (supported) {
                    return IExtensionPayee(owner).payeeOf(node);
                }
            } catch {}
        }

        return owner;
    }

    // Registry payee address
    function registryPayee() public view returns (address) {
        // get address of root owner from registrar
        return base.root().owner();
    }

    constructor(UniversalRegistrar base_, uint256 ownerShare_, uint256 registryShare_) {
        base = base_;
        _ownerShare = ownerShare_;
        _registryShare = registryShare_;
        _totalShares = ownerShare_ + registryShare_;
    }

    /**
     * @dev Getter for the total shares held by payees.
     */
    function totalShares() external view returns (uint256) {
        return _totalShares;
    }

    /**
     * @dev Getter for the total amount of Ether already released.
     */
    function totalReleased(bytes32 node) external view returns (uint256) {
        return _totalReleased[node];
    }

    /**
     * @dev Getter for the amount of shares held by owner
     */
    function ownerShare() external view returns (uint256) {
        return _ownerShare;
    }

    /**
     * @dev Getter for the amount of shares held by registry.
     */
    function registryShare() external view returns (uint256) {
        return _registryShare;
    }

    /**
     * @dev Getter for the amount of Ether already released to the owner
     */
    function ownerReleased(bytes32 node) external view returns (uint256) {
        return _ownerReleased[node];
    }

    /**
     * @dev Getter for the amount of Ether already released to the registry.
     */
    function registryReleased(bytes32 node) external view returns (uint256) {
        return _registryReleased[node];
    }

    function balance(bytes32 node) external view returns (uint256) {
        return _balances[node];
    }

    function ownerBalance(bytes32 node) public view returns (uint256) {
        uint256 totalReceived = _balances[node] + _totalReleased[node];
        return _pendingPayment(_ownerShare, totalReceived, _ownerReleased[node]);
    }

    function registryBalance(bytes32 node) public view returns (uint256) {
        uint256 totalReceived = _balances[node] + _totalReleased[node];
        return _pendingPayment(_registryShare, totalReceived, _registryReleased[node]);
    }

    function _addPayment(bytes32 node, uint256 amount) internal {
        _balances[node] += amount;
    }

    /**
     * @dev Triggers a transfer to the owner for the amount of Ether they are owed, according to their
     * percentage of the total shares and their previous withdrawals.
     */
    function releaseToOwner(bytes32 node) external {
        uint256 payment = ownerBalance(node);
        require(payment != 0, "owner is not due payment");

        _ownerReleased[node] += payment;
        _totalReleased[node] += payment;
        _balances[node] -= payment;

        address owner = ownerPayee(node);
        Address.sendValue(payable(owner), payment);
        emit PaymentReleased(node, owner, payment);
    }

    /**
     * @dev Triggers a transfer to the registry owner of the amount of Ether they are owed, according to their
     * percentage of the total shares and their previous withdrawals.
     */
    function releaseToRegistry(bytes32 node) external {
        uint256 payment = registryBalance(node);
        require(payment != 0, "registry is not due payment");

        _registryReleased[node] += payment;
        _totalReleased[node] += payment;
        _balances[node] -= payment;

        address rootOwner = registryPayee();
        Address.sendValue(payable(rootOwner), payment);
        emit PaymentReleased(node, rootOwner, payment);
    }

    /**
     * @dev internal logic for computing the pending payment of an account given the token historical balances and
     * already released amounts.
     */
    function _pendingPayment(
        uint256 shares,
        uint256 totalReceived,
        uint256 alreadyReleased
    ) private view returns (uint256) {
        return (totalReceived * shares) / _totalShares - alreadyReleased;
    }
}

File 41 of 43 : IExtensionAccess.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

interface IExtensionAccess {
    function getOperator(uint256 tokenId) external view returns (address);
    function getOwner(uint256 tokenId) external view returns (address);
    function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);
}

File 42 of 43 : IExtensionPayee.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

interface IExtensionPayee {
    function payeeOf(bytes32 node) external view returns (address);
}

File 43 of 43 : NameStore.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

import "../universal/UniversalRegistrar.sol";
import "./Access.sol";

contract NameStore is Access {
    mapping(uint256 => bytes32) public tokenToExtension;

    mapping(uint256 => mapping(bytes32 => mapping(bytes32 => address))) public reservedNames;
    mapping(bytes32 => uint256) public reservedNamesVersion;

    mapping(bytes32 => bool) public registrationsPaused;

    mapping(bytes32 => bytes) public metadata;

    event NameReserved(bytes32 indexed node, string name, address recipient);
    event ReservedNamesCleared(bytes32 indexed node);
    event RegistrationsPauseChanged(bytes32 indexed node, bool paused);
    event MetadataChanged(bytes32 indexed node);

    constructor(UniversalRegistrar _registrar) Access(_registrar) {}

    function parentOf(uint256 tokenId) external view returns (bytes32) {
        return tokenToExtension[tokenId];
    }

    function adopt(bytes32 parent, bytes32 label) external {
        uint256 tokenId = uint256(keccak256(abi.encodePacked(parent, label)));
        tokenToExtension[tokenId] = parent;
    }

    function bulkAdopt(bytes32 parent, bytes32[] calldata labels) external {
        for (uint i = 0; i < labels.length; i++) {
            uint256 tokenId = uint256(keccak256(abi.encodePacked(parent, labels[i])));
            tokenToExtension[tokenId] = parent;
        }
    }

    function setMetadata(bytes32 node, bytes calldata _metadata) external nodeOperator(node) {
        metadata[node] = _metadata;
        emit MetadataChanged(node);
    }

    function reserved(bytes32 node, bytes32 label) external view returns (address) {
        return reservedNames[reservedNamesVersion[node]][node][label];
    }

    function available(bytes32 node, bytes32 label) external view returns (bool) {
        return reservedNames[reservedNamesVersion[node]][node][label] == address(0) && !registrationsPaused[node];
    }

    function pauseRegistrations(bytes32 node) external nodeOperator(node) {
        registrationsPaused[node] = true;
        emit RegistrationsPauseChanged(node, true);
    }

    function unpauseRegistrations(bytes32 node) external nodeOperator(node) {
        registrationsPaused[node] = false;
        emit RegistrationsPauseChanged(node, false);
    }

    // can be called by either the TLD owner or a controller authorised by the TLD owner.
    function reserve(bytes32 node, string calldata name, address recipient) external {
        require(isNodeApprovedOrOwner(node, msg.sender) ||
                isNodeOperator(node, msg.sender) ||
                registrar.controllers(node, msg.sender),
            "caller is not a controller, owner or operator");
        _reserve(node, name, recipient);
    }

    function _reserve(bytes32 node, string calldata name, address recipient) internal {
        bytes32 label = keccak256(bytes(name));
        reservedNames[reservedNamesVersion[node]][node][label] = recipient;
        emit NameReserved(node, name, recipient);
    }

    function bulkReserve(bytes32 node, string[] calldata names, address[] calldata recipients) external nodeOperator(node) {
        require(names.length == recipients.length, "names and recipients must have the same length");
        for (uint i = 0; i < names.length; i++) {
            bytes32 label = keccak256(bytes(names[i]));
            reservedNames[reservedNamesVersion[node]][node][label] = recipients[i];
            emit NameReserved(node, names[i], recipients[i]);
        }
    }

    function clearReservedNames(bytes32 node) external nodeOperator(node) {
        reservedNamesVersion[node]++;
        emit ReservedNamesCleared(node);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract UniversalRegistrar","name":"base_","type":"address"},{"internalType":"contract PremiumPriceOracle","name":"prices_","type":"address"},{"internalType":"contract NameStore","name":"store_","type":"address"},{"internalType":"uint256","name":"minCommitmentAge_","type":"uint256"},{"internalType":"uint256","name":"maxCommitmentAge_","type":"uint256"},{"internalType":"uint256","name":"ownerShare_","type":"uint256"},{"internalType":"uint256","name":"registryShare_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tld","type":"bytes32"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"cost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tld","type":"bytes32"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"cost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"}],"name":"NewPriceOracle","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":false,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"inputs":[],"name":"MIN_REGISTRATION_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"}],"name":"availabilityInfo","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"}],"name":"available","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"base","outputs":[{"internalType":"contract UniversalRegistrar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"commit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"commitments","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"secret","type":"bytes32"}],"name":"makeCommitment","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"addr","type":"address"}],"name":"makeCommitmentWithConfig","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"maxCommitmentAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minCommitmentAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"ownerBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"ownerPayee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"ownerReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"bytes32","name":"secret","type":"bytes32"}],"name":"register","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"addr","type":"address"}],"name":"registerReservedWithConfig","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"addr","type":"address"}],"name":"registerWithConfig","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"registryBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryPayee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"registryReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"releaseToOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"releaseToRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"renew","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"rentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"valid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]

60806040523480156200001157600080fd5b50604051620033eb380380620033eb833981016040819052620000349162000115565b8682826200004233620000c5565b600880546001600160a01b0319166001600160a01b038516179055600382905560028190556200007381836200018f565b6001555050508383116200008657600080fd5b5050600a80546001600160a01b039485166001600160a01b0319918216179091556009805495909416941693909317909155600b55600c5550620001cd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600080600060e0888a03121562000130578283fd5b87516200013d81620001b4565b60208901519097506200015081620001b4565b60408901519096506200016381620001b4565b80955050606088015193506080880151925060a0880151915060c0880151905092959891949750929550565b60008219821115620001af57634e487b7160e01b81526011600452602481fd5b500190565b6001600160a01b0381168114620001ca57600080fd5b50565b61320e80620001dd6000396000f3fe6080604052600436106101fe5760003560e01c80638d839ffe1161011d578063b07b9eec116100b0578063ce1e09c01161007f578063f024ad4411610064578063f024ad44146105d8578063f14fcbc8146105f8578063f2fde38b1461061857600080fd5b8063ce1e09c0146105af578063d6238f7d146105c557600080fd5b8063b07b9eec1461052f578063c1eeb97214610542578063c837b0d11461056f578063caf162571461058257600080fd5b80639791c097116100ec5780639791c09714610481578063987f2764146104a1578063a55b9f60146104e2578063aaafffac1461050f57600080fd5b80638d839ffe146104185780638d9d367f1461042e5780638da5cb5b1461044e5780638f1c31511461046c57600080fd5b80635001f3b511610195578063839df94511610164578063839df9451461039257806389eba421146103bf5780638a95b09f146103ec5780638bb7b7781461040357600080fd5b80635001f3b5146103055780635e56ae7c1461033d578063715018a61461035d5780637e76458a1461037257600080fd5b80631e56ca53116101d15780631e56ca531461029b5780633a5a749f146102bb5780633a98ef39146102d05780634c5ad439146102e557600080fd5b806301ffc9a71461020357806312af901f14610238578063164f4c36146102665780631a0cd0c214610286575b600080fd5b34801561020f57600080fd5b5061022361021e366004612edf565b610638565b60405190151581526020015b60405180910390f35b34801561024457600080fd5b50610258610253366004612d19565b610769565b60405190815260200161022f565b34801561027257600080fd5b50610258610281366004612bfc565b610783565b610299610294366004612dff565b6107cf565b005b3480156102a757600080fd5b506102236102b6366004612cd4565b610d70565b3480156102c757600080fd5b50600254610258565b3480156102dc57600080fd5b50600154610258565b3480156102f157600080fd5b50610299610300366004612bfc565b610e31565b34801561031157600080fd5b50600854610325906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b34801561034957600080fd5b50610325610358366004612bfc565b610f79565b34801561036957600080fd5b50610299611174565b34801561037e57600080fd5b5061029961038d366004612bfc565b6111f4565b34801561039e57600080fd5b506102586103ad366004612bfc565b600d6020526000908152604090205481565b3480156103cb57600080fd5b506102586103da366004612bfc565b60009081526004602052604090205490565b3480156103f857600080fd5b506102586224ea0081565b34801561040f57600080fd5b506103256112d8565b34801561042457600080fd5b50610258600b5481565b34801561043a57600080fd5b50610258610449366004612bfc565b6113e3565b34801561045a57600080fd5b506000546001600160a01b0316610325565b34801561047857600080fd5b50600354610258565b34801561048d57600080fd5b5061022361049c366004612f1f565b611428565b3480156104ad57600080fd5b506104c16104bc366004612cd4565b61143d565b6040805160ff90931683526001600160a01b0390911660208301520161022f565b3480156104ee57600080fd5b506102586104fd366004612bfc565b60009081526006602052604090205490565b34801561051b57600080fd5b5061025861052a366004612e91565b611728565b61029961053d366004612d78565b611864565b34801561054e57600080fd5b5061025861055d366004612bfc565b60009081526005602052604090205490565b61029961057d366004612c83565b612075565b34801561058e57600080fd5b5061025861059d366004612bfc565b60009081526007602052604090205490565b3480156105bb57600080fd5b50610258600c5481565b6102996105d3366004612c14565b61221f565b3480156105e457600080fd5b506102586105f3366004612d78565b61226c565b34801561060457600080fd5b50610299610613366004612bfc565b612292565b34801561062457600080fd5b50610299610633366004612ba4565b6122cc565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806106cb57507fffffffff0000000000000000000000000000000000000000000000000000000082167f490d518400000000000000000000000000000000000000000000000000000000145b8061071757507fffffffff0000000000000000000000000000000000000000000000000000000082167fea287d8600000000000000000000000000000000000000000000000000000000145b8061076357507fffffffff0000000000000000000000000000000000000000000000000000000082167f2804b98800000000000000000000000000000000000000000000000000000000145b92915050565b600061077a8585858560008061226c565b95945050505050565b600081815260056020908152604080832054600490925282205482916107a891613087565b6003546000858152600760205260409020549192506107c89183906123e2565b9392505050565b8551602087012060006107f2898984896107ed84838e8d8d8d612408565b612518565b600a546040517f80d1795e000000000000000000000000000000000000000000000000000000008152600481018c9052602481018590529192506001600160a01b0316906380d1795e90604401600060405180830381600087803b15801561085957600080fd5b505af115801561086d573d6000803e3d6000fd5b506000925050506001600160a01b03851615610c0f576008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018c905260248101859052306044820152606481018990526001600160a01b039091169063d9b0829f90608401602060405180830381600087803b1580156108f657600080fd5b505af115801561090a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092e9190612f52565b905060008a8460405160200161094e929190918252602082015260400190565b60408051601f1981840301815282825280516020918201206008547f3f15457f00000000000000000000000000000000000000000000000000000000855292519094506001600160a01b0390921692633f15457f9260048083019392829003018186803b1580156109be57600080fd5b505afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612bc0565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0388811660248301529190911690631896f70a90604401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505050506001600160a01b03851615610afe576040517fd5fa2b00000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03868116602483015287169063d5fa2b0090604401600060405180830381600087803b158015610ae557600080fd5b505af1158015610af9573d6000803e3d6000fd5b505050505b6008546040517f8ae85c4c000000000000000000000000000000000000000000000000000000008152600481018d9052602481018690526001600160a01b038b8116604483015290911690638ae85c4c90606401600060405180830381600087803b158015610b6c57600080fd5b505af1158015610b80573d6000803e3d6000fd5b50506008546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038d811660248301526044820186905290911692506323b872dd9150606401600060405180830381600087803b158015610bf157600080fd5b505af1158015610c05573d6000803e3d6000fd5b5050505050610cd3565b6001600160a01b03841615610c2357600080fd5b6008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018c9052602481018590526001600160a01b038a81166044830152606482018a90529091169063d9b0829f90608401602060405180830381600087803b158015610c9857600080fd5b505af1158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612f52565b90505b610cdd8a8361265c565b876001600160a01b0316838b7fbcab7089eb476e4916067070bdd55c9b45ad8b444db54e699f6e96644369f8c98c8686604051610d1c93929190613062565b60405180910390a481341115610d6457336108fc610d3a8434613115565b6040518115909202916000818181858888f19350505050158015610d62573d6000803e3d6000fd5b505b50505050505050505050565b80516020820120600090610d85848483612683565b8015610e295750600a546040517f5561be9d00000000000000000000000000000000000000000000000000000000815260048101869052602481018390526001600160a01b0390911690635561be9d906044015b60206040518083038186803b158015610df157600080fd5b505afa158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190612bdc565b949350505050565b6000610e3c82610783565b905080610eaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6f776e6572206973206e6f7420647565207061796d656e74000000000000000060448201526064015b60405180910390fd5b60008281526007602052604081208054839290610ec8908490613087565b909155505060008281526005602052604081208054839290610eeb908490613087565b909155505060008281526004602052604081208054839290610f0e908490613115565b9091555060009050610f1f83610f79565b9050610f2b81836126f5565b604080518481526001600160a01b03831660208201529081018390527f1e170c3b430cc6fdcdaa453c42619ac587e13793aa81a489fab9ebd7019c2efb9060600160405180910390a1505050565b6008546040517fd344f0620000000000000000000000000000000000000000000000000000000081526004810183905260009182916001600160a01b039091169063d344f0629060240160206040518083038186803b158015610fdb57600080fd5b505afa158015610fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110139190612bc0565b90506001600160a01b0381163b15610763576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f8cede5760000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561109d57600080fd5b505afa9250505080156110cd575060408051601f3d908101601f191682019092526110ca91810190612bdc565b60015b6110d657610763565b801561116d576040517f8cede576000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03831690638cede5769060240160206040518083038186803b15801561113557600080fd5b505afa158015611149573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190612bc0565b5092915050565b6000546001600160a01b031633146111e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ea1565b6111f26000612847565b565b60006111ff826113e3565b905080611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f7265676973747279206973206e6f7420647565207061796d656e7400000000006044820152606401610ea1565b60008281526006602052604081208054839290611286908490613087565b9091555050600082815260056020526040812080548392906112a9908490613087565b9091555050600082815260046020526040812080548392906112cc908490613115565b9091555060009050610f1f5b600854604080517febf0c71700000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163ebf0c717916004808301926020929190829003018186803b15801561133657600080fd5b505afa15801561134a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136e9190612bc0565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a657600080fd5b505afa1580156113ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113de9190612bc0565b905090565b6000818152600560209081526040808320546004909252822054829161140891613087565b6002546000858152600660205260409020549192506107c89183906123e2565b60006001611435836128af565b101592915050565b80516020820120600090819061145284611428565b158061150b57506008546001600160a01b03166396e494e861149b8784604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b81526004016114b991815260200190565b60206040518083038186803b1580156114d157600080fd5b505afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115099190612bdc565b155b1561151d576000809250925050611721565b600a546040517f93c3551700000000000000000000000000000000000000000000000000000000815260048101879052602481018390526000916001600160a01b0316906393c355179060440160206040518083038186803b15801561158257600080fd5b505afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190612bc0565b6001600160a01b03161461166f57600a546040517f93c3551700000000000000000000000000000000000000000000000000000000815260048101879052602481018390526002916001600160a01b0316906393c355179060440160206040518083038186803b15801561162d57600080fd5b505afa158015611641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116659190612bc0565b9250925050611721565b600a546040517f9d84a2c2000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0390911690639d84a2c29060240160206040518083038186803b1580156116cc57600080fd5b505afa1580156116e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117049190612bdc565b1561171757600360009250925050611721565b6001600092509250505b9250929050565b81516020830120600954600854600092916001600160a01b0390811691630e283ed591889188911663d6e4fa866117868488604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b81526004016117a491815260200190565b60206040518083038186803b1580156117bc57600080fd5b505afa1580156117d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f49190612f52565b876040518563ffffffff1660e01b81526004016118149493929190612ff7565b60206040518083038186803b15801561182c57600080fd5b505afa158015611840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612f52565b84516020860120611876878783612683565b80156119145750600a546040517f9d84a2c2000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b0390911690639d84a2c29060240160206040518083038186803b1580156118da57600080fd5b505afa1580156118ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119129190612bdc565b155b61191d57600080fd5b600a546040517f93c35517000000000000000000000000000000000000000000000000000000008152600481018990526024810183905233916001600160a01b0316906393c355179060440160206040518083038186803b15801561198157600080fd5b505afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b99190612bc0565b6001600160a01b031614611a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f756e617574686f726973656420746f207265676973746572207265736572766560448201527f64206e616d6500000000000000000000000000000000000000000000000000006064820152608401610ea1565b6000611a5c888887611728565b90506224ea00851015611a6e57600080fd5b80341015611a7b57600080fd5b600a546040517f80d1795e000000000000000000000000000000000000000000000000000000008152600481018a9052602481018490526001600160a01b03909116906380d1795e90604401600060405180830381600087803b158015611ae157600080fd5b505af1158015611af5573d6000803e3d6000fd5b5050600a546040517fe62e1e820000000000000000000000000000000000000000000000000000000081526001600160a01b03909116925063e62e1e829150611b47908b908b90600090600401612fc5565b600060405180830381600087803b158015611b6157600080fd5b505af1158015611b75573d6000803e3d6000fd5b506000925050506001600160a01b03851615611f17576008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018b905260248101859052306044820152606481018890526001600160a01b039091169063d9b0829f90608401602060405180830381600087803b158015611bfe57600080fd5b505af1158015611c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c369190612f52565b905060008984604051602001611c56929190918252602082015260400190565b60408051601f1981840301815282825280516020918201206008547f3f15457f00000000000000000000000000000000000000000000000000000000855292519094506001600160a01b0390921692633f15457f9260048083019392829003018186803b158015611cc657600080fd5b505afa158015611cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfe9190612bc0565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0388811660248301529190911690631896f70a90604401600060405180830381600087803b158015611d6357600080fd5b505af1158015611d77573d6000803e3d6000fd5b505050506001600160a01b03851615611e06576040517fd5fa2b00000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03868116602483015287169063d5fa2b0090604401600060405180830381600087803b158015611ded57600080fd5b505af1158015611e01573d6000803e3d6000fd5b505050505b6008546040517f8ae85c4c000000000000000000000000000000000000000000000000000000008152600481018c9052602481018690526001600160a01b038a8116604483015290911690638ae85c4c90606401600060405180830381600087803b158015611e7457600080fd5b505af1158015611e88573d6000803e3d6000fd5b50506008546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038c811660248301526044820186905290911692506323b872dd9150606401600060405180830381600087803b158015611ef957600080fd5b505af1158015611f0d573d6000803e3d6000fd5b5050505050611fdb565b6001600160a01b03841615611f2b57600080fd5b6008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018b9052602481018590526001600160a01b038981166044830152606482018990529091169063d9b0829f90608401602060405180830381600087803b158015611fa057600080fd5b505af1158015611fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd89190612f52565b90505b611fe5898361265c565b866001600160a01b0316838a7fbcab7089eb476e4916067070bdd55c9b45ad8b444db54e699f6e96644369f8c98b868660405161202493929190613062565b60405180910390a48134111561206a57336108fc6120428434613115565b6040518115909202916000818181858888f19350505050158015610d64573d6000803e3d6000fd5b505050505050505050565b60006120b98585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250611728915050565b9050803410156120c857600080fd5b600084846040516120da929190612fb5565b6040519081900381206008547fcd34004b0000000000000000000000000000000000000000000000000000000083526004830189905260248301829052604483018690529092506000916001600160a01b039091169063cd34004b90606401602060405180830381600087803b15801561215357600080fd5b505af1158015612167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218b9190612f52565b9050612197878461265c565b823411156121d757336108fc6121ad8534613115565b6040518115909202916000818181858888f193505050501580156121d5573d6000803e3d6000fd5b505b81877f25e87b59363c8952f38dba7977d573f2623c9f4da005ba6556338ad7e4435e848888878660405161220e9493929190613023565b60405180910390a350505050505050565b6122648686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250899350889250879150806107cf565b505050505050565b84516020860120600090612284888288888888612408565b9150505b9695505050505050565b600c546000828152600d602052604090205442916122af91613087565b106122b957600080fd5b6000908152600d60205260409020429055565b6000546001600160a01b03163314612340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ea1565b6001600160a01b0381166123d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ea1565b6123df81612847565b50565b60008160015485856123f491906130d8565b6123fe919061309f565b610e299190613115565b60006001600160a01b03831615801561242857506001600160a01b038216155b15612490576040805160208101899052908101879052606086811b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169082015260748101859052609401604051602081830303815290604052805190602001209050612288565b6001600160a01b0383166124a357600080fd5b5060408051602080820198909852808201969096527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606095861b81168688015292851b83166074870152931b166088840152609c808401919091528151808403909101815260bc9092019052805191012090565b600b546000828152600d6020526040812054909142916125389190613087565b111561254357600080fd5b600c546000838152600d6020526040902054429161256091613087565b1161256a57600080fd5b612575868686612683565b80156126185750600a546040517f5561be9d00000000000000000000000000000000000000000000000000000000815260048101889052602481018690526001600160a01b0390911690635561be9d9060440160206040518083038186803b1580156125e057600080fd5b505afa1580156125f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126189190612bdc565b61262157600080fd5b6000828152600d6020526040812081905561263d878786611728565b90506224ea0084101561264f57600080fd5b8034101561228857600080fd5b6000828152600460205260408120805483929061267a908490613087565b90915550505050565b600061268e83611428565b8015610e2957506008546001600160a01b03166396e494e86126d78685604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b8152600401610dd991815260200190565b8047101561275f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ea1565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127ac576040519150601f19603f3d011682016040523d82523d6000602084013e6127b1565b606091505b5050905080612842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610ea1565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8051600090819081905b80821015612ad45760008583815181106128fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561295f57612958600184613087565b9250612ac1565b7fe0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156129b457612958600284613087565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612a0957612958600384613087565b7ff8000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612a5e57612958600484613087565b7ffc000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612ab357612958600584613087565b612abe600684613087565b92505b5082612acc8161312c565b9350506128b9565b50909392505050565b60008083601f840112612aee578182fd5b50813567ffffffffffffffff811115612b05578182fd5b60208301915083602082850101111561172157600080fd5b600082601f830112612b2d578081fd5b813567ffffffffffffffff80821115612b4857612b48613194565b604051601f8301601f19908116603f01168101908282118183101715612b7057612b70613194565b81604052838152866020858801011115612b88578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215612bb5578081fd5b81356107c8816131c3565b600060208284031215612bd1578081fd5b81516107c8816131c3565b600060208284031215612bed578081fd5b815180151581146107c8578182fd5b600060208284031215612c0d578081fd5b5035919050565b60008060008060008060a08789031215612c2c578182fd5b86359550602087013567ffffffffffffffff811115612c49578283fd5b612c5589828a01612add565b9096509450506040870135612c69816131c3565b959894975092956060810135946080909101359350915050565b60008060008060608587031215612c98578384fd5b84359350602085013567ffffffffffffffff811115612cb5578384fd5b612cc187828801612add565b9598909750949560400135949350505050565b60008060408385031215612ce6578182fd5b82359150602083013567ffffffffffffffff811115612d03578182fd5b612d0f85828601612b1d565b9150509250929050565b60008060008060808587031215612d2e578384fd5b84359350602085013567ffffffffffffffff811115612d4b578384fd5b612d5787828801612b1d565b9350506040850135612d68816131c3565b9396929550929360600135925050565b60008060008060008060c08789031215612d90578182fd5b86359550602087013567ffffffffffffffff811115612dad578283fd5b612db989828a01612b1d565b9550506040870135612dca816131c3565b9350606087013592506080870135612de1816131c3565b915060a0870135612df1816131c3565b809150509295509295509295565b600080600080600080600060e0888a031215612e19578485fd5b87359650602088013567ffffffffffffffff811115612e36578586fd5b612e428a828b01612b1d565b9650506040880135612e53816131c3565b9450606088013593506080880135925060a0880135612e71816131c3565b915060c0880135612e81816131c3565b8091505092959891949750929550565b600080600060608486031215612ea5578081fd5b83359250602084013567ffffffffffffffff811115612ec2578182fd5b612ece86828701612b1d565b925050604084013590509250925092565b600060208284031215612ef0578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146107c8578182fd5b600060208284031215612f30578081fd5b813567ffffffffffffffff811115612f46578182fd5b610e2984828501612b1d565b600060208284031215612f63578081fd5b5051919050565b60008151808452815b81811015612f8f57602081850181015186830182015201612f73565b81811115612fa05782602083870101525b50601f01601f19169290920160200192915050565b8183823760009101908152919050565b838152606060208201526000612fde6060830185612f6a565b90506001600160a01b0383166040830152949350505050565b8481526080602082015260006130106080830186612f6a565b6040830194909452506060015292915050565b6060815283606082015283856080830137600080608086840101526080601f19601f870116830101905083602083015282604083015295945050505050565b6060815260006130756060830186612f6a565b60208301949094525060400152919050565b6000821982111561309a5761309a613165565b500190565b6000826130d3577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561311057613110613165565b500290565b60008282101561312757613127613165565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561315e5761315e613165565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146123df57600080fdfea26469706673582212203c6275ad285374ecf0754ad7dccefeec2bed9e6ac1811740bd097bd93cd49afb64736f6c63430008040033000000000000000000000000feddc1448eb4480714a9942ba28a27b16caf9ce4000000000000000000000000992e4a95195ea9ce0f9b4b9d30364d3b0df5263a0000000000000000000000008f27dabde3ff0b1394c2cfb330a74c8dc750e108000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000093a8000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000014

Deployed Bytecode

0x6080604052600436106101fe5760003560e01c80638d839ffe1161011d578063b07b9eec116100b0578063ce1e09c01161007f578063f024ad4411610064578063f024ad44146105d8578063f14fcbc8146105f8578063f2fde38b1461061857600080fd5b8063ce1e09c0146105af578063d6238f7d146105c557600080fd5b8063b07b9eec1461052f578063c1eeb97214610542578063c837b0d11461056f578063caf162571461058257600080fd5b80639791c097116100ec5780639791c09714610481578063987f2764146104a1578063a55b9f60146104e2578063aaafffac1461050f57600080fd5b80638d839ffe146104185780638d9d367f1461042e5780638da5cb5b1461044e5780638f1c31511461046c57600080fd5b80635001f3b511610195578063839df94511610164578063839df9451461039257806389eba421146103bf5780638a95b09f146103ec5780638bb7b7781461040357600080fd5b80635001f3b5146103055780635e56ae7c1461033d578063715018a61461035d5780637e76458a1461037257600080fd5b80631e56ca53116101d15780631e56ca531461029b5780633a5a749f146102bb5780633a98ef39146102d05780634c5ad439146102e557600080fd5b806301ffc9a71461020357806312af901f14610238578063164f4c36146102665780631a0cd0c214610286575b600080fd5b34801561020f57600080fd5b5061022361021e366004612edf565b610638565b60405190151581526020015b60405180910390f35b34801561024457600080fd5b50610258610253366004612d19565b610769565b60405190815260200161022f565b34801561027257600080fd5b50610258610281366004612bfc565b610783565b610299610294366004612dff565b6107cf565b005b3480156102a757600080fd5b506102236102b6366004612cd4565b610d70565b3480156102c757600080fd5b50600254610258565b3480156102dc57600080fd5b50600154610258565b3480156102f157600080fd5b50610299610300366004612bfc565b610e31565b34801561031157600080fd5b50600854610325906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b34801561034957600080fd5b50610325610358366004612bfc565b610f79565b34801561036957600080fd5b50610299611174565b34801561037e57600080fd5b5061029961038d366004612bfc565b6111f4565b34801561039e57600080fd5b506102586103ad366004612bfc565b600d6020526000908152604090205481565b3480156103cb57600080fd5b506102586103da366004612bfc565b60009081526004602052604090205490565b3480156103f857600080fd5b506102586224ea0081565b34801561040f57600080fd5b506103256112d8565b34801561042457600080fd5b50610258600b5481565b34801561043a57600080fd5b50610258610449366004612bfc565b6113e3565b34801561045a57600080fd5b506000546001600160a01b0316610325565b34801561047857600080fd5b50600354610258565b34801561048d57600080fd5b5061022361049c366004612f1f565b611428565b3480156104ad57600080fd5b506104c16104bc366004612cd4565b61143d565b6040805160ff90931683526001600160a01b0390911660208301520161022f565b3480156104ee57600080fd5b506102586104fd366004612bfc565b60009081526006602052604090205490565b34801561051b57600080fd5b5061025861052a366004612e91565b611728565b61029961053d366004612d78565b611864565b34801561054e57600080fd5b5061025861055d366004612bfc565b60009081526005602052604090205490565b61029961057d366004612c83565b612075565b34801561058e57600080fd5b5061025861059d366004612bfc565b60009081526007602052604090205490565b3480156105bb57600080fd5b50610258600c5481565b6102996105d3366004612c14565b61221f565b3480156105e457600080fd5b506102586105f3366004612d78565b61226c565b34801561060457600080fd5b50610299610613366004612bfc565b612292565b34801561062457600080fd5b50610299610633366004612ba4565b6122cc565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806106cb57507fffffffff0000000000000000000000000000000000000000000000000000000082167f490d518400000000000000000000000000000000000000000000000000000000145b8061071757507fffffffff0000000000000000000000000000000000000000000000000000000082167fea287d8600000000000000000000000000000000000000000000000000000000145b8061076357507fffffffff0000000000000000000000000000000000000000000000000000000082167f2804b98800000000000000000000000000000000000000000000000000000000145b92915050565b600061077a8585858560008061226c565b95945050505050565b600081815260056020908152604080832054600490925282205482916107a891613087565b6003546000858152600760205260409020549192506107c89183906123e2565b9392505050565b8551602087012060006107f2898984896107ed84838e8d8d8d612408565b612518565b600a546040517f80d1795e000000000000000000000000000000000000000000000000000000008152600481018c9052602481018590529192506001600160a01b0316906380d1795e90604401600060405180830381600087803b15801561085957600080fd5b505af115801561086d573d6000803e3d6000fd5b506000925050506001600160a01b03851615610c0f576008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018c905260248101859052306044820152606481018990526001600160a01b039091169063d9b0829f90608401602060405180830381600087803b1580156108f657600080fd5b505af115801561090a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092e9190612f52565b905060008a8460405160200161094e929190918252602082015260400190565b60408051601f1981840301815282825280516020918201206008547f3f15457f00000000000000000000000000000000000000000000000000000000855292519094506001600160a01b0390921692633f15457f9260048083019392829003018186803b1580156109be57600080fd5b505afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612bc0565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0388811660248301529190911690631896f70a90604401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505050506001600160a01b03851615610afe576040517fd5fa2b00000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03868116602483015287169063d5fa2b0090604401600060405180830381600087803b158015610ae557600080fd5b505af1158015610af9573d6000803e3d6000fd5b505050505b6008546040517f8ae85c4c000000000000000000000000000000000000000000000000000000008152600481018d9052602481018690526001600160a01b038b8116604483015290911690638ae85c4c90606401600060405180830381600087803b158015610b6c57600080fd5b505af1158015610b80573d6000803e3d6000fd5b50506008546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038d811660248301526044820186905290911692506323b872dd9150606401600060405180830381600087803b158015610bf157600080fd5b505af1158015610c05573d6000803e3d6000fd5b5050505050610cd3565b6001600160a01b03841615610c2357600080fd5b6008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018c9052602481018590526001600160a01b038a81166044830152606482018a90529091169063d9b0829f90608401602060405180830381600087803b158015610c9857600080fd5b505af1158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612f52565b90505b610cdd8a8361265c565b876001600160a01b0316838b7fbcab7089eb476e4916067070bdd55c9b45ad8b444db54e699f6e96644369f8c98c8686604051610d1c93929190613062565b60405180910390a481341115610d6457336108fc610d3a8434613115565b6040518115909202916000818181858888f19350505050158015610d62573d6000803e3d6000fd5b505b50505050505050505050565b80516020820120600090610d85848483612683565b8015610e295750600a546040517f5561be9d00000000000000000000000000000000000000000000000000000000815260048101869052602481018390526001600160a01b0390911690635561be9d906044015b60206040518083038186803b158015610df157600080fd5b505afa158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190612bdc565b949350505050565b6000610e3c82610783565b905080610eaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6f776e6572206973206e6f7420647565207061796d656e74000000000000000060448201526064015b60405180910390fd5b60008281526007602052604081208054839290610ec8908490613087565b909155505060008281526005602052604081208054839290610eeb908490613087565b909155505060008281526004602052604081208054839290610f0e908490613115565b9091555060009050610f1f83610f79565b9050610f2b81836126f5565b604080518481526001600160a01b03831660208201529081018390527f1e170c3b430cc6fdcdaa453c42619ac587e13793aa81a489fab9ebd7019c2efb9060600160405180910390a1505050565b6008546040517fd344f0620000000000000000000000000000000000000000000000000000000081526004810183905260009182916001600160a01b039091169063d344f0629060240160206040518083038186803b158015610fdb57600080fd5b505afa158015610fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110139190612bc0565b90506001600160a01b0381163b15610763576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f8cede5760000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561109d57600080fd5b505afa9250505080156110cd575060408051601f3d908101601f191682019092526110ca91810190612bdc565b60015b6110d657610763565b801561116d576040517f8cede576000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03831690638cede5769060240160206040518083038186803b15801561113557600080fd5b505afa158015611149573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190612bc0565b5092915050565b6000546001600160a01b031633146111e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ea1565b6111f26000612847565b565b60006111ff826113e3565b905080611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f7265676973747279206973206e6f7420647565207061796d656e7400000000006044820152606401610ea1565b60008281526006602052604081208054839290611286908490613087565b9091555050600082815260056020526040812080548392906112a9908490613087565b9091555050600082815260046020526040812080548392906112cc908490613115565b9091555060009050610f1f5b600854604080517febf0c71700000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163ebf0c717916004808301926020929190829003018186803b15801561133657600080fd5b505afa15801561134a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136e9190612bc0565b6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a657600080fd5b505afa1580156113ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113de9190612bc0565b905090565b6000818152600560209081526040808320546004909252822054829161140891613087565b6002546000858152600660205260409020549192506107c89183906123e2565b60006001611435836128af565b101592915050565b80516020820120600090819061145284611428565b158061150b57506008546001600160a01b03166396e494e861149b8784604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b81526004016114b991815260200190565b60206040518083038186803b1580156114d157600080fd5b505afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115099190612bdc565b155b1561151d576000809250925050611721565b600a546040517f93c3551700000000000000000000000000000000000000000000000000000000815260048101879052602481018390526000916001600160a01b0316906393c355179060440160206040518083038186803b15801561158257600080fd5b505afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190612bc0565b6001600160a01b03161461166f57600a546040517f93c3551700000000000000000000000000000000000000000000000000000000815260048101879052602481018390526002916001600160a01b0316906393c355179060440160206040518083038186803b15801561162d57600080fd5b505afa158015611641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116659190612bc0565b9250925050611721565b600a546040517f9d84a2c2000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0390911690639d84a2c29060240160206040518083038186803b1580156116cc57600080fd5b505afa1580156116e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117049190612bdc565b1561171757600360009250925050611721565b6001600092509250505b9250929050565b81516020830120600954600854600092916001600160a01b0390811691630e283ed591889188911663d6e4fa866117868488604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b81526004016117a491815260200190565b60206040518083038186803b1580156117bc57600080fd5b505afa1580156117d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f49190612f52565b876040518563ffffffff1660e01b81526004016118149493929190612ff7565b60206040518083038186803b15801561182c57600080fd5b505afa158015611840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612f52565b84516020860120611876878783612683565b80156119145750600a546040517f9d84a2c2000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b0390911690639d84a2c29060240160206040518083038186803b1580156118da57600080fd5b505afa1580156118ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119129190612bdc565b155b61191d57600080fd5b600a546040517f93c35517000000000000000000000000000000000000000000000000000000008152600481018990526024810183905233916001600160a01b0316906393c355179060440160206040518083038186803b15801561198157600080fd5b505afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b99190612bc0565b6001600160a01b031614611a4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f756e617574686f726973656420746f207265676973746572207265736572766560448201527f64206e616d6500000000000000000000000000000000000000000000000000006064820152608401610ea1565b6000611a5c888887611728565b90506224ea00851015611a6e57600080fd5b80341015611a7b57600080fd5b600a546040517f80d1795e000000000000000000000000000000000000000000000000000000008152600481018a9052602481018490526001600160a01b03909116906380d1795e90604401600060405180830381600087803b158015611ae157600080fd5b505af1158015611af5573d6000803e3d6000fd5b5050600a546040517fe62e1e820000000000000000000000000000000000000000000000000000000081526001600160a01b03909116925063e62e1e829150611b47908b908b90600090600401612fc5565b600060405180830381600087803b158015611b6157600080fd5b505af1158015611b75573d6000803e3d6000fd5b506000925050506001600160a01b03851615611f17576008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018b905260248101859052306044820152606481018890526001600160a01b039091169063d9b0829f90608401602060405180830381600087803b158015611bfe57600080fd5b505af1158015611c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c369190612f52565b905060008984604051602001611c56929190918252602082015260400190565b60408051601f1981840301815282825280516020918201206008547f3f15457f00000000000000000000000000000000000000000000000000000000855292519094506001600160a01b0390921692633f15457f9260048083019392829003018186803b158015611cc657600080fd5b505afa158015611cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfe9190612bc0565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0388811660248301529190911690631896f70a90604401600060405180830381600087803b158015611d6357600080fd5b505af1158015611d77573d6000803e3d6000fd5b505050506001600160a01b03851615611e06576040517fd5fa2b00000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03868116602483015287169063d5fa2b0090604401600060405180830381600087803b158015611ded57600080fd5b505af1158015611e01573d6000803e3d6000fd5b505050505b6008546040517f8ae85c4c000000000000000000000000000000000000000000000000000000008152600481018c9052602481018690526001600160a01b038a8116604483015290911690638ae85c4c90606401600060405180830381600087803b158015611e7457600080fd5b505af1158015611e88573d6000803e3d6000fd5b50506008546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038c811660248301526044820186905290911692506323b872dd9150606401600060405180830381600087803b158015611ef957600080fd5b505af1158015611f0d573d6000803e3d6000fd5b5050505050611fdb565b6001600160a01b03841615611f2b57600080fd5b6008546040517fd9b0829f000000000000000000000000000000000000000000000000000000008152600481018b9052602481018590526001600160a01b038981166044830152606482018990529091169063d9b0829f90608401602060405180830381600087803b158015611fa057600080fd5b505af1158015611fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd89190612f52565b90505b611fe5898361265c565b866001600160a01b0316838a7fbcab7089eb476e4916067070bdd55c9b45ad8b444db54e699f6e96644369f8c98b868660405161202493929190613062565b60405180910390a48134111561206a57336108fc6120428434613115565b6040518115909202916000818181858888f19350505050158015610d64573d6000803e3d6000fd5b505050505050505050565b60006120b98585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250611728915050565b9050803410156120c857600080fd5b600084846040516120da929190612fb5565b6040519081900381206008547fcd34004b0000000000000000000000000000000000000000000000000000000083526004830189905260248301829052604483018690529092506000916001600160a01b039091169063cd34004b90606401602060405180830381600087803b15801561215357600080fd5b505af1158015612167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218b9190612f52565b9050612197878461265c565b823411156121d757336108fc6121ad8534613115565b6040518115909202916000818181858888f193505050501580156121d5573d6000803e3d6000fd5b505b81877f25e87b59363c8952f38dba7977d573f2623c9f4da005ba6556338ad7e4435e848888878660405161220e9493929190613023565b60405180910390a350505050505050565b6122648686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250899350889250879150806107cf565b505050505050565b84516020860120600090612284888288888888612408565b9150505b9695505050505050565b600c546000828152600d602052604090205442916122af91613087565b106122b957600080fd5b6000908152600d60205260409020429055565b6000546001600160a01b03163314612340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ea1565b6001600160a01b0381166123d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ea1565b6123df81612847565b50565b60008160015485856123f491906130d8565b6123fe919061309f565b610e299190613115565b60006001600160a01b03831615801561242857506001600160a01b038216155b15612490576040805160208101899052908101879052606086811b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169082015260748101859052609401604051602081830303815290604052805190602001209050612288565b6001600160a01b0383166124a357600080fd5b5060408051602080820198909852808201969096527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606095861b81168688015292851b83166074870152931b166088840152609c808401919091528151808403909101815260bc9092019052805191012090565b600b546000828152600d6020526040812054909142916125389190613087565b111561254357600080fd5b600c546000838152600d6020526040902054429161256091613087565b1161256a57600080fd5b612575868686612683565b80156126185750600a546040517f5561be9d00000000000000000000000000000000000000000000000000000000815260048101889052602481018690526001600160a01b0390911690635561be9d9060440160206040518083038186803b1580156125e057600080fd5b505afa1580156125f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126189190612bdc565b61262157600080fd5b6000828152600d6020526040812081905561263d878786611728565b90506224ea0084101561264f57600080fd5b8034101561228857600080fd5b6000828152600460205260408120805483929061267a908490613087565b90915550505050565b600061268e83611428565b8015610e2957506008546001600160a01b03166396e494e86126d78685604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040518263ffffffff1660e01b8152600401610dd991815260200190565b8047101561275f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610ea1565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127ac576040519150601f19603f3d011682016040523d82523d6000602084013e6127b1565b606091505b5050905080612842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610ea1565b505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8051600090819081905b80821015612ad45760008583815181106128fc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561295f57612958600184613087565b9250612ac1565b7fe0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156129b457612958600284613087565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612a0957612958600384613087565b7ff8000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612a5e57612958600484613087565b7ffc000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612ab357612958600584613087565b612abe600684613087565b92505b5082612acc8161312c565b9350506128b9565b50909392505050565b60008083601f840112612aee578182fd5b50813567ffffffffffffffff811115612b05578182fd5b60208301915083602082850101111561172157600080fd5b600082601f830112612b2d578081fd5b813567ffffffffffffffff80821115612b4857612b48613194565b604051601f8301601f19908116603f01168101908282118183101715612b7057612b70613194565b81604052838152866020858801011115612b88578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215612bb5578081fd5b81356107c8816131c3565b600060208284031215612bd1578081fd5b81516107c8816131c3565b600060208284031215612bed578081fd5b815180151581146107c8578182fd5b600060208284031215612c0d578081fd5b5035919050565b60008060008060008060a08789031215612c2c578182fd5b86359550602087013567ffffffffffffffff811115612c49578283fd5b612c5589828a01612add565b9096509450506040870135612c69816131c3565b959894975092956060810135946080909101359350915050565b60008060008060608587031215612c98578384fd5b84359350602085013567ffffffffffffffff811115612cb5578384fd5b612cc187828801612add565b9598909750949560400135949350505050565b60008060408385031215612ce6578182fd5b82359150602083013567ffffffffffffffff811115612d03578182fd5b612d0f85828601612b1d565b9150509250929050565b60008060008060808587031215612d2e578384fd5b84359350602085013567ffffffffffffffff811115612d4b578384fd5b612d5787828801612b1d565b9350506040850135612d68816131c3565b9396929550929360600135925050565b60008060008060008060c08789031215612d90578182fd5b86359550602087013567ffffffffffffffff811115612dad578283fd5b612db989828a01612b1d565b9550506040870135612dca816131c3565b9350606087013592506080870135612de1816131c3565b915060a0870135612df1816131c3565b809150509295509295509295565b600080600080600080600060e0888a031215612e19578485fd5b87359650602088013567ffffffffffffffff811115612e36578586fd5b612e428a828b01612b1d565b9650506040880135612e53816131c3565b9450606088013593506080880135925060a0880135612e71816131c3565b915060c0880135612e81816131c3565b8091505092959891949750929550565b600080600060608486031215612ea5578081fd5b83359250602084013567ffffffffffffffff811115612ec2578182fd5b612ece86828701612b1d565b925050604084013590509250925092565b600060208284031215612ef0578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146107c8578182fd5b600060208284031215612f30578081fd5b813567ffffffffffffffff811115612f46578182fd5b610e2984828501612b1d565b600060208284031215612f63578081fd5b5051919050565b60008151808452815b81811015612f8f57602081850181015186830182015201612f73565b81811115612fa05782602083870101525b50601f01601f19169290920160200192915050565b8183823760009101908152919050565b838152606060208201526000612fde6060830185612f6a565b90506001600160a01b0383166040830152949350505050565b8481526080602082015260006130106080830186612f6a565b6040830194909452506060015292915050565b6060815283606082015283856080830137600080608086840101526080601f19601f870116830101905083602083015282604083015295945050505050565b6060815260006130756060830186612f6a565b60208301949094525060400152919050565b6000821982111561309a5761309a613165565b500190565b6000826130d3577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561311057613110613165565b500290565b60008282101561312757613127613165565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561315e5761315e613165565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146123df57600080fdfea26469706673582212203c6275ad285374ecf0754ad7dccefeec2bed9e6ac1811740bd097bd93cd49afb64736f6c63430008040033

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

000000000000000000000000feddc1448eb4480714a9942ba28a27b16caf9ce4000000000000000000000000992e4a95195ea9ce0f9b4b9d30364d3b0df5263a0000000000000000000000008f27dabde3ff0b1394c2cfb330a74c8dc750e108000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000093a8000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000014

-----Decoded View---------------
Arg [0] : base_ (address): 0xfEDDc1448Eb4480714A9942ba28a27b16Caf9cE4
Arg [1] : prices_ (address): 0x992E4A95195eA9ce0F9B4B9d30364D3B0DF5263a
Arg [2] : store_ (address): 0x8f27DAbdE3ff0B1394C2cfB330A74c8Dc750E108
Arg [3] : minCommitmentAge_ (uint256): 60
Arg [4] : maxCommitmentAge_ (uint256): 604800
Arg [5] : ownerShare_ (uint256): 80
Arg [6] : registryShare_ (uint256): 20

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000feddc1448eb4480714a9942ba28a27b16caf9ce4
Arg [1] : 000000000000000000000000992e4a95195ea9ce0f9b4b9d30364d3b0df5263a
Arg [2] : 0000000000000000000000008f27dabde3ff0b1394c2cfb330a74c8dc750e108
Arg [3] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [4] : 0000000000000000000000000000000000000000000000000000000000093a80
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000050
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000014


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.