Contract 0xa1d6eca0e19327935e6afd93a066653d313cdc85

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xbf1b9dd15d99314a10518f93c2c72a5b5b5c0281f73b0833b8a7d35d4dae56000x60a0604025409752022-04-29 5:56:48225 days 3 hrs ago0x9cc988617e48b6b370061a06aee7093f5f215272 IN  Create: BaseRegistrarImplementationUpgradeable0 CRO16.5554750
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
BaseRegistrarImplementationUpgradeable

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 65 : BaseRegistrar.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ENS} from "../registry/interfaces/IENS.sol";
import {IERC721MetadataUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";

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

abstract contract BaseRegistrar is IERC721MetadataUpgradeable {
    uint256 public constant GRACE_PERIOD = 90 days;

    event BaseUriChanged(string indexed oldUri, string indexed newUri);
    event ControllerAdded(address indexed controller);
    event ControllerRemoved(address indexed controller);
    event NameMigrated(
        uint256 indexed id,
        address indexed owner,
        uint256 expires
    );
    event NameRegistered(
        uint256 indexed id,
        address indexed owner,
        uint256 expires
    );
    event NameRenewed(uint256 indexed id, uint256 expires);

    // The ENS registry
    ENS public ens;

    // The namehash of the TLD this registrar owns (eg, .eth)
    bytes32 public baseNode;

    // The base URI for ERC721 Metadata
    string public baseUri;

    // A map of addresses that are authorised to register and renew names.
    mapping(address => bool) public controllers;

    // Set the baseURI
    function setBaseUri(string memory baseUri_) external virtual;

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

    // Revoke controller permission for an address.
    function removeController(address controller) external virtual;

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

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

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

    /**
     * @dev Register a name.
     */
    function register(
        uint256 id,
        address nameOwner,
        uint256 duration
    ) external virtual returns (uint256);

    function renew(uint256 id, uint256 duration)
        external
        virtual
        returns (uint256);

    /**
     * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
     */
    function reclaim(uint256 id, address nameOwner) external virtual;
}

File 2 of 65 : IENS.sol
// SPDX-License-Identifier: MIT
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 3 of 65 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

File 4 of 65 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 65 : IERC165Upgradeable.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 IERC165Upgradeable {
    /**
     * @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 6 of 65 : BaseRegistrarImplementationUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ENS} from "../registry/interfaces/IENS.sol";
import {UUPSProxy} from "../proxy/UUPSProxy.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";

contract BaseRegistrarImplementationUpgradeable is
    Initializable,
    UUPSProxy,
    ERC721Upgradeable,
    BaseRegistrar
{
    // A map of expiry times
    mapping(uint256 => uint256) private expiries;

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

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

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

    // constructor(ENS _ens, bytes32 _baseNode) ERC721("", "") {
    //     ens = _ens;
    //     baseNode = _baseNode;
    // }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {} // solhint-disable-line

    /**
     * @dev Initialise a new ENS registrar.
     */
    function initialize(
        ENS _ens,
        bytes32 _baseNode,
        string memory name_,
        string memory symbol_,
        string memory baseUri_
    ) public initializer {
        ens = _ens;
        baseNode = _baseNode;
        baseUri = baseUri_;
        __UUPSProxy_init();
        __ERC721_init(name_, symbol_);
    }

    modifier live() {
        require(ens.owner(baseNode) == address(this), "BaseRegistrar::live:");
        _;
    }

    modifier onlyController() {
        require(controllers[msg.sender], "BaseRegistrar::onlyController:");
        _;
    }

    /**
     *@dev Set the base uri
     *@param baseUri_ new base uri, with mandatory ending `/`
     */
    function setBaseUri(string memory baseUri_) external override onlyOwner {
        emit BaseUriChanged(baseUri, baseUri_);
        baseUri = baseUri_;
    }

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

    // Authorises a controller, who can register and renew domains.
    function addController(address controller) external override onlyOwner {
        controllers[controller] = true;
        emit ControllerAdded(controller);
    }

    // Revoke controller permission for an address.
    function removeController(address controller) external override onlyOwner {
        controllers[controller] = false;
        emit ControllerRemoved(controller);
    }

    // Set the resolver for the TLD this registrar manages.
    function setResolver(address resolver) external override onlyOwner {
        ens.setResolver(baseNode, resolver);
    }

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

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

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

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

    function _register(
        uint256 id,
        address nameOwner,
        uint256 duration,
        bool updateRegistry
    ) internal live onlyController returns (uint256) {
        require(available(id), "BaseRegistrar::_register(): not available");
        require(
            block.timestamp + duration + GRACE_PERIOD >
                block.timestamp + GRACE_PERIOD,
            "BaseRegistrar::_register(): duration less than grace period"
        ); // Prevent future overflow

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

        emit NameRegistered(id, nameOwner, block.timestamp + duration);

        return block.timestamp + duration;
    }

    function renew(uint256 id, uint256 duration)
        external
        override
        live
        onlyController
        returns (uint256)
    {
        require(
            expiries[id] + GRACE_PERIOD >= block.timestamp,
            "BaseRegistrar: name not found"
        ); // Name must be registered here or in grace period
        require(
            expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD,
            "BaseRegistrar: name not found"
        ); // Prevent future overflow

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

    /**
     * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
     */
    function reclaim(uint256 id, address nameOwner) external override live {
        require(
            _isApprovedOrOwner(msg.sender, id),
            "BaseRegistrar:reclaim(): sender not approved"
        );
        ens.setSubnodeOwner(baseNode, bytes32(id), nameOwner);
    }

    function supportsInterface(bytes4 interfaceID)
        public
        view
        override(ERC721Upgradeable, IERC165Upgradeable)
        returns (bool)
    {
        return
            interfaceID == INTERFACE_META_ID ||
            interfaceID == ERC721_ID ||
            interfaceID == RECLAIM_ID ||
            super.supportsInterface(interfaceID);
    }
}

File 7 of 65 : UUPSProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract UUPSProxy is OwnableUpgradeable, UUPSUpgradeable {
    function __UUPSProxy_init() internal onlyInitializing {
        __Ownable_init();
        __UUPSUpgradeable_init();
        __UUPSProxy_init_unchained();
    }

    function __UUPSProxy_init_unchained() internal onlyInitializing {} // solhint-disable-line

    function _authorizeUpgrade(address) internal override onlyOwner {} // solhint-disable-line

    modifier onlyProxyAdmin() {
        require(_getAdmin() == msg.sender, "Caller must be Proxy Admin");
        _;
    }

    /**
     * @dev Returns the active proxy admin.
     */
    function getProxyAdmin() public view returns (address) {
        return _getAdmin();
    }

    function changeProxyAdmin(address newAdmin) external onlyOwner {
        _changeAdmin(newAdmin);
    }
}

File 8 of 65 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

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

File 9 of 65 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 10 of 65 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

File 11 of 65 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
        __UUPSUpgradeable_init_unchained();
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
    uint256[50] private __gap;
}

File 12 of 65 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
        __ERC1967Upgrade_init_unchained();
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            _functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }
    uint256[50] private __gap;
}

File 13 of 65 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 14 of 65 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 15 of 65 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 17 of 65 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 18 of 65 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

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

import "hardhat-deploy/solc_0.8/proxy/Proxied.sol";

import "./StableERC20PriceBase.sol";
import "./interfaces/IPriceBase.sol";
import "./BaseRegistrarImplementationUpgradeable.sol";
import "../library/StringUtils.sol";
import "../resolver/interfaces/IResolver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/**
 * @dev A registrar controller for registering and renewing names at fixed cost.
 */
contract CRORegistrarController is Ownable, Proxied {
    using StringUtils for *;
    using SafeERC20 for IERC20;

    uint256 public constant MIN_REGISTRATION_DURATION = 28 days;

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

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

    BaseRegistrarImplementationUpgradeable public base;
    IPriceBase public priceBase;
    uint256 public minCommitmentAge;
    uint256 public maxCommitmentAge;

    mapping(bytes32 => uint256) public commitments;

    event NameRegistered(
        string name,
        bytes32 indexed label,
        address indexed nameOwner,
        uint256 cost,
        uint256 expires
    );
    event NameRenewed(
        string name,
        bytes32 indexed label,
        uint256 cost,
        uint256 expires
    );
    event NewPriceBase(address indexed oracle);
    event CommitmentAgeChanged(
        uint256 indexed minCommitmentAge,
        uint256 indexed maxCommitmentAge
    );

    function init(
        BaseRegistrarImplementationUpgradeable _base,
        IPriceBase _priceBase,
        uint256 _minCommitmentAge,
        uint256 _maxCommitmentAge
    ) public proxied {
        require(
            _maxCommitmentAge > _minCommitmentAge,
            "CROController: max is less than min age"
        );

        base = _base;
        priceBase = _priceBase;
        minCommitmentAge = _minCommitmentAge;
        maxCommitmentAge = _maxCommitmentAge;
        emit CommitmentAgeChanged(minCommitmentAge, maxCommitmentAge);
    }

    constructor(
        BaseRegistrarImplementationUpgradeable _base,
        IPriceBase _priceBase,
        uint256 _minCommitmentAge,
        uint256 _maxCommitmentAge
    ) {
        init(_base, _priceBase, _minCommitmentAge, _maxCommitmentAge);
    }

    function rentPrice(string memory name, uint256 duration)
        public
        view
        returns (uint256)
    {
        bytes32 hash = keccak256(bytes(name));
        uint256 expires = base.nameExpires(uint256(hash));
        return priceBase.price(name, expires, duration);
    }

    function _transferRentPrice(string memory name, uint256 duration) internal {
        bytes32 hash = keccak256(bytes(name));
        priceBase.transferFee(
            name,
            base.nameExpires(uint256(hash)),
            duration,
            msg.sender
        );
    }

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

    function available(string memory name) public view returns (bool) {
        bytes32 label = keccak256(bytes(name));
        return valid(name) && base.available(uint256(label));
    }

    function makeCommitment(
        string memory _name,
        address _nameOwner,
        bytes32 _secret
    ) public pure returns (bytes32) {
        return
            makeCommitmentWithConfig(
                _name,
                _nameOwner,
                _secret,
                address(0),
                address(0)
            );
    }

    function makeCommitmentWithConfig(
        string memory name,
        address nameOwner,
        bytes32 secret,
        address resolver,
        address addr
    ) public pure returns (bytes32) {
        bytes32 label = keccak256(bytes(name));
        if (resolver == address(0) && addr == address(0)) {
            return keccak256(abi.encodePacked(label, nameOwner, secret));
        }
        require(resolver != address(0), "CROController: resolver ZERO ADDRESS");
        return
            keccak256(
                abi.encodePacked(label, nameOwner, resolver, addr, secret)
            );
    }

    function commit(bytes32 commitment) public {
        require(
            commitments[commitment] + maxCommitmentAge < block.timestamp,
            "CROController: Commitment already exists"
        );
        commitments[commitment] = block.timestamp;
    }

    function register(
        string calldata name,
        address nameOwner,
        uint256 duration,
        bytes32 secret
    ) external payable {
        registerWithConfig(
            name,
            nameOwner,
            duration,
            secret,
            address(0),
            address(0)
        );
    }

    function registerWithConfig(
        string memory name,
        address nameOwner,
        uint256 duration,
        bytes32 secret,
        address resolver,
        address addr
    ) public payable {
        bytes32 commitment = makeCommitmentWithConfig(
            name,
            nameOwner,
            secret,
            resolver,
            addr
        );
        uint256 cost = _consumeCommitment(name, duration, commitment);
        // transfer fee token
        _transferRentPrice(name, duration);

        bytes32 label = keccak256(bytes(name));
        uint256 tokenId = uint256(label);

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

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

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

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

            // Now transfer full ownership to the expeceted owner
            base.reclaim(tokenId, nameOwner);

            base.transferFrom(address(this), nameOwner, tokenId);
        } else {
            require(
                addr == address(0),
                "CRORegistrarController::registerWithConfig(): addr is not zero"
            );
            expires = base.register(tokenId, nameOwner, duration);
        }

        emit NameRegistered(name, label, nameOwner, cost, expires);

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

    /// @notice Bulk Reserve names
    /// @param names array for names to reserve
    /// @param nameOwners array for owners in same order as names array
    /// @param duration duration to register for
    /// @param resolver resolver address
    function reserve(
        string[] memory names,
        address[] memory nameOwners,
        uint256 duration,
        address resolver
    ) public onlyOwner {
        require(
            names.length == nameOwners.length,
            "CRORegistrarController::reserve: names and owners should have equal length"
        );

        for (uint256 i = 0; i < names.length; i++) {
            string memory name = names[i];
            address nameOwner = nameOwners[i];
            bytes32 label = keccak256(bytes(name));
            uint256 tokenId = uint256(label);

            uint256 expires;
            // Set this contract as the (temporary) owner, giving it
            // permission to set up the resolver.
            expires = base.register(tokenId, address(this), duration);

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

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

            // Configure the resolver
            // IResolver(resolver).setAddr(nodehash, nameOwner);

            // Now transfer full ownership to the expected owner
            base.reclaim(tokenId, nameOwner);

            base.transferFrom(address(this), nameOwner, tokenId);

            emit NameRegistered(name, label, nameOwner, 0, expires);
        }
    }

    function renew(string calldata name, uint256 duration) external payable {
        uint256 cost = rentPrice(name, duration);
        // transfer the fee token
        _transferRentPrice(name, duration);
        // require(msg.value >= cost);

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

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

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

    function setPriceBase(IPriceBase _priceBase) public onlyOwner {
        priceBase = _priceBase;
        emit NewPriceBase(address(priceBase));
    }

    function setCommitmentAges(
        uint256 _minCommitmentAge,
        uint256 _maxCommitmentAge
    ) public onlyOwner {
        minCommitmentAge = _minCommitmentAge;
        maxCommitmentAge = _maxCommitmentAge;
        emit CommitmentAgeChanged(minCommitmentAge, maxCommitmentAge);
    }

    function withdraw() public onlyOwner {
        payable(msg.sender).transfer(address(this).balance);
    }

    function withdrawERC20(IERC20 _token, uint256 _amount) public onlyOwner {
        _token.safeTransfer(msg.sender, _amount);
    }

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

    function _consumeCommitment(
        string memory name,
        uint256 duration,
        bytes32 commitment
    ) internal returns (uint256) {
        // Require a valid commitment
        require(
            commitments[commitment] + minCommitmentAge <= block.timestamp,
            "CRORegistrarController::_consumeCommitment(): commitment doesn't exist or too early to consume"
        );

        // If the commitment is too old, or the name is registered, stop
        require(
            commitments[commitment] + maxCommitmentAge > block.timestamp,
            "CRORegistrarController::_consumeCommitment(): commitment too old"
        );
        require(
            available(name),
            "CRORegistrarController::_consumeCommitment(): Name not available"
        );

        delete (commitments[commitment]);

        uint256 cost = rentPrice(name, duration);
        require(
            duration >= MIN_REGISTRATION_DURATION,
            "CRORegistrarController::_consumeCommitment(): less than min duration"
        );
        // require(msg.value >= cost);

        return cost;
    }
}

File 21 of 65 : Proxied.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract Proxied {
    /// @notice to be used by initialisation / postUpgrade function so that only the proxy's admin can execute them
    /// It also allows these functions to be called inside a contructor
    /// even if the contract is meant to be used without proxy
    modifier proxied() {
        address proxyAdminAddress = _proxyAdmin();
        // With hardhat-deploy proxies
        // the proxyAdminAddress is zero only for the implementation contract
        // if the implementation contract want to be used as a standalone/immutable contract
        // it simply has to execute the `proxied` function
        // This ensure the proxyAdminAddress is never zero post deployment
        // And allow you to keep the same code for both proxied contract and immutable contract
        if (proxyAdminAddress == address(0)) {
            // ensure can not be called twice when used outside of proxy : no admin
            // solhint-disable-next-line security/no-inline-assembly
            assembly {
                sstore(
                    0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
                    0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                )
            }
        } else {
            require(msg.sender == proxyAdminAddress);
        }
        _;
    }

    modifier onlyProxyAdmin() {
        require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
        _;
    }

    function _proxyAdmin() internal view returns (address ownerAddress) {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            ownerAddress := sload(0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103)
        }
    }
}

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

import "hardhat-deploy/solc_0.8/proxy/Proxied.sol";
import "./interfaces/IPriceBase.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../library/StringUtils.sol";

contract StableERC20PriceBase is IPriceBase, Ownable, ReentrancyGuard, Proxied {
    using SafeMath for uint256;
    using SafeERC20 for ERC20;
    using SafeERC20 for IERC20;
    using StringUtils for *;

    // uint256 immutable GRACE_PERIOD = 90 days;
    address public treasury;
    // Rent in base price units by length. Element 0 is for 1-length names, and so on.
    uint256[] public rentPrices;
    ERC20 public feeCurrency;
    mapping(address => bool) public whitelist;

    event RentPriceChanged(uint256[] prices);
    event FeeCurrencyChanged(
        address indexed previousToken,
        address indexed nextToken
    );
    event TransferFee(
        string indexed name,
        uint256 indexed expires,
        uint256 duration,
        address indexed from,
        uint256 fees
    );
    event WhitelistAdd(address indexed user);
    event WhitelistRemove(address indexed user);
    event TreasuryChanged(
        address indexed previousTreasury,
        address indexed nextTreasury
    );

    function init(
        uint256[] memory _rentPrices,
        address _feeCurrency,
        address _treasury
    ) public proxied {
        require(
            address(_treasury) != address(0),
            "StableERC20PriceBase: _treasury ZERO ADDRESS"
        );
        require(
            address(_feeCurrency) != address(0),
            "StableERC20PriceBase: _feeCurrency ZERO ADDRESS"
        );

        rentPrices = _rentPrices;
        feeCurrency = ERC20(_feeCurrency);
        treasury = _treasury;

        emit RentPriceChanged(rentPrices);
        emit FeeCurrencyChanged(address(0), address(feeCurrency));
    }

    constructor(
        uint256[] memory _rentPrices,
        address _feeCurrency,
        address _treasury
    ) {
        init(_rentPrices, _feeCurrency, _treasury);
    }

    /// @dev Get the price for registerng/renewing name
    /// @param name name string
    /// @param expires expiration timestamp
    /// @param duration duration for lease
    /// @return Price in 10^18 decimals
    function price(
        string calldata name,
        uint256 expires,
        uint256 duration
    ) public view override returns (uint256) {
        return _adjustForTokenDecimals(_price(name, expires, duration));
    }

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

    /// @dev Transfer the rent fee from user to treasury
    /// @param name name string
    /// @param expires expiration timestamp
    /// @param duration duration for lease
    /// @param from user address to transfer money from
    function transferFee(
        string calldata name,
        uint256 expires,
        uint256 duration,
        address from
    ) external override nonReentrant {
        if (whitelist[from]) {
            emit TransferFee(name, expires, duration, from, 0);
        } else {
            uint256 fees = price(name, expires, duration);
            emit TransferFee(name, expires, duration, from, fees);
            feeCurrency.safeTransferFrom(from, treasury, fees);
        }
    }

    function addToWhitelist(address _user) external onlyOwner {
        whitelist[_user] = true;
        emit WhitelistAdd(_user);
    }

    function removeFromWhitelist(address _user) external onlyOwner {
        whitelist[_user] = false;
        emit WhitelistRemove(_user);
    }

    function setTreasury(address treasury_) external onlyOwner {
        require(
            treasury_ != address(0),
            "[email protected])PriceBase::setTreasury: ZERO ADDRESS"
        );
        address previousTreasury = treasury;
        treasury = treasury_;
        emit TreasuryChanged(previousTreasury, treasury);
    }

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

    function setCurrency(ERC20 _feeCurrency) external onlyOwner {
        IERC20 previousCurrency = feeCurrency;
        feeCurrency = _feeCurrency;
        emit FeeCurrencyChanged(
            address(previousCurrency),
            address(feeCurrency)
        );
    }

    function feeCurrencyDecimals() external view returns (uint256) {
        return feeCurrency.decimals();
    }

    function withdraw() public onlyOwner {
        payable(msg.sender).transfer(address(this).balance);
    }

    function withdrawERC20(IERC20 _token, uint256 _amount) public onlyOwner {
        _token.safeTransfer(msg.sender, _amount);
    }

    function withdrawFees() public onlyOwner {
        feeCurrency.safeTransfer(msg.sender, feeCurrency.balanceOf(msg.sender));
    }

    /// @dev Get the price for registerng/renewing name
    /// @param name name string
    /// @param expires expiration timestamp
    /// @param duration duration for lease
    /// @return Price in 10^18 decimals
    function _price(
        string calldata name,
        uint256 expires,
        uint256 duration
    ) internal view returns (uint256) {
        uint256 len = name.strlen();
        if (len > rentPrices.length) {
            len = rentPrices.length;
        }
        require(len > 0, "StableERC20PriceBase::_price: empty rentPrices");

        uint256 basePrice = rentPrices[len - 1].mul(duration);

        basePrice = basePrice.add(_premium(name, expires, duration));

        return basePrice;
    }

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

    function _adjustForTokenDecimals(uint256 amount)
        internal
        view
        returns (uint256)
    {
        uint256 feeDecimals = feeCurrency.decimals();
        if (feeDecimals > 18) {
            return amount.mul(10**(feeDecimals.sub(18)));
        } else {
            return amount.div(10**(uint256(18).sub(feeDecimals)));
        }
    }

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

File 23 of 65 : IPriceBase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

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

    /**
     * @dev Transfer the fees to treasury.
     * @param name The name being registered or renewed.
     * @param expires When the name presently expires (0 if this is a new registration).
     * @param duration How long the name is being registered or extended for, in seconds.
     * @param from Payee address.
     */
    function transferFee(
        string calldata name,
        uint256 expires,
        uint256 duration,
        address from
    ) external;
}

File 24 of 65 : StringUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

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

File 25 of 65 : IResolver.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IABIResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IAddrResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IAddressResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IContentHashResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IInterfaceResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/INameResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/IPubkeyResolver.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/ITextResolver.sol";

/**
 * A generic resolver interface
 */
interface IResolver is
    ISupportsInterface,
    IABIResolver,
    IAddressResolver,
    IAddrResolver,
    IContentHashResolver,
    IInterfaceResolver,
    INameResolver,
    IPubkeyResolver,
    ITextResolver
{
    function setABI(
        bytes32 node,
        uint256 contentType,
        bytes calldata data
    ) external;

    function setAddr(bytes32 node, address addr) external;

    function setAddr(
        bytes32 node,
        uint256 coinType,
        bytes calldata a
    ) external;

    function setContenthash(bytes32 node, bytes calldata hash) external;

    function setName(bytes32 node, string calldata _name) external;

    function setPubkey(
        bytes32 node,
        bytes32 x,
        bytes32 y
    ) external;

    function setText(
        bytes32 node,
        string calldata key,
        string calldata value
    ) external;

    function setInterface(
        bytes32 node,
        bytes4 interfaceID,
        address implementer
    ) external;

    function setContent(bytes32 node, bytes32 hash) external;

    function setMultihash(bytes32 node, bytes calldata hash) external;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 27 of 65 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 28 of 65 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 29 of 65 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 30 of 65 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 31 of 65 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

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

File 32 of 65 : 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 33 of 65 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 34 of 65 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 35 of 65 : 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 36 of 65 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 38 of 65 : 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 39 of 65 : IAddressResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

import "./SupportsInterface.sol";

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

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

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

import "./ISupportsInterface.sol";

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

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

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

File 48 of 65 : ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967Upgrade {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            Address.functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

File 49 of 65 : IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 50 of 65 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 51 of 65 : ERC1967Proxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)

pragma solidity ^0.8.0;

import "../Proxy.sol";
import "./ERC1967Upgrade.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy, ERC1967Upgrade {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializating the storage of the proxy like a Solidity constructor.
     */
    constructor(address _logic, bytes memory _data) payable {
        assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
        _upgradeToAndCall(_logic, _data, false);
    }

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        return ERC1967Upgrade._getImplementation();
    }
}

File 52 of 65 : Proxy.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/Proxy.sol)

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overriden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

File 53 of 65 : import.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

contract MockStub {
    function init() public {} // solhint-disable-line
}

File 54 of 65 : MockERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

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

contract MockERC20 is ERC20, Ownable {
    uint8 _decimals;

    constructor(
        string memory name_,
        string memory symbol_,
        uint8 decimals_
    ) ERC20(name_, symbol_) {
        _decimals = decimals_;
    }

    function decimals() public view virtual override returns (uint8) {
        return _decimals;
    }

    function mint(uint256 amount, address to) public onlyOwner {
        _mint(to, amount);
    }

    function mintAll(uint256 amount, address[] memory to) public onlyOwner {
        for (uint256 i = 0; i < to.length; i++) {
            _mint(to[i], amount);
        }
    }
}

File 55 of 65 : TextResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../ResolverBase.sol";
import "./ITextResolver.sol";

abstract contract TextResolver is ITextResolver, ResolverBase {
    mapping(bytes32=>mapping(string=>string)) texts;

    /**
     * Sets the text data associated with an ENS node and key.
     * May only be called by the owner of that node in the ENS registry.
     * @param node The node to update.
     * @param key The key to set.
     * @param value The text data value to set.
     */
    function setText(bytes32 node, string calldata key, string calldata value) virtual external authorised(node) {
        texts[node][key] = value;
        emit TextChanged(node, key, key);
    }

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

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

File 56 of 65 : PubkeyResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../ResolverBase.sol";
import "./IPubkeyResolver.sol";

abstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {
    struct PublicKey {
        bytes32 x;
        bytes32 y;
    }

    mapping(bytes32=>PublicKey) pubkeys;

    /**
     * Sets the SECP256k1 public key associated with an ENS node.
     * @param node The ENS node to query
     * @param x the X coordinate of the curve point for the public key.
     * @param y the Y coordinate of the curve point for the public key.
     */
    function setPubkey(bytes32 node, bytes32 x, bytes32 y) virtual external authorised(node) {
        pubkeys[node] = PublicKey(x, y);
        emit PubkeyChanged(node, x, y);
    }

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

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

File 57 of 65 : PublicResolverUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.4;

import {ENS} from "../registry/interfaces/IENS.sol";
import {UUPSProxy} from "../proxy/UUPSProxy.sol";
import {ABIResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/ABIResolver.sol";
import {AddrResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/AddrResolver.sol";
import {ContentHashResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/ContentHashResolver.sol";
import {InterfaceResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/InterfaceResolver.sol";
import {NameResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/NameResolver.sol";
import {PubkeyResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/PubkeyResolver.sol";
import {TextResolver} from "@ensdomains/ens-contracts/contracts/resolvers/profiles/TextResolver.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

interface INameWrapper {
    function ownerOf(uint256 id) external view returns (address);
}

/**
 * A simple resolver anyone can use; only allows the owner of a node to set its
 * address.
 */
contract PublicResolverUpgradeable is
    Initializable,
    UUPSProxy,
    ABIResolver,
    AddrResolver,
    ContentHashResolver,
    InterfaceResolver,
    NameResolver,
    PubkeyResolver,
    TextResolver
{
    ENS public ens;
    INameWrapper public nameWrapper;

    /**
     * A mapping of operators. An address that is authorised for an address
     * may make any changes to the name that the owner could, but may not update
     * the set of authorisations.
     * (owner, operator) => approved
     */
    mapping(address => mapping(address => bool)) private _operatorApprovals;

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

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {} // solhint-disable-line

    /**
     * @dev Initialiser
     * @param _ens The address of the ENS registry.
     * @param wrapperAddress The address of the ERC1155 NameWrapper.
     */
    function initialize(ENS _ens, INameWrapper wrapperAddress)
        public
        initializer
    {
        ens = _ens;
        nameWrapper = wrapperAddress;

        __UUPSProxy_init();
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) external {
        require(
            msg.sender != operator,
            "ERC1155: setting approval status for self"
        );

        _operatorApprovals[msg.sender][operator] = approved;
        emit ApprovalForAll(msg.sender, operator, approved);
    }

    function isAuthorised(bytes32 node) internal view override returns (bool) {
        address _owner = ens.owner(node);
        if (_owner == address(nameWrapper)) {
            _owner = nameWrapper.ownerOf(uint256(node));
        }
        return _owner == msg.sender || isApprovedForAll(_owner, msg.sender);
    }

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

    function supportsInterface(bytes4 interfaceID)
        public
        pure
        override(
            ABIResolver,
            AddrResolver,
            ContentHashResolver,
            InterfaceResolver,
            NameResolver,
            PubkeyResolver,
            TextResolver
        )
        returns (bool)
    {
        return super.supportsInterface(interfaceID);
    }
}

File 58 of 65 : ABIResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

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

abstract contract ABIResolver is IABIResolver, ResolverBase {
    mapping(bytes32=>mapping(uint256=>bytes)) abis;

    /**
     * Sets the ABI associated with an ENS node.
     * Nodes may have one ABI of each content type. To remove an ABI, set it to
     * the empty string.
     * @param node The node to update.
     * @param contentType The content type of the ABI
     * @param data The ABI data.
     */
    function setABI(bytes32 node, uint256 contentType, bytes calldata data) virtual external authorised(node) {
        // Content types must be powers of 2
        require(((contentType - 1) & contentType) == 0);

        abis[node][contentType] = data;
        emit ABIChanged(node, contentType);
    }

    /**
     * Returns the ABI associated with an ENS node.
     * Defined in EIP205.
     * @param node The ENS node to query
     * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
     * @return contentType The content type of the return value
     * @return data The ABI data
     */
    function ABI(bytes32 node, uint256 contentTypes) virtual override external view returns (uint256, bytes memory) {
        mapping(uint256=>bytes) storage abiset = abis[node];

        for (uint256 contentType = 1; contentType <= contentTypes; contentType <<= 1) {
            if ((contentType & contentTypes) != 0 && abiset[contentType].length > 0) {
                return (contentType, abiset[contentType]);
            }
        }

        return (0, bytes(""));
    }

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

File 59 of 65 : 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 {
    uint constant private COIN_TYPE_ETH = 60;

    mapping(bytes32=>mapping(uint=>bytes)) _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) virtual external 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) virtual override public view 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, uint coinType, bytes memory a) virtual public authorised(node) {
        emit AddressChanged(node, coinType, a);
        if(coinType == COIN_TYPE_ETH) {
            emit AddrChanged(node, bytesToAddress(a));
        }
        _addresses[node][coinType] = a;
    }

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

    function supportsInterface(bytes4 interfaceID) virtual override public pure 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 60 of 65 : ContentHashResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../ResolverBase.sol";
import "./IContentHashResolver.sol";

abstract contract ContentHashResolver is IContentHashResolver, ResolverBase {
    mapping(bytes32=>bytes) hashes;

    /**
     * Sets the contenthash 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 hash The contenthash to set
     */
    function setContenthash(bytes32 node, bytes calldata hash) virtual external authorised(node) {
        hashes[node] = hash;
        emit ContenthashChanged(node, hash);
    }

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

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

File 61 of 65 : InterfaceResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../ResolverBase.sol";
import "../ISupportsInterface.sol";
import "./AddrResolver.sol";
import "./IInterfaceResolver.sol";

abstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {
    mapping(bytes32=>mapping(bytes4=>address)) interfaces;

    /**
     * Sets an interface associated with a name.
     * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.
     * @param node The node to update.
     * @param interfaceID The EIP 165 interface ID.
     * @param implementer The address of a contract that implements this interface for this node.
     */
    function setInterface(bytes32 node, bytes4 interfaceID, address implementer) virtual external authorised(node) {
        interfaces[node][interfaceID] = implementer;
        emit InterfaceChanged(node, interfaceID, implementer);
    }

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

        address a = addr(node);
        if(a == address(0)) {
            return address(0);
        }

        (bool success, bytes memory returnData) = a.staticcall(abi.encodeWithSignature("supportsInterface(bytes4)", type(ISupportsInterface).interfaceId));
        if(!success || returnData.length < 32 || returnData[31] == 0) {
            // EIP 165 not supported by target
            return address(0);
        }

        (success, returnData) = a.staticcall(abi.encodeWithSignature("supportsInterface(bytes4)", interfaceID));
        if(!success || returnData.length < 32 || returnData[31] == 0) {
            // Specified interface not supported by target
            return address(0);
        }

        return a;
    }

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

File 62 of 65 : NameResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../ResolverBase.sol";
import "./INameResolver.sol";

abstract contract NameResolver is INameResolver, ResolverBase {
    mapping(bytes32=>string) names;

    /**
     * Sets the name associated with an ENS node, for reverse records.
     * May only be called by the owner of that node in the ENS registry.
     * @param node The node to update.
     */
    function setName(bytes32 node, string calldata newName) virtual external authorised(node) {
        names[node] = newName;
        emit NameChanged(node, newName);
    }

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

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

File 63 of 65 : ControllableUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

contract ControllableUpgradeable is OwnableUpgradeable {
    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 64 of 65 : ReverseRegistrarUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ENS} from "./interfaces/IENS.sol";
import {UUPSProxy} from "../proxy/UUPSProxy.sol";
import {ControllableUpgradeable} from "../root/ControllableUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

interface NameResolver {
    function setName(bytes32 node, string memory name) external;
}

bytes32 constant LOOKUP = 0x3031323334353637383961626364656600000000000000000000000000000000;
bytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;

// namehash('addr.reverse')

contract ReverseRegistrarUpgradeable is
    Initializable,
    ControllableUpgradeable,
    UUPSProxy
{
    ENS public ens;
    NameResolver public defaultResolver;

    event ReverseClaimed(address indexed addr, bytes32 indexed node);

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {} // solhint-disable-line

    /**
     * @dev Initialiser
     * @param ensAddr The address of the ENS registry.
     * @param resolverAddr The address of the default reverse resolver.
     */
    function initialize(ENS ensAddr, NameResolver resolverAddr)
        public
        initializer
    {
        ens = ensAddr;
        defaultResolver = resolverAddr;

        // Assign ownership of the reverse record to our deployer
        ReverseRegistrarUpgradeable oldRegistrar = ReverseRegistrarUpgradeable(
            ens.owner(ADDR_REVERSE_NODE)
        );
        if (address(oldRegistrar) != address(0x0)) {
            oldRegistrar.claim(msg.sender);
        }

        __UUPSProxy_init();
    }

    modifier authorised(address addr) {
        require(
            addr == msg.sender ||
                controllers[msg.sender] ||
                ens.isApprovedForAll(addr, msg.sender) ||
                ownsContract(addr),
            "Caller is not a controller or authorised by address or the address itself"
        );
        _;
    }

    /**
     * @dev Transfers ownership of the reverse ENS record associated with the
     *      calling account.
     * @param owner The address to set as the owner of the reverse record in ENS.
     * @return The ENS node hash of the reverse record.
     */
    function claim(address owner) public returns (bytes32) {
        return _claimWithResolver(msg.sender, owner, address(0x0));
    }

    /**
     * @dev Transfers ownership of the reverse ENS record associated with the
     *      calling account.
     * @param addr The reverse record to set
     * @param owner The address to set as the owner of the reverse record in ENS.
     * @return The ENS node hash of the reverse record.
     */
    function claimForAddr(address addr, address owner)
        public
        authorised(addr)
        returns (bytes32)
    {
        return _claimWithResolver(addr, owner, address(0x0));
    }

    /**
     * @dev Transfers ownership of the reverse ENS record associated with the
     *      calling account.
     * @param owner The address to set as the owner of the reverse record in ENS.
     * @param resolver The address of the resolver to set; 0 to leave unchanged.
     * @return The ENS node hash of the reverse record.
     */
    function claimWithResolver(address owner, address resolver)
        public
        returns (bytes32)
    {
        return _claimWithResolver(msg.sender, owner, resolver);
    }

    /**
     * @dev Transfers ownership of the reverse ENS record specified with the
     *      address provided
     * @param addr The reverse record to set
     * @param owner The address to set as the owner of the reverse record in ENS.
     * @param resolver The address of the resolver to set; 0 to leave unchanged.
     * @return The ENS node hash of the reverse record.
     */
    function claimWithResolverForAddr(
        address addr,
        address owner,
        address resolver
    ) public authorised(addr) returns (bytes32) {
        return _claimWithResolver(addr, owner, resolver);
    }

    /**
     * @dev Sets the `name()` record for the reverse ENS record associated with
     * the calling account. First updates the resolver to the default reverse
     * resolver if necessary.
     * @param name The name to set for this address.
     * @return The ENS node hash of the reverse record.
     */
    function setName(string memory name) public returns (bytes32) {
        bytes32 _node = _claimWithResolver(
            msg.sender,
            address(this),
            address(defaultResolver)
        );
        defaultResolver.setName(_node, name);
        return _node;
    }

    /**
     * @dev Sets the `name()` record for the reverse ENS record associated with
     * the account provided. First updates the resolver to the default reverse
     * resolver if necessary.
     * Only callable by controllers and authorised users
     * @param addr The reverse record to set
     * @param owner The owner of the reverse node
     * @param name The name to set for this address.
     * @return The ENS node hash of the reverse record.
     */
    function setNameForAddr(
        address addr,
        address owner,
        string memory name
    ) public authorised(addr) returns (bytes32) {
        bytes32 _node = _claimWithResolver(
            addr,
            address(this),
            address(defaultResolver)
        );
        defaultResolver.setName(_node, name);
        ens.setSubnodeOwner(ADDR_REVERSE_NODE, sha3HexAddress(addr), owner);
        return _node;
    }

    /**
     * @dev Returns the node hash for a given account's reverse records.
     * @param addr The address to hash
     * @return The ENS node hash.
     */
    function node(address addr) public pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))
            );
    }

    /**
     * @dev An optimised function to compute the sha3 of the lower-case
     *      hexadecimal representation of an Ethereum address.
     * @param addr The address to hash
     * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the
     *         input address.
     */
    function sha3HexAddress(address addr) private pure returns (bytes32 ret) {
        bytes32 lookup = LOOKUP;

        /* solhint-disable */
        assembly {
            for {
                let i := 40
            } gt(i, 0) {

            } {
                i := sub(i, 1)
                mstore8(i, byte(and(addr, 0xf), lookup))
                addr := div(addr, 0x10)
                i := sub(i, 1)
                mstore8(i, byte(and(addr, 0xf), lookup))
                addr := div(addr, 0x10)
            }

            ret := keccak256(0, 40)
        }
        /* solhint-enable */
    }

    /* Internal functions */

    function _claimWithResolver(
        address addr,
        address owner,
        address resolver
    ) internal returns (bytes32) {
        bytes32 label = sha3HexAddress(addr);
        bytes32 _node = keccak256(abi.encodePacked(ADDR_REVERSE_NODE, label));
        address currentResolver = ens.resolver(_node);
        bool shouldUpdateResolver = (resolver != address(0x0) &&
            resolver != currentResolver);
        address newResolver = shouldUpdateResolver ? resolver : currentResolver;

        ens.setSubnodeRecord(ADDR_REVERSE_NODE, label, owner, newResolver, 0);

        emit ReverseClaimed(addr, _node);

        return _node;
    }

    function ownsContract(address addr) internal view returns (bool) {
        try OwnableUpgradeable(addr).owner() returns (address owner) {
            return owner == msg.sender;
        } catch {
            return false;
        }
    }
}

File 65 of 65 : ENSRegistryUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ENS} from "./interfaces/IENS.sol";
import {UUPSProxy} from "../proxy/UUPSProxy.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

/**
 * The ENS registry contract.
 */
contract ENSRegistryUpgradeable is ENS, Initializable, UUPSProxy {
    struct Record {
        address owner;
        address resolver;
        uint64 ttl;
    }

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

    // Permits modifications only by the owner of the specified node.
    modifier authorised(bytes32 _node) {
        address recordOwner = records[_node].owner;
        require(
            recordOwner == msg.sender || operators[recordOwner][msg.sender],
            "ENSRegistry: not authorized"
        );
        _;
    }

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

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {} // solhint-disable-line

    /**
     * @dev Initialise a new ENS registrar.
     */
    function initialize() public initializer {
        records[0x0].owner = msg.sender;
        __UUPSProxy_init();
    }

    /**
     * @dev Sets the record for a node.
     * @param _node The node to update.
     * @param _recordOwner The address of the new owner.
     * @param _resolver The address of the resolver.
     * @param _ttl The TTL in seconds.
     */
    function setRecord(
        bytes32 _node,
        address _recordOwner,
        address _resolver,
        uint64 _ttl
    ) external virtual override {
        setOwner(_node, _recordOwner);
        _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 _recordOwner 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 _recordOwner,
        address _resolver,
        uint64 _ttl
    ) external virtual override {
        bytes32 subnode = setSubnodeOwner(_node, _label, _recordOwner);
        _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 _recordOwner The address of the new owner.
     */
    function setOwner(bytes32 _node, address _recordOwner)
        public
        virtual
        override
        authorised(_node)
    {
        _setOwner(_node, _recordOwner);
        emit Transfer(_node, _recordOwner);
    }

    /**
     * @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 _recordOwner The address of the new owner.
     */
    function setSubnodeOwner(
        bytes32 _node,
        bytes32 _label,
        address _recordOwner
    ) public virtual override authorised(_node) returns (bytes32) {
        bytes32 subnode = keccak256(abi.encodePacked(_node, _label));
        _setOwner(subnode, _recordOwner);
        emit NewOwner(_node, _label, _recordOwner);
        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 _recordOwner 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 _recordOwner, address _operator)
        external
        view
        virtual
        override
        returns (bool)
    {
        return operators[_recordOwner][_operator];
    }

    function _setOwner(bytes32 _node, address _recordOwner) internal virtual {
        // Includes fix from new ENSRegistry
        // https://github.com/ensdomains/ens-contracts/blob/v0.0.8/contracts/registry/ENSRegistryWithFallback.sol#L59-L67
        address addr = _recordOwner;
        if (addr == address(0x0)) {
            addr = address(this);
        }
        records[_node].owner = addr;
    }

    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);
        }
    }
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"oldUri","type":"string"},{"indexed":true,"internalType":"string","name":"newUri","type":"string"}],"name":"BaseUriChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"ControllerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"ControllerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"addController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"available","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseNode","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"changeProxyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ens","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProxyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ENS","name":"_ens","type":"address"},{"internalType":"bytes32","name":"_baseNode","type":"bytes32"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"baseUri_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"nameExpires","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"nameOwner","type":"address"}],"name":"reclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"nameOwner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"register","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"nameOwner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"registerOnly","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"removeController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"renew","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseUri_","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

60a06040523060601b6080523480156200001857600080fd5b50600054610100900460ff16620000365760005460ff161562000040565b62000040620000e5565b620000a85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000cb576000805461ffff19166101011790555b8015620000de576000805461ff00191690555b5062000109565b6000620000fd306200010360201b62001bd01760201c565b15905090565b3b151590565b60805160601c613a8f6200013d60003960008181610e3301528181610ec9015281816110a5015261113b0152613a8f6000f3fe60806040526004361061024f5760003560e01c806395d89b4111610138578063c475abff116100b0578063ddf7fcb01161007f578063f2fde38b11610064578063f2fde38b146106b0578063f6a74ed7146106d0578063fca247ac146106f057600080fd5b8063ddf7fcb01461064f578063e985e9c51461066657600080fd5b8063c475abff146105b0578063c87b56dd146105d0578063d6e4fa86146105f0578063da8c229e1461061e57600080fd5b8063a0bcfc7f11610107578063a7fc7a07116100ec578063a7fc7a0714610559578063b88d4fde14610579578063c1a287e21461059957600080fd5b8063a0bcfc7f14610519578063a22cb4651461053957600080fd5b806395d89b41146104af57806396e494e8146104c45780639abc8320146104e45780639f712f2f146104f957600080fd5b80633f15457f116101cb5780636352211e1161019a578063715018a61161017f578063715018a6146104675780638b3240a01461047c5780638da5cb5b1461049157600080fd5b80636352211e1461042757806370a082311461044757600080fd5b80633f15457f146103b357806342842e0e146103d45780634e543b26146103f45780634f1ef2861461041457600080fd5b80630e297b451161022257806328ed4f6c1161020757806328ed4f6c146103535780632994338c146103735780633659cfe61461039357600080fd5b80630e297b451461030557806323b872dd1461033357600080fd5b806301ffc9a71461025457806306fdde0314610289578063081812fc146102ab578063095ea7b3146102e3575b600080fd5b34801561026057600080fd5b5061027461026f3660046135de565b610710565b60405190151581526020015b60405180910390f35b34801561029557600080fd5b5061029e6107bc565b60405161028091906138bb565b3480156102b757600080fd5b506102cb6102c63660046136ea565b61084e565b6040516001600160a01b039091168152602001610280565b3480156102ef57600080fd5b506103036102fe36600461359b565b6108f9565b005b34801561031157600080fd5b50610325610320366004613726565b610a2b565b604051908152602001610280565b34801561033f57600080fd5b5061030361034e366004613472565b610a44565b34801561035f57600080fd5b5061030361036e366004613702565b610acb565b34801561037f57600080fd5b5061030361038e366004613616565b610ccb565b34801561039f57600080fd5b506103036103ae366004613402565b610e28565b3480156103bf57600080fd5b5061012d546102cb906001600160a01b031681565b3480156103e057600080fd5b506103036103ef366004613472565b610f9d565b34801561040057600080fd5b5061030361040f366004613402565b610fb8565b61030361042236600461354d565b61109a565b34801561043357600080fd5b506102cb6104423660046136ea565b611200565b34801561045357600080fd5b50610325610462366004613402565b611267565b34801561047357600080fd5b50610303611301565b34801561048857600080fd5b506102cb611367565b34801561049d57600080fd5b506033546001600160a01b03166102cb565b3480156104bb57600080fd5b5061029e611376565b3480156104d057600080fd5b506102746104df3660046136ea565b611385565b3480156104f057600080fd5b5061029e6113ac565b34801561050557600080fd5b50610303610514366004613402565b61143b565b34801561052557600080fd5b506103036105343660046136b7565b61149e565b34801561054557600080fd5b5061030361055436600461351c565b611562565b34801561056557600080fd5b50610303610574366004613402565b61156d565b34801561058557600080fd5b506103036105943660046134b2565b611614565b3480156105a557600080fd5b506103256276a70081565b3480156105bc57600080fd5b506103256105cb36600461374c565b6116a2565b3480156105dc57600080fd5b5061029e6105eb3660046136ea565b611956565b3480156105fc57600080fd5b5061032561060b3660046136ea565b6000908152610131602052604090205490565b34801561062a57600080fd5b50610274610639366004613402565b6101306020526000908152604090205460ff1681565b34801561065b57600080fd5b5061032561012e5481565b34801561067257600080fd5b5061027461068136600461343a565b6001600160a01b0391821660009081526101006020908152604080832093909416825291909152205460ff1690565b3480156106bc57600080fd5b506103036106cb366004613402565b611a3e565b3480156106dc57600080fd5b506103036106eb366004613402565b611b1d565b3480156106fc57600080fd5b5061032561070b366004613726565b611bc1565b60006001600160e01b031982167f01ffc9a700000000000000000000000000000000000000000000000000000000148061077357506001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000145b806107a757506001600160e01b031982167f28ed4f6c00000000000000000000000000000000000000000000000000000000145b806107b657506107b682611bd6565b92915050565b606060fb80546107cb9061393d565b80601f01602080910402602001604051908101604052809291908181526020018280546107f79061393d565b80156108445780601f1061081957610100808354040283529160200191610844565b820191906000526020600020905b81548152906001019060200180831161082757829003601f168201915b5050505050905090565b600081815260fd60205260408120546001600160a01b03166108dd5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600090815260ff60205260409020546001600160a01b031690565b600061090482611c71565b9050806001600160a01b0316836001600160a01b0316141561098e5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016108d4565b336001600160a01b03821614806109aa57506109aa8133610681565b610a1c5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108d4565b610a268383611cfc565b505050565b6000610a3a8484846000611d77565b90505b9392505050565b610a4e338261211e565b610ac05760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108d4565b610a2683838361219a565b61012d5461012e546040516302571be360e01b8152600481019190915230916001600160a01b0316906302571be39060240160206040518083038186803b158015610b1557600080fd5b505afa158015610b29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4d919061341e565b6001600160a01b031614610ba35760405162461bcd60e51b815260206004820152601460248201527f426173655265676973747261723a3a6c6976653a00000000000000000000000060448201526064016108d4565b610bad338361211e565b610c1f5760405162461bcd60e51b815260206004820152602c60248201527f426173655265676973747261723a7265636c61696d28293a2073656e6465722060448201527f6e6f7420617070726f766564000000000000000000000000000000000000000060648201526084016108d4565b61012d5461012e546040517f06ab59230000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526001600160a01b038381166044830152909116906306ab592390606401602060405180830381600087803b158015610c9357600080fd5b505af1158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906135c6565b600054610100900460ff16610ce65760005460ff1615610cea565b303b155b610d5c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108d4565b600054610100900460ff16158015610d9b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b61012d805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03881617905561012e8590558151610dde9061012f9060208501906132e2565b50610de7612374565b610df184846123f7565b8015610e2057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610ec75760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084016108d4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ef961247c565b6001600160a01b031614610f755760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016108d4565b610f7e816124af565b60408051600080825260208201909252610f9a91839190612509565b50565b610a2683838360405180602001604052806000815250611614565b6033546001600160a01b031633146110125760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b61012d5461012e546040517f1896f70a00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b03838116602483015290911690631896f70a90604401600060405180830381600087803b15801561107f57600080fd5b505af1158015611093573d6000803e3d6000fd5b5050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111395760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084016108d4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661116b61247c565b6001600160a01b0316146111e75760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016108d4565b6111f0826124af565b6111fc82826001612509565b5050565b60008181526101316020526040812054421061125e5760405162461bcd60e51b815260206004820181905260248201527f426173655265676973747261723a6f776e65724f6628293a206578706972656460448201526064016108d4565b6107b682611c71565b60006001600160a01b0382166112e55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016108d4565b506001600160a01b0316600090815260fe602052604090205490565b6033546001600160a01b0316331461135b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6113656000612689565b565b60006113716126e8565b905090565b606060fc80546107cb9061393d565b6000818152610131602052604081205442906113a5906276a700906138ce565b1092915050565b61012f80546113ba9061393d565b80601f01602080910402602001604051908101604052809291908181526020018280546113e69061393d565b80156114335780601f1061140857610100808354040283529160200191611433565b820191906000526020600020905b81548152906001019060200180831161141657829003601f168201915b505050505081565b6033546001600160a01b031633146114955760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b610f9a81612710565b6033546001600160a01b031633146114f85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b806040516115069190613799565b604051809103902061012f60405161151e91906137e4565b604051908190038120907f0dd4fd340cbf455a258b248b013540f5d7d6428fcd5418c9fb1261af655c42fb90600090a380516111fc9061012f9060208401906132e2565b6111fc338383612764565b6033546001600160a01b031633146115c75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6001600160a01b03811660008181526101306020526040808220805460ff19166001179055517f0a8bb31534c0ed46f380cb867bd5c803a189ced9a764e30b3a4991a9901d74749190a250565b61161e338361211e565b6116905760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108d4565b61169c84848484612834565b50505050565b61012d5461012e546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be39060240160206040518083038186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611729919061341e565b6001600160a01b03161461177f5760405162461bcd60e51b815260206004820152601460248201527f426173655265676973747261723a3a6c6976653a00000000000000000000000060448201526064016108d4565b336000908152610130602052604090205460ff166117df5760405162461bcd60e51b815260206004820152601e60248201527f426173655265676973747261723a3a6f6e6c79436f6e74726f6c6c65723a000060448201526064016108d4565b6000838152610131602052604090205442906117ff906276a700906138ce565b101561184d5760405162461bcd60e51b815260206004820152601d60248201527f426173655265676973747261723a206e616d65206e6f7420666f756e6400000060448201526064016108d4565b61185a6276a700836138ce565b600084815261013160205260409020546276a7009061187a9085906138ce565b61188491906138ce565b116118d15760405162461bcd60e51b815260206004820152601d60248201527f426173655265676973747261723a206e616d65206e6f7420666f756e6400000060448201526064016108d4565b60008381526101316020526040812080548492906118f09084906138ce565b9091555050600083815261013160205260409081902054905184917f9b87a00e30f1ac65d898f070f8a3488fe60517182d0a2098e1b4b93a54aa9bd69161193991815260200190565b60405180910390a250506000908152610131602052604090205490565b600081815260fd60205260409020546060906001600160a01b03166119e35760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016108d4565b60006119ed6128bd565b90506000815111611a0d5760405180602001604052806000815250610a3d565b80611a17846128cd565b604051602001611a289291906137b5565b6040516020818303038152906040529392505050565b6033546001600160a01b03163314611a985760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6001600160a01b038116611b145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108d4565b610f9a81612689565b6033546001600160a01b03163314611b775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b6001600160a01b03811660008181526101306020526040808220805460ff19169055517f33d83959be2573f5453b12eb9d43b3499bc57d96bd2f067ba44803c859e811139190a250565b6000610a3a8484846001611d77565b3b151590565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480611c3957506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806107b657507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146107b6565b600081815260fd60205260408120546001600160a01b0316806107b65760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016108d4565b600081815260ff60205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190611d3e82611c71565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61012d5461012e546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be39060240160206040518083038186803b158015611dc657600080fd5b505afa158015611dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfe919061341e565b6001600160a01b031614611e545760405162461bcd60e51b815260206004820152601460248201527f426173655265676973747261723a3a6c6976653a00000000000000000000000060448201526064016108d4565b336000908152610130602052604090205460ff16611eb45760405162461bcd60e51b815260206004820152601e60248201527f426173655265676973747261723a3a6f6e6c79436f6e74726f6c6c65723a000060448201526064016108d4565b611ebd85611385565b611f2f5760405162461bcd60e51b815260206004820152602960248201527f426173655265676973747261723a3a5f726567697374657228293a206e6f742060448201527f617661696c61626c65000000000000000000000000000000000000000000000060648201526084016108d4565b611f3c6276a700426138ce565b6276a700611f4a85426138ce565b611f5491906138ce565b11611fc75760405162461bcd60e51b815260206004820152603b60248201527f426173655265676973747261723a3a5f726567697374657228293a206475726160448201527f74696f6e206c657373207468616e20677261636520706572696f64000000000060648201526084016108d4565b611fd183426138ce565b6000868152610131602090815260408083209390935560fd905220546001600160a01b0316156120045761200485612a1b565b61200e8486612ac3565b81156120c25761012d5461012e546040517f06ab59230000000000000000000000000000000000000000000000000000000081526004810191909152602481018790526001600160a01b038681166044830152909116906306ab592390606401602060405180830381600087803b15801561208857600080fd5b505af115801561209c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c091906135c6565b505b6001600160a01b038416857fb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d96120f886426138ce565b60405190815260200160405180910390a361211383426138ce565b90505b949350505050565b60008061212a83611200565b9050806001600160a01b0316846001600160a01b031614806121655750836001600160a01b031661215a8461084e565b6001600160a01b0316145b8061211657506001600160a01b038082166000908152610100602090815260408083209388168352929052205460ff16612116565b826001600160a01b03166121ad82611c71565b6001600160a01b0316146122295760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016108d4565b6001600160a01b0382166122a45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108d4565b6122af600082611cfc565b6001600160a01b038316600090815260fe602052604081208054600192906122d89084906138fa565b90915550506001600160a01b038216600090815260fe602052604081208054600192906123069084906138ce565b9091555050600081815260fd6020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600054610100900460ff166123df5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b6123e7612c12565b6123ef612c8d565b611365612cfc565b600054610100900460ff166124625760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b61246a612cfc565b612472612cfc565b6111fc8282612d67565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b546001600160a01b0316919050565b6033546001600160a01b03163314610f9a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108d4565b600061251361247c565b905061251e84612df9565b60008351118061252b5750815b1561253c5761253a8484612ebe565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661109357805460ff191660011781556040516001600160a01b03831660248201526125e990869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f3659cfe600000000000000000000000000000000000000000000000000000000179052612ebe565b50805460ff191681556125fa61247c565b6001600160a01b0316826001600160a01b0316146126805760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f757274686572207570677261646573000000000000000000000000000000000060648201526084016108d4565b61109385612fc0565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036124a0565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6127396126e8565b604080516001600160a01b03928316815291841660208301520160405180910390a1610f9a81613000565b816001600160a01b0316836001600160a01b031614156127c65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108d4565b6001600160a01b0383811660008181526101006020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61283f84848461219a565b61284b848484846130a3565b61169c5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108d4565b606061012f80546107cb9061393d565b60608161290d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612937578061292181613978565b91506129309050600a836138e6565b9150612911565b60008167ffffffffffffffff81111561296057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561298a576020820181803683370190505b5090505b84156121165761299f6001836138fa565b91506129ac600a866139b1565b6129b79060306138ce565b60f81b8183815181106129da57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612a14600a866138e6565b945061298e565b6000612a2682611c71565b9050612a33600083611cfc565b6001600160a01b038116600090815260fe60205260408120805460019290612a5c9084906138fa565b9091555050600082815260fd6020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b038216612b195760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108d4565b600081815260fd60205260409020546001600160a01b031615612b7e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108d4565b6001600160a01b038216600090815260fe60205260408120805460019290612ba79084906138ce565b9091555050600081815260fd6020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600054610100900460ff16612c7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b612c85612cfc565b611365613235565b600054610100900460ff16612cf85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b6123ef5b600054610100900460ff166113655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b600054610100900460ff16612dd25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b8151612de59060fb9060208501906132e2565b508051610a269060fc9060208401906132e2565b803b612e6d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016108d4565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6060823b612f345760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016108d4565b600080846001600160a01b031684604051612f4f9190613799565b600060405180830381855af49150503d8060008114612f8a576040519150601f19603f3d011682016040523d82523d6000602084013e612f8f565b606091505b5091509150612fb78282604051806060016040528060278152602001613a33602791396132a9565b95945050505050565b612fc981612df9565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b03811661307c5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108d4565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103612e90565b60006001600160a01b0384163b1561322d576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a029061310090339089908890889060040161387f565b602060405180830381600087803b15801561311a57600080fd5b505af192505050801561314a575060408051601f3d908101601f19168201909252613147918101906135fa565b60015b6131fa573d808015613178576040519150601f19603f3d011682016040523d82523d6000602084013e61317d565b606091505b5080516131f25760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108d4565b805181602001fd5b6001600160e01b0319167f150b7a0200000000000000000000000000000000000000000000000000000000149050612116565b506001612116565b600054610100900460ff166132a05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108d4565b61136533612689565b606083156132b8575081610a3d565b8251156132c85782518084602001fd5b8160405162461bcd60e51b81526004016108d491906138bb565b8280546132ee9061393d565b90600052602060002090601f0160209004810192826133105760008555613356565b82601f1061332957805160ff1916838001178555613356565b82800160010185558215613356579182015b8281111561335657825182559160200191906001019061333b565b50613362929150613366565b5090565b5b808211156133625760008155600101613367565b600082601f83011261338b578081fd5b813567ffffffffffffffff808211156133a6576133a66139f1565b604051601f8301601f19908116603f011681019082821181831017156133ce576133ce6139f1565b816040528381528660208588010111156133e6578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215613413578081fd5b8135610a3d81613a07565b60006020828403121561342f578081fd5b8151610a3d81613a07565b6000806040838503121561344c578081fd5b823561345781613a07565b9150602083013561346781613a07565b809150509250929050565b600080600060608486031215613486578081fd5b833561349181613a07565b925060208401356134a181613a07565b929592945050506040919091013590565b600080600080608085870312156134c7578081fd5b84356134d281613a07565b935060208501356134e281613a07565b925060408501359150606085013567ffffffffffffffff811115613504578182fd5b6135108782880161337b565b91505092959194509250565b6000806040838503121561352e578182fd5b823561353981613a07565b915060208301358015158114613467578182fd5b6000806040838503121561355f578182fd5b823561356a81613a07565b9150602083013567ffffffffffffffff811115613585578182fd5b6135918582860161337b565b9150509250929050565b600080604083850312156135ad578182fd5b82356135b881613a07565b946020939093013593505050565b6000602082840312156135d7578081fd5b5051919050565b6000602082840312156135ef578081fd5b8135610a3d81613a1c565b60006020828403121561360b578081fd5b8151610a3d81613a1c565b600080600080600060a0868803121561362d578081fd5b853561363881613a07565b945060208601359350604086013567ffffffffffffffff8082111561365b578283fd5b61366789838a0161337b565b9450606088013591508082111561367c578283fd5b61368889838a0161337b565b9350608088013591508082111561369d578283fd5b506136aa8882890161337b565b9150509295509295909350565b6000602082840312156136c8578081fd5b813567ffffffffffffffff8111156136de578182fd5b6121168482850161337b565b6000602082840312156136fb578081fd5b5035919050565b60008060408385031215613714578182fd5b82359150602083013561346781613a07565b60008060006060848603121561373a578081fd5b8335925060208401356134a181613a07565b6000806040838503121561375e578182fd5b50508035926020909101359150565b60008151808452613785816020860160208601613911565b601f01601f19169290920160200192915050565b600082516137ab818460208701613911565b9190910192915050565b600083516137c7818460208801613911565b8351908301906137db818360208801613911565b01949350505050565b600080835482600182811c91508083168061380057607f831692505b602080841082141561382057634e487b7160e01b87526022600452602487fd5b818015613834576001811461384557613871565b60ff19861689528489019650613871565b60008a815260209020885b868110156138695781548b820152908501908301613850565b505084890196505b509498975050505050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526138b1608083018461376d565b9695505050505050565b602081526000610a3d602083018461376d565b600082198211156138e1576138e16139c5565b500190565b6000826138f5576138f56139db565b500490565b60008282101561390c5761390c6139c5565b500390565b60005b8381101561392c578181015183820152602001613914565b8381111561169c5750506000910152565b600181811c9082168061395157607f821691505b6020821081141561397257634e487b7160e01b600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156139aa576139aa6139c5565b5060010190565b6000826139c0576139c06139db565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f9a57600080fd5b6001600160e01b031981168114610f9a57600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204c8ced1dde70d79e5a3118abb71e8bca461bf0d5f3565a12a63c9a15868bb24c64736f6c63430008040033

Deployed ByteCode Sourcemap

607:8384:50:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8630:359;;;;;;;;;;-1:-1:-1;8630:359:50;;;;;:::i;:::-;;:::i;:::-;;;11239:14:65;;11232:22;11214:41;;11202:2;11187:18;8630:359:50;;;;;;;;3005:98:23;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;4527:217::-;;;;;;;;;;-1:-1:-1;4527:217:23;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;10159:55:65;;;10141:74;;10129:2;10114:18;4527:217:23;10096:125:65;4054:412:23;;;;;;;;;;-1:-1:-1;4054:412:23;;;;;:::i;:::-;;:::i;:::-;;6510:193:50;;;;;;;;;;-1:-1:-1;6510:193:50;;;;;:::i;:::-;;:::i;:::-;;;11412:25:65;;;11400:2;11385:18;6510:193:50;11367:76:65;5254:330:23;;;;;;;;;;-1:-1:-1;5254:330:23;;;;;:::i;:::-;;:::i;8348:276:50:-;;;;;;;;;;-1:-1:-1;8348:276:50;;;;;:::i;:::-;;:::i;3239:334::-;;;;;;;;;;-1:-1:-1;3239:334:50;;;;;:::i;:::-;;:::i;2233:199:22:-;;;;;;;;;;-1:-1:-1;2233:199:22;;;;;:::i;:::-;;:::i;924:14:49:-;;;;;;;;;;-1:-1:-1;924:14:49;;;;-1:-1:-1;;;;;924:14:49;;;5650:179:23;;;;;;;;;;-1:-1:-1;5650:179:23;;;;;:::i;:::-;;:::i;5212:119:50:-;;;;;;;;;;-1:-1:-1;5212:119:50;;;;;:::i;:::-;;:::i;2681:224:22:-;;;;;;:::i;:::-;;:::i;4370:318:50:-;;;;;;;;;;-1:-1:-1;4370:318:50;;;;;:::i;:::-;;:::i;2446:205:23:-;;;;;;;;;;-1:-1:-1;2446:205:23;;;;;:::i;:::-;;:::i;1944:101:18:-;;;;;;;;;;;;;:::i;876:90:57:-;;;;;;;;;;;;;:::i;1312:85:18:-;;;;;;;;;;-1:-1:-1;1384:6:18;;-1:-1:-1;;;;;1384:6:18;1312:85;;3167:102:23;;;;;;;;;;;;;:::i;5588:209:50:-;;;;;;;;;;-1:-1:-1;5588:209:50;;;;;:::i;:::-;;:::i;1077:21:49:-;;;;;;;;;;;;;:::i;972:102:57:-;;;;;;;;;;-1:-1:-1;972:102:57;;;;;:::i;:::-;;:::i;3930:155:50:-;;;;;;;;;;-1:-1:-1;3930:155:50;;;;;:::i;:::-;;:::i;4811:153:23:-;;;;;;;;;;-1:-1:-1;4811:153:23;;;;;:::i;:::-;;:::i;4762:160:50:-;;;;;;;;;;-1:-1:-1;4762:160:50;;;;;:::i;:::-;;:::i;5895:320:23:-;;;;;;;;;;-1:-1:-1;5895:320:23;;;;;:::i;:::-;;:::i;372:46:49:-;;;;;;;;;;;;411:7;372:46;;7626:620:50;;;;;;;;;;-1:-1:-1;7626:620:50;;;;;:::i;:::-;;:::i;3335:329:23:-;;;;;;;;;;-1:-1:-1;3335:329:23;;;;;:::i;:::-;;:::i;5398:110:50:-;;;;;;;;;;-1:-1:-1;5398:110:50;;;;;:::i;:::-;5463:7;5489:12;;;:8;:12;;;;;;;5398:110;1180:43:49;;;;;;;;;;-1:-1:-1;1180:43:49;;;;;:::i;:::-;;;;;;;;;;;;;;;;1007:23;;;;;;;;;;;;;;;;5030:162:23;;;;;;;;;;-1:-1:-1;5030:162:23;;;;;:::i;:::-;-1:-1:-1;;;;;5150:25:23;;;5127:4;5150:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;5030:162;2194:198:18;;;;;;;;;;-1:-1:-1;2194:198:18;;;;;:::i;:::-;;:::i;4980:166:50:-;;;;;;;;;;-1:-1:-1;4980:166:50;;;;;:::i;:::-;;:::i;6039:197::-;;;;;;;;;;-1:-1:-1;6039:197:50;;;;;:::i;:::-;;:::i;8630:359::-;8778:4;-1:-1:-1;;;;;;8817:32:50;;;;;:72;;-1:-1:-1;;;;;;;8865:24:50;;;;8817:72;:113;;;-1:-1:-1;;;;;;;8905:25:50;;;;8817:113;:165;;;;8946:36;8970:11;8946:23;:36::i;:::-;8798:184;8630:359;-1:-1:-1;;8630:359:50:o;3005:98:23:-;3059:13;3091:5;3084:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3005:98;:::o;4527:217::-;4603:7;7775:16;;;:7;:16;;;;;;-1:-1:-1;;;;;7775:16:23;4622:73;;;;-1:-1:-1;;;4622:73:23;;20296:2:65;4622:73:23;;;20278:21:65;20335:2;20315:18;;;20308:30;20374:34;20354:18;;;20347:62;20445:14;20425:18;;;20418:42;20477:19;;4622:73:23;;;;;;;;;-1:-1:-1;4713:24:23;;;;:15;:24;;;;;;-1:-1:-1;;;;;4713:24:23;;4527:217::o;4054:412::-;4134:13;4150:34;4176:7;4150:25;:34::i;:::-;4134:50;;4208:5;-1:-1:-1;;;;;4202:11:23;:2;-1:-1:-1;;;;;4202:11:23;;;4194:57;;;;-1:-1:-1;;;4194:57:23;;22669:2:65;4194:57:23;;;22651:21:65;22708:2;22688:18;;;22681:30;22747:34;22727:18;;;22720:62;22818:3;22798:18;;;22791:31;22839:19;;4194:57:23;22641:223:65;4194:57:23;965:10:28;-1:-1:-1;;;;;4283:21:23;;;;:62;;-1:-1:-1;4308:37:23;4325:5;965:10:28;5030:162:23;:::i;4308:37::-;4262:165;;;;-1:-1:-1;;;4262:165:23;;18274:2:65;4262:165:23;;;18256:21:65;18313:2;18293:18;;;18286:30;18352:34;18332:18;;;18325:62;18423:26;18403:18;;;18396:54;18467:19;;4262:165:23;18246:246:65;4262:165:23;4438:21;4447:2;4451:7;4438:8;:21::i;:::-;4054:412;;;:::o;6510:193:50:-;6629:7;6655:41;6665:2;6669:9;6680:8;6690:5;6655:9;:41::i;:::-;6648:48;;6510:193;;;;;;:::o;5254:330:23:-;5443:41;965:10:28;5476:7:23;5443:18;:41::i;:::-;5435:103;;;;-1:-1:-1;;;5435:103:23;;23478:2:65;5435:103:23;;;23460:21:65;23517:2;23497:18;;;23490:30;23556:34;23536:18;;;23529:62;23627:19;23607:18;;;23600:47;23664:19;;5435:103:23;23450:239:65;5435:103:23;5549:28;5559:4;5565:2;5569:7;5549:9;:28::i;8348:276:50:-;3613:3;;3623:8;;3613:19;;-1:-1:-1;;;3613:19:50;;;;;11412:25:65;;;;3644:4:50;;-1:-1:-1;;;;;3613:3:50;;:9;;11385:18:65;;3613:19:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3613:36:50;;3605:69;;;;-1:-1:-1;;;3605:69:50;;13563:2:65;3605:69:50;;;13545:21:65;13602:2;13582:18;;;13575:30;13641:22;13621:18;;;13614:50;13681:18;;3605:69:50;13535:170:65;3605:69:50;8450:34:::1;8469:10;8481:2;8450:18;:34::i;:::-;8429:125;;;::::0;-1:-1:-1;;;8429:125:50;;12792:2:65;8429:125:50::1;::::0;::::1;12774:21:65::0;12831:2;12811:18;;;12804:30;12870:34;12850:18;;;12843:62;12941:14;12921:18;;;12914:42;12973:19;;8429:125:50::1;12764:234:65::0;8429:125:50::1;8564:3;::::0;8584:8:::1;::::0;8564:53:::1;::::0;;;;::::1;::::0;::::1;11952:25:65::0;;;;11993:18;;;11986:34;;;-1:-1:-1;;;;;12056:55:65;;;12036:18;;;12029:83;8564:3:50;;::::1;::::0;:19:::1;::::0;11925:18:65;;8564:53:50::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;3239:334::-:0;2347:13:21;;;;;;;:48;;2383:12;;;;2382:13;2347:48;;;3125:4;1098:20:27;1144:8;2363:16:21;2339:107;;;;-1:-1:-1;;;2339:107:21;;19520:2:65;2339:107:21;;;19502:21:65;19559:2;19539:18;;;19532:30;19598:34;19578:18;;;19571:62;19669:16;19649:18;;;19642:44;19703:19;;2339:107:21;19492:236:65;2339:107:21;2457:19;2480:13;;;;;;2479:14;2503:98;;;;2537:13;:20;;2571:19;;;;;;2503:98;3431:3:50::1;:10:::0;;-1:-1:-1;;3431:10:50::1;-1:-1:-1::0;;;;;3431:10:50;::::1;;::::0;;3451:8:::1;:20:::0;;;3481:18;;::::1;::::0;:7:::1;::::0;:18:::1;::::0;::::1;::::0;::::1;:::i;:::-;;3509;:16;:18::i;:::-;3537:29;3551:5;3558:7;3537:13;:29::i;:::-;2627:14:21::0;2623:66;;;2673:5;2657:21;;;;;;2623:66;3239:334:50;;;;;;:::o;2233:199:22:-;1874:4;-1:-1:-1;;;;;1883:6:22;1866:23;;;1858:80;;;;-1:-1:-1;;;1858:80:22;;16282:2:65;1858:80:22;;;16264:21:65;16321:2;16301:18;;;16294:30;16360:34;16340:18;;;16333:62;16431:14;16411:18;;;16404:42;16463:19;;1858:80:22;16254:234:65;1858:80:22;1980:6;-1:-1:-1;;;;;1956:30:22;:20;:18;:20::i;:::-;-1:-1:-1;;;;;1956:30:22;;1948:87;;;;-1:-1:-1;;;1948:87:22;;17861:2:65;1948:87:22;;;17843:21:65;17900:2;17880:18;;;17873:30;17939:34;17919:18;;;17912:62;18010:14;17990:18;;;17983:42;18042:19;;1948:87:22;17833:234:65;1948:87:22;2316:36:::1;2334:17;2316;:36::i;:::-;2405:12;::::0;;2415:1:::1;2405:12:::0;;;::::1;::::0;::::1;::::0;;;2362:63:::1;::::0;2386:17;;2405:12;2362:23:::1;:63::i;:::-;2233:199:::0;:::o;5650:179:23:-;5783:39;5800:4;5806:2;5810:7;5783:39;;;;;;;;;;;;:16;:39::i;5212:119:50:-;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;5289:3:50::1;::::0;5305:8:::1;::::0;5289:35:::1;::::0;;;;::::1;::::0;::::1;11622:25:65::0;;;;-1:-1:-1;;;;;11683:55:65;;;11663:18;;;11656:83;5289:3:50;;::::1;::::0;:15:::1;::::0;11595:18:65;;5289:35:50::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;5212:119:::0;:::o;2681:224:22:-;1874:4;-1:-1:-1;;;;;1883:6:22;1866:23;;;1858:80;;;;-1:-1:-1;;;1858:80:22;;16282:2:65;1858:80:22;;;16264:21:65;16321:2;16301:18;;;16294:30;16360:34;16340:18;;;16333:62;16431:14;16411:18;;;16404:42;16463:19;;1858:80:22;16254:234:65;1858:80:22;1980:6;-1:-1:-1;;;;;1956:30:22;:20;:18;:20::i;:::-;-1:-1:-1;;;;;1956:30:22;;1948:87;;;;-1:-1:-1;;;1948:87:22;;17861:2:65;1948:87:22;;;17843:21:65;17900:2;17880:18;;;17873:30;17939:34;17919:18;;;17912:62;18010:14;17990:18;;;17983:42;18042:19;;1948:87:22;17833:234:65;1948:87:22;2798:36:::1;2816:17;2798;:36::i;:::-;2844:54;2868:17;2887:4;2893;2844:23;:54::i;:::-;2681:224:::0;;:::o;4370:318:50:-;4505:7;4549:17;;;:8;:17;;;;;;4569:15;-1:-1:-1;4528:114:50;;;;-1:-1:-1;;;4528:114:50;;13912:2:65;4528:114:50;;;13894:21:65;;;13931:18;;;13924:30;13990:34;13970:18;;;13963:62;14042:18;;4528:114:50;13884:182:65;4528:114:50;4659:22;4673:7;4659:13;:22::i;2446:205:23:-;2518:7;-1:-1:-1;;;;;2545:19:23;;2537:74;;;;-1:-1:-1;;;2537:74:23;;18699:2:65;2537:74:23;;;18681:21:65;18738:2;18718:18;;;18711:30;18777:34;18757:18;;;18750:62;18848:12;18828:18;;;18821:40;18878:19;;2537:74:23;18671:232:65;2537:74:23;-1:-1:-1;;;;;;2628:16:23;;;;;:9;:16;;;;;;;2446:205::o;1944:101:18:-;1384:6;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;2008:30:::1;2035:1;2008:18;:30::i;:::-;1944:101::o:0;876:90:57:-;922:7;948:11;:9;:11::i;:::-;941:18;;876:90;:::o;3167:102:23:-;3223:13;3255:7;3248:14;;;;;:::i;5588:209:50:-;5649:4;5745:12;;;:8;:12;;;;;;5775:15;;5745:27;;411:7:49;;5745:27:50;:::i;:::-;:45;;5588:209;-1:-1:-1;;5588:209:50:o;1077:21:49:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;972:102:57:-;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;1045:22:57::1;1058:8;1045:12;:22::i;3930:155:50:-:0;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;4041:8:50::1;4017:33;;;;;;:::i;:::-;;;;;;;;4032:7;4017:33;;;;;;:::i;:::-;;::::0;;;;::::1;::::0;;;::::1;::::0;;;::::1;4060:18:::0;;::::1;::::0;:7:::1;::::0;:18:::1;::::0;::::1;::::0;::::1;:::i;4811:153:23:-:0;4905:52;965:10:28;4938:8:23;4948;4905:18;:52::i;4762:160:50:-;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;-1:-1:-1;;;;;4843:23:50;::::1;;::::0;;;:11:::1;:23;::::0;;;;;:30;;-1:-1:-1;;4843:30:50::1;4869:4;4843:30;::::0;;4888:27;::::1;::::0;4843:23;4888:27:::1;4762:160:::0;:::o;5895:320:23:-;6064:41;965:10:28;6097:7:23;6064:18;:41::i;:::-;6056:103;;;;-1:-1:-1;;;6056:103:23;;23478:2:65;6056:103:23;;;23460:21:65;23517:2;23497:18;;;23490:30;23556:34;23536:18;;;23529:62;23627:19;23607:18;;;23600:47;23664:19;;6056:103:23;23450:239:65;6056:103:23;6169:39;6183:4;6189:2;6193:7;6202:5;6169:13;:39::i;:::-;5895:320;;;;:::o;7626:620:50:-;3613:3;;3623:8;;3613:19;;-1:-1:-1;;;3613:19:50;;;;;11412:25:65;;;;7758:7:50;;3644:4;;-1:-1:-1;;;;;3613:3:50;;;;:9;;11385:18:65;;3613:19:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3613:36:50;;3605:69;;;;-1:-1:-1;;;3605:69:50;;13563:2:65;3605:69:50;;;13545:21:65;13602:2;13582:18;;;13575:30;13641:22;13621:18;;;13614:50;13681:18;;3605:69:50;13535:170:65;3605:69:50;3754:10:::1;3742:23;::::0;;;:11:::1;:23;::::0;;;;;::::1;;3734:66;;;::::0;-1:-1:-1;;;3734:66:50;;20709:2:65;3734:66:50::1;::::0;::::1;20691:21:65::0;20748:2;20728:18;;;20721:30;20787:32;20767:18;;;20760:60;20837:18;;3734:66:50::1;20681:180:65::0;3734:66:50::1;7802:12:::2;::::0;;;:8:::2;:12;::::0;;;;;7833:15:::2;::::0;7802:27:::2;::::0;411:7:49::2;::::0;7802:27:50::2;:::i;:::-;:46;;7781:122;;;::::0;-1:-1:-1;;;7781:122:50;;13205:2:65;7781:122:50::2;::::0;::::2;13187:21:65::0;13244:2;13224:18;;;13217:30;13283:31;13263:18;;;13256:59;13332:18;;7781:122:50::2;13177:179:65::0;7781:122:50::2;8026:23;411:7:49;8026:8:50::0;:23:::2;:::i;:::-;7985:12;::::0;;;:8:::2;:12;::::0;;;;;411:7:49::2;::::0;7985:23:50::2;::::0;8000:8;;7985:23:::2;:::i;:::-;:38;;;;:::i;:::-;:64;7964:140;;;::::0;-1:-1:-1;;;7964:140:50;;13205:2:65;7964:140:50::2;::::0;::::2;13187:21:65::0;13244:2;13224:18;;;13217:30;13283:31;13263:18;;;13256:59;13332:18;;7964:140:50::2;13177:179:65::0;7964:140:50::2;8142:12;::::0;;;:8:::2;:12;::::0;;;;:24;;8158:8;;8142:12;:24:::2;::::0;8158:8;;8142:24:::2;:::i;:::-;::::0;;;-1:-1:-1;;8197:12:50::2;::::0;;;:8:::2;:12;::::0;;;;;;;8181:29;;8193:2;;8181:29:::2;::::0;::::2;::::0;11412:25:65;;11400:2;11385:18;;11367:76;8181:29:50::2;;;;;;;;-1:-1:-1::0;;8227:12:50::2;::::0;;;:8:::2;:12;::::0;;;;;;7626:620::o;3335:329:23:-;7752:4;7775:16;;;:7;:16;;;;;;3408:13;;-1:-1:-1;;;;;7775:16:23;3433:76;;;;-1:-1:-1;;;3433:76:23;;22253:2:65;3433:76:23;;;22235:21:65;22292:2;22272:18;;;22265:30;22331:34;22311:18;;;22304:62;22402:17;22382:18;;;22375:45;22437:19;;3433:76:23;22225:237:65;3433:76:23;3520:21;3544:10;:8;:10::i;:::-;3520:34;;3595:1;3577:7;3571:21;:25;:86;;;;;;;;;;;;;;;;;3623:7;3632:18;:7;:16;:18::i;:::-;3606:45;;;;;;;;;:::i;:::-;;;;;;;;;;;;;3564:93;3335:329;-1:-1:-1;;;3335:329:23:o;2194:198:18:-;1384:6;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;-1:-1:-1;;;;;2282:22:18;::::1;2274:73;;;::::0;-1:-1:-1;;;2274:73:18;;15108:2:65;2274:73:18::1;::::0;::::1;15090:21:65::0;15147:2;15127:18;;;15120:30;15186:34;15166:18;;;15159:62;15257:8;15237:18;;;15230:36;15283:19;;2274:73:18::1;15080:228:65::0;2274:73:18::1;2357:28;2376:8;2357:18;:28::i;4980:166:50:-:0;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;1516:68:18;-1:-1:-1;;;;;5064:23:50;::::1;5090:5;5064:23:::0;;;:11:::1;:23;::::0;;;;;:31;;-1:-1:-1;;5064:31:50::1;::::0;;5110:29;::::1;::::0;5090:5;5110:29:::1;4980:166:::0;:::o;6039:197::-;6163:7;6189:40;6199:2;6203:9;6214:8;6224:4;6189:9;:40::i;782:377:27:-;1098:20;1144:8;;;782:377::o;2043:344:23:-;2167:4;-1:-1:-1;;;;;;2202:51:23;;2217:36;2202:51;;:126;;-1:-1:-1;;;;;;;2269:59:23;;2284:44;2269:59;2202:126;:178;;;-1:-1:-1;1218:36:31;-1:-1:-1;;;;;;1203:51:31;;;2344:36:23;1095:166:31;2708:235:23;2780:7;2815:16;;;:7;:16;;;;;;-1:-1:-1;;;;;2815:16:23;2849:19;2841:73;;;;-1:-1:-1;;;2841:73:23;;19110:2:65;2841:73:23;;;19092:21:65;19149:2;19129:18;;;19122:30;19188:34;19168:18;;;19161:62;19259:11;19239:18;;;19232:39;19288:19;;2841:73:23;19082:231:65;11571:182:23;11645:24;;;;:15;:24;;;;;:29;;-1:-1:-1;;11645:29:23;-1:-1:-1;;;;;11645:29:23;;;;;;;;:24;;11698:34;11645:24;11698:25;:34::i;:::-;-1:-1:-1;;;;;11689:57:23;;;;;;;;;;;11571:182;;:::o;6709:911:50:-;3613:3;;3623:8;;3613:19;;-1:-1:-1;;;3613:19:50;;;;;11412:25:65;;;;6874:7:50;;3644:4;;-1:-1:-1;;;;;3613:3:50;;;;:9;;11385:18:65;;3613:19:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3613:36:50;;3605:69;;;;-1:-1:-1;;;3605:69:50;;13563:2:65;3605:69:50;;;13545:21:65;13602:2;13582:18;;;13575:30;13641:22;13621:18;;;13614:50;13681:18;;3605:69:50;13535:170:65;3605:69:50;3754:10:::1;3742:23;::::0;;;:11:::1;:23;::::0;;;;;::::1;;3734:66;;;::::0;-1:-1:-1;;;3734:66:50;;20709:2:65;3734:66:50::1;::::0;::::1;20691:21:65::0;20748:2;20728:18;;;20721:30;20787:32;20767:18;;;20760:60;20837:18;;3734:66:50::1;20681:180:65::0;3734:66:50::1;6901:13:::2;6911:2;6901:9;:13::i;:::-;6893:67;;;::::0;-1:-1:-1;;;6893:67:50;;15515:2:65;6893:67:50::2;::::0;::::2;15497:21:65::0;15554:2;15534:18;;;15527:30;15593:34;15573:18;;;15566:62;15664:11;15644:18;;;15637:39;15693:19;;6893:67:50::2;15487:231:65::0;6893:67:50::2;7051:30;411:7:49;7051:15:50;:30;:::i;:::-;411:7:49;6991:26:50;7009:8:::0;6991:15:::2;:26;:::i;:::-;:41;;;;:::i;:::-;:90;6970:196;;;::::0;-1:-1:-1;;;6970:196:50;;24308:2:65;6970:196:50::2;::::0;::::2;24290:21:65::0;24347:2;24327:18;;;24320:30;24386:34;24366:18;;;24359:62;24457:29;24437:18;;;24430:57;24504:19;;6970:196:50::2;24280:249:65::0;6970:196:50::2;7219:26;7237:8:::0;7219:15:::2;:26;:::i;:::-;7204:12;::::0;;;:8:::2;:12;::::0;;;;;;;:41;;;;7775:7:23;:16;;;;-1:-1:-1;;;;;7775:16:23;:30;7255:105:50::2;;7340:9;7346:2;7340:5;:9::i;:::-;7369:20;7375:9;7386:2;7369:5;:20::i;:::-;7403:14;7399:98;;;7433:3;::::0;7453:8:::2;::::0;7433:53:::2;::::0;;;;::::2;::::0;::::2;11952:25:65::0;;;;11993:18;;;11986:34;;;-1:-1:-1;;;;;12056:55:65;;;12036:18;;;12029:83;7433:3:50;;::::2;::::0;:19:::2;::::0;11925:18:65;;7433:53:50::2;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;7399:98;-1:-1:-1::0;;;;;7512:57:50;::::2;7527:2:::0;7512:57:::2;7542:26;7560:8:::0;7542:15:::2;:26;:::i;:::-;7512:57;::::0;11412:25:65;;;11400:2;11385:18;7512:57:50::2;;;;;;;7587:26;7605:8:::0;7587:15:::2;:26;:::i;:::-;7580:33;;3810:1;6709:911:::0;;;;;;:::o;2265:327::-;2391:4;2411:17;2431:16;2439:7;2431;:16::i;:::-;2411:36;;2476:9;-1:-1:-1;;;;;2465:20:50;:7;-1:-1:-1;;;;;2465:20:50;;:67;;;;2525:7;-1:-1:-1;;;;;2501:31:50;:20;2513:7;2501:11;:20::i;:::-;-1:-1:-1;;;;;2501:31:50;;2465:67;:119;;;-1:-1:-1;;;;;;5150:25:23;;;5127:4;5150:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;2548:36:50;5030:162:23;10889:571;11054:4;-1:-1:-1;;;;;11016:42:23;:34;11042:7;11016:25;:34::i;:::-;-1:-1:-1;;;;;11016:42:23;;11008:96;;;;-1:-1:-1;;;11008:96:23;;21843:2:65;11008:96:23;;;21825:21:65;21882:2;21862:18;;;21855:30;21921:34;21901:18;;;21894:62;21992:11;21972:18;;;21965:39;22021:19;;11008:96:23;21815:231:65;11008:96:23;-1:-1:-1;;;;;11122:16:23;;11114:65;;;;-1:-1:-1;;;11114:65:23;;17102:2:65;11114:65:23;;;17084:21:65;17141:2;17121:18;;;17114:30;17180:34;17160:18;;;17153:62;17251:6;17231:18;;;17224:34;17275:19;;11114:65:23;17074:226:65;11114:65:23;11291:29;11308:1;11312:7;11291:8;:29::i;:::-;-1:-1:-1;;;;;11331:15:23;;;;;;:9;:15;;;;;:20;;11350:1;;11331:15;:20;;11350:1;;11331:20;:::i;:::-;;;;-1:-1:-1;;;;;;;11361:13:23;;;;;;:9;:13;;;;;:18;;11378:1;;11361:13;:18;;11378:1;;11361:18;:::i;:::-;;;;-1:-1:-1;;11389:16:23;;;;:7;:16;;;;;;:21;;-1:-1:-1;;11389:21:23;-1:-1:-1;;;;;11389:21:23;;;;;;;;;11426:27;;11389:16;;11426:27;;;;;;;10889:571;;;:::o;335:159:57:-;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;399:16:57::1;:14;:16::i;:::-;425:24;:22;:24::i;:::-;459:28;:26;:28::i;1590:220:23:-:0;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;1693:26:23::1;:24;:26::i;:::-;1729:25;:23;:25::i;:::-;1764:39;1788:5;1795:7;1764:23;:39::i;1534:151:19:-:0;1587:7;1263:66;1613:59;:65;-1:-1:-1;;;;;1613:65:19;;1534:151;-1:-1:-1;1534:151:19:o;596:66:57:-;1384:6:18;;-1:-1:-1;;;;;1384:6:18;965:10:28;1524:23:18;1516:68;;;;-1:-1:-1;;;1516:68:18;;21482:2:65;1516:68:18;;;21464:21:65;;;21501:18;;;21494:30;21560:34;21540:18;;;21533:62;21612:18;;1516:68:18;21454:182:65;2909:1240:19;3053:25;3081:20;:18;:20::i;:::-;3053:48;;3154:37;3173:17;3154:18;:37::i;:::-;3219:1;3205:4;:11;:15;:28;;;;3224:9;3205:28;3201:105;;;3249:46;3271:17;3290:4;3249:21;:46::i;:::-;;3201:105;922:66;3505:21;;;;3500:643;;3618:28;;-1:-1:-1;;3618:28:19;3642:4;3618:28;;;3734:64;;-1:-1:-1;;;;;10159:55:65;;3734:64:19;;;10141:74:65;3660:152:19;;3699:17;;10114:18:65;;3734:64:19;;;-1:-1:-1;;3734:64:19;;;;;;;;;;;;;;;;;;;;3660:21;:152::i;:::-;-1:-1:-1;3826:29:19;;-1:-1:-1;;3826:29:19;;;3942:20;:18;:20::i;:::-;-1:-1:-1;;;;;3921:41:19;:17;-1:-1:-1;;;;;3921:41:19;;3913:101;;;;-1:-1:-1;;;3913:101:19;;14692:2:65;3913:101:19;;;14674:21:65;14731:2;14711:18;;;14704:30;14770:34;14750:18;;;14743:62;14841:17;14821:18;;;14814:45;14876:19;;3913:101:19;14664:237:65;3913:101:19;4103:29;4114:17;4103:10;:29::i;2546:187:18:-;2638:6;;;-1:-1:-1;;;;;2654:17:18;;;-1:-1:-1;;2654:17:18;;;;;;;2686:40;;2638:6;;;2654:17;2638:6;;2686:40;;2619:16;;2686:40;2546:187;;:::o;4655:133:19:-;4699:7;4389:66;4725:50;1713:38:29;5193:135:19;5257:35;5270:11;:9;:11::i;:::-;5257:35;;;-1:-1:-1;;;;;10479:15:65;;;10461:34;;10531:15;;;10526:2;10511:18;;10504:43;10373:18;5257:35:19;;;;;;;5302:19;5312:8;5302:9;:19::i;11888:307:23:-;12038:8;-1:-1:-1;;;;;12029:17:23;:5;-1:-1:-1;;;;;12029:17:23;;;12021:55;;;;-1:-1:-1;;;12021:55:23;;17507:2:65;12021:55:23;;;17489:21:65;17546:2;17526:18;;;17519:30;17585:27;17565:18;;;17558:55;17630:18;;12021:55:23;17479:175:65;12021:55:23;-1:-1:-1;;;;;12086:25:23;;;;;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;:46;;-1:-1:-1;;12086:46:23;;;;;;;;;;12147:41;;11214::65;;;12147::23;;11187:18:65;12147:41:23;;;;;;;11888:307;;;:::o;7077:::-;7228:28;7238:4;7244:2;7248:7;7228:9;:28::i;:::-;7274:48;7297:4;7303:2;7307:7;7316:5;7274:22;:48::i;:::-;7266:111;;;;-1:-1:-1;;;7266:111:23;;14273:2:65;7266:111:23;;;14255:21:65;14312:2;14292:18;;;14285:30;14351:34;14331:18;;;14324:62;14422:20;14402:18;;;14395:48;14460:19;;7266:111:23;14245:240:65;2833:98:50;2885:13;2917:7;2910:14;;;;;:::i;339:703:30:-;395:13;612:10;608:51;;-1:-1:-1;;638:10:30;;;;;;;;;;;;;;;;;;339:703::o;608:51::-;683:5;668:12;722:75;729:9;;722:75;;754:8;;;;:::i;:::-;;-1:-1:-1;776:10:30;;-1:-1:-1;784:2:30;776:10;;:::i;:::-;;;722:75;;;806:19;838:6;828:17;;;;;;-1:-1:-1;;;828:17:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;828:17:30;;806:39;;855:150;862:10;;855:150;;888:11;898:1;888:11;;:::i;:::-;;-1:-1:-1;956:10:30;964:2;956:5;:10;:::i;:::-;943:24;;:2;:24;:::i;:::-;930:39;;913:6;920;913:14;;;;;;-1:-1:-1;;;913:14:30;;;;;;;;;;;;:56;;;;;;;;;;-1:-1:-1;983:11:30;992:2;983:11;;:::i;:::-;;;855:150;;10206:359:23;10265:13;10281:34;10307:7;10281:25;:34::i;:::-;10265:50;;10412:29;10429:1;10433:7;10412:8;:29::i;:::-;-1:-1:-1;;;;;10452:16:23;;;;;;:9;:16;;;;;:21;;10472:1;;10452:16;:21;;10472:1;;10452:21;:::i;:::-;;;;-1:-1:-1;;10490:16:23;;;;:7;:16;;;;;;10483:23;;-1:-1:-1;;10483:23:23;;;10522:36;10498:7;;10490:16;-1:-1:-1;;;;;10522:36:23;;;;;10490:16;;10522:36;10206:359;;:::o;9617:372::-;-1:-1:-1;;;;;9696:16:23;;9688:61;;;;-1:-1:-1;;;9688:61:23;;19935:2:65;9688:61:23;;;19917:21:65;;;19954:18;;;19947:30;20013:34;19993:18;;;19986:62;20065:18;;9688:61:23;19907:182:65;9688:61:23;7752:4;7775:16;;;:7;:16;;;;;;-1:-1:-1;;;;;7775:16:23;:30;9759:58;;;;-1:-1:-1;;;9759:58:23;;15925:2:65;9759:58:23;;;15907:21:65;15964:2;15944:18;;;15937:30;16003;15983:18;;;15976:58;16051:18;;9759:58:23;15897:178:65;9759:58:23;-1:-1:-1;;;;;9884:13:23;;;;;;:9;:13;;;;;:18;;9901:1;;9884:13;:18;;9901:1;;9884:18;:::i;:::-;;;;-1:-1:-1;;9912:16:23;;;;:7;:16;;;;;;:21;;-1:-1:-1;;9912:21:23;-1:-1:-1;;;;;9912:21:23;;;;;;;;9949:33;;9912:16;;;9949:33;;9912:16;;9949:33;9617:372;;:::o;988:131:18:-;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;1050:26:18::1;:24;:26::i;:::-;1086;:24;:26::i;940:154:22:-:0;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;1010:33:22::1;500:66:57::0;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;1816:160:23;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;1929:13:23;;::::1;::::0;:5:::1;::::0;:13:::1;::::0;::::1;::::0;::::1;:::i;:::-;-1:-1:-1::0;1952:17:23;;::::1;::::0;:7:::1;::::0;:17:::1;::::0;::::1;::::0;::::1;:::i;1776:281:19:-:0;1098:20:27;;1849:106:19;;;;-1:-1:-1;;;1849:106:19;;21068:2:65;1849:106:19;;;21050:21:65;21107:2;21087:18;;;21080:30;21146:34;21126:18;;;21119:62;21217:15;21197:18;;;21190:43;21250:19;;1849:106:19;21040:235:65;1849:106:19;2033:17;1263:66;1965:59;:85;;-1:-1:-1;;1965:85:19;-1:-1:-1;;;;;1965:85:19;;;;;;;;;;-1:-1:-1;1776:281:19:o;7325:455::-;7408:12;1098:20:27;;7432:88:19;;;;-1:-1:-1;;;7432:88:19;;23071:2:65;7432:88:19;;;23053:21:65;23110:2;23090:18;;;23083:30;23149:34;23129:18;;;23122:62;23220:8;23200:18;;;23193:36;23246:19;;7432:88:19;23043:228:65;7432:88:19;7591:12;7605:23;7632:6;-1:-1:-1;;;;;7632:19:19;7652:4;7632:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7590:67;;;;7674:99;7710:7;7719:10;7674:99;;;;;;;;;;;;;;;;;:35;:99::i;:::-;7667:106;7325:455;-1:-1:-1;;;;;7325:455:19:o;2163:152::-;2229:37;2248:17;2229:18;:37::i;:::-;2281:27;;-1:-1:-1;;;;;2281:27:19;;;;;;;;2163:152;:::o;4870:212::-;-1:-1:-1;;;;;4933:22:19;;4925:73;;;;-1:-1:-1;;;4925:73:19;;16695:2:65;4925:73:19;;;16677:21:65;16734:2;16714:18;;;16707:30;16773:34;16753:18;;;16746:62;16844:8;16824:18;;;16817:36;16870:19;;4925:73:19;16667:228:65;4925:73:19;5067:8;4389:66;5008:50;1713:38:29;12748:800:23;12898:4;-1:-1:-1;;;;;12918:13:23;;1098:20:27;1144:8;12914:628:23;;12953:83;;;;;-1:-1:-1;;;;;12953:47:23;;;;;:83;;965:10:28;;13015:4:23;;13021:7;;13030:5;;12953:83;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;12953:83:23;;;;;;;;-1:-1:-1;;12953:83:23;;;;;;;;;;;;:::i;:::-;;;12949:541;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;13214:13:23;;13210:266;;13256:60;;-1:-1:-1;;;13256:60:23;;14273:2:65;13256:60:23;;;14255:21:65;14312:2;14292:18;;;14285:30;14351:34;14331:18;;;14324:62;14422:20;14402:18;;;14395:48;14460:19;;13256:60:23;14245:240:65;13210:266:23;13428:6;13422:13;13413:6;13409:2;13405:15;13398:38;12949:541;-1:-1:-1;;;;;;13086:62:23;13096:52;13086:62;;-1:-1:-1;13079:69:23;;12914:628;-1:-1:-1;13527:4:23;13520:11;;1125:111:18;2930:13:21;;;;;;;2922:69;;;;-1:-1:-1;;;2922:69:21;;23896:2:65;2922:69:21;;;23878:21:65;23935:2;23915:18;;;23908:30;23974:34;23954:18;;;23947:62;-1:-1:-1;;;24025:18:65;;;24018:41;24076:19;;2922:69:21;23868:233:65;2922:69:21;1197:32:18::1;965:10:28::0;1197:18:18::1;:32::i;6275:692:27:-:0;6421:12;6449:7;6445:516;;;-1:-1:-1;6479:10:27;6472:17;;6445:516;6590:17;;:21;6586:365;;6784:10;6778:17;6844:15;6831:10;6827:2;6823:19;6816:44;6733:145;6923:12;6916:20;;-1:-1:-1;;;6916:20:27;;;;;;;;:::i;-1:-1:-1:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;14:797:65;56:5;109:3;102:4;94:6;90:17;86:27;76:2;;131:5;124;117:20;76:2;171:6;158:20;197:18;234:2;230;227:10;224:2;;;240:18;;:::i;:::-;374:2;368:9;436:4;428:13;;-1:-1:-1;;424:22:65;;;448:2;420:31;416:40;404:53;;;472:18;;;492:22;;;469:46;466:2;;;518:18;;:::i;:::-;558:10;554:2;547:22;593:2;585:6;578:18;639:3;632:4;627:2;619:6;615:15;611:26;608:35;605:2;;;660:5;653;646:20;605:2;728;721:4;713:6;709:17;702:4;694:6;690:17;677:54;751:15;;;768:4;747:26;740:41;;;;-1:-1:-1;755:6:65;66:745;-1:-1:-1;;;66:745:65:o;816:257::-;875:6;928:2;916:9;907:7;903:23;899:32;896:2;;;949:6;941;934:22;896:2;993:9;980:23;1012:31;1037:5;1012:31;:::i;1078:261::-;1148:6;1201:2;1189:9;1180:7;1176:23;1172:32;1169:2;;;1222:6;1214;1207:22;1169:2;1259:9;1253:16;1278:31;1303:5;1278:31;:::i;1344:398::-;1412:6;1420;1473:2;1461:9;1452:7;1448:23;1444:32;1441:2;;;1494:6;1486;1479:22;1441:2;1538:9;1525:23;1557:31;1582:5;1557:31;:::i;:::-;1607:5;-1:-1:-1;1664:2:65;1649:18;;1636:32;1677:33;1636:32;1677:33;:::i;:::-;1729:7;1719:17;;;1431:311;;;;;:::o;1747:466::-;1824:6;1832;1840;1893:2;1881:9;1872:7;1868:23;1864:32;1861:2;;;1914:6;1906;1899:22;1861:2;1958:9;1945:23;1977:31;2002:5;1977:31;:::i;:::-;2027:5;-1:-1:-1;2084:2:65;2069:18;;2056:32;2097:33;2056:32;2097:33;:::i;:::-;1851:362;;2149:7;;-1:-1:-1;;;2203:2:65;2188:18;;;;2175:32;;1851:362::o;2218:685::-;2313:6;2321;2329;2337;2390:3;2378:9;2369:7;2365:23;2361:33;2358:2;;;2412:6;2404;2397:22;2358:2;2456:9;2443:23;2475:31;2500:5;2475:31;:::i;:::-;2525:5;-1:-1:-1;2582:2:65;2567:18;;2554:32;2595:33;2554:32;2595:33;:::i;:::-;2647:7;-1:-1:-1;2701:2:65;2686:18;;2673:32;;-1:-1:-1;2756:2:65;2741:18;;2728:32;2783:18;2772:30;;2769:2;;;2820:6;2812;2805:22;2769:2;2848:49;2889:7;2880:6;2869:9;2865:22;2848:49;:::i;:::-;2838:59;;;2348:555;;;;;;;:::o;2908:436::-;2973:6;2981;3034:2;3022:9;3013:7;3009:23;3005:32;3002:2;;;3055:6;3047;3040:22;3002:2;3099:9;3086:23;3118:31;3143:5;3118:31;:::i;:::-;3168:5;-1:-1:-1;3225:2:65;3210:18;;3197:32;3267:15;;3260:23;3248:36;;3238:2;;3303:6;3295;3288:22;3349:475;3426:6;3434;3487:2;3475:9;3466:7;3462:23;3458:32;3455:2;;;3508:6;3500;3493:22;3455:2;3552:9;3539:23;3571:31;3596:5;3571:31;:::i;:::-;3621:5;-1:-1:-1;3677:2:65;3662:18;;3649:32;3704:18;3693:30;;3690:2;;;3741:6;3733;3726:22;3690:2;3769:49;3810:7;3801:6;3790:9;3786:22;3769:49;:::i;:::-;3759:59;;;3445:379;;;;;:::o;3829:325::-;3897:6;3905;3958:2;3946:9;3937:7;3933:23;3929:32;3926:2;;;3979:6;3971;3964:22;3926:2;4023:9;4010:23;4042:31;4067:5;4042:31;:::i;:::-;4092:5;4144:2;4129:18;;;;4116:32;;-1:-1:-1;;;3916:238:65:o;4159:194::-;4229:6;4282:2;4270:9;4261:7;4257:23;4253:32;4250:2;;;4303:6;4295;4288:22;4250:2;-1:-1:-1;4331:16:65;;4240:113;-1:-1:-1;4240:113:65:o;4358:255::-;4416:6;4469:2;4457:9;4448:7;4444:23;4440:32;4437:2;;;4490:6;4482;4475:22;4437:2;4534:9;4521:23;4553:30;4577:5;4553:30;:::i;4618:259::-;4687:6;4740:2;4728:9;4719:7;4715:23;4711:32;4708:2;;;4761:6;4753;4746:22;4708:2;4798:9;4792:16;4817:30;4841:5;4817:30;:::i;4882:997::-;5019:6;5027;5035;5043;5051;5104:3;5092:9;5083:7;5079:23;5075:33;5072:2;;;5126:6;5118;5111:22;5072:2;5170:9;5157:23;5189:31;5214:5;5189:31;:::i;:::-;5239:5;-1:-1:-1;5291:2:65;5276:18;;5263:32;;-1:-1:-1;5346:2:65;5331:18;;5318:32;5369:18;5399:14;;;5396:2;;;5431:6;5423;5416:22;5396:2;5459:49;5500:7;5491:6;5480:9;5476:22;5459:49;:::i;:::-;5449:59;;5561:2;5550:9;5546:18;5533:32;5517:48;;5590:2;5580:8;5577:16;5574:2;;;5611:6;5603;5596:22;5574:2;5639:51;5682:7;5671:8;5660:9;5656:24;5639:51;:::i;:::-;5629:61;;5743:3;5732:9;5728:19;5715:33;5699:49;;5773:2;5763:8;5760:16;5757:2;;;5794:6;5786;5779:22;5757:2;;5822:51;5865:7;5854:8;5843:9;5839:24;5822:51;:::i;:::-;5812:61;;;5062:817;;;;;;;;:::o;5884:341::-;5953:6;6006:2;5994:9;5985:7;5981:23;5977:32;5974:2;;;6027:6;6019;6012:22;5974:2;6072:9;6059:23;6105:18;6097:6;6094:30;6091:2;;;6142:6;6134;6127:22;6091:2;6170:49;6211:7;6202:6;6191:9;6187:22;6170:49;:::i;6230:190::-;6289:6;6342:2;6330:9;6321:7;6317:23;6313:32;6310:2;;;6363:6;6355;6348:22;6310:2;-1:-1:-1;6391:23:65;;6300:120;-1:-1:-1;6300:120:65:o;6425:325::-;6493:6;6501;6554:2;6542:9;6533:7;6529:23;6525:32;6522:2;;;6575:6;6567;6560:22;6522:2;6616:9;6603:23;6593:33;;6676:2;6665:9;6661:18;6648:32;6689:31;6714:5;6689:31;:::i;6755:393::-;6832:6;6840;6848;6901:2;6889:9;6880:7;6876:23;6872:32;6869:2;;;6922:6;6914;6907:22;6869:2;6963:9;6950:23;6940:33;;7023:2;7012:9;7008:18;6995:32;7036:31;7061:5;7036:31;:::i;7153:258::-;7221:6;7229;7282:2;7270:9;7261:7;7257:23;7253:32;7250:2;;;7303:6;7295;7288:22;7250:2;-1:-1:-1;;7331:23:65;;;7401:2;7386:18;;;7373:32;;-1:-1:-1;7240:171:65:o;7416:316::-;7457:3;7495:5;7489:12;7522:6;7517:3;7510:19;7538:63;7594:6;7587:4;7582:3;7578:14;7571:4;7564:5;7560:16;7538:63;:::i;:::-;7646:2;7634:15;-1:-1:-1;;7630:88:65;7621:98;;;;7721:4;7617:109;;7465:267;-1:-1:-1;;7465:267:65:o;7737:274::-;7866:3;7904:6;7898:13;7920:53;7966:6;7961:3;7954:4;7946:6;7942:17;7920:53;:::i;:::-;7989:16;;;;;7874:137;-1:-1:-1;;7874:137:65:o;8297:470::-;8476:3;8514:6;8508:13;8530:53;8576:6;8571:3;8564:4;8556:6;8552:17;8530:53;:::i;:::-;8646:13;;8605:16;;;;8668:57;8646:13;8605:16;8702:4;8690:17;;8668:57;:::i;:::-;8741:20;;8484:283;-1:-1:-1;;;;8484:283:65:o;8772:1218::-;8900:3;8929;8964:6;8958:13;8994:3;9016:1;9044:9;9040:2;9036:18;9026:28;;9104:2;9093:9;9089:18;9126;9116:2;;9170:4;9162:6;9158:17;9148:27;;9116:2;9196;9244;9236:6;9233:14;9213:18;9210:38;9207:2;;;-1:-1:-1;;;9278:3:65;9271:90;9384:4;9381:1;9374:15;9414:4;9409:3;9402:17;9207:2;9445:18;9472:162;;;;9648:1;9643:322;;;;9438:527;;9472:162;-1:-1:-1;;9509:9:65;9505:82;9500:3;9493:95;9617:6;9612:3;9608:16;9601:23;;9472:162;;9643:322;24763:4;24782:17;;;24832:4;24816:21;;9738:3;9754:165;9768:6;9765:1;9762:13;9754:165;;;9846:14;;9833:11;;;9826:35;9889:16;;;;9783:10;;9754:165;;;9758:3;;9948:6;9943:3;9939:16;9932:23;;9438:527;-1:-1:-1;9981:3:65;;8908:1082;-1:-1:-1;;;;;;;;8908:1082:65:o;10558:511::-;10752:4;-1:-1:-1;;;;;10862:2:65;10854:6;10850:15;10839:9;10832:34;10914:2;10906:6;10902:15;10897:2;10886:9;10882:18;10875:43;;10954:6;10949:2;10938:9;10934:18;10927:34;10997:3;10992:2;10981:9;10977:18;10970:31;11018:45;11058:3;11047:9;11043:19;11035:6;11018:45;:::i;:::-;11010:53;10761:308;-1:-1:-1;;;;;;10761:308:65:o;12366:219::-;12515:2;12504:9;12497:21;12478:4;12535:44;12575:2;12564:9;12560:18;12552:6;12535:44;:::i;24848:128::-;24888:3;24919:1;24915:6;24912:1;24909:13;24906:2;;;24925:18;;:::i;:::-;-1:-1:-1;24961:9:65;;24896:80::o;24981:120::-;25021:1;25047;25037:2;;25052:18;;:::i;:::-;-1:-1:-1;25086:9:65;;25027:74::o;25106:125::-;25146:4;25174:1;25171;25168:8;25165:2;;;25179:18;;:::i;:::-;-1:-1:-1;25216:9:65;;25155:76::o;25236:258::-;25308:1;25318:113;25332:6;25329:1;25326:13;25318:113;;;25408:11;;;25402:18;25389:11;;;25382:39;25354:2;25347:10;25318:113;;;25449:6;25446:1;25443:13;25440:2;;;-1:-1:-1;;25484:1:65;25466:16;;25459:27;25289:205::o;25499:437::-;25578:1;25574:12;;;;25621;;;25642:2;;25696:4;25688:6;25684:17;25674:27;;25642:2;25749;25741:6;25738:14;25718:18;25715:38;25712:2;;;-1:-1:-1;;;25783:1:65;25776:88;25887:4;25884:1;25877:15;25915:4;25912:1;25905:15;25712:2;;25554:382;;;:::o;25941:195::-;25980:3;26011:66;26004:5;26001:77;25998:2;;;26081:18;;:::i;:::-;-1:-1:-1;26128:1:65;26117:13;;25988:148::o;26141:112::-;26173:1;26199;26189:2;;26204:18;;:::i;:::-;-1:-1:-1;26238:9:65;;26179:74::o;26258:184::-;-1:-1:-1;;;26307:1:65;26300:88;26407:4;26404:1;26397:15;26431:4;26428:1;26421:15;26447:184;-1:-1:-1;;;26496:1:65;26489:88;26596:4;26593:1;26586:15;26620:4;26617:1;26610:15;26636:184;-1:-1:-1;;;26685:1:65;26678:88;26785:4;26782:1;26775:15;26809:4;26806:1;26799:15;26825:154;-1:-1:-1;;;;;26904:5:65;26900:54;26893:5;26890:65;26880:2;;26969:1;26966;26959:12;26984:177;-1:-1:-1;;;;;;27062:5:65;27058:78;27051:5;27048:89;27038:2;;27151:1;27148;27141:12

Swarm Source

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