Sepolia Testnet

Contract

0x5a07C75Ae469Bf3ee2657B588e8E6ABAC6741b4f

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Prove And Claim ...57447322024-04-21 8:32:4827 days ago1713688368IN
0x5a07C75A...AC6741b4f
0 ETH0.012423443.82327848
Prove And Claim ...56870502024-04-13 5:40:2435 days ago1712986824IN
0x5a07C75A...AC6741b4f
0 ETH0.001191490.36151465
Prove And Claim ...56282812024-04-04 15:24:4844 days ago1712244288IN
0x5a07C75A...AC6741b4f
0 ETH0.014866834.4282313
Prove And Claim ...56282652024-04-04 15:21:3644 days ago1712244096IN
0x5a07C75A...AC6741b4f
0 ETH0.014904154.33784145
Prove And Claim ...56126972024-04-02 10:22:2446 days ago1712053344IN
0x5a07C75A...AC6741b4f
0 ETH0.010719793.26672635
Prove And Claim ...55791622024-03-28 15:49:3651 days ago1711640976IN
0x5a07C75A...AC6741b4f
0 ETH0.002225450.67674851
Prove And Claim ...55631622024-03-26 7:11:1253 days ago1711437072IN
0x5a07C75A...AC6741b4f
0 ETH0.003297880.99517752
Prove And Claim54679352024-03-12 3:44:2467 days ago1710215064IN
0x5a07C75A...AC6741b4f
0 ETH0.005013041.54919737
Prove And Claim54645052024-03-11 15:57:4868 days ago1710172668IN
0x5a07C75A...AC6741b4f
0 ETH0.1285705640.83426648
Prove And Claim ...54634202024-03-11 12:19:4868 days ago1710159588IN
0x5a07C75A...AC6741b4f
0 ETH0.0600226818.45763834
Transfer53682172024-02-26 16:35:1282 days ago1708965312IN
0x5a07C75A...AC6741b4f
0 ETH0.000421420
Prove And Claim53468132024-02-23 10:51:4885 days ago1708685508IN
0x5a07C75A...AC6741b4f
0 ETH0.003181291.00000005
Prove And Claim ...53462792024-02-23 8:53:1285 days ago1708678392IN
0x5a07C75A...AC6741b4f
0 ETH0.005221351.50000051
Prove And Claim53407682024-02-22 12:09:3686 days ago1708603776IN
0x5a07C75A...AC6741b4f
0 ETH0.00026142.14588621
Prove And Claim ...52477492024-02-08 22:34:48100 days ago1707431688IN
0x5a07C75A...AC6741b4f
0 ETH0.049695378.44826587
Prove And Claim ...52012512024-02-02 2:14:00106 days ago1706840040IN
0x5a07C75A...AC6741b4f
0 ETH0.2071758760.64831881
Prove And Claim ...52011752024-02-02 1:58:00107 days ago1706839080IN
0x5a07C75A...AC6741b4f
0 ETH0.1542766346.30348371
Prove And Claim ...51954552024-02-01 5:47:24107 days ago1706766444IN
0x5a07C75A...AC6741b4f
0 ETH0.007237572.14646534
Prove And Claim ...51953102024-02-01 5:16:36107 days ago1706764596IN
0x5a07C75A...AC6741b4f
0 ETH0.005113631.48777124
Enable Node51487572024-01-25 2:35:12114 days ago1706150112IN
0x5a07C75A...AC6741b4f
0 ETH0.000171951.6288379
Enable Node51139222024-01-19 11:03:36120 days ago1705662216IN
0x5a07C75A...AC6741b4f
0 ETH0.0095582990.49699051
Enable Node51137252024-01-19 10:16:24120 days ago1705659384IN
0x5a07C75A...AC6741b4f
0 ETH0.0024458979.80079385
Enable Node51136432024-01-19 9:57:00120 days ago1705658220IN
0x5a07C75A...AC6741b4f
0 ETH0.0029207895.36939651
Set Public Suffi...51135272024-01-19 9:31:36120 days ago1705656696IN
0x5a07C75A...AC6741b4f
0 ETH0.00408724104.86039601
Enable Node50395982024-01-07 11:15:36132 days ago1704626136IN
0x5a07C75A...AC6741b4f
0 ETH0.000741420.84362072
View all transactions

Advanced mode:
Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DNSRegistrar

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1200 runs

Other Settings:
london EvmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : DNSRegistrar.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@ensdomains/buffer/contracts/Buffer.sol";
import "../dnssec-oracle/BytesUtils.sol";
import "../dnssec-oracle/DNSSEC.sol";
import "../dnssec-oracle/RRUtils.sol";
import "../registry/ENSRegistry.sol";
import "../root/Root.sol";
import "../resolvers/profiles/AddrResolver.sol";
import "./DNSClaimChecker.sol";
import "./PublicSuffixList.sol";
import "./IDNSRegistrar.sol";

/**
 * @dev An ENS registrar that allows the owner of a DNS name to claim the
 *      corresponding name in ENS.
 */
contract DNSRegistrar is IDNSRegistrar, IERC165 {
    using BytesUtils for bytes;
    using Buffer for Buffer.buffer;
    using RRUtils for *;

    ENS public immutable ens;
    DNSSEC public immutable oracle;
    PublicSuffixList public suffixes;
    address public immutable previousRegistrar;
    address public immutable resolver;
    // A mapping of the most recent signatures seen for each claimed domain.
    mapping(bytes32 => uint32) public inceptions;

    error NoOwnerRecordFound();
    error PermissionDenied(address caller, address owner);
    error PreconditionNotMet();
    error StaleProof();
    error InvalidPublicSuffix(bytes name);

    struct OwnerRecord {
        bytes name;
        address owner;
        address resolver;
        uint64 ttl;
    }

    event Claim(
        bytes32 indexed node,
        address indexed owner,
        bytes dnsname,
        uint32 inception
    );
    event NewPublicSuffixList(address suffixes);

    constructor(
        address _previousRegistrar,
        address _resolver,
        DNSSEC _dnssec,
        PublicSuffixList _suffixes,
        ENS _ens
    ) {
        previousRegistrar = _previousRegistrar;
        resolver = _resolver;
        oracle = _dnssec;
        suffixes = _suffixes;
        emit NewPublicSuffixList(address(suffixes));
        ens = _ens;
    }

    /**
     * @dev This contract's owner-only functions can be invoked by the owner of the ENS root.
     */
    modifier onlyOwner() {
        Root root = Root(ens.owner(bytes32(0)));
        address owner = root.owner();
        require(msg.sender == owner);
        _;
    }

    function setPublicSuffixList(PublicSuffixList _suffixes) public onlyOwner {
        suffixes = _suffixes;
        emit NewPublicSuffixList(address(suffixes));
    }

    /**
     * @dev Submits proofs to the DNSSEC oracle, then claims a name using those proofs.
     * @param name The name to claim, in DNS wire format.
     * @param input A chain of signed DNS RRSETs ending with a text record.
     */
    function proveAndClaim(
        bytes memory name,
        DNSSEC.RRSetWithSignature[] memory input
    ) public override {
        (bytes32 rootNode, bytes32 labelHash, address addr) = _claim(
            name,
            input
        );
        ens.setSubnodeOwner(rootNode, labelHash, addr);
    }

    function proveAndClaimWithResolver(
        bytes memory name,
        DNSSEC.RRSetWithSignature[] memory input,
        address resolver,
        address addr
    ) public override {
        (bytes32 rootNode, bytes32 labelHash, address owner) = _claim(
            name,
            input
        );
        if (msg.sender != owner) {
            revert PermissionDenied(msg.sender, owner);
        }
        ens.setSubnodeRecord(rootNode, labelHash, owner, resolver, 0);
        if (addr != address(0)) {
            if (resolver == address(0)) {
                revert PreconditionNotMet();
            }
            bytes32 node = keccak256(abi.encodePacked(rootNode, labelHash));
            // Set the resolver record
            AddrResolver(resolver).setAddr(node, addr);
        }
    }

    function supportsInterface(
        bytes4 interfaceID
    ) external pure override returns (bool) {
        return
            interfaceID == type(IERC165).interfaceId ||
            interfaceID == type(IDNSRegistrar).interfaceId;
    }

    function _claim(
        bytes memory name,
        DNSSEC.RRSetWithSignature[] memory input
    ) internal returns (bytes32 parentNode, bytes32 labelHash, address addr) {
        (bytes memory data, uint32 inception) = oracle.verifyRRSet(input);

        // Get the first label
        uint256 labelLen = name.readUint8(0);
        labelHash = name.keccak(1, labelLen);

        bytes memory parentName = name.substring(
            labelLen + 1,
            name.length - labelLen - 1
        );

        // Make sure the parent name is enabled
        parentNode = enableNode(parentName);

        bytes32 node = keccak256(abi.encodePacked(parentNode, labelHash));
        if (!RRUtils.serialNumberGte(inception, inceptions[node])) {
            revert StaleProof();
        }
        inceptions[node] = inception;

        bool found;
        (addr, found) = DNSClaimChecker.getOwnerAddress(name, data);
        if (!found) {
            revert NoOwnerRecordFound();
        }

        emit Claim(node, addr, name, inception);
    }

    function enableNode(bytes memory domain) public returns (bytes32 node) {
        // Name must be in the public suffix list.
        if (!suffixes.isPublicSuffix(domain)) {
            revert InvalidPublicSuffix(domain);
        }
        return _enableNode(domain, 0);
    }

    function _enableNode(
        bytes memory domain,
        uint256 offset
    ) internal returns (bytes32 node) {
        uint256 len = domain.readUint8(offset);
        if (len == 0) {
            return bytes32(0);
        }

        bytes32 parentNode = _enableNode(domain, offset + len + 1);
        bytes32 label = domain.keccak(offset + 1, len);
        node = keccak256(abi.encodePacked(parentNode, label));
        address owner = ens.owner(node);
        if (owner == address(0) || owner == previousRegistrar) {
            if (parentNode == bytes32(0)) {
                Root root = Root(ens.owner(bytes32(0)));
                root.setSubnodeOwner(label, address(this));
                ens.setResolver(node, resolver);
            } else {
                ens.setSubnodeRecord(
                    parentNode,
                    label,
                    address(this),
                    resolver,
                    0
                );
            }
        } else if (owner != address(this)) {
            revert PreconditionNotMet();
        }
        return node;
    }
}

File 2 of 22 : Buffer.sol
// SPDX-License-Identifier: BSD-2-Clause
pragma solidity ^0.8.4;

/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for appending to them. At any time you can fetch a bytes object containing the
* current contents of the buffer. The bytes object should not be stored between
* operations, as it may change due to resizing of the buffer.
*/
library Buffer {
    /**
    * @dev Represents a mutable buffer. Buffers have a current value (buf) and
    *      a capacity. The capacity may be longer than the current value, in
    *      which case it can be extended without the need to allocate more memory.
    */
    struct buffer {
        bytes buf;
        uint capacity;
    }

    /**
    * @dev Initializes a buffer with an initial capacity.
    * @param buf The buffer to initialize.
    * @param capacity The number of bytes of space to allocate the buffer.
    * @return The buffer, for chaining.
    */
    function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {
        if (capacity % 32 != 0) {
            capacity += 32 - (capacity % 32);
        }
        // Allocate space for the buffer data
        buf.capacity = capacity;
        assembly {
            let ptr := mload(0x40)
            mstore(buf, ptr)
            mstore(ptr, 0)
            let fpm := add(32, add(ptr, capacity))
            if lt(fpm, ptr) {
                revert(0, 0)
            }
            mstore(0x40, fpm)
        }
        return buf;
    }

    /**
    * @dev Initializes a new buffer from an existing bytes object.
    *      Changes to the buffer may mutate the original value.
    * @param b The bytes object to initialize the buffer with.
    * @return A new buffer.
    */
    function fromBytes(bytes memory b) internal pure returns(buffer memory) {
        buffer memory buf;
        buf.buf = b;
        buf.capacity = b.length;
        return buf;
    }

    function resize(buffer memory buf, uint capacity) private pure {
        bytes memory oldbuf = buf.buf;
        init(buf, capacity);
        append(buf, oldbuf);
    }

    /**
    * @dev Sets buffer length to 0.
    * @param buf The buffer to truncate.
    * @return The original buffer, for chaining..
    */
    function truncate(buffer memory buf) internal pure returns (buffer memory) {
        assembly {
            let bufptr := mload(buf)
            mstore(bufptr, 0)
        }
        return buf;
    }

    /**
    * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @param len The number of bytes to copy.
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {
        require(len <= data.length);

        uint off = buf.buf.length;
        uint newCapacity = off + len;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        uint dest;
        uint src;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Length of existing buffer data
            let buflen := mload(bufptr)
            // Start address = buffer address + offset + sizeof(buffer length)
            dest := add(add(bufptr, 32), off)
            // Update buffer length if we're extending it
            if gt(newCapacity, buflen) {
                mstore(bufptr, newCapacity)
            }
            src := add(data, 32)
        }

        // Copy word-length chunks while possible
        for (; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        unchecked {
            uint mask = (256 ** (32 - len)) - 1;
            assembly {
                let srcpart := and(mload(src), not(mask))
                let destpart := and(mload(dest), mask)
                mstore(dest, or(destpart, srcpart))
            }
        }

        return buf;
    }

    /**
    * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
        return append(buf, data, data.length);
    }

    /**
    * @dev Appends a byte to the buffer. Resizes if doing so would exceed the
    *      capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint offPlusOne = off + 1;
        if (off >= buf.capacity) {
            resize(buf, offPlusOne * 2);
        }

        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Address = buffer address + sizeof(buffer length) + off
            let dest := add(add(bufptr, off), 32)
            mstore8(dest, data)
            // Update buffer length if we extended it
            if gt(offPlusOne, mload(bufptr)) {
                mstore(bufptr, offPlusOne)
            }
        }

        return buf;
    }

    /**
    * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would
    *      exceed the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @param len The number of bytes to write (left-aligned).
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint newCapacity = len + off;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        unchecked {
            uint mask = (256 ** len) - 1;
            // Right-align data
            data = data >> (8 * (32 - len));
            assembly {
                // Memory address of the buffer data
                let bufptr := mload(buf)
                // Address = buffer address + sizeof(buffer length) + newCapacity
                let dest := add(bufptr, newCapacity)
                mstore(dest, or(and(mload(dest), not(mask)), data))
                // Update buffer length if we extended it
                if gt(newCapacity, mload(bufptr)) {
                    mstore(bufptr, newCapacity)
                }
            }
        }
        return buf;
    }

    /**
    * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chhaining.
    */
    function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {
        return append(buf, bytes32(data), 20);
    }

    /**
    * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {
        return append(buf, data, 32);
    }

    /**
     * @dev Appends a byte to the end of the buffer. Resizes if doing so would
     *      exceed the capacity of the buffer.
     * @param buf The buffer to append to.
     * @param data The data to append.
     * @param len The number of bytes to write (right-aligned).
     * @return The original buffer.
     */
    function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint newCapacity = len + off;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        uint mask = (256 ** len) - 1;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Address = buffer address + sizeof(buffer length) + newCapacity
            let dest := add(bufptr, newCapacity)
            mstore(dest, or(and(mload(dest), not(mask)), data))
            // Update buffer length if we extended it
            if gt(newCapacity, mload(bufptr)) {
                mstore(bufptr, newCapacity)
            }
        }
        return buf;
    }
}

File 3 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 4 of 22 : 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 5 of 22 : 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 6 of 22 : 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 7 of 22 : DNSClaimChecker.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../dnssec-oracle/DNSSEC.sol";
import "../dnssec-oracle/BytesUtils.sol";
import "../dnssec-oracle/RRUtils.sol";
import "../utils/HexUtils.sol";
import "@ensdomains/buffer/contracts/Buffer.sol";

library DNSClaimChecker {
    using BytesUtils for bytes;
    using HexUtils for bytes;
    using RRUtils for *;
    using Buffer for Buffer.buffer;

    uint16 constant CLASS_INET = 1;
    uint16 constant TYPE_TXT = 16;

    function getOwnerAddress(
        bytes memory name,
        bytes memory data
    ) internal pure returns (address, bool) {
        // Add "_ens." to the front of the name.
        Buffer.buffer memory buf;
        buf.init(name.length + 5);
        buf.append("\x04_ens");
        buf.append(name);

        for (
            RRUtils.RRIterator memory iter = data.iterateRRs(0);
            !iter.done();
            iter.next()
        ) {
            if (iter.name().compareNames(buf.buf) != 0) continue;
            bool found;
            address addr;
            (addr, found) = parseRR(data, iter.rdataOffset, iter.nextOffset);
            if (found) {
                return (addr, true);
            }
        }

        return (address(0x0), false);
    }

    function parseRR(
        bytes memory rdata,
        uint256 idx,
        uint256 endIdx
    ) internal pure returns (address, bool) {
        while (idx < endIdx) {
            uint256 len = rdata.readUint8(idx);
            idx += 1;

            bool found;
            address addr;
            (addr, found) = parseString(rdata, idx, len);

            if (found) return (addr, true);
            idx += len;
        }

        return (address(0x0), false);
    }

    function parseString(
        bytes memory str,
        uint256 idx,
        uint256 len
    ) internal pure returns (address, bool) {
        // TODO: More robust parsing that handles whitespace and multiple key/value pairs
        if (str.readUint32(idx) != 0x613d3078) return (address(0x0), false); // 0x613d3078 == 'a=0x'
        return str.hexToAddress(idx + 4, idx + len);
    }
}

File 9 of 22 : IDNSRegistrar.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../dnssec-oracle/DNSSEC.sol";

interface IDNSRegistrar {
    function proveAndClaim(
        bytes memory name,
        DNSSEC.RRSetWithSignature[] memory input
    ) external;

    function proveAndClaimWithResolver(
        bytes memory name,
        DNSSEC.RRSetWithSignature[] memory input,
        address resolver,
        address addr
    ) external;
}

File 10 of 22 : PublicSuffixList.sol
pragma solidity ^0.8.4;

interface PublicSuffixList {
    function isPublicSuffix(bytes calldata name) external view returns (bool);
}

File 11 of 22 : BytesUtils.sol
pragma solidity ^0.8.4;

library BytesUtils {
    error OffsetOutOfBoundsError(uint256 offset, uint256 length);

    /*
     * @dev Returns the keccak-256 hash of a byte range.
     * @param self The byte string to hash.
     * @param offset The position to start hashing at.
     * @param len The number of bytes to hash.
     * @return The hash of the byte range.
     */
    function keccak(
        bytes memory self,
        uint256 offset,
        uint256 len
    ) internal pure returns (bytes32 ret) {
        require(offset + len <= self.length);
        assembly {
            ret := keccak256(add(add(self, 32), offset), len)
        }
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two bytes are equal.
     * @param self The first bytes to compare.
     * @param other The second bytes to compare.
     * @return The result of the comparison.
     */
    function compare(
        bytes memory self,
        bytes memory other
    ) internal pure returns (int256) {
        return compare(self, 0, self.length, other, 0, other.length);
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two bytes are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first bytes to compare.
     * @param offset The offset of self.
     * @param len    The length of self.
     * @param other The second bytes to compare.
     * @param otheroffset The offset of the other string.
     * @param otherlen    The length of the other string.
     * @return The result of the comparison.
     */
    function compare(
        bytes memory self,
        uint256 offset,
        uint256 len,
        bytes memory other,
        uint256 otheroffset,
        uint256 otherlen
    ) internal pure returns (int256) {
        if (offset + len > self.length) {
            revert OffsetOutOfBoundsError(offset + len, self.length);
        }
        if (otheroffset + otherlen > other.length) {
            revert OffsetOutOfBoundsError(otheroffset + otherlen, other.length);
        }

        uint256 shortest = len;
        if (otherlen < len) shortest = otherlen;

        uint256 selfptr;
        uint256 otherptr;

        assembly {
            selfptr := add(self, add(offset, 32))
            otherptr := add(other, add(otheroffset, 32))
        }
        for (uint256 idx = 0; idx < shortest; idx += 32) {
            uint256 a;
            uint256 b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint256 mask;
                if (shortest - idx >= 32) {
                    mask = type(uint256).max;
                } else {
                    mask = ~(2 ** (8 * (idx + 32 - shortest)) - 1);
                }
                int256 diff = int256(a & mask) - int256(b & mask);
                if (diff != 0) return diff;
            }
            selfptr += 32;
            otherptr += 32;
        }

        return int256(len) - int256(otherlen);
    }

    /*
     * @dev Returns true if the two byte ranges are equal.
     * @param self The first byte range to compare.
     * @param offset The offset into the first byte range.
     * @param other The second byte range to compare.
     * @param otherOffset The offset into the second byte range.
     * @param len The number of bytes to compare
     * @return True if the byte ranges are equal, false otherwise.
     */
    function equals(
        bytes memory self,
        uint256 offset,
        bytes memory other,
        uint256 otherOffset,
        uint256 len
    ) internal pure returns (bool) {
        return keccak(self, offset, len) == keccak(other, otherOffset, len);
    }

    /*
     * @dev Returns true if the two byte ranges are equal with offsets.
     * @param self The first byte range to compare.
     * @param offset The offset into the first byte range.
     * @param other The second byte range to compare.
     * @param otherOffset The offset into the second byte range.
     * @return True if the byte ranges are equal, false otherwise.
     */
    function equals(
        bytes memory self,
        uint256 offset,
        bytes memory other,
        uint256 otherOffset
    ) internal pure returns (bool) {
        return
            keccak(self, offset, self.length - offset) ==
            keccak(other, otherOffset, other.length - otherOffset);
    }

    /*
     * @dev Compares a range of 'self' to all of 'other' and returns True iff
     *      they are equal.
     * @param self The first byte range to compare.
     * @param offset The offset into the first byte range.
     * @param other The second byte range to compare.
     * @return True if the byte ranges are equal, false otherwise.
     */
    function equals(
        bytes memory self,
        uint256 offset,
        bytes memory other
    ) internal pure returns (bool) {
        return
            self.length == offset + other.length &&
            equals(self, offset, other, 0, other.length);
    }

    /*
     * @dev Returns true if the two byte ranges are equal.
     * @param self The first byte range to compare.
     * @param other The second byte range to compare.
     * @return True if the byte ranges are equal, false otherwise.
     */
    function equals(
        bytes memory self,
        bytes memory other
    ) internal pure returns (bool) {
        return
            self.length == other.length &&
            equals(self, 0, other, 0, self.length);
    }

    /*
     * @dev Returns the 8-bit number at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes
     * @return The specified 8 bits of the string, interpreted as an integer.
     */
    function readUint8(
        bytes memory self,
        uint256 idx
    ) internal pure returns (uint8 ret) {
        return uint8(self[idx]);
    }

    /*
     * @dev Returns the 16-bit number at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes
     * @return The specified 16 bits of the string, interpreted as an integer.
     */
    function readUint16(
        bytes memory self,
        uint256 idx
    ) internal pure returns (uint16 ret) {
        require(idx + 2 <= self.length);
        assembly {
            ret := and(mload(add(add(self, 2), idx)), 0xFFFF)
        }
    }

    /*
     * @dev Returns the 32-bit number at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes
     * @return The specified 32 bits of the string, interpreted as an integer.
     */
    function readUint32(
        bytes memory self,
        uint256 idx
    ) internal pure returns (uint32 ret) {
        require(idx + 4 <= self.length);
        assembly {
            ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF)
        }
    }

    /*
     * @dev Returns the 32 byte value at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes
     * @return The specified 32 bytes of the string.
     */
    function readBytes32(
        bytes memory self,
        uint256 idx
    ) internal pure returns (bytes32 ret) {
        require(idx + 32 <= self.length);
        assembly {
            ret := mload(add(add(self, 32), idx))
        }
    }

    /*
     * @dev Returns the 32 byte value at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes
     * @return The specified 32 bytes of the string.
     */
    function readBytes20(
        bytes memory self,
        uint256 idx
    ) internal pure returns (bytes20 ret) {
        require(idx + 20 <= self.length);
        assembly {
            ret := and(
                mload(add(add(self, 32), idx)),
                0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000
            )
        }
    }

    /*
     * @dev Returns the n byte value at the specified index of self.
     * @param self The byte string.
     * @param idx The index into the bytes.
     * @param len The number of bytes.
     * @return The specified 32 bytes of the string.
     */
    function readBytesN(
        bytes memory self,
        uint256 idx,
        uint256 len
    ) internal pure returns (bytes32 ret) {
        require(len <= 32);
        require(idx + len <= self.length);
        assembly {
            let mask := not(sub(exp(256, sub(32, len)), 1))
            ret := and(mload(add(add(self, 32), idx)), mask)
        }
    }

    function memcpy(uint256 dest, uint256 src, uint256 len) private pure {
        // Copy word-length chunks while possible
        for (; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        unchecked {
            uint256 mask = (256 ** (32 - len)) - 1;
            assembly {
                let srcpart := and(mload(src), not(mask))
                let destpart := and(mload(dest), mask)
                mstore(dest, or(destpart, srcpart))
            }
        }
    }

    /*
     * @dev Copies a substring into a new byte string.
     * @param self The byte string to copy from.
     * @param offset The offset to start copying at.
     * @param len The number of bytes to copy.
     */
    function substring(
        bytes memory self,
        uint256 offset,
        uint256 len
    ) internal pure returns (bytes memory) {
        require(offset + len <= self.length);

        bytes memory ret = new bytes(len);
        uint256 dest;
        uint256 src;

        assembly {
            dest := add(ret, 32)
            src := add(add(self, 32), offset)
        }
        memcpy(dest, src, len);

        return ret;
    }

    // Maps characters from 0x30 to 0x7A to their base32 values.
    // 0xFF represents invalid characters in that range.
    bytes constant base32HexTable =
        hex"00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";

    /**
     * @dev Decodes unpadded base32 data of up to one word in length.
     * @param self The data to decode.
     * @param off Offset into the string to start at.
     * @param len Number of characters to decode.
     * @return The decoded data, left aligned.
     */
    function base32HexDecodeWord(
        bytes memory self,
        uint256 off,
        uint256 len
    ) internal pure returns (bytes32) {
        require(len <= 52);

        uint256 ret = 0;
        uint8 decoded;
        for (uint256 i = 0; i < len; i++) {
            bytes1 char = self[off + i];
            require(char >= 0x30 && char <= 0x7A);
            decoded = uint8(base32HexTable[uint256(uint8(char)) - 0x30]);
            require(decoded <= 0x20);
            if (i == len - 1) {
                break;
            }
            ret = (ret << 5) | decoded;
        }

        uint256 bitlen = len * 5;
        if (len % 8 == 0) {
            // Multiple of 8 characters, no padding
            ret = (ret << 5) | decoded;
        } else if (len % 8 == 2) {
            // Two extra characters - 1 byte
            ret = (ret << 3) | (decoded >> 2);
            bitlen -= 2;
        } else if (len % 8 == 4) {
            // Four extra characters - 2 bytes
            ret = (ret << 1) | (decoded >> 4);
            bitlen -= 4;
        } else if (len % 8 == 5) {
            // Five extra characters - 3 bytes
            ret = (ret << 4) | (decoded >> 1);
            bitlen -= 1;
        } else if (len % 8 == 7) {
            // Seven extra characters - 4 bytes
            ret = (ret << 2) | (decoded >> 3);
            bitlen -= 3;
        } else {
            revert();
        }

        return bytes32(ret << (256 - bitlen));
    }

    /**
     * @dev Finds the first occurrence of the byte `needle` in `self`.
     * @param self The string to search
     * @param off The offset to start searching at
     * @param len The number of bytes to search
     * @param needle The byte to search for
     * @return The offset of `needle` in `self`, or 2**256-1 if it was not found.
     */
    function find(
        bytes memory self,
        uint256 off,
        uint256 len,
        bytes1 needle
    ) internal pure returns (uint256) {
        for (uint256 idx = off; idx < off + len; idx++) {
            if (self[idx] == needle) {
                return idx;
            }
        }
        return type(uint256).max;
    }
}

File 12 of 22 : DNSSEC.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma experimental ABIEncoderV2;

abstract contract DNSSEC {
    bytes public anchors;

    struct RRSetWithSignature {
        bytes rrset;
        bytes sig;
    }

    event AlgorithmUpdated(uint8 id, address addr);
    event DigestUpdated(uint8 id, address addr);

    function verifyRRSet(
        RRSetWithSignature[] memory input
    ) external view virtual returns (bytes memory rrs, uint32 inception);

    function verifyRRSet(
        RRSetWithSignature[] memory input,
        uint256 now
    ) public view virtual returns (bytes memory rrs, uint32 inception);
}

File 13 of 22 : RRUtils.sol
pragma solidity ^0.8.4;

import "./BytesUtils.sol";
import "@ensdomains/buffer/contracts/Buffer.sol";

/**
 * @dev RRUtils is a library that provides utilities for parsing DNS resource records.
 */
library RRUtils {
    using BytesUtils for *;
    using Buffer for *;

    /**
     * @dev Returns the number of bytes in the DNS name at 'offset' in 'self'.
     * @param self The byte array to read a name from.
     * @param offset The offset to start reading at.
     * @return The length of the DNS name at 'offset', in bytes.
     */
    function nameLength(
        bytes memory self,
        uint256 offset
    ) internal pure returns (uint256) {
        uint256 idx = offset;
        while (true) {
            assert(idx < self.length);
            uint256 labelLen = self.readUint8(idx);
            idx += labelLen + 1;
            if (labelLen == 0) {
                break;
            }
        }
        return idx - offset;
    }

    /**
     * @dev Returns a DNS format name at the specified offset of self.
     * @param self The byte array to read a name from.
     * @param offset The offset to start reading at.
     * @return ret The name.
     */
    function readName(
        bytes memory self,
        uint256 offset
    ) internal pure returns (bytes memory ret) {
        uint256 len = nameLength(self, offset);
        return self.substring(offset, len);
    }

    /**
     * @dev Returns the number of labels in the DNS name at 'offset' in 'self'.
     * @param self The byte array to read a name from.
     * @param offset The offset to start reading at.
     * @return The number of labels in the DNS name at 'offset', in bytes.
     */
    function labelCount(
        bytes memory self,
        uint256 offset
    ) internal pure returns (uint256) {
        uint256 count = 0;
        while (true) {
            assert(offset < self.length);
            uint256 labelLen = self.readUint8(offset);
            offset += labelLen + 1;
            if (labelLen == 0) {
                break;
            }
            count += 1;
        }
        return count;
    }

    uint256 constant RRSIG_TYPE = 0;
    uint256 constant RRSIG_ALGORITHM = 2;
    uint256 constant RRSIG_LABELS = 3;
    uint256 constant RRSIG_TTL = 4;
    uint256 constant RRSIG_EXPIRATION = 8;
    uint256 constant RRSIG_INCEPTION = 12;
    uint256 constant RRSIG_KEY_TAG = 16;
    uint256 constant RRSIG_SIGNER_NAME = 18;

    struct SignedSet {
        uint16 typeCovered;
        uint8 algorithm;
        uint8 labels;
        uint32 ttl;
        uint32 expiration;
        uint32 inception;
        uint16 keytag;
        bytes signerName;
        bytes data;
        bytes name;
    }

    function readSignedSet(
        bytes memory data
    ) internal pure returns (SignedSet memory self) {
        self.typeCovered = data.readUint16(RRSIG_TYPE);
        self.algorithm = data.readUint8(RRSIG_ALGORITHM);
        self.labels = data.readUint8(RRSIG_LABELS);
        self.ttl = data.readUint32(RRSIG_TTL);
        self.expiration = data.readUint32(RRSIG_EXPIRATION);
        self.inception = data.readUint32(RRSIG_INCEPTION);
        self.keytag = data.readUint16(RRSIG_KEY_TAG);
        self.signerName = readName(data, RRSIG_SIGNER_NAME);
        self.data = data.substring(
            RRSIG_SIGNER_NAME + self.signerName.length,
            data.length - RRSIG_SIGNER_NAME - self.signerName.length
        );
    }

    function rrs(
        SignedSet memory rrset
    ) internal pure returns (RRIterator memory) {
        return iterateRRs(rrset.data, 0);
    }

    /**
     * @dev An iterator over resource records.
     */
    struct RRIterator {
        bytes data;
        uint256 offset;
        uint16 dnstype;
        uint16 class;
        uint32 ttl;
        uint256 rdataOffset;
        uint256 nextOffset;
    }

    /**
     * @dev Begins iterating over resource records.
     * @param self The byte string to read from.
     * @param offset The offset to start reading at.
     * @return ret An iterator object.
     */
    function iterateRRs(
        bytes memory self,
        uint256 offset
    ) internal pure returns (RRIterator memory ret) {
        ret.data = self;
        ret.nextOffset = offset;
        next(ret);
    }

    /**
     * @dev Returns true iff there are more RRs to iterate.
     * @param iter The iterator to check.
     * @return True iff the iterator has finished.
     */
    function done(RRIterator memory iter) internal pure returns (bool) {
        return iter.offset >= iter.data.length;
    }

    /**
     * @dev Moves the iterator to the next resource record.
     * @param iter The iterator to advance.
     */
    function next(RRIterator memory iter) internal pure {
        iter.offset = iter.nextOffset;
        if (iter.offset >= iter.data.length) {
            return;
        }

        // Skip the name
        uint256 off = iter.offset + nameLength(iter.data, iter.offset);

        // Read type, class, and ttl
        iter.dnstype = iter.data.readUint16(off);
        off += 2;
        iter.class = iter.data.readUint16(off);
        off += 2;
        iter.ttl = iter.data.readUint32(off);
        off += 4;

        // Read the rdata
        uint256 rdataLength = iter.data.readUint16(off);
        off += 2;
        iter.rdataOffset = off;
        iter.nextOffset = off + rdataLength;
    }

    /**
     * @dev Returns the name of the current record.
     * @param iter The iterator.
     * @return A new bytes object containing the owner name from the RR.
     */
    function name(RRIterator memory iter) internal pure returns (bytes memory) {
        return
            iter.data.substring(
                iter.offset,
                nameLength(iter.data, iter.offset)
            );
    }

    /**
     * @dev Returns the rdata portion of the current record.
     * @param iter The iterator.
     * @return A new bytes object containing the RR's RDATA.
     */
    function rdata(
        RRIterator memory iter
    ) internal pure returns (bytes memory) {
        return
            iter.data.substring(
                iter.rdataOffset,
                iter.nextOffset - iter.rdataOffset
            );
    }

    uint256 constant DNSKEY_FLAGS = 0;
    uint256 constant DNSKEY_PROTOCOL = 2;
    uint256 constant DNSKEY_ALGORITHM = 3;
    uint256 constant DNSKEY_PUBKEY = 4;

    struct DNSKEY {
        uint16 flags;
        uint8 protocol;
        uint8 algorithm;
        bytes publicKey;
    }

    function readDNSKEY(
        bytes memory data,
        uint256 offset,
        uint256 length
    ) internal pure returns (DNSKEY memory self) {
        self.flags = data.readUint16(offset + DNSKEY_FLAGS);
        self.protocol = data.readUint8(offset + DNSKEY_PROTOCOL);
        self.algorithm = data.readUint8(offset + DNSKEY_ALGORITHM);
        self.publicKey = data.substring(
            offset + DNSKEY_PUBKEY,
            length - DNSKEY_PUBKEY
        );
    }

    uint256 constant DS_KEY_TAG = 0;
    uint256 constant DS_ALGORITHM = 2;
    uint256 constant DS_DIGEST_TYPE = 3;
    uint256 constant DS_DIGEST = 4;

    struct DS {
        uint16 keytag;
        uint8 algorithm;
        uint8 digestType;
        bytes digest;
    }

    function readDS(
        bytes memory data,
        uint256 offset,
        uint256 length
    ) internal pure returns (DS memory self) {
        self.keytag = data.readUint16(offset + DS_KEY_TAG);
        self.algorithm = data.readUint8(offset + DS_ALGORITHM);
        self.digestType = data.readUint8(offset + DS_DIGEST_TYPE);
        self.digest = data.substring(offset + DS_DIGEST, length - DS_DIGEST);
    }

    function isSubdomainOf(
        bytes memory self,
        bytes memory other
    ) internal pure returns (bool) {
        uint256 off = 0;
        uint256 counts = labelCount(self, 0);
        uint256 othercounts = labelCount(other, 0);

        while (counts > othercounts) {
            off = progress(self, off);
            counts--;
        }

        return self.equals(off, other, 0);
    }

    function compareNames(
        bytes memory self,
        bytes memory other
    ) internal pure returns (int256) {
        if (self.equals(other)) {
            return 0;
        }

        uint256 off;
        uint256 otheroff;
        uint256 prevoff;
        uint256 otherprevoff;
        uint256 counts = labelCount(self, 0);
        uint256 othercounts = labelCount(other, 0);

        // Keep removing labels from the front of the name until both names are equal length
        while (counts > othercounts) {
            prevoff = off;
            off = progress(self, off);
            counts--;
        }

        while (othercounts > counts) {
            otherprevoff = otheroff;
            otheroff = progress(other, otheroff);
            othercounts--;
        }

        // Compare the last nonequal labels to each other
        while (counts > 0 && !self.equals(off, other, otheroff)) {
            prevoff = off;
            off = progress(self, off);
            otherprevoff = otheroff;
            otheroff = progress(other, otheroff);
            counts -= 1;
        }

        if (off == 0) {
            return -1;
        }
        if (otheroff == 0) {
            return 1;
        }

        return
            self.compare(
                prevoff + 1,
                self.readUint8(prevoff),
                other,
                otherprevoff + 1,
                other.readUint8(otherprevoff)
            );
    }

    /**
     * @dev Compares two serial numbers using RFC1982 serial number math.
     */
    function serialNumberGte(
        uint32 i1,
        uint32 i2
    ) internal pure returns (bool) {
        unchecked {
            return int32(i1) - int32(i2) >= 0;
        }
    }

    function progress(
        bytes memory body,
        uint256 off
    ) internal pure returns (uint256) {
        return off + 1 + body.readUint8(off);
    }

    /**
     * @dev Computes the keytag for a chunk of data.
     * @param data The data to compute a keytag for.
     * @return The computed key tag.
     */
    function computeKeytag(bytes memory data) internal pure returns (uint16) {
        /* This function probably deserves some explanation.
         * The DNSSEC keytag function is a checksum that relies on summing up individual bytes
         * from the input string, with some mild bitshifting. Here's a Naive solidity implementation:
         *
         *     function computeKeytag(bytes memory data) internal pure returns (uint16) {
         *         uint ac;
         *         for (uint i = 0; i < data.length; i++) {
         *             ac += i & 1 == 0 ? uint16(data.readUint8(i)) << 8 : data.readUint8(i);
         *         }
         *         return uint16(ac + (ac >> 16));
         *     }
         *
         * The EVM, with its 256 bit words, is exceedingly inefficient at doing byte-by-byte operations;
         * the code above, on reasonable length inputs, consumes over 100k gas. But we can make the EVM's
         * large words work in our favour.
         *
         * The code below works by treating the input as a series of 256 bit words. It first masks out
         * even and odd bytes from each input word, adding them to two separate accumulators `ac1` and `ac2`.
         * The bytes are separated by empty bytes, so as long as no individual sum exceeds 2^16-1, we're
         * effectively summing 16 different numbers with each EVM ADD opcode.
         *
         * Once it's added up all the inputs, it has to add all the 16 bit values in `ac1` and `ac2` together.
         * It does this using the same trick - mask out every other value, shift to align them, add them together.
         * After the first addition on both accumulators, there's enough room to add the two accumulators together,
         * and the remaining sums can be done just on ac1.
         */
        unchecked {
            require(data.length <= 8192, "Long keys not permitted");
            uint256 ac1;
            uint256 ac2;
            for (uint256 i = 0; i < data.length + 31; i += 32) {
                uint256 word;
                assembly {
                    word := mload(add(add(data, 32), i))
                }
                if (i + 32 > data.length) {
                    uint256 unused = 256 - (data.length - i) * 8;
                    word = (word >> unused) << unused;
                }
                ac1 +=
                    (word &
                        0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00) >>
                    8;
                ac2 += (word &
                    0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF);
            }
            ac1 =
                (ac1 &
                    0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +
                ((ac1 &
                    0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>
                    16);
            ac2 =
                (ac2 &
                    0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +
                ((ac2 &
                    0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>
                    16);
            ac1 = (ac1 << 8) + ac2;
            ac1 =
                (ac1 &
                    0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) +
                ((ac1 &
                    0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000) >>
                    32);
            ac1 =
                (ac1 &
                    0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) +
                ((ac1 &
                    0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000) >>
                    64);
            ac1 =
                (ac1 &
                    0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) +
                (ac1 >> 128);
            ac1 += (ac1 >> 16) & 0xFFFF;
            return uint16(ac1);
        }
    }
}

File 14 of 22 : 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;

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

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

    function setResolver(bytes32 node, address resolver) external;

    function setOwner(bytes32 node, address owner) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function setApprovalForAll(address operator, bool approved) external;

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

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

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

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

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

File 15 of 22 : 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 registry.
     */
    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 view virtual override 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 view virtual override 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 view virtual override 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 view virtual override 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 view virtual override 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 16 of 22 : ResolverBase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./profiles/IVersionableResolver.sol";

abstract contract ResolverBase is ERC165, IVersionableResolver {
    mapping(bytes32 => uint64) public recordVersions;

    function isAuthorised(bytes32 node) internal view virtual returns (bool);

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

    /**
     * Increments the record version associated with an ENS node.
     * May only be called by the owner of that node in the ENS registry.
     * @param node The node to update.
     */
    function clearRecords(bytes32 node) public virtual authorised(node) {
        recordVersions[node]++;
        emit VersionChanged(node, recordVersions[node]);
    }

    function supportsInterface(
        bytes4 interfaceID
    ) public view virtual override returns (bool) {
        return
            interfaceID == type(IVersionableResolver).interfaceId ||
            super.supportsInterface(interfaceID);
    }
}

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

import "../ResolverBase.sol";
import "./IAddrResolver.sol";
import "./IAddressResolver.sol";

abstract contract AddrResolver is
    IAddrResolver,
    IAddressResolver,
    ResolverBase
{
    uint256 private constant COIN_TYPE_ETH = 60;

    mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;

    /**
     * Sets the address associated with an ENS node.
     * May only be called by the owner of that node in the ENS registry.
     * @param node The node to update.
     * @param a The address to set.
     */
    function setAddr(
        bytes32 node,
        address a
    ) external virtual authorised(node) {
        setAddr(node, COIN_TYPE_ETH, addressToBytes(a));
    }

    /**
     * Returns the address associated with an ENS node.
     * @param node The ENS node to query.
     * @return The associated address.
     */
    function addr(
        bytes32 node
    ) public view virtual override returns (address payable) {
        bytes memory a = addr(node, COIN_TYPE_ETH);
        if (a.length == 0) {
            return payable(0);
        }
        return bytesToAddress(a);
    }

    function setAddr(
        bytes32 node,
        uint256 coinType,
        bytes memory a
    ) public virtual authorised(node) {
        emit AddressChanged(node, coinType, a);
        if (coinType == COIN_TYPE_ETH) {
            emit AddrChanged(node, bytesToAddress(a));
        }
        versionable_addresses[recordVersions[node]][node][coinType] = a;
    }

    function addr(
        bytes32 node,
        uint256 coinType
    ) public view virtual override returns (bytes memory) {
        return versionable_addresses[recordVersions[node]][node][coinType];
    }

    function supportsInterface(
        bytes4 interfaceID
    ) public view virtual override returns (bool) {
        return
            interfaceID == type(IAddrResolver).interfaceId ||
            interfaceID == type(IAddressResolver).interfaceId ||
            super.supportsInterface(interfaceID);
    }

    function bytesToAddress(
        bytes memory b
    ) internal pure returns (address payable a) {
        require(b.length == 20);
        assembly {
            a := div(mload(add(b, 32)), exp(256, 12))
        }
    }

    function addressToBytes(address a) internal pure returns (bytes memory b) {
        b = new bytes(20);
        assembly {
            mstore(add(b, 32), mul(a, exp(256, 12)))
        }
    }
}

File 18 of 22 : 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 19 of 22 : 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,
        uint256 coinType,
        bytes newAddress
    );

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

File 20 of 22 : IVersionableResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IVersionableResolver {
    event VersionChanged(bytes32 indexed node, uint64 newVersion);

    function recordVersions(bytes32 node) external view returns (uint64);
}

File 21 of 22 : Controllable.sol
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 22 of 22 : Root.sol
pragma solidity ^0.8.4;

import "../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) public {
        ens = _ens;
    }

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

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

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

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

File 23 of 22 : HexUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

library HexUtils {
    /**
     * @dev Attempts to parse bytes32 from a hex string
     * @param str The string to parse
     * @param idx The offset to start parsing at
     * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.
     */
    function hexStringToBytes32(
        bytes memory str,
        uint256 idx,
        uint256 lastIdx
    ) internal pure returns (bytes32 r, bool valid) {
        uint256 hexLength = lastIdx - idx;
        if ((hexLength != 64 && hexLength != 40) || hexLength % 2 == 1) {
            revert("Invalid string length");
        }
        valid = true;
        assembly {
            // check that the index to read to is not past the end of the string
            if gt(lastIdx, mload(str)) {
                revert(0, 0)
            }

            function getHex(c) -> ascii {
                // chars 48-57: 0-9
                if and(gt(c, 47), lt(c, 58)) {
                    ascii := sub(c, 48)
                    leave
                }
                // chars 65-70: A-F
                if and(gt(c, 64), lt(c, 71)) {
                    ascii := add(sub(c, 65), 10)
                    leave
                }
                // chars 97-102: a-f
                if and(gt(c, 96), lt(c, 103)) {
                    ascii := add(sub(c, 97), 10)
                    leave
                }
                // invalid char
                ascii := 0xff
            }

            let ptr := add(str, 32)
            for {
                let i := idx
            } lt(i, lastIdx) {
                i := add(i, 2)
            } {
                let byte1 := getHex(byte(0, mload(add(ptr, i))))
                let byte2 := getHex(byte(0, mload(add(ptr, add(i, 1)))))
                // if either byte is invalid, set invalid and break loop
                if or(eq(byte1, 0xff), eq(byte2, 0xff)) {
                    valid := false
                    break
                }
                let combined := or(shl(4, byte1), byte2)
                r := or(shl(8, r), combined)
            }
        }
    }

    /**
     * @dev Attempts to parse an address from a hex string
     * @param str The string to parse
     * @param idx The offset to start parsing at
     * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.
     */
    function hexToAddress(
        bytes memory str,
        uint256 idx,
        uint256 lastIdx
    ) internal pure returns (address, bool) {
        if (lastIdx - idx < 40) return (address(0x0), false);
        (bytes32 r, bool valid) = hexStringToBytes32(str, idx, lastIdx);
        return (address(uint160(uint256(r))), valid);
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_previousRegistrar","type":"address"},{"internalType":"address","name":"_resolver","type":"address"},{"internalType":"contract DNSSEC","name":"_dnssec","type":"address"},{"internalType":"contract PublicSuffixList","name":"_suffixes","type":"address"},{"internalType":"contract ENS","name":"_ens","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"name","type":"bytes"}],"name":"InvalidPublicSuffix","type":"error"},{"inputs":[],"name":"NoOwnerRecordFound","type":"error"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"OffsetOutOfBoundsError","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"PermissionDenied","type":"error"},{"inputs":[],"name":"PreconditionNotMet","type":"error"},{"inputs":[],"name":"StaleProof","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes","name":"dnsname","type":"bytes"},{"indexed":false,"internalType":"uint32","name":"inception","type":"uint32"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"suffixes","type":"address"}],"name":"NewPublicSuffixList","type":"event"},{"inputs":[{"internalType":"bytes","name":"domain","type":"bytes"}],"name":"enableNode","outputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ens","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"inceptions","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract DNSSEC","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousRegistrar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"name","type":"bytes"},{"components":[{"internalType":"bytes","name":"rrset","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}],"internalType":"struct DNSSEC.RRSetWithSignature[]","name":"input","type":"tuple[]"}],"name":"proveAndClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"name","type":"bytes"},{"components":[{"internalType":"bytes","name":"rrset","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}],"internalType":"struct DNSSEC.RRSetWithSignature[]","name":"input","type":"tuple[]"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"addr","type":"address"}],"name":"proveAndClaimWithResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resolver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract PublicSuffixList","name":"_suffixes","type":"address"}],"name":"setPublicSuffixList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"suffixes","outputs":[{"internalType":"contract PublicSuffixList","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]

6101006040523480156200001257600080fd5b50604051620023e1380380620023e18339810160408190526200003591620000c8565b6001600160a01b0385811660c05284811660e05283811660a052600080546001600160a01b03191691841691821790556040519081527f9176b7f47e4504df5e5516c99d90d82ac7cbd49cc77e7f22ba2ac2f2e3a3eba89060200160405180910390a16001600160a01b0316608052506200014892505050565b6001600160a01b0381168114620000c557600080fd5b50565b600080600080600060a08688031215620000e157600080fd5b8551620000ee81620000af565b60208701519095506200010181620000af565b60408701519094506200011481620000af565b60608701519093506200012781620000af565b60808701519092506200013a81620000af565b809150509295509295909350565b60805160a05160c05160e051612213620001ce6000396000818160fb01528181610cde0152610d950152600081816102320152610b6301526000818161020b01526108020152600081816101c301528181610397015281816104f8015281816106b301528181610ae301528181610bba01528181610d060152610dc401526122136000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806329d56630116100815780636f9512211161005b5780636f951221146101e55780637dc0d1d014610206578063ab14ec591461022d57600080fd5b806329d566301461019857806330349ebe146101ab5780633f15457f146101be57600080fd5b806306963218116100b257806306963218146101355780631ecfc4111461014a57806325916d411461015d57600080fd5b806301ffc9a7146100ce57806304f3bcec146100f6575b600080fd5b6100e16100dc366004611a75565b610254565b60405190151581526020015b60405180910390f35b61011d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100ed565b610148610143366004611cb7565b6102ed565b005b610148610158366004611d40565b6104df565b61018361016b366004611d5d565b60016020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020016100ed565b6101486101a6366004611d76565b610656565b60005461011d906001600160a01b031681565b61011d7f000000000000000000000000000000000000000000000000000000000000000081565b6101f86101f3366004611dda565b61072a565b6040519081526020016100ed565b61011d7f000000000000000000000000000000000000000000000000000000000000000081565b61011d7f000000000000000000000000000000000000000000000000000000000000000081565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102e757507fffffffff0000000000000000000000000000000000000000000000000000000082167f2f43542800000000000000000000000000000000000000000000000000000000145b92915050565b60008060006102fc87876107f8565b91945092509050336001600160a01b0382161461035b576040517fe03f60240000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03821660248201526044015b60405180910390fd5b6040516305ef2c7f60e41b815260048101849052602481018390526001600160a01b0382811660448301528681166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156103db57600080fd5b505af11580156103ef573d6000803e3d6000fd5b505050506001600160a01b038416156104d6576001600160a01b03851661042957604051633c584f1360e21b815260040160405180910390fd5b604080516020810185905290810183905260009060600160408051808303601f190181529082905280516020909101207fd5fa2b00000000000000000000000000000000000000000000000000000000008252600482018190526001600160a01b03878116602484015290925087169063d5fa2b0090604401600060405180830381600087803b1580156104bc57600080fd5b505af11580156104d0573d6000803e3d6000fd5b50505050505b50505050505050565b6040516302571be360e01b8152600060048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b9190611e0f565b90506000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d19190611e0f565b9050336001600160a01b038216146105e857600080fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0385169081179091556040519081527f9176b7f47e4504df5e5516c99d90d82ac7cbd49cc77e7f22ba2ac2f2e3a3eba89060200160405180910390a1505050565b600080600061066585856107f8565b6040517f06ab592300000000000000000000000000000000000000000000000000000000815260048101849052602481018390526001600160a01b03828116604483015293965091945092507f0000000000000000000000000000000000000000000000000000000000000000909116906306ab5923906064016020604051808303816000875af11580156106fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107229190611e2c565b505050505050565b600080546040517f4f89059e0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f89059e90610774908590600401611e95565b602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b59190611ea8565b6107ed57816040517f396e24b80000000000000000000000000000000000000000000000000000000081526004016103529190611e95565b6102e7826000610a35565b60008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bdf95fef876040518263ffffffff1660e01b815260040161084c9190611eca565b600060405180830381865afa158015610869573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108919190810190611f4f565b909250905060006108a28882610e58565b60ff1690506108b388600183610e7c565b945060006108e66108c5836001611ffc565b6001848c516108d4919061200f565b6108de919061200f565b8b9190610ea0565b90506108f18161072a565b965060008787604051602001610911929190918252602082015260400190565b60408051808303601f190181529181528151602092830120600081815260019093529082205490925063ffffffff16850360030b121561097d576040517f2dd6a7af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600160205260408120805463ffffffff191663ffffffff87161790556109a88b87610f22565b9097509050806109e4576040517f6260f6f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b866001600160a01b0316827f87db02a0e483e2818060eddcbb3488ce44e35aff49a70d92c2aa6c8046cf01e28d88604051610a20929190612022565b60405180910390a35050505050509250925092565b600080610a428484610e58565b60ff16905080600003610a595750600090506102e7565b6000610a7985610a698487611ffc565b610a74906001611ffc565b610a35565b90506000610a93610a8b866001611ffc565b879085610e7c565b604080516020810185905290810182905290915060600160408051601f198184030181529082905280516020909101206302571be360e01b82526004820181905294506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015610b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4e9190611e0f565b90506001600160a01b0381161580610b9757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316145b15610e255782610d6a576040516302571be360e01b8152600060048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d9190611e0f565b6040517f8cb8ecec000000000000000000000000000000000000000000000000000000008152600481018590523060248201529091506001600160a01b03821690638cb8ecec90604401600060405180830381600087803b158015610c9157600080fd5b505af1158015610ca5573d6000803e3d6000fd5b50506040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250631896f70a9150604401600060405180830381600087803b158015610d4c57600080fd5b505af1158015610d60573d6000803e3d6000fd5b5050505050610e4e565b6040516305ef2c7f60e41b815260048101849052602481018390523060448201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b158015610e0857600080fd5b505af1158015610e1c573d6000803e3d6000fd5b50505050610e4e565b6001600160a01b0381163014610e4e57604051633c584f1360e21b815260040160405180910390fd5b5050505092915050565b6000828281518110610e6c57610e6c61204a565b016020015160f81c905092915050565b8251600090610e8b8385611ffc565b1115610e9657600080fd5b5091016020012090565b8251606090610eaf8385611ffc565b1115610eba57600080fd5b60008267ffffffffffffffff811115610ed557610ed5611ab7565b6040519080825280601f01601f191660200182016040528015610eff576020820181803683370190505b50905060208082019086860101610f17828287611030565b509095945050505050565b600080610f42604051806040016040528060608152602001600081525090565b610f5a85516005610f539190611ffc565b8290611086565b5060408051808201909152600581527f045f656e730000000000000000000000000000000000000000000000000000006020820152610f9a9082906110fd565b50610fa581866110fd565b506000610fb28582611125565b90505b8051516020820151101561101f578151610fd890610fd283611186565b906111a7565b60000361101157600080610ff5878460a001518560c00151611300565b92509050811561100e5794506001935061102992505050565b50505b61101a81611373565b610fb5565b5060008092509250505b9250929050565b602081106110685781518352611047602084611ffc565b9250611054602083611ffc565b915061106160208261200f565b9050611030565b905182516020929092036101000a6000190180199091169116179052565b6040805180820190915260608152600060208201526110a6602083612060565b156110ce576110b6602083612060565b6110c190602061200f565b6110cb9083611ffc565b91505b6020808401839052604051808552600081529081840101818110156110f257600080fd5b604052509192915050565b60408051808201909152606081526000602082015261111e8383845161145b565b9392505050565b6111736040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526102e781611373565b602081015181516060916102e79161119e9082611531565b84519190610ea0565b60006111b38383611593565b156111c0575060006102e7565b60008060008060006111d38860006115b1565b905060006111e28860006115b1565b90505b8082111561120e578593506111fa898761160e565b95508161120681612082565b9250506111e5565b8181111561123757849250611223888661160e565b94508061122f81612082565b91505061120e565b600082118015611250575061124e89878a88611632565b155b1561128557859350611262898761160e565b9550849250611271888661160e565b945061127e60018361200f565b9150611237565b8560000361129d5760001996505050505050506102e7565b846000036112b457600196505050505050506102e7565b6112f36112c2856001611ffc565b6112cc8b87610e58565b60ff168a6112db876001611ffc565b6112e58d89610e58565b8e949392919060ff16611667565b9998505050505050505050565b6000805b828410156113645760006113188686610e58565b60ff169050611328600186611ffc565b94506000806113388888856117e5565b9250905081156113505793506001925061136b915050565b61135a8388611ffc565b9650505050611304565b5060009050805b935093915050565b60c0810151602082018190528151511161138a5750565b600061139e82600001518360200151611531565b82602001516113ad9190611ffc565b82519091506113bc9082611839565b61ffff1660408301526113d0600282611ffc565b82519091506113df9082611839565b61ffff1660608301526113f3600282611ffc565b82519091506114029082611861565b63ffffffff166080830152611418600482611ffc565b825190915060009061142a9083611839565b61ffff16905061143b600283611ffc565b60a08401819052915061144e8183611ffc565b60c0909301929092525050565b604080518082019091526060815260006020820152825182111561147e57600080fd5b835151600061148d8483611ffc565b905085602001518111156114af576114af866114aa836002612099565b61188b565b8551805183820160200191600091808511156114c9578482525b505050602086015b6020861061150957805182526114e8602083611ffc565b91506114f5602082611ffc565b905061150260208761200f565b95506114d1565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b6000815b83518110611545576115456120b0565b60006115518583610e58565b60ff169050611561816001611ffc565b61156b9083611ffc565b91508060000361157b5750611581565b50611535565b61158b838261200f565b949350505050565b60008151835114801561111e575061111e83600084600087516118a8565b6000805b835183106115c5576115c56120b0565b60006115d18585610e58565b60ff1690506115e1816001611ffc565b6115eb9085611ffc565b9350806000036115fb575061111e565b611606600183611ffc565b9150506115b5565b600061161a8383610e58565b60ff16611628836001611ffc565b61111e9190611ffc565b600061164b8383848651611646919061200f565b610e7c565b61165d8686878951611646919061200f565b1495945050505050565b85516000906116768688611ffc565b11156116aa576116868587611ffc565b8751604051638a3c1cfb60e01b815260048101929092526024820152604401610352565b83516116b68385611ffc565b11156116ea576116c68284611ffc565b8451604051638a3c1cfb60e01b815260048101929092526024820152604401610352565b84808310156116f65750815b60208789018101908587010160005b838110156117ca578251825180821461179a5760006020611726858961200f565b106117345750600019611770565b600187611742866020611ffc565b61174c919061200f565b611757906008612099565b6117629060026121aa565b61176c919061200f565b1990505b60006117808383168584166121b6565b905080156117975797506117db9650505050505050565b50505b6117a5602086611ffc565b94506117b2602085611ffc565b935050506020816117c39190611ffc565b9050611705565b506117d585896121b6565b93505050505b9695505050505050565b6000806117f28585611861565b63ffffffff1663613d30781461180d5750600090508061136b565b61182d61181b856004611ffc565b6118258587611ffc565b8791906118cb565b91509150935093915050565b8151600090611849836002611ffc565b111561185457600080fd5b50016002015161ffff1690565b8151600090611871836004611ffc565b111561187c57600080fd5b50016004015163ffffffff1690565b81516118978383611086565b506118a283826110fd565b50505050565b60006118b5848484610e7c565b6118c0878785610e7c565b149695505050505050565b60008060286118da858561200f565b10156118eb5750600090508061136b565b6000806118f9878787611907565b909890975095505050505050565b60008080611915858561200f565b905080604014158015611929575080602814155b8061193e575061193a600282612060565b6001145b156119a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c696420737472696e67206c656e67746800000000000000000000006044820152606401610352565b6001915085518411156119b757600080fd5b611a08565b6000603a8210602f831116156119d45750602f190190565b604782106040831116156119ea57506036190190565b60678210606083111615611a0057506056190190565b5060ff919050565b60208601855b85811015611a6a57611a258183015160001a6119bc565b611a376001830184015160001a6119bc565b60ff811460ff83141715611a5057600095505050611a6a565b60049190911b1760089590951b9490941793600201611a0e565b505050935093915050565b600060208284031215611a8757600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461111e57600080fd5b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611af057611af0611ab7565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b1f57611b1f611ab7565b604052919050565b600067ffffffffffffffff821115611b4157611b41611ab7565b50601f01601f191660200190565b600082601f830112611b6057600080fd5b8135611b73611b6e82611b27565b611af6565b818152846020838601011115611b8857600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611bb657600080fd5b8135602067ffffffffffffffff80831115611bd357611bd3611ab7565b8260051b611be2838201611af6565b9384528581018301938381019088861115611bfc57600080fd5b84880192505b85831015611c9357823584811115611c1a5760008081fd5b88016040818b03601f1901811315611c325760008081fd5b611c3a611acd565b8783013587811115611c4c5760008081fd5b611c5a8d8a83870101611b4f565b825250908201359086821115611c705760008081fd5b611c7e8c8984860101611b4f565b81890152845250509184019190840190611c02565b98975050505050505050565b6001600160a01b0381168114611cb457600080fd5b50565b60008060008060808587031215611ccd57600080fd5b843567ffffffffffffffff80821115611ce557600080fd5b611cf188838901611b4f565b95506020870135915080821115611d0757600080fd5b50611d1487828801611ba5565b9350506040850135611d2581611c9f565b91506060850135611d3581611c9f565b939692955090935050565b600060208284031215611d5257600080fd5b813561111e81611c9f565b600060208284031215611d6f57600080fd5b5035919050565b60008060408385031215611d8957600080fd5b823567ffffffffffffffff80821115611da157600080fd5b611dad86838701611b4f565b93506020850135915080821115611dc357600080fd5b50611dd085828601611ba5565b9150509250929050565b600060208284031215611dec57600080fd5b813567ffffffffffffffff811115611e0357600080fd5b61158b84828501611b4f565b600060208284031215611e2157600080fd5b815161111e81611c9f565b600060208284031215611e3e57600080fd5b5051919050565b60005b83811015611e60578181015183820152602001611e48565b50506000910152565b60008151808452611e81816020860160208601611e45565b601f01601f19169290920160200192915050565b60208152600061111e6020830184611e69565b600060208284031215611eba57600080fd5b8151801515811461111e57600080fd5b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015611f4157888303603f1901855281518051878552611f1588860182611e69565b91890151858303868b0152919050611f2d8183611e69565b968901969450505090860190600101611ef1565b509098975050505050505050565b60008060408385031215611f6257600080fd5b825167ffffffffffffffff811115611f7957600080fd5b8301601f81018513611f8a57600080fd5b8051611f98611b6e82611b27565b818152866020838501011115611fad57600080fd5b611fbe826020830160208601611e45565b809450505050602083015163ffffffff81168114611fdb57600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102e7576102e7611fe6565b818103818111156102e7576102e7611fe6565b6040815260006120356040830185611e69565b905063ffffffff831660208301529392505050565b634e487b7160e01b600052603260045260246000fd5b60008261207d57634e487b7160e01b600052601260045260246000fd5b500690565b60008161209157612091611fe6565b506000190190565b80820281158282048414176102e7576102e7611fe6565b634e487b7160e01b600052600160045260246000fd5b600181815b808511156121015781600019048211156120e7576120e7611fe6565b808516156120f457918102915b93841c93908002906120cb565b509250929050565b600082612118575060016102e7565b81612125575060006102e7565b816001811461213b576002811461214557612161565b60019150506102e7565b60ff84111561215657612156611fe6565b50506001821b6102e7565b5060208310610133831016604e8410600b8410161715612184575081810a6102e7565b61218e83836120c6565b80600019048211156121a2576121a2611fe6565b029392505050565b600061111e8383612109565b81810360008312801583831316838312821617156121d6576121d6611fe6565b509291505056fea26469706673582212204fd3172855fc29f1ee29f5099e32e8c1f163dcac07aa16324d9f13cbd4f6ee7164736f6c63430008110033000000000000000000000000f13fc748601fdc5afa255e9d9166eb43f603a903000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad8583000000000000000000000000e62e4b6ce018ad6e916fcc24545e20a33b9d8653000000000000000000000000670ca7456be604b5d5361a20b784aecd23ac514b00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c95760003560e01c806329d56630116100815780636f9512211161005b5780636f951221146101e55780637dc0d1d014610206578063ab14ec591461022d57600080fd5b806329d566301461019857806330349ebe146101ab5780633f15457f146101be57600080fd5b806306963218116100b257806306963218146101355780631ecfc4111461014a57806325916d411461015d57600080fd5b806301ffc9a7146100ce57806304f3bcec146100f6575b600080fd5b6100e16100dc366004611a75565b610254565b60405190151581526020015b60405180910390f35b61011d7f000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad858381565b6040516001600160a01b0390911681526020016100ed565b610148610143366004611cb7565b6102ed565b005b610148610158366004611d40565b6104df565b61018361016b366004611d5d565b60016020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020016100ed565b6101486101a6366004611d76565b610656565b60005461011d906001600160a01b031681565b61011d7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b6101f86101f3366004611dda565b61072a565b6040519081526020016100ed565b61011d7f000000000000000000000000e62e4b6ce018ad6e916fcc24545e20a33b9d865381565b61011d7f000000000000000000000000f13fc748601fdc5afa255e9d9166eb43f603a90381565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102e757507fffffffff0000000000000000000000000000000000000000000000000000000082167f2f43542800000000000000000000000000000000000000000000000000000000145b92915050565b60008060006102fc87876107f8565b91945092509050336001600160a01b0382161461035b576040517fe03f60240000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03821660248201526044015b60405180910390fd5b6040516305ef2c7f60e41b815260048101849052602481018390526001600160a01b0382811660448301528681166064830152600060848301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690635ef2c7f09060a401600060405180830381600087803b1580156103db57600080fd5b505af11580156103ef573d6000803e3d6000fd5b505050506001600160a01b038416156104d6576001600160a01b03851661042957604051633c584f1360e21b815260040160405180910390fd5b604080516020810185905290810183905260009060600160408051808303601f190181529082905280516020909101207fd5fa2b00000000000000000000000000000000000000000000000000000000008252600482018190526001600160a01b03878116602484015290925087169063d5fa2b0090604401600060405180830381600087803b1580156104bc57600080fd5b505af11580156104d0573d6000803e3d6000fd5b50505050505b50505050505050565b6040516302571be360e01b8152600060048201819052907f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316906302571be390602401602060405180830381865afa158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b9190611e0f565b90506000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d19190611e0f565b9050336001600160a01b038216146105e857600080fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0385169081179091556040519081527f9176b7f47e4504df5e5516c99d90d82ac7cbd49cc77e7f22ba2ac2f2e3a3eba89060200160405180910390a1505050565b600080600061066585856107f8565b6040517f06ab592300000000000000000000000000000000000000000000000000000000815260048101849052602481018390526001600160a01b03828116604483015293965091945092507f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e909116906306ab5923906064016020604051808303816000875af11580156106fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107229190611e2c565b505050505050565b600080546040517f4f89059e0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f89059e90610774908590600401611e95565b602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b59190611ea8565b6107ed57816040517f396e24b80000000000000000000000000000000000000000000000000000000081526004016103529190611e95565b6102e7826000610a35565b60008060008060007f000000000000000000000000e62e4b6ce018ad6e916fcc24545e20a33b9d86536001600160a01b031663bdf95fef876040518263ffffffff1660e01b815260040161084c9190611eca565b600060405180830381865afa158015610869573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108919190810190611f4f565b909250905060006108a28882610e58565b60ff1690506108b388600183610e7c565b945060006108e66108c5836001611ffc565b6001848c516108d4919061200f565b6108de919061200f565b8b9190610ea0565b90506108f18161072a565b965060008787604051602001610911929190918252602082015260400190565b60408051808303601f190181529181528151602092830120600081815260019093529082205490925063ffffffff16850360030b121561097d576040517f2dd6a7af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152600160205260408120805463ffffffff191663ffffffff87161790556109a88b87610f22565b9097509050806109e4576040517f6260f6f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b866001600160a01b0316827f87db02a0e483e2818060eddcbb3488ce44e35aff49a70d92c2aa6c8046cf01e28d88604051610a20929190612022565b60405180910390a35050505050509250925092565b600080610a428484610e58565b60ff16905080600003610a595750600090506102e7565b6000610a7985610a698487611ffc565b610a74906001611ffc565b610a35565b90506000610a93610a8b866001611ffc565b879085610e7c565b604080516020810185905290810182905290915060600160408051601f198184030181529082905280516020909101206302571be360e01b82526004820181905294506000906001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16906302571be390602401602060405180830381865afa158015610b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4e9190611e0f565b90506001600160a01b0381161580610b9757507f000000000000000000000000f13fc748601fdc5afa255e9d9166eb43f603a9036001600160a01b0316816001600160a01b0316145b15610e255782610d6a576040516302571be360e01b8152600060048201819052907f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316906302571be390602401602060405180830381865afa158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d9190611e0f565b6040517f8cb8ecec000000000000000000000000000000000000000000000000000000008152600481018590523060248201529091506001600160a01b03821690638cb8ecec90604401600060405180830381600087803b158015610c9157600080fd5b505af1158015610ca5573d6000803e3d6000fd5b50506040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b037f000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad8583811660248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e169250631896f70a9150604401600060405180830381600087803b158015610d4c57600080fd5b505af1158015610d60573d6000803e3d6000fd5b5050505050610e4e565b6040516305ef2c7f60e41b815260048101849052602481018390523060448201526001600160a01b037f000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad858381166064830152600060848301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690635ef2c7f09060a401600060405180830381600087803b158015610e0857600080fd5b505af1158015610e1c573d6000803e3d6000fd5b50505050610e4e565b6001600160a01b0381163014610e4e57604051633c584f1360e21b815260040160405180910390fd5b5050505092915050565b6000828281518110610e6c57610e6c61204a565b016020015160f81c905092915050565b8251600090610e8b8385611ffc565b1115610e9657600080fd5b5091016020012090565b8251606090610eaf8385611ffc565b1115610eba57600080fd5b60008267ffffffffffffffff811115610ed557610ed5611ab7565b6040519080825280601f01601f191660200182016040528015610eff576020820181803683370190505b50905060208082019086860101610f17828287611030565b509095945050505050565b600080610f42604051806040016040528060608152602001600081525090565b610f5a85516005610f539190611ffc565b8290611086565b5060408051808201909152600581527f045f656e730000000000000000000000000000000000000000000000000000006020820152610f9a9082906110fd565b50610fa581866110fd565b506000610fb28582611125565b90505b8051516020820151101561101f578151610fd890610fd283611186565b906111a7565b60000361101157600080610ff5878460a001518560c00151611300565b92509050811561100e5794506001935061102992505050565b50505b61101a81611373565b610fb5565b5060008092509250505b9250929050565b602081106110685781518352611047602084611ffc565b9250611054602083611ffc565b915061106160208261200f565b9050611030565b905182516020929092036101000a6000190180199091169116179052565b6040805180820190915260608152600060208201526110a6602083612060565b156110ce576110b6602083612060565b6110c190602061200f565b6110cb9083611ffc565b91505b6020808401839052604051808552600081529081840101818110156110f257600080fd5b604052509192915050565b60408051808201909152606081526000602082015261111e8383845161145b565b9392505050565b6111736040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526102e781611373565b602081015181516060916102e79161119e9082611531565b84519190610ea0565b60006111b38383611593565b156111c0575060006102e7565b60008060008060006111d38860006115b1565b905060006111e28860006115b1565b90505b8082111561120e578593506111fa898761160e565b95508161120681612082565b9250506111e5565b8181111561123757849250611223888661160e565b94508061122f81612082565b91505061120e565b600082118015611250575061124e89878a88611632565b155b1561128557859350611262898761160e565b9550849250611271888661160e565b945061127e60018361200f565b9150611237565b8560000361129d5760001996505050505050506102e7565b846000036112b457600196505050505050506102e7565b6112f36112c2856001611ffc565b6112cc8b87610e58565b60ff168a6112db876001611ffc565b6112e58d89610e58565b8e949392919060ff16611667565b9998505050505050505050565b6000805b828410156113645760006113188686610e58565b60ff169050611328600186611ffc565b94506000806113388888856117e5565b9250905081156113505793506001925061136b915050565b61135a8388611ffc565b9650505050611304565b5060009050805b935093915050565b60c0810151602082018190528151511161138a5750565b600061139e82600001518360200151611531565b82602001516113ad9190611ffc565b82519091506113bc9082611839565b61ffff1660408301526113d0600282611ffc565b82519091506113df9082611839565b61ffff1660608301526113f3600282611ffc565b82519091506114029082611861565b63ffffffff166080830152611418600482611ffc565b825190915060009061142a9083611839565b61ffff16905061143b600283611ffc565b60a08401819052915061144e8183611ffc565b60c0909301929092525050565b604080518082019091526060815260006020820152825182111561147e57600080fd5b835151600061148d8483611ffc565b905085602001518111156114af576114af866114aa836002612099565b61188b565b8551805183820160200191600091808511156114c9578482525b505050602086015b6020861061150957805182526114e8602083611ffc565b91506114f5602082611ffc565b905061150260208761200f565b95506114d1565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b6000815b83518110611545576115456120b0565b60006115518583610e58565b60ff169050611561816001611ffc565b61156b9083611ffc565b91508060000361157b5750611581565b50611535565b61158b838261200f565b949350505050565b60008151835114801561111e575061111e83600084600087516118a8565b6000805b835183106115c5576115c56120b0565b60006115d18585610e58565b60ff1690506115e1816001611ffc565b6115eb9085611ffc565b9350806000036115fb575061111e565b611606600183611ffc565b9150506115b5565b600061161a8383610e58565b60ff16611628836001611ffc565b61111e9190611ffc565b600061164b8383848651611646919061200f565b610e7c565b61165d8686878951611646919061200f565b1495945050505050565b85516000906116768688611ffc565b11156116aa576116868587611ffc565b8751604051638a3c1cfb60e01b815260048101929092526024820152604401610352565b83516116b68385611ffc565b11156116ea576116c68284611ffc565b8451604051638a3c1cfb60e01b815260048101929092526024820152604401610352565b84808310156116f65750815b60208789018101908587010160005b838110156117ca578251825180821461179a5760006020611726858961200f565b106117345750600019611770565b600187611742866020611ffc565b61174c919061200f565b611757906008612099565b6117629060026121aa565b61176c919061200f565b1990505b60006117808383168584166121b6565b905080156117975797506117db9650505050505050565b50505b6117a5602086611ffc565b94506117b2602085611ffc565b935050506020816117c39190611ffc565b9050611705565b506117d585896121b6565b93505050505b9695505050505050565b6000806117f28585611861565b63ffffffff1663613d30781461180d5750600090508061136b565b61182d61181b856004611ffc565b6118258587611ffc565b8791906118cb565b91509150935093915050565b8151600090611849836002611ffc565b111561185457600080fd5b50016002015161ffff1690565b8151600090611871836004611ffc565b111561187c57600080fd5b50016004015163ffffffff1690565b81516118978383611086565b506118a283826110fd565b50505050565b60006118b5848484610e7c565b6118c0878785610e7c565b149695505050505050565b60008060286118da858561200f565b10156118eb5750600090508061136b565b6000806118f9878787611907565b909890975095505050505050565b60008080611915858561200f565b905080604014158015611929575080602814155b8061193e575061193a600282612060565b6001145b156119a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c696420737472696e67206c656e67746800000000000000000000006044820152606401610352565b6001915085518411156119b757600080fd5b611a08565b6000603a8210602f831116156119d45750602f190190565b604782106040831116156119ea57506036190190565b60678210606083111615611a0057506056190190565b5060ff919050565b60208601855b85811015611a6a57611a258183015160001a6119bc565b611a376001830184015160001a6119bc565b60ff811460ff83141715611a5057600095505050611a6a565b60049190911b1760089590951b9490941793600201611a0e565b505050935093915050565b600060208284031215611a8757600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461111e57600080fd5b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611af057611af0611ab7565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b1f57611b1f611ab7565b604052919050565b600067ffffffffffffffff821115611b4157611b41611ab7565b50601f01601f191660200190565b600082601f830112611b6057600080fd5b8135611b73611b6e82611b27565b611af6565b818152846020838601011115611b8857600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611bb657600080fd5b8135602067ffffffffffffffff80831115611bd357611bd3611ab7565b8260051b611be2838201611af6565b9384528581018301938381019088861115611bfc57600080fd5b84880192505b85831015611c9357823584811115611c1a5760008081fd5b88016040818b03601f1901811315611c325760008081fd5b611c3a611acd565b8783013587811115611c4c5760008081fd5b611c5a8d8a83870101611b4f565b825250908201359086821115611c705760008081fd5b611c7e8c8984860101611b4f565b81890152845250509184019190840190611c02565b98975050505050505050565b6001600160a01b0381168114611cb457600080fd5b50565b60008060008060808587031215611ccd57600080fd5b843567ffffffffffffffff80821115611ce557600080fd5b611cf188838901611b4f565b95506020870135915080821115611d0757600080fd5b50611d1487828801611ba5565b9350506040850135611d2581611c9f565b91506060850135611d3581611c9f565b939692955090935050565b600060208284031215611d5257600080fd5b813561111e81611c9f565b600060208284031215611d6f57600080fd5b5035919050565b60008060408385031215611d8957600080fd5b823567ffffffffffffffff80821115611da157600080fd5b611dad86838701611b4f565b93506020850135915080821115611dc357600080fd5b50611dd085828601611ba5565b9150509250929050565b600060208284031215611dec57600080fd5b813567ffffffffffffffff811115611e0357600080fd5b61158b84828501611b4f565b600060208284031215611e2157600080fd5b815161111e81611c9f565b600060208284031215611e3e57600080fd5b5051919050565b60005b83811015611e60578181015183820152602001611e48565b50506000910152565b60008151808452611e81816020860160208601611e45565b601f01601f19169290920160200192915050565b60208152600061111e6020830184611e69565b600060208284031215611eba57600080fd5b8151801515811461111e57600080fd5b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015611f4157888303603f1901855281518051878552611f1588860182611e69565b91890151858303868b0152919050611f2d8183611e69565b968901969450505090860190600101611ef1565b509098975050505050505050565b60008060408385031215611f6257600080fd5b825167ffffffffffffffff811115611f7957600080fd5b8301601f81018513611f8a57600080fd5b8051611f98611b6e82611b27565b818152866020838501011115611fad57600080fd5b611fbe826020830160208601611e45565b809450505050602083015163ffffffff81168114611fdb57600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102e7576102e7611fe6565b818103818111156102e7576102e7611fe6565b6040815260006120356040830185611e69565b905063ffffffff831660208301529392505050565b634e487b7160e01b600052603260045260246000fd5b60008261207d57634e487b7160e01b600052601260045260246000fd5b500690565b60008161209157612091611fe6565b506000190190565b80820281158282048414176102e7576102e7611fe6565b634e487b7160e01b600052600160045260246000fd5b600181815b808511156121015781600019048211156120e7576120e7611fe6565b808516156120f457918102915b93841c93908002906120cb565b509250929050565b600082612118575060016102e7565b81612125575060006102e7565b816001811461213b576002811461214557612161565b60019150506102e7565b60ff84111561215657612156611fe6565b50506001821b6102e7565b5060208310610133831016604e8410600b8410161715612184575081810a6102e7565b61218e83836120c6565b80600019048211156121a2576121a2611fe6565b029392505050565b600061111e8383612109565b81810360008312801583831316838312821617156121d6576121d6611fe6565b509291505056fea26469706673582212204fd3172855fc29f1ee29f5099e32e8c1f163dcac07aa16324d9f13cbd4f6ee7164736f6c63430008110033

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

000000000000000000000000f13fc748601fdc5afa255e9d9166eb43f603a903000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad8583000000000000000000000000e62e4b6ce018ad6e916fcc24545e20a33b9d8653000000000000000000000000670ca7456be604b5d5361a20b784aecd23ac514b00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e

-----Decoded View---------------
Arg [0] : _previousRegistrar (address): 0xf13fC748601fDc5afA255e9D9166EB43f603a903
Arg [1] : _resolver (address): 0x179Be112b24Ad4cFC392eF8924DfA08C20Ad8583
Arg [2] : _dnssec (address): 0xe62E4b6cE018Ad6e916fcC24545e20a33b9d8653
Arg [3] : _suffixes (address): 0x670CA7456Be604B5d5361a20B784Aecd23ac514b
Arg [4] : _ens (address): 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000f13fc748601fdc5afa255e9d9166eb43f603a903
Arg [1] : 000000000000000000000000179be112b24ad4cfc392ef8924dfa08c20ad8583
Arg [2] : 000000000000000000000000e62e4b6ce018ad6e916fcc24545e20a33b9d8653
Arg [3] : 000000000000000000000000670ca7456be604b5d5361a20b784aecd23ac514b
Arg [4] : 00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.