Goerli Testnet

Token

NameWrapper ()
ERC-1155

Overview

Max Total Supply

0

Holders

42,274

Market

Fully Diluted Market Cap

$0.00

Circulating Supply Market Cap

-
0x29555ad402030ca44e2024e52551f9c2570b7a86
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
NameWrapper

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 21 : NameWrapper.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

import {ERC1155Fuse, IERC165, OperationProhibited} from "./ERC1155Fuse.sol";
import {Controllable} from "./Controllable.sol";
import {INameWrapper, CANNOT_UNWRAP, CANNOT_BURN_FUSES, CANNOT_TRANSFER, CANNOT_SET_RESOLVER, CANNOT_SET_TTL, CANNOT_CREATE_SUBDOMAIN, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING} from "./INameWrapper.sol";
import {INameWrapperUpgrade} from "./INameWrapperUpgrade.sol";
import {IMetadataService} from "./IMetadataService.sol";
import {ONS} from "../registry/ONS.sol";
import {IBaseRegistrar} from "../ethregistrar/IBaseRegistrar.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {BytesUtils} from "./BytesUtils.sol";
import {ERC20Recoverable} from "../utils/ERC20Recoverable.sol";

error Unauthorised(bytes32 node, address addr);
error NameNotFound();
error IncompatibleParent();
error IncompatibleName(bytes name);
error IncorrectTokenType();
error LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);
error LabelTooShort();
error LabelTooLong(string label);
error IncorrectTargetOwner(address owner);
error CannotUpgrade();

contract NameWrapper is
    Ownable,
    ERC1155Fuse,
    INameWrapper,
    Controllable,
    IERC721Receiver,
    ERC20Recoverable
{
    using BytesUtils for bytes;
    ONS public immutable override ons;
    IBaseRegistrar public immutable override registrar;
    IMetadataService public override metadataService;
    mapping(bytes32 => bytes) public override names;
    string public constant name = "NameWrapper";

    bytes32 private constant ETH_NODE =
        0x070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701;
    bytes32 private constant ROOT_NODE =
        0x0000000000000000000000000000000000000000000000000000000000000000;

    INameWrapperUpgrade public upgradeContract;
    uint64 private constant MAX_EXPIRY = type(uint64).max;

    constructor(
        ONS _ons,
        IBaseRegistrar _registrar,
        IMetadataService _metadataService
    ) {
        ons = _ons;
        registrar = _registrar;
        metadataService = _metadataService;

        /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE and ETH_NODE */

        _setData(
            uint256(ETH_NODE),
            address(0),
            uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),
            MAX_EXPIRY
        );
        _setData(
            uint256(ROOT_NODE),
            address(0),
            uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),
            MAX_EXPIRY
        );
        names[ROOT_NODE] = "\x00";
        names[ETH_NODE] = "\x03op\x00";
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC1155Fuse, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(INameWrapper).interfaceId ||
            interfaceId == type(IERC721Receiver).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /* ERC1155 Fuse */

    /**
     * @notice Gets the owner of a name
     * @param id Label as a string of the .op domain to wrap
     * @return owner The owner of the name
     */

    function ownerOf(uint256 id)
        public
        view
        override(ERC1155Fuse, INameWrapper)
        returns (address owner)
    {
        return super.ownerOf(id);
    }

    /**
     * @notice Gets the data for a name
     * @param id Label as a string of the .op domain to wrap
     * @return address The owner of the name
     * @return uint32 Fuses of the name
     * @return uint64 Expiry of when the fuses expire for the name
     */

    function getData(uint256 id)
        public
        view
        override(ERC1155Fuse, INameWrapper)
        returns (
            address,
            uint32,
            uint64
        )
    {
        return super.getData(id);
    }

    /* Metadata service */

    /**
     * @notice Set the metadata service. Only the owner can do this
     * @param _metadataService The new metadata service
     */

    function setMetadataService(IMetadataService _metadataService)
        public
        onlyOwner
    {
        metadataService = _metadataService;
    }

    /**
     * @notice Get the metadata uri
     * @param tokenId The id of the token
     * @return string uri of the metadata service
     */

    function uri(uint256 tokenId) public view override returns (string memory) {
        return metadataService.uri(tokenId);
    }

    /**
     * @notice Set the address of the upgradeContract of the contract. only admin can do this
     * @dev The default value of upgradeContract is the 0 address. Use the 0 address at any time
     * to make the contract not upgradable.
     * @param _upgradeAddress address of an upgraded contract
     */

    function setUpgradeContract(INameWrapperUpgrade _upgradeAddress)
        public
        onlyOwner
    {
        if (address(upgradeContract) != address(0)) {
            registrar.setApprovalForAll(address(upgradeContract), false);
            ons.setApprovalForAll(address(upgradeContract), false);
        }

        upgradeContract = _upgradeAddress;

        if (address(upgradeContract) != address(0)) {
            registrar.setApprovalForAll(address(upgradeContract), true);
            ons.setApprovalForAll(address(upgradeContract), true);
        }
    }

    /**
     * @notice Checks if msg.sender is the owner or approved by the owner of a name
     * @param node namehash of the name to check
     */

    modifier onlyTokenOwner(bytes32 node) {
        if (!isTokenOwnerOrApproved(node, msg.sender)) {
            revert Unauthorised(node, msg.sender);
        }

        _;
    }

    /**
     * @notice Checks if owner or approved by owner
     * @param node namehash of the name to check
     * @param addr which address to check permissions for
     * @return whether or not is owner or approved
     */

    function isTokenOwnerOrApproved(bytes32 node, address addr)
        public
        view
        override
        returns (bool)
    {
        address owner = ownerOf(uint256(node));
        return owner == addr || isApprovedForAll(owner, addr);
    }

    /**
     * @notice Wraps a .op domain, creating a new token and sending the original ERC721 token to this contract
     * @dev Can be called by the owner of the name on the .op registrar or an authorised caller on the registrar
     * @param label Label as a string of the .op domain to wrap
     * @param wrappedOwner Owner of the name in this contract
     * @param fuses Initial fuses to set
     * @param expiry When the fuses will expire
     * @param resolver Resolver contract address
     * @return Normalised expiry of when the fuses expire
     */

    function wrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint32 fuses,
        uint64 expiry,
        address resolver
    ) public override returns (uint64) {
        uint256 tokenId = uint256(keccak256(bytes(label)));
        address registrant = registrar.ownerOf(tokenId);
        if (
            registrant != msg.sender &&
            !registrar.isApprovedForAll(registrant, msg.sender)
        ) {
            revert Unauthorised(
                _makeNode(ETH_NODE, bytes32(tokenId)),
                msg.sender
            );
        }

        // transfer the token from the user to this contract
        registrar.transferFrom(registrant, address(this), tokenId);

        // transfer the ons record back to the new owner (this contract)
        registrar.reclaim(tokenId, address(this));

        return _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);
    }

    /**
     * @dev Registers a new .op second-level domain and wraps it.
     *      Only callable by authorised controllers.
     * @param label The label to register (Eg, 'foo' for 'foo.op').
     * @param wrappedOwner The owner of the wrapped name.
     * @param duration The duration, in seconds, to register the name for.
     * @param resolver The resolver address to set on the ONS registry (optional).
     * @param fuses Initial fuses to set
     * @param expiry When the fuses will expire
     * @return registrarExpiry The expiry date of the new name on the .op registrar, in seconds since the Unix epoch.
     */

    function registerAndWrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint256 duration,
        address resolver,
        uint32 fuses,
        uint64 expiry
    ) external override onlyController returns (uint256 registrarExpiry) {
        uint256 tokenId = uint256(keccak256(bytes(label)));
        registrarExpiry = registrar.register(tokenId, address(this), duration);
        _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);
    }

    /**
     * @notice Renews a .op second-level domain.
     * @dev Only callable by authorised controllers.
     * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo.op').
     * @param duration The number of seconds to renew the name for.
     * @return expires The expiry date of the name on the .op registrar, in seconds since the Unix epoch.
     */

    function renew(
        uint256 tokenId,
        uint256 duration,
        uint32 fuses,
        uint64 expiry
    ) external override onlyController returns (uint256 expires) {
        bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));

        expires = registrar.renew(tokenId, duration);
        if (isWrapped(node)) {
            (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(
                uint256(node)
            );
            expiry = _normaliseExpiry(expiry, oldExpiry, uint64(expires));

            _setData(
                node,
                owner,
                oldFuses | fuses | PARENT_CANNOT_CONTROL,
                expiry
            );
        }
    }

    /**
     * @notice Wraps a non .op domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
     * @dev Can be called by the owner in the registry or an authorised caller in the registry
     * @param name The name to wrap, in ONS format
     * @param wrappedOwner Owner of the name in this contract
     * @param resolver Resolver contract
     */

    function wrap(
        bytes calldata name,
        address wrappedOwner,
        address resolver
    ) public override {
        (bytes32 labelhash, uint256 offset) = name.readLabel(0);
        bytes32 parentNode = name.namehash(offset);
        bytes32 node = _makeNode(parentNode, labelhash);

        if (parentNode == ETH_NODE) {
            revert IncompatibleParent();
        }

        address owner = ons.owner(node);

        if (owner != msg.sender && !ons.isApprovedForAll(owner, msg.sender)) {
            revert Unauthorised(node, msg.sender);
        }

        if (resolver != address(0)) {
            ons.setResolver(node, resolver);
        }

        ons.setOwner(node, address(this));

        _wrap(node, name, wrappedOwner, 0, 0);
    }

    /**
     * @notice Unwraps a .op domain. e.g. vitalik.op
     * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper
     * @param labelhash Labelhash of the .op domain
     * @param registrant Sets the owner in the .op registrar to this address
     * @param controller Sets the owner in the registry to this address
     */

    function unwrapETH2LD(
        bytes32 labelhash,
        address registrant,
        address controller
    ) public override onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {
        if (controller == address(0x0)) {
            revert IncorrectTargetOwner(controller);
        }
        if (registrant == address(this)) {
            revert IncorrectTargetOwner(registrant);
        }
        _unwrap(_makeNode(ETH_NODE, labelhash), controller);
        registrar.safeTransferFrom(
            address(this),
            registrant,
            uint256(labelhash)
        );
    }

    /**
     * @notice Unwraps a non .op domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
     * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper
     * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')
     * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')
     * @param controller Sets the owner in the registry to this address
     */

    function unwrap(
        bytes32 parentNode,
        bytes32 labelhash,
        address controller
    ) public override onlyTokenOwner(_makeNode(parentNode, labelhash)) {
        if (parentNode == ETH_NODE) {
            revert IncompatibleParent();
        }
        if (controller == address(0x0) || controller == address(this)) {
            revert IncorrectTargetOwner(controller);
        }
        _unwrap(_makeNode(parentNode, labelhash), controller);
    }

    /**
     * @notice Sets fuses of a name
     * @param node Namehash of the name
     * @param fuses Fuses to burn (cannot burn PARENT_CANNOT_CONTROL)
     * @return New fuses
     */

    function setFuses(bytes32 node, uint32 fuses)
        public
        onlyTokenOwner(node)
        operationAllowed(node, CANNOT_BURN_FUSES)
        returns (uint32)
    {
        _checkForParentCannotControl(node, fuses);

        (address owner, uint32 oldFuses, uint64 expiry) = getData(
            uint256(node)
        );

        fuses |= oldFuses;
        _setFuses(node, owner, fuses, expiry);
        return fuses;
    }

    /**
     * @notice Upgrades a .op wrapped domain by calling the wrapETH2LD function of the upgradeContract
     *     and burning the token of this contract
     * @dev Can be called by the owner of the name in this contract
     * @param label Label as a string of the .op name to upgrade
     * @param wrappedOwner The owner of the wrapped name
     */

    function upgradeETH2LD(
        string calldata label,
        address wrappedOwner,
        address resolver
    ) public {
        bytes32 labelhash = keccak256(bytes(label));
        bytes32 node = _makeNode(ETH_NODE, labelhash);
        (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);

        upgradeContract.wrapETH2LD(
            label,
            wrappedOwner,
            fuses,
            expiry,
            resolver
        );
    }

    /**
     * @notice Upgrades a non .op domain of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
     * @dev Can be called by the owner or an authorised caller
     * Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names
     * @param parentNode Namehash of the parent name
     * @param label Label as a string of the name to upgrade
     * @param wrappedOwner Owner of the name in this contract
     * @param resolver Resolver contract for this name
     */

    function upgrade(
        bytes32 parentNode,
        string calldata label,
        address wrappedOwner,
        address resolver
    ) public {
        bytes32 labelhash = keccak256(bytes(label));
        bytes32 node = _makeNode(parentNode, labelhash);
        (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);
        upgradeContract.setSubnodeRecord(
            parentNode,
            label,
            wrappedOwner,
            resolver,
            0,
            fuses,
            expiry
        );
    }

    /** 
    /* @notice Sets fuses of a name that you own the parent of. Can also be called by the owner of a .op name
     * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')
     * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')
     * @param fuses Fuses to burn
     * @param expiry When the fuses will expire
     */

    function setChildFuses(
        bytes32 parentNode,
        bytes32 labelhash,
        uint32 fuses,
        uint64 expiry
    ) public {
        bytes32 node = _makeNode(parentNode, labelhash);
        (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(
            uint256(node)
        );
        uint64 maxExpiry;
        (, uint32 parentFuses, uint64 parentExpiry) = getData(
            uint256(parentNode)
        );
        if (parentNode == ETH_NODE) {
            if (!isTokenOwnerOrApproved(node, msg.sender)) {
                revert Unauthorised(node, msg.sender);
            }
            // max expiry is set to the expiry on the registrar
            maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));
        } else {
            if (!isTokenOwnerOrApproved(parentNode, msg.sender)) {
                revert Unauthorised(node, msg.sender);
            }

            // max expiry is set to the expiry of the parent
            maxExpiry = parentExpiry;
        }

        _checkParentFuses(node, fuses, parentFuses);

        expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);

        // if PARENT_CANNOT_CONTROL has been burned and fuses have changed
        if (
            oldFuses & PARENT_CANNOT_CONTROL != 0 &&
            oldFuses | fuses != oldFuses
        ) {
            revert OperationProhibited(node);
        }
        fuses |= oldFuses;
        _setFuses(node, owner, fuses, expiry);
    }

    /**
     * @notice Sets the subdomain owner in the registry and then wraps the subdomain
     * @param parentNode Parent namehash of the subdomain
     * @param label Label of the subdomain as a string
     * @param owner New owner in the wrapper
     * @param fuses Initial fuses for the wrapped subdomain
     * @param expiry When the fuses will expire
     * @return node Namehash of the subdomain
     */

    function setSubnodeOwner(
        bytes32 parentNode,
        string calldata label,
        address owner,
        uint32 fuses,
        uint64 expiry
    )
        public
        onlyTokenOwner(parentNode)
        canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))
        returns (bytes32 node)
    {
        bytes32 labelhash = keccak256(bytes(label));
        node = _makeNode(parentNode, labelhash);
        expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);

        if (!isWrapped(node)) {
            ons.setSubnodeOwner(parentNode, labelhash, address(this));
            _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);
        } else {
            _updateName(parentNode, node, label, owner, fuses, expiry);
        }
    }

    /**
     * @notice Sets the subdomain owner in the registry with records and then wraps the subdomain
     * @param parentNode parent namehash of the subdomain
     * @param label label of the subdomain as a string
     * @param owner new owner in the wrapper
     * @param resolver resolver contract in the registry
     * @param ttl ttl in the regsitry
     * @param fuses initial fuses for the wrapped subdomain
     * @param expiry expiry date for the domain
     * @return node Namehash of the subdomain
     */

    function setSubnodeRecord(
        bytes32 parentNode,
        string memory label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    )
        public
        onlyTokenOwner(parentNode)
        canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))
        returns (bytes32 node)
    {
        bytes32 labelhash = keccak256(bytes(label));
        node = _makeNode(parentNode, labelhash);
        expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);
        if (!isWrapped(node)) {
            ons.setSubnodeRecord(
                parentNode,
                labelhash,
                address(this),
                resolver,
                ttl
            );
            _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);
        } else {
            ons.setSubnodeRecord(
                parentNode,
                labelhash,
                address(this),
                resolver,
                ttl
            );
            _updateName(parentNode, node, label, owner, fuses, expiry);
        }
    }

    /**
     * @notice Sets records for the name in the ONS Registry
     * @param node Namehash of the name to set a record for
     * @param owner New owner in the registry
     * @param resolver Resolver contract
     * @param ttl Time to live in the registry
     */

    function setRecord(
        bytes32 node,
        address owner,
        address resolver,
        uint64 ttl
    )
        public
        override
        onlyTokenOwner(node)
        operationAllowed(
            node,
            CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL
        )
    {
        ons.setRecord(node, address(this), resolver, ttl);
        (address oldOwner, , ) = getData(uint256(node));
        _transfer(oldOwner, owner, uint256(node), 1, "");
    }

    /**
     * @notice Sets resolver contract in the registry
     * @param node namehash of the name
     * @param resolver the resolver contract
     */

    function setResolver(bytes32 node, address resolver)
        public
        override
        onlyTokenOwner(node)
        operationAllowed(node, CANNOT_SET_RESOLVER)
    {
        ons.setResolver(node, resolver);
    }

    /**
     * @notice Sets TTL in the registry
     * @param node Namehash of the name
     * @param ttl TTL in the registry
     */

    function setTTL(bytes32 node, uint64 ttl)
        public
        override
        onlyTokenOwner(node)
        operationAllowed(node, CANNOT_SET_TTL)
    {
        ons.setTTL(node, ttl);
    }

    /**
     * @dev Allows an operation only if none of the specified fuses are burned.
     * @param node The namehash of the name to check fuses on.
     * @param fuseMask A bitmask of fuses that must not be burned.
     */

    modifier operationAllowed(bytes32 node, uint32 fuseMask) {
        (, uint32 fuses, ) = getData(uint256(node));
        if (fuses & fuseMask != 0) {
            revert OperationProhibited(node);
        }
        _;
    }

    /**
     * @notice Check whether a name can call setSubnodeOwner/setSubnodeRecord
     * @dev Checks both CANNOT_CREATE_SUBDOMAIN and PARENT_CANNOT_CONTROL and whether not they have been burnt
     *      and checks whether the owner of the subdomain is 0x0 for creating or already exists for
     *      replacing a subdomain. If either conditions are true, then it is possible to call
     *      setSubnodeOwner
     * @param node Namehash of the name to check
     * @param labelhash Labelhash of the name to check
     */

    modifier canCallSetSubnodeOwner(bytes32 node, bytes32 labelhash) {
        bytes32 subnode = _makeNode(node, labelhash);
        address owner = ons.owner(subnode);

        if (owner == address(0)) {
            (, uint32 fuses, ) = getData(uint256(node));
            if (fuses & CANNOT_CREATE_SUBDOMAIN != 0) {
                revert OperationProhibited(subnode);
            }
        } else {
            (, uint32 subnodeFuses, ) = getData(uint256(subnode));
            if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {
                revert OperationProhibited(subnode);
            }
        }

        _;
    }

    /**
     * @notice Checks all Fuses in the mask are burned for the node
     * @param node Namehash of the name
     * @param fuseMask The fuses you want to check
     * @return Boolean of whether or not all the selected fuses are burned
     */

    function allFusesBurned(bytes32 node, uint32 fuseMask)
        public
        view
        override
        returns (bool)
    {
        (, uint32 fuses, ) = getData(uint256(node));
        return fuses & fuseMask == fuseMask;
    }

    /**
     * @notice Checks if a name is wrapped or not
     * @dev Both of these checks need to be true to be considered wrapped if checked without this contract
     * @param node Namehash of the name
     * @return Boolean of whether or not the name is wrapped
     */

    function isWrapped(bytes32 node) public view override returns (bool) {
        return
            ownerOf(uint256(node)) != address(0) &&
            ons.owner(node) == address(this);
    }

    function onERC721Received(
        address to,
        address,
        uint256 tokenId,
        bytes calldata data
    ) public override returns (bytes4) {
        //check if it's the op registrar ERC721
        if (msg.sender != address(registrar)) {
            revert IncorrectTokenType();
        }

        (
            string memory label,
            address owner,
            uint32 fuses,
            uint64 expiry,
            address resolver
        ) = abi.decode(data, (string, address, uint32, uint64, address));

        bytes32 labelhash = bytes32(tokenId);
        bytes32 labelhashFromData = keccak256(bytes(label));

        if (labelhashFromData != labelhash) {
            revert LabelMismatch(labelhashFromData, labelhash);
        }

        // transfer the ons record back to the new owner (this contract)
        registrar.reclaim(uint256(labelhash), address(this));

        _wrapETH2LD(label, owner, fuses, expiry, resolver);

        return IERC721Receiver(to).onERC721Received.selector;
    }

    /***** Internal functions */

    function _canTransfer(uint32 fuses) internal pure override returns (bool) {
        return fuses & CANNOT_TRANSFER == 0;
    }

    function _makeNode(bytes32 node, bytes32 labelhash)
        private
        pure
        returns (bytes32)
    {
        return keccak256(abi.encodePacked(node, labelhash));
    }

    function _addLabel(string memory label, bytes memory name)
        internal
        pure
        returns (bytes memory ret)
    {
        if (bytes(label).length < 1) {
            revert LabelTooShort();
        }
        if (bytes(label).length > 255) {
            revert LabelTooLong(label);
        }
        return abi.encodePacked(uint8(bytes(label).length), label, name);
    }

    function _mint(
        bytes32 node,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal override {
        _canFusesBeBurned(node, fuses);
        address oldOwner = ownerOf(uint256(node));
        if (oldOwner != address(0)) {
            // burn and unwrap old token of old owner
            _burn(uint256(node));
            emit NameUnwrapped(node, address(0));
        }
        super._mint(node, owner, fuses, expiry);
    }

    function _wrap(
        bytes32 node,
        bytes memory name,
        address wrappedOwner,
        uint32 fuses,
        uint64 expiry
    ) internal {
        names[node] = name;
        _mint(node, wrappedOwner, fuses, expiry);
        emit NameWrapped(node, name, wrappedOwner, fuses, expiry);
    }

    function _addLabelAndWrap(
        bytes32 parentNode,
        bytes32 node,
        string memory label,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal {
        bytes memory name = _addLabel(label, names[parentNode]);
        _wrap(node, name, owner, fuses, expiry);
    }

    function _prepareUpgrade(bytes32 node)
        private
        returns (uint32 fuses, uint64 expiry)
    {
        if (address(upgradeContract) == address(0)) {
            revert CannotUpgrade();
        }

        if (!isTokenOwnerOrApproved(node, msg.sender)) {
            revert Unauthorised(node, msg.sender);
        }

        (, fuses, expiry) = getData(uint256(node));

        // burn token and fuse data
        _burn(uint256(node));
    }

    function _updateName(
        bytes32 parentNode,
        bytes32 node,
        string memory label,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal {
        address oldOwner = ownerOf(uint256(node));
        bytes memory name = _addLabel(label, names[parentNode]);
        if (names[node].length == 0) {
            names[node] = name;
        }
        _setFuses(node, oldOwner, fuses, expiry);
        if (owner == address(0)) {
            _unwrap(node, address(0));
        } else {
            _transfer(oldOwner, owner, uint256(node), 1, "");
        }
    }

    // wrapper function for stack limit
    function _checkParentFusesAndExpiry(
        bytes32 parentNode,
        bytes32 node,
        uint32 fuses,
        uint64 expiry
    ) internal view returns (uint64) {
        (, , uint64 oldExpiry) = getData(uint256(node));
        (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));
        _checkParentFuses(node, fuses, parentFuses);
        return _normaliseExpiry(expiry, oldExpiry, maxExpiry);
    }

    function _checkParentFuses(
        bytes32 node,
        uint32 fuses,
        uint32 parentFuses
    ) internal pure {
        bool isBurningPCC = fuses & PARENT_CANNOT_CONTROL ==
            PARENT_CANNOT_CONTROL;

        bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;

        if (isBurningPCC && parentHasNotBurnedCU) {
            revert OperationProhibited(node);
        }
    }

    function _getETH2LDDataAndNormaliseExpiry(
        bytes32 node,
        bytes32 labelhash,
        uint64 expiry
    )
        internal
        view
        returns (
            address owner,
            uint32 fuses,
            uint64
        )
    {
        uint64 oldExpiry;
        (owner, fuses, oldExpiry) = getData(uint256(node));
        uint64 maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));

        expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);
        return (owner, fuses, expiry);
    }

    function _normaliseExpiry(
        uint64 expiry,
        uint64 oldExpiry,
        uint64 maxExpiry
    ) internal pure returns (uint64) {
        // Expiry cannot be more than maximum allowed
        // .op names will check registrar, non .op check parent
        if (expiry > maxExpiry) {
            expiry = maxExpiry;
        }
        // Expiry cannot be less than old expiry
        if (expiry < oldExpiry) {
            expiry = oldExpiry;
        }

        return expiry;
    }

    function _wrapETH2LD(
        string memory label,
        address wrappedOwner,
        uint32 fuses,
        uint64 expiry,
        address resolver
    ) private returns (uint64) {
        // Mint a new ERC1155 token with fuses
        // Set PARENT_CANNOT_REPLACE to reflect wrapper + registrar control over the 2LD
        bytes32 labelhash = keccak256(bytes(label));
        bytes32 node = _makeNode(ETH_NODE, labelhash);
        uint32 oldFuses;

        (, oldFuses, expiry) = _getETH2LDDataAndNormaliseExpiry(
            node,
            labelhash,
            expiry
        );

        _addLabelAndWrap(
            ETH_NODE,
            node,
            label,
            wrappedOwner,
            fuses | PARENT_CANNOT_CONTROL,
            expiry
        );
        if (resolver != address(0)) {
            ons.setResolver(node, resolver);
        }

        return expiry;
    }

    function _unwrap(bytes32 node, address owner) private {
        if (allFusesBurned(node, CANNOT_UNWRAP)) {
            revert OperationProhibited(node);
        }

        // Burn token and fuse data
        _burn(uint256(node));
        ons.setOwner(node, owner);

        emit NameUnwrapped(node, owner);
    }

    function _setFuses(
        bytes32 node,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal {
        _setData(node, owner, fuses, expiry);
        emit FusesSet(node, fuses, expiry);
    }

    function _setData(
        bytes32 node,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal {
        _canFusesBeBurned(node, fuses);
        super._setData(uint256(node), owner, fuses, expiry);
    }

    function _canFusesBeBurned(bytes32 node, uint32 fuses) internal pure {
        if (
            fuses & ~PARENT_CANNOT_CONTROL != 0 &&
            fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=
            (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)
        ) {
            revert OperationProhibited(node);
        }
    }

    function _checkForParentCannotControl(bytes32 node, uint32 fuses)
        internal
        view
    {
        if (fuses & PARENT_CANNOT_CONTROL != 0) {
            // Only the parent can burn the PARENT_CANNOT_CONTROL fuse.
            revert Unauthorised(node, msg.sender);
        }
    }
}

File 2 of 21 : ERC1155Fuse.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/* This contract is a variation on ERC1155 with the additions of _setData, getData and _canTransfer and ownerOf. _setData and getData allows the use of the other 96 bits next to the address of the owner for extra data. We use this to store 'fuses' that control permissions that can be burnt. 32 bits are used for the fuses themselves and 64 bits are used for the expiry of the name. When a name has expired, its fuses will be be set back to 0 */

error OperationProhibited(bytes32 node);

abstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;
    mapping(uint256 => uint256) public _tokens;

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

    /**************************************************************************
     * ERC721 methods
     *************************************************************************/

    function ownerOf(uint256 id) public view virtual returns (address) {
        (address owner, , ) = getData(id);
        return owner;
    }

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

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id)
        public
        view
        virtual
        override
        returns (uint256)
    {
        require(
            account != address(0),
            "ERC1155: balance query for the zero address"
        );
        (address owner, , ) = getData(id);
        if (owner == account) {
            return 1;
        }
        return 0;
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(
            accounts.length == ids.length,
            "ERC1155: accounts and ids length mismatch"
        );

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

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

    /**
     * @dev Returns the Name's owner address and fuses
     */
    function getData(uint256 tokenId)
        public
        view
        virtual
        returns (
            address owner,
            uint32 fuses,
            uint64 expiry
        )
    {
        uint256 t = _tokens[tokenId];
        owner = address(uint160(t));
        expiry = uint64(t >> 192);
        if (block.timestamp > expiry) {
            fuses = 0;
        } else {
            fuses = uint32(t >> 160);
        }
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "ERC1155: caller is not owner nor approved"
        );

        _transfer(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            ids.length == amounts.length,
            "ERC1155: ids and amounts length mismatch"
        );
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "ERC1155: transfer caller is not owner nor approved"
        );

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            (address oldOwner, uint32 fuses, uint64 expiration) = getData(id);

            if (!_canTransfer(fuses)) {
                revert OperationProhibited(bytes32(id));
            }

            require(
                amount == 1 && oldOwner == from,
                "ERC1155: insufficient balance for transfer"
            );
            _setData(id, to, fuses, expiration);
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(
            msg.sender,
            from,
            to,
            ids,
            amounts,
            data
        );
    }

    /**************************************************************************
     * Internal/private methods
     *************************************************************************/

    /**
     * @dev Sets the Name's owner address and fuses
     */
    function _setData(
        uint256 tokenId,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal virtual {
        _tokens[tokenId] =
            uint256(uint160(owner)) |
            (uint256(fuses) << 160) |
            (uint256(expiry) << 192);
    }

    function _canTransfer(uint32 fuses) internal virtual returns (bool);

    function _mint(
        bytes32 node,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal virtual {
        uint256 tokenId = uint256(node);
        (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(
            uint256(node)
        );

        if (oldExpiry > expiry) {
            expiry = oldExpiry;
        }

        require(oldOwner == address(0), "ERC1155: mint of existing token");
        require(owner != address(0), "ERC1155: mint to the zero address");
        require(
            owner != address(this),
            "ERC1155: newOwner cannot be the NameWrapper contract"
        );

        _setData(tokenId, owner, fuses | oldFuses, expiry);
        emit TransferSingle(msg.sender, address(0x0), owner, tokenId, 1);
        _doSafeTransferAcceptanceCheck(
            msg.sender,
            address(0),
            owner,
            tokenId,
            1,
            ""
        );
    }

    function _burn(uint256 tokenId) internal virtual {
        (address owner, uint32 fuses, uint64 expiry) = getData(tokenId);
        // Fuses and expiry are kept on burn
        _setData(tokenId, address(0x0), fuses, expiry);
        emit TransferSingle(msg.sender, owner, address(0x0), tokenId, 1);
    }

    function _transfer(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal {
        (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);

        if (!_canTransfer(fuses)) {
            revert OperationProhibited(bytes32(id));
        }

        require(
            amount == 1 && oldOwner == from,
            "ERC1155: insufficient balance for transfer"
        );

        if (oldOwner == to) {
            return;
        }

        _setData(id, to, fuses, expiry);

        emit TransferSingle(msg.sender, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);
    }

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try
                IERC1155Receiver(to).onERC1155Received(
                    operator,
                    from,
                    id,
                    amount,
                    data
                )
            returns (bytes4 response) {
                if (
                    response != IERC1155Receiver(to).onERC1155Received.selector
                ) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try
                IERC1155Receiver(to).onERC1155BatchReceived(
                    operator,
                    from,
                    ids,
                    amounts,
                    data
                )
            returns (bytes4 response) {
                if (
                    response !=
                    IERC1155Receiver(to).onERC1155BatchReceived.selector
                ) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }
}

File 3 of 21 : Controllable.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

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

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

    event ControllerChanged(address indexed controller, bool active);

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

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

File 4 of 21 : INameWrapper.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

import "../registry/ONS.sol";
import "../ethregistrar/IBaseRegistrar.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "./IMetadataService.sol";

uint32 constant CANNOT_UNWRAP = 1;
uint32 constant CANNOT_BURN_FUSES = 2;
uint32 constant CANNOT_TRANSFER = 4;
uint32 constant CANNOT_SET_RESOLVER = 8;
uint32 constant CANNOT_SET_TTL = 16;
uint32 constant CANNOT_CREATE_SUBDOMAIN = 32;
uint32 constant PARENT_CANNOT_CONTROL = 64;
uint32 constant CAN_DO_EVERYTHING = 0;

interface INameWrapper is IERC1155 {
    event NameWrapped(
        bytes32 indexed node,
        bytes name,
        address owner,
        uint32 fuses,
        uint64 expiry
    );

    event NameUnwrapped(bytes32 indexed node, address owner);

    event FusesSet(bytes32 indexed node, uint32 fuses, uint64 expiry);

    function ons() external view returns (ONS);

    function registrar() external view returns (IBaseRegistrar);

    function metadataService() external view returns (IMetadataService);

    function names(bytes32) external view returns (bytes memory);

    function wrap(
        bytes calldata name,
        address wrappedOwner,
        address resolver
    ) external;

    function wrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint32 fuses,
        uint64 _expiry,
        address resolver
    ) external returns (uint64 expiry);

    function registerAndWrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint256 duration,
        address resolver,
        uint32 fuses,
        uint64 expiry
    ) external returns (uint256 registrarExpiry);

    function renew(
        uint256 labelHash,
        uint256 duration,
        uint32 fuses,
        uint64 expiry
    ) external returns (uint256 expires);

    function unwrap(
        bytes32 node,
        bytes32 label,
        address owner
    ) external;

    function unwrapETH2LD(
        bytes32 label,
        address newRegistrant,
        address newController
    ) external;

    function setFuses(bytes32 node, uint32 fuses)
        external
        returns (uint32 newFuses);

    function setChildFuses(
        bytes32 parentNode,
        bytes32 labelhash,
        uint32 fuses,
        uint64 expiry
    ) external;

    function setSubnodeRecord(
        bytes32 node,
        string calldata label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    ) external returns (bytes32);

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

    function setSubnodeOwner(
        bytes32 node,
        string calldata label,
        address newOwner,
        uint32 fuses,
        uint64 expiry
    ) external returns (bytes32);

    function isTokenOwnerOrApproved(bytes32 node, address addr)
        external
        returns (bool);

    function setResolver(bytes32 node, address resolver) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function ownerOf(uint256 id) external returns (address owner);

    function getData(uint256 id)
        external
        returns (
            address,
            uint32,
            uint64
        );

    function allFusesBurned(bytes32 node, uint32 fuseMask)
        external
        view
        returns (bool);

    function isWrapped(bytes32 node) external view returns (bool);
}

File 5 of 21 : INameWrapperUpgrade.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

interface INameWrapperUpgrade {
    function setSubnodeRecord(
        bytes32 parentNode,
        string calldata label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    ) external;

    function wrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint32 fuses,
        uint64 expiry,
        address resolver
    ) external;
}

File 6 of 21 : IMetadataService.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

interface IMetadataService {
    function uri(uint256) external view returns (string memory);
}

File 7 of 21 : ONS.sol
pragma solidity >=0.8.4;

interface ONS {
    // 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 8 of 21 : IBaseRegistrar.sol
import "../registry/ONS.sol";
import "./IBaseRegistrar.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IBaseRegistrar is IERC721 {
    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);

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

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

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

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

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

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

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

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

File 9 of 21 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 10 of 21 : 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 11 of 21 : BytesUtils.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;

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

    /**
     * @dev Returns the ONS namehash of a ONS-encoded name.
     * @param self The ONS-encoded name to hash.
     * @param offset The offset at which to start hashing.
     * @return The namehash of the name.
     */
    function namehash(bytes memory self, uint256 offset)
        internal
        pure
        returns (bytes32)
    {
        (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);
        if (labelhash == bytes32(0)) {
            require(offset == self.length - 1, "namehash: Junk at end of name");
            return bytes32(0);
        }
        return
            keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));
    }

    /**
     * @dev Returns the keccak-256 hash of a ONS-encoded label, and the offset to the start of the next label.
     * @param self The byte string to read a label from.
     * @param idx The index to read a label at.
     * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.
     * @return newIdx The index of the start of the next label.
     */
    function readLabel(bytes memory self, uint256 idx)
        internal
        pure
        returns (bytes32 labelhash, uint256 newIdx)
    {
        require(idx < self.length, "readLabel: Index out of bounds");
        uint256 len = uint256(uint8(self[idx]));
        if (len > 0) {
            labelhash = keccak(self, idx + 1, len);
        } else {
            labelhash = bytes32(0);
        }
        newIdx = idx + len + 1;
    }
}

File 12 of 21 : ERC20Recoverable.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.17 <0.9.0;

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

/**
    @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.
 */

contract ERC20Recoverable is Ownable {
    /**
    @notice Recover ERC20 tokens sent to the contract by mistake.
    @dev The contract is Ownable and only the owner can call the recover function.
    @param _to The address to send the tokens to.
@param _token The address of the ERC20 token to recover
    @param _amount The amount of tokens to recover.
 */
    function recoverFunds(
        address _token,
        address _to,
        uint256 _amount
    ) external onlyOwner {
        IERC20(_token).transfer(_to, _amount);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 14 of 21 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 15 of 21 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 16 of 21 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 18 of 21 : 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 19 of 21 : 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 20 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 21 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        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);
}

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

Contract ABI

[{"inputs":[{"internalType":"contract ONS","name":"_ons","type":"address"},{"internalType":"contract IBaseRegistrar","name":"_registrar","type":"address"},{"internalType":"contract IMetadataService","name":"_metadataService","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotUpgrade","type":"error"},{"inputs":[],"name":"IncompatibleParent","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"IncorrectTargetOwner","type":"error"},{"inputs":[],"name":"IncorrectTokenType","type":"error"},{"inputs":[{"internalType":"bytes32","name":"labelHash","type":"bytes32"},{"internalType":"bytes32","name":"expectedLabelhash","type":"bytes32"}],"name":"LabelMismatch","type":"error"},{"inputs":[{"internalType":"string","name":"label","type":"string"}],"name":"LabelTooLong","type":"error"},{"inputs":[],"name":"LabelTooShort","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"OperationProhibited","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"Unauthorised","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"ControllerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"fuses","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"FusesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"NameUnwrapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint32","name":"fuses","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"NameWrapped","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":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint32","name":"fuseMask","type":"uint32"}],"name":"allFusesBurned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getData","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"isTokenOwnerOrApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"isWrapped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataService","outputs":[{"internalType":"contract IMetadataService","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"names","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ons","outputs":[{"internalType":"contract ONS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"registerAndWrapETH2LD","outputs":[{"internalType":"uint256","name":"registrarExpiry","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registrar","outputs":[{"internalType":"contract IBaseRegistrar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"renew","outputs":[{"internalType":"uint256","name":"expires","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":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setChildFuses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint32","name":"fuses","type":"uint32"}],"name":"setFuses","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMetadataService","name":"_metadataService","type":"address"}],"name":"setMetadataService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setSubnodeOwner","outputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setSubnodeRecord","outputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INameWrapperUpgrade","name":"_upgradeAddress","type":"address"}],"name":"setUpgradeContract","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"address","name":"controller","type":"address"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"address","name":"registrant","type":"address"},{"internalType":"address","name":"controller","type":"address"}],"name":"unwrapETH2LD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeContract","outputs":[{"internalType":"contract INameWrapperUpgrade","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"upgradeETH2LD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"name","type":"bytes"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"wrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"address","name":"resolver","type":"address"}],"name":"wrapETH2LD","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b5060405162006352380380620063528339810160408190526200003491620001f0565b6200003f3362000187565b6001600160a01b0383811660805282811660a052600480546001600160a01b031916918316919091179055600163ffffffbf60a01b03197fc2a3766eab92013a07b1988bffa78f055f6bf3763034a5c8ed4da4eb088926ce8190557fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4955604080518082019091526001815260006020808301829052908052600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc90620001099082620002e9565b5060408051808201909152600481526136f760ec1b6020808301919091527f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701600052600590527f17a9f8ef1788bb3309db89ff991adf91d2aa1dfb647e884275245d2223b7d1d2906200017d9082620002e9565b50505050620003b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620001ed57600080fd5b50565b6000806000606084860312156200020657600080fd5b83516200021381620001d7565b60208501519093506200022681620001d7565b60408501519092506200023981620001d7565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200026f57607f821691505b6020821081036200029057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002e457600081815260208120601f850160051c81016020861015620002bf5750805b601f850160051c820191505b81811015620002e057828155600101620002cb565b5050505b505050565b81516001600160401b0381111562000305576200030562000244565b6200031d816200031684546200025a565b8462000296565b602080601f8311600181146200035557600084156200033c5750858301515b600019600386901b1c1916600185901b178555620002e0565b600085815260208120601f198616915b82811015620003865788860151825594840194600190910190840162000365565b5085821015620003a55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a051615ea5620004ad600039600081816104e001528181610ae101528181610bd801528181611686015281816118b501528181611dbf01528181611efc0152818161219f0152818161231b0152818161349f015281816135660152818161368801528181613717015261464c01526000818161046801528181610a6701528181610dbc01528181610f31015281816110cd015281816111980152818161223d015281816123b90152818161257f015281816127180152818161290101528181612e0b01528181612ed201528181612fb4015281816130460152818161382601528181613aab015261411b0152615ea56000f3fe608060405234801561001057600080fd5b50600436106102f35760003560e01c80638b4dfa7511610191578063e0dba60f116100e3578063ee7eba7811610097578063f44779b911610071578063f44779b91461075e578063f9547a9e14610771578063fd0cd0d91461079d57600080fd5b8063ee7eba7814610725578063f242432a14610738578063f2fde38b1461074b57600080fd5b8063e985e9c5116100c8578063e985e9c5146106b6578063eb8ae530146106f2578063ed70554d1461070557600080fd5b8063e0dba60f14610690578063e72bf00f146106a357600080fd5b8063b6bcad2611610145578063cf4088231161011f578063cf40882314610647578063d8c9921a1461065a578063da8c229e1461066d57600080fd5b8063b6bcad26146105f9578063c20a2eb01461060c578063c658e0861461063457600080fd5b80639f56dac6116101765780639f56dac6146105c0578063a22cb465146105d3578063adf4960a146105e657600080fd5b80638b4dfa751461059c5780638da5cb5b146105af57600080fd5b806320c38e2b1161024a57806347d2e9fe116101fe5780635d3590d5116101d85780635d3590d51461056e5780636352211e14610581578063715018a61461059457600080fd5b806347d2e9fe146105285780634e1273f41461053b578063530954671461055b57600080fd5b80632b20e3971161022f5780632b20e397146104db5780632eb2c2d61461050257806333c69ea91461051557600080fd5b806320c38e2b146104b557806324c1af44146104c857600080fd5b806314ab9038116102ac5780631896f70a116102865780631896f70a146104505780631c789b59146104635780631f4e1504146104a257600080fd5b806314ab9038146103e4578063150b7a02146103f95780631534e1771461043d57600080fd5b806301ffc9a7116102dd57806301ffc9a71461036557806306fdde03146103885780630e89341c146103d157600080fd5b8062fdd58e146102f85780630178fe3f1461031e575b600080fd5b61030b610306366004614cca565b6107b0565b6040519081526020015b60405180910390f35b61033161032c366004614cf6565b610871565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610315565b610378610373366004614d3d565b61088c565b6040519015158152602001610315565b6103c46040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516103159190614db1565b6103c46103df366004614cf6565b61092e565b6103f76103f2366004614de1565b6109bb565b005b61040c610407366004614e56565b610ad4565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610315565b6103f761044b366004614ec9565b610c7c565b6103f761045e366004614ee6565b610d10565b61048a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610315565b60065461048a906001600160a01b031681565b6103c46104c3366004614cf6565b610deb565b61030b6104d636600461500a565b610e85565b61048a7f000000000000000000000000000000000000000000000000000000000000000081565b6103f761051036600461513d565b611213565b6103f76105233660046151eb565b6115b1565b61030b6105363660046151eb565b6117aa565b61054e610549366004615231565b611978565b604051610315919061532f565b60045461048a906001600160a01b031681565b6103f761057c366004615342565b611ab6565b61048a61058f366004614cf6565b611ba2565b6103f7611bad565b6103f76105aa366004615383565b611c13565b6000546001600160a01b031661048a565b61030b6105ce3660046153c5565b611e21565b6103f76105e1366004615458565b611fc5565b6103786105f4366004615486565b6120cd565b6103f7610607366004614ec9565b6120f2565b61061f61061a366004615486565b612418565b60405163ffffffff9091168152602001610315565b61030b6106423660046154a9565b6124c3565b6103f7610655366004615528565b61283f565b6103f7610668366004615560565b61299a565b61037861067b366004614ec9565b60036020526000908152604090205460ff1681565b6103f761069e366004615458565b612adc565b6103f76106b136600461558e565b612bb4565b6103786106c43660046155f6565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6103f761070036600461558e565b612cc5565b61030b610713366004614cf6565b60016020526000908152604090205481565b6103f7610733366004615624565b6130ed565b6103f7610746366004615698565b6131e3565b6103f7610759366004614ec9565b613318565b61037861076c366004614ee6565b6133f7565b61078461077f366004615701565b613452565b60405167ffffffffffffffff9091168152602001610315565b6103786107ab366004614cf6565b6137cf565b60006001600160a01b0383166108335760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061083e83610871565b50509050836001600160a01b0316816001600160a01b03160361086557600191505061086b565b60009150505b92915050565b600080600061087f846138a1565b9250925092509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fcbf196fa00000000000000000000000000000000000000000000000000000000148061091f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b8061086b575061086b826138d8565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa158015610993573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261086b919081019061578b565b816109c681336133f7565b6109ec5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b82601060006109fa83610871565b5091505063ffffffff8282161615610a285760405163a2a7201360e01b81526004810184905260240161082a565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b38576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610b4a8789018961580d565b84516020860120949950929750909550935091508990808214610ba3576040517fc65c3ccc000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161082a565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610c2457600080fd5b505af1158015610c38573d6000803e3d6000fd5b50505050610c4987878787876139bb565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b6000546001600160a01b03163314610cd65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610d1b81336133f7565b610d415760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8260086000610d4f83610871565b5091505063ffffffff8282161615610d7d5760405163a2a7201360e01b81526004810184905260240161082a565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610a9a565b60056020526000908152604090208054610e0490615885565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3090615885565b8015610e7d5780601f10610e5257610100808354040283529160200191610e7d565b820191906000526020600020905b815481529060010190602001808311610e6057829003601f168201915b505050505081565b600087610e9281336133f7565b610eb85760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8888805190602001206000610ef48383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906158d8565b90506001600160a01b038116610fe6576000610fb785610871565b509150506020811615610fe05760405163a2a7201360e01b81526004810184905260240161082a565b5061101c565b6000610ff183610871565b50915050604081161561101a5760405163a2a7201360e01b81526004810184905260240161082a565b505b8b5160208d01206110548e82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506110628e888b8b613b15565b975061106d876137cf565b61113c576040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b505050506111378e888f8f8d8d613b5b565b611202565b6040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156111dc57600080fd5b505af11580156111f0573d6000803e3d6000fd5b505050506112028e888f8f8d8d613c15565b505050505050979650505050505050565b815183511461128a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b0384166113065760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03851633148061134057506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6113b25760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161082a565b60005b83518110156115445760008482815181106113d2576113d26158f5565b6020026020010151905060008483815181106113f0576113f06158f5565b60200260200101519050600080600061140885610871565b925092509250611419826004161590565b6114395760405163a2a7201360e01b81526004810186905260240161082a565b83600114801561145a57508a6001600160a01b0316836001600160a01b0316145b6114cc5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905550505050508061153d90615953565b90506113b5565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161159492919061598b565b60405180910390a46115aa338686868686613cd0565b5050505050565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806115e684610871565b91945092509050600080806115fa8b610871565b9093509150507ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8b016117005761163187336133f7565b6116575760405163168ab55d60e31b81526004810188905233602482015260440161082a565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156116d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f991906159b9565b9250611734565b61170a8b336133f7565b6117305760405163168ab55d60e31b81526004810188905233602482015260440161082a565b8092505b61173f878a84613edc565b61174a888585613f12565b9750604085161580159061176c57508463ffffffff1689861763ffffffff1614155b1561178d5760405163a2a7201360e01b81526004810188905260240161082a565b9784179761179d87878b8b613f5c565b5050505050505050505050565b3360009081526003602052604081205460ff1661182f5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c6572000000000000000000000000000000000000000000000000606482015260840161082a565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701602080830191909152818301889052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af1158015611906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192a91906159b9565b9150611935816137cf565b1561196f576000808061194784610871565b925092509250611958868287613f12565b955061196b848460408a86171789613fb8565b5050505b50949350505050565b606081518351146119f15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161082a565b6000835167ffffffffffffffff811115611a0d57611a0d614f16565b604051908082528060200260200182016040528015611a36578160200160208202803683370190505b50905060005b8451811015611aae57611a81858281518110611a5a57611a5a6158f5565b6020026020010151858381518110611a7457611a746158f5565b60200260200101516107b0565b828281518110611a9357611a936158f5565b6020908102919091010152611aa781615953565b9050611a3c565b509392505050565b6000546001600160a01b03163314611b105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9c91906159d2565b50505050565b600061086b82614029565b6000546001600160a01b03163314611c075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b611c11600061403f565b565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870160208083019190915281830186905282518083038401815260609092019092528051910120611c6781336133f7565b611c8d5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b6001600160a01b038216611cd8576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260240161082a565b306001600160a01b03841603611d25576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260240161082a565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870160208083019190915281830187905282518083038401815260609092019092528051910120611d7a905b836140a7565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015611e0357600080fd5b505af1158015611e17573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611ea65760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c6572000000000000000000000000000000000000000000000000606482015260840161082a565b60008888604051611eb89291906159ef565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7191906159b9565b9150611fb889898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896139bb565b5050979650505050505050565b6001600160a01b03821633036120435760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161082a565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806120d984610871565b50841663ffffffff908116908516149250505092915050565b6000546001600160a01b0316331461214c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6006546001600160a01b03161561229e576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561228557600080fd5b505af1158015612299573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515612415576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561236157600080fd5b505af1158015612375573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561240157600080fd5b505af11580156115aa573d6000803e3d6000fd5b50565b60008261242581336133f7565b61244b5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b836002600061245983610871565b5091505063ffffffff82821616156124875760405163a2a7201360e01b81526004810184905260240161082a565b61249187876141b2565b6000808061249e8a610871565b92509250925081891798506124b58a848b84613f5c565b509698975050505050505050565b6000866124d081336133f7565b6124f65760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8787876040516125079291906159ef565b604051809103902060006125428383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa1580156125c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ea91906158d8565b90506001600160a01b03811661263457600061260585610871565b50915050602081161561262e5760405163a2a7201360e01b81526004810184905260240161082a565b5061266a565b600061263f83610871565b5091505060408116156126685760405163a2a7201360e01b81526004810184905260240161082a565b505b60008b8b60405161267c9291906159ef565b604051809103902090506126b78d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506126c58d888b8b613b15565b97506126d0876137cf565b6127dd576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306ab5923906064016020604051808303816000875af1158015612761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061278591906159b9565b506127d88d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613b5b565b61282f565b61282f8d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613c15565b5050505050509695505050505050565b8361284a81336133f7565b6128705760405163168ab55d60e31b81526004810182905233602482015260440161082a565b84601c600061287e83610871565b5091505063ffffffff82821616156128ac5760405163a2a7201360e01b81526004810184905260240161082a565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b15801561294557600080fd5b505af1158015612959573d6000803e3d6000fd5b50505050600061296b8960001c610871565b5050905061298f81898b60001c6001604051806020016040528060008152506141e1565b505050505050505050565b604080516020808201869052818301859052825180830384018152606090920190925280519101206129cc81336133f7565b6129f25760405163168ab55d60e31b81526004810182905233602482015260440161082a565b7ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8401612a4b576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382161580612a6957506001600160a01b03821630145b15612aab576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260240161082a565b60408051602080820187905281830186905282518083038401815260609092019092528051910120611b9c90611d74565b6000546001600160a01b03163314612b365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b60008484604051612bc69291906159ef565b60405190819003902090506000612c247f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612c328361438f565b6006546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612c89908b908b908b90889088908d90600401615a2a565b600060405180830381600087803b158015612ca357600080fd5b505af1158015612cb7573d6000803e3d6000fd5b505050505050505050505050565b600080612d0c600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144249050565b915091506000612d558288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144db9050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8201612dd9576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015612e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7e91906158d8565b90506001600160a01b0381163314801590612f3f57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015612f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f3d91906159d2565b155b15612f665760405163168ab55d60e31b81526004810183905233602482015260440161082a565b6001600160a01b03861615613011576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015612ff857600080fd5b505af115801561300c573d6000803e3d6000fd5b505050505b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b15801561309257600080fd5b505af11580156130a6573d6000803e3d6000fd5b5050505061298f828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d9350915081905061459a565b600084846040516130ff9291906159ef565b60405180910390209050600061313c8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060008061314a8361438f565b6006546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af44906131a6908c908c908c908c908c906000908b908b90600401615a80565b600060405180830381600087803b1580156131c057600080fd5b505af11580156131d4573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b03841661325f5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03851633148061329957506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b61330b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f7665640000000000000000000000000000000000000000000000606482015260840161082a565b6115aa85858585856141e1565b6000546001600160a01b031633146133725760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6001600160a01b0381166133ee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161082a565b6124158161403f565b60008061340384611ba2565b9050826001600160a01b0316816001600160a01b0316148061344a57506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b60008087876040516134659291906159ef565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156134ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351291906158d8565b90506001600160a01b03811633148015906135d357506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d191906159d2565b155b1561364357604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b87016020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a40161082a565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b1580156136cc57600080fd5b505af11580156136e0573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b15801561376557600080fd5b505af1158015613779573d6000803e3d6000fd5b505050506137c289898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886139bb565b9998505050505050505050565b6000806137db83611ba2565b6001600160a01b03161415801561086b57506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561386d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061389191906158d8565b6001600160a01b03161492915050565b6000818152600160205260408120549060c082901c82428210156138c857600092506138d0565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a2600000000000000000000000000000000000000000000000000000000148061396b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061086b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461086b565b8451602086012060009081613a177f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000613a26828488614604565b97509150613a5d90507f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701838b8b60408c178b613b5b565b6001600160a01b03851615613b08576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015613aef57600080fd5b505af1158015613b03573d6000803e3d6000fd5b505050505b5093979650505050505050565b600080613b2185610871565b92505050600080613b348860001c610871565b9250925050613b44878784613edc565b613b4f858483613f12565b98975050505050505050565b60008681526005602052604081208054613bfd918791613b7a90615885565b80601f0160208091040260200160405190810160405280929190818152602001828054613ba690615885565b8015613bf35780601f10613bc857610100808354040283529160200191613bf3565b820191906000526020600020905b815481529060010190602001808311613bd657829003601f168201915b50505050506146dc565b9050613c0c868286868661459a565b50505050505050565b6000613c2086611ba2565b90506000613c4686600560008b81526020019081526020016000208054613b7a90615885565b6000888152600560205260409020805491925090613c6390615885565b9050600003613c86576000878152600560205260409020613c848282615b2e565b505b613c9287838686613f5c565b6001600160a01b038516613cb057613cab8760006140a7565b611e17565b611e1782868960001c6001604051806020016040528060008152506141e1565b6001600160a01b0384163b15613ed4576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613d2d9089908990889088908890600401615c2a565b6020604051808303816000875af1925050508015613d68575060408051601f3d908101601f19168201909252613d6591810190615c7c565b60015b613e1d57613d74615c99565b806308c379a003613dad5750613d88615cb5565b80613d935750613daf565b8060405162461bcd60e51b815260040161082a9190614db1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161082a565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613c0c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b505050505050565b6040828116146001821615818015613ef15750805b156115aa5760405163a2a7201360e01b81526004810186905260240161082a565b60008167ffffffffffffffff168467ffffffffffffffff161115613f34578193505b8267ffffffffffffffff168467ffffffffffffffff161015613f54578293505b509192915050565b613f6884848484613fb8565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b613fc28483614785565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b16179055611b9c565b60008061403583610871565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6140b28260016120cd565b156140d35760405163a2a7201360e01b81526004810183905260240161082a565b6140dc826147be565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b15801561415f57600080fd5b505af1158015614173573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612ba8565b60408116156141dd5760405163168ab55d60e31b81526004810183905233602482015260440161082a565b5050565b60008060006141ef86610871565b925092509250614200826004161590565b6142205760405163a2a7201360e01b81526004810187905260240161082a565b8460011480156142415750876001600160a01b0316836001600160a01b0316145b6142b35760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b866001600160a01b0316836001600160a01b0316036142d4575050506115aa565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e17338989898989614879565b60065460009081906001600160a01b03166143d6576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6143e083336133f7565b6144065760405163168ab55d60e31b81526004810184905233602482015260440161082a565b61440f83610871565b909350915061441f9050836147be565b915091565b600080835183106144775760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e64730000604482015260640161082a565b600084848151811061448b5761448b6158f5565b016020015160f81c905080156144b7576144b0856144aa866001615d5d565b836149d4565b92506144bc565b600092505b6144c68185615d5d565b6144d1906001615d5d565b9150509250929050565b60008060006144ea8585614424565b90925090508161455c57600185516145029190615d70565b84146145505760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d65000000604482015260640161082a565b506000915061086b9050565b61456685826144db565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b60008581526005602052604090206145b28582615b2e565b506145bf858484846149f8565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516145f59493929190615d83565b60405180910390a25050505050565b600080808061461287610871565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa15801561469b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146bf91906159b9565b90506146cc868383613f12565b9550859250505093509350939050565b606060018351101561471a576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561475857826040517fe3ba295f00000000000000000000000000000000000000000000000000000000815260040161082a9190614db1565b8251838360405160200161476e93929190615dcb565b604051602081830303815290604052905092915050565b63ffffffbf81161580159061479d5750604181811614155b156141dd5760405163a2a7201360e01b81526004810183905260240161082a565b60008060006147cc84610871565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b6001600160a01b0384163b15613ed4576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906148d69089908990889088908890600401615e2c565b6020604051808303816000875af1925050508015614911575060408051601f3d908101601f1916820190925261490e91810190615c7c565b60015b61491d57613d74615c99565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613c0c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b82516000906149e38385615d5d565b11156149ee57600080fd5b5091016020012090565b614a028483614785565b6000614a0d85611ba2565b90506001600160a01b03811615614a5e57614a27856147be565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6115aa858585858360008080614a7384610871565b9250925092508467ffffffffffffffff168167ffffffffffffffff161115614a99578094505b6001600160a01b03831615614af05760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e00604482015260640161082a565b6001600160a01b038716614b6c5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161082a565b306001600160a01b03881603614bea5760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e7472616374000000000000000000000000606482015260840161082a565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e173360008987600160405180602001604052806000815250614879565b6001600160a01b038116811461241557600080fd5b60008060408385031215614cdd57600080fd5b8235614ce881614cb5565b946020939093013593505050565b600060208284031215614d0857600080fd5b5035919050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461241557600080fd5b600060208284031215614d4f57600080fd5b8135614d5a81614d0f565b9392505050565b60005b83811015614d7c578181015183820152602001614d64565b50506000910152565b60008151808452614d9d816020860160208601614d61565b601f01601f19169290920160200192915050565b602081526000614d5a6020830184614d85565b803567ffffffffffffffff81168114614ddc57600080fd5b919050565b60008060408385031215614df457600080fd5b82359150614e0460208401614dc4565b90509250929050565b60008083601f840112614e1f57600080fd5b50813567ffffffffffffffff811115614e3757600080fd5b602083019150836020828501011115614e4f57600080fd5b9250929050565b600080600080600060808688031215614e6e57600080fd5b8535614e7981614cb5565b94506020860135614e8981614cb5565b935060408601359250606086013567ffffffffffffffff811115614eac57600080fd5b614eb888828901614e0d565b969995985093965092949392505050565b600060208284031215614edb57600080fd5b8135614d5a81614cb5565b60008060408385031215614ef957600080fd5b823591506020830135614f0b81614cb5565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614f6b57614f6b614f16565b6040525050565b600067ffffffffffffffff821115614f8c57614f8c614f16565b50601f01601f191660200190565b600082601f830112614fab57600080fd5b8135614fb681614f72565b604051614fc38282614f45565b828152856020848701011115614fd857600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614ddc57600080fd5b600080600080600080600060e0888a03121561502557600080fd5b87359650602088013567ffffffffffffffff81111561504357600080fd5b61504f8a828b01614f9a565b965050604088013561506081614cb5565b9450606088013561507081614cb5565b935061507e60808901614dc4565b925061508c60a08901614ff6565b915061509a60c08901614dc4565b905092959891949750929550565b600067ffffffffffffffff8211156150c2576150c2614f16565b5060051b60200190565b600082601f8301126150dd57600080fd5b813560206150ea826150a8565b6040516150f78282614f45565b83815260059390931b850182019282810191508684111561511757600080fd5b8286015b84811015615132578035835291830191830161511b565b509695505050505050565b600080600080600060a0868803121561515557600080fd5b853561516081614cb5565b9450602086013561517081614cb5565b9350604086013567ffffffffffffffff8082111561518d57600080fd5b61519989838a016150cc565b945060608801359150808211156151af57600080fd5b6151bb89838a016150cc565b935060808801359150808211156151d157600080fd5b506151de88828901614f9a565b9150509295509295909350565b6000806000806080858703121561520157600080fd5b843593506020850135925061521860408601614ff6565b915061522660608601614dc4565b905092959194509250565b6000806040838503121561524457600080fd5b823567ffffffffffffffff8082111561525c57600080fd5b818501915085601f83011261527057600080fd5b8135602061527d826150a8565b60405161528a8282614f45565b83815260059390931b85018201928281019150898411156152aa57600080fd5b948201945b838610156152d15785356152c281614cb5565b825294820194908201906152af565b965050860135925050808211156152e757600080fd5b506144d1858286016150cc565b600081518084526020808501945080840160005b8381101561532457815187529582019590820190600101615308565b509495945050505050565b602081526000614d5a60208301846152f4565b60008060006060848603121561535757600080fd5b833561536281614cb5565b9250602084013561537281614cb5565b929592945050506040919091013590565b60008060006060848603121561539857600080fd5b8335925060208401356153aa81614cb5565b915060408401356153ba81614cb5565b809150509250925092565b600080600080600080600060c0888a0312156153e057600080fd5b873567ffffffffffffffff8111156153f757600080fd5b6154038a828b01614e0d565b909850965050602088013561541781614cb5565b945060408801359350606088013561542e81614cb5565b925061543c60808901614ff6565b915061509a60a08901614dc4565b801515811461241557600080fd5b6000806040838503121561546b57600080fd5b823561547681614cb5565b91506020830135614f0b8161544a565b6000806040838503121561549957600080fd5b82359150614e0460208401614ff6565b60008060008060008060a087890312156154c257600080fd5b86359550602087013567ffffffffffffffff8111156154e057600080fd5b6154ec89828a01614e0d565b909650945050604087013561550081614cb5565b925061550e60608801614ff6565b915061551c60808801614dc4565b90509295509295509295565b6000806000806080858703121561553e57600080fd5b84359350602085013561555081614cb5565b9250604085013561521881614cb5565b60008060006060848603121561557557600080fd5b833592506020840135915060408401356153ba81614cb5565b600080600080606085870312156155a457600080fd5b843567ffffffffffffffff8111156155bb57600080fd5b6155c787828801614e0d565b90955093505060208501356155db81614cb5565b915060408501356155eb81614cb5565b939692955090935050565b6000806040838503121561560957600080fd5b823561561481614cb5565b91506020830135614f0b81614cb5565b60008060008060006080868803121561563c57600080fd5b85359450602086013567ffffffffffffffff81111561565a57600080fd5b61566688828901614e0d565b909550935050604086013561567a81614cb5565b9150606086013561568a81614cb5565b809150509295509295909350565b600080600080600060a086880312156156b057600080fd5b85356156bb81614cb5565b945060208601356156cb81614cb5565b93506040860135925060608601359150608086013567ffffffffffffffff8111156156f557600080fd5b6151de88828901614f9a565b60008060008060008060a0878903121561571a57600080fd5b863567ffffffffffffffff81111561573157600080fd5b61573d89828a01614e0d565b909750955050602087013561575181614cb5565b935061575f60408801614ff6565b925061576d60608801614dc4565b9150608087013561577d81614cb5565b809150509295509295509295565b60006020828403121561579d57600080fd5b815167ffffffffffffffff8111156157b457600080fd5b8201601f810184136157c557600080fd5b80516157d081614f72565b6040516157dd8282614f45565b8281528660208486010111156157f257600080fd5b615803836020830160208701614d61565b9695505050505050565b600080600080600060a0868803121561582557600080fd5b853567ffffffffffffffff81111561583c57600080fd5b61584888828901614f9a565b955050602086013561585981614cb5565b935061586760408701614ff6565b925061587560608701614dc4565b9150608086013561568a81614cb5565b600181811c9082168061589957607f821691505b6020821081036158d2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000602082840312156158ea57600080fd5b8151614d5a81614cb5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361598457615984615924565b5060010190565b60408152600061599e60408301856152f4565b82810360208401526159b081856152f4565b95945050505050565b6000602082840312156159cb57600080fd5b5051919050565b6000602082840312156159e457600080fd5b8151614d5a8161544a565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60a081526000615a3e60a08301888a6159ff565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b88815260e060208201526000615a9a60e08301898b6159ff565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b601f821115615b2957600081815260208120601f850160051c81016020861015615b0a5750805b601f850160051c820191505b81811015613ed457828155600101615b16565b505050565b815167ffffffffffffffff811115615b4857615b48614f16565b615b5c81615b568454615885565b84615ae3565b602080601f831160018114615baf5760008415615b795750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613ed4565b600085815260208120601f198616915b82811015615bde57888601518255948401946001909101908401615bbf565b5085821015615c1a57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615c5660a08301866152f4565b8281036060840152615c6881866152f4565b90508281036080840152613b4f8185614d85565b600060208284031215615c8e57600080fd5b8151614d5a81614d0f565b600060033d1115615cb25760046000803e5060005160e01c5b90565b600060443d1015615cc35790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615d1157505050505090565b8285019150815181811115615d295750505050505090565b843d8701016020828501011115615d435750505050505090565b615d5260208286010187614f45565b509095945050505050565b8082018082111561086b5761086b615924565b8181038181111561086b5761086b615924565b608081526000615d966080830187614d85565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615e08816001850160208801614d61565b835190830190615e1f816001840160208801614d61565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615e6460a0830184614d85565b97965050505050505056fea2646970667358221220ff2d4fd741de92ccee9086b9290fa0622b3c01649162875d3b66e100c6cb928a64736f6c63430008110033000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f600000000000000000000000014237fedfd5f2784ef75ab126ef06db3cb280a2b

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102f35760003560e01c80638b4dfa7511610191578063e0dba60f116100e3578063ee7eba7811610097578063f44779b911610071578063f44779b91461075e578063f9547a9e14610771578063fd0cd0d91461079d57600080fd5b8063ee7eba7814610725578063f242432a14610738578063f2fde38b1461074b57600080fd5b8063e985e9c5116100c8578063e985e9c5146106b6578063eb8ae530146106f2578063ed70554d1461070557600080fd5b8063e0dba60f14610690578063e72bf00f146106a357600080fd5b8063b6bcad2611610145578063cf4088231161011f578063cf40882314610647578063d8c9921a1461065a578063da8c229e1461066d57600080fd5b8063b6bcad26146105f9578063c20a2eb01461060c578063c658e0861461063457600080fd5b80639f56dac6116101765780639f56dac6146105c0578063a22cb465146105d3578063adf4960a146105e657600080fd5b80638b4dfa751461059c5780638da5cb5b146105af57600080fd5b806320c38e2b1161024a57806347d2e9fe116101fe5780635d3590d5116101d85780635d3590d51461056e5780636352211e14610581578063715018a61461059457600080fd5b806347d2e9fe146105285780634e1273f41461053b578063530954671461055b57600080fd5b80632b20e3971161022f5780632b20e397146104db5780632eb2c2d61461050257806333c69ea91461051557600080fd5b806320c38e2b146104b557806324c1af44146104c857600080fd5b806314ab9038116102ac5780631896f70a116102865780631896f70a146104505780631c789b59146104635780631f4e1504146104a257600080fd5b806314ab9038146103e4578063150b7a02146103f95780631534e1771461043d57600080fd5b806301ffc9a7116102dd57806301ffc9a71461036557806306fdde03146103885780630e89341c146103d157600080fd5b8062fdd58e146102f85780630178fe3f1461031e575b600080fd5b61030b610306366004614cca565b6107b0565b6040519081526020015b60405180910390f35b61033161032c366004614cf6565b610871565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610315565b610378610373366004614d3d565b61088c565b6040519015158152602001610315565b6103c46040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516103159190614db1565b6103c46103df366004614cf6565b61092e565b6103f76103f2366004614de1565b6109bb565b005b61040c610407366004614e56565b610ad4565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610315565b6103f761044b366004614ec9565b610c7c565b6103f761045e366004614ee6565b610d10565b61048a7f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f081565b6040516001600160a01b039091168152602001610315565b60065461048a906001600160a01b031681565b6103c46104c3366004614cf6565b610deb565b61030b6104d636600461500a565b610e85565b61048a7f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f681565b6103f761051036600461513d565b611213565b6103f76105233660046151eb565b6115b1565b61030b6105363660046151eb565b6117aa565b61054e610549366004615231565b611978565b604051610315919061532f565b60045461048a906001600160a01b031681565b6103f761057c366004615342565b611ab6565b61048a61058f366004614cf6565b611ba2565b6103f7611bad565b6103f76105aa366004615383565b611c13565b6000546001600160a01b031661048a565b61030b6105ce3660046153c5565b611e21565b6103f76105e1366004615458565b611fc5565b6103786105f4366004615486565b6120cd565b6103f7610607366004614ec9565b6120f2565b61061f61061a366004615486565b612418565b60405163ffffffff9091168152602001610315565b61030b6106423660046154a9565b6124c3565b6103f7610655366004615528565b61283f565b6103f7610668366004615560565b61299a565b61037861067b366004614ec9565b60036020526000908152604090205460ff1681565b6103f761069e366004615458565b612adc565b6103f76106b136600461558e565b612bb4565b6103786106c43660046155f6565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6103f761070036600461558e565b612cc5565b61030b610713366004614cf6565b60016020526000908152604090205481565b6103f7610733366004615624565b6130ed565b6103f7610746366004615698565b6131e3565b6103f7610759366004614ec9565b613318565b61037861076c366004614ee6565b6133f7565b61078461077f366004615701565b613452565b60405167ffffffffffffffff9091168152602001610315565b6103786107ab366004614cf6565b6137cf565b60006001600160a01b0383166108335760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061083e83610871565b50509050836001600160a01b0316816001600160a01b03160361086557600191505061086b565b60009150505b92915050565b600080600061087f846138a1565b9250925092509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fcbf196fa00000000000000000000000000000000000000000000000000000000148061091f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b8061086b575061086b826138d8565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa158015610993573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261086b919081019061578b565b816109c681336133f7565b6109ec5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b82601060006109fa83610871565b5091505063ffffffff8282161615610a285760405163a2a7201360e01b81526004810184905260240161082a565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f06001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f61614610b38576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610b4a8789018961580d565b84516020860120949950929750909550935091508990808214610ba3576040517fc65c3ccc000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161082a565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610c2457600080fd5b505af1158015610c38573d6000803e3d6000fd5b50505050610c4987878787876139bb565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b6000546001600160a01b03163314610cd65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610d1b81336133f7565b610d415760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8260086000610d4f83610871565b5091505063ffffffff8282161615610d7d5760405163a2a7201360e01b81526004810184905260240161082a565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690631896f70a90604401610a9a565b60056020526000908152604090208054610e0490615885565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3090615885565b8015610e7d5780601f10610e5257610100808354040283529160200191610e7d565b820191906000526020600020905b815481529060010190602001808311610e6057829003601f168201915b505050505081565b600087610e9281336133f7565b610eb85760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8888805190602001206000610ef48383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f016906302571be390602401602060405180830381865afa158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906158d8565b90506001600160a01b038116610fe6576000610fb785610871565b509150506020811615610fe05760405163a2a7201360e01b81526004810184905260240161082a565b5061101c565b6000610ff183610871565b50915050604081161561101a5760405163a2a7201360e01b81526004810184905260240161082a565b505b8b5160208d01206110548e82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506110628e888b8b613b15565b975061106d876137cf565b61113c576040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690635ef2c7f09060a401600060405180830381600087803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b505050506111378e888f8f8d8d613b5b565b611202565b6040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690635ef2c7f09060a401600060405180830381600087803b1580156111dc57600080fd5b505af11580156111f0573d6000803e3d6000fd5b505050506112028e888f8f8d8d613c15565b505050505050979650505050505050565b815183511461128a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b0384166113065760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03851633148061134057506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6113b25760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161082a565b60005b83518110156115445760008482815181106113d2576113d26158f5565b6020026020010151905060008483815181106113f0576113f06158f5565b60200260200101519050600080600061140885610871565b925092509250611419826004161590565b6114395760405163a2a7201360e01b81526004810186905260240161082a565b83600114801561145a57508a6001600160a01b0316836001600160a01b0316145b6114cc5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905550505050508061153d90615953565b90506113b5565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161159492919061598b565b60405180910390a46115aa338686868686613cd0565b5050505050565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806115e684610871565b91945092509050600080806115fa8b610871565b9093509150507ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8b016117005761163187336133f7565b6116575760405163168ab55d60e31b81526004810188905233602482015260440161082a565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018b90527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156116d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f991906159b9565b9250611734565b61170a8b336133f7565b6117305760405163168ab55d60e31b81526004810188905233602482015260440161082a565b8092505b61173f878a84613edc565b61174a888585613f12565b9750604085161580159061176c57508463ffffffff1689861763ffffffff1614155b1561178d5760405163a2a7201360e01b81526004810188905260240161082a565b9784179761179d87878b8b613f5c565b5050505050505050505050565b3360009081526003602052604081205460ff1661182f5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c6572000000000000000000000000000000000000000000000000606482015260840161082a565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701602080830191909152818301889052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b03169063c475abff906044016020604051808303816000875af1158015611906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192a91906159b9565b9150611935816137cf565b1561196f576000808061194784610871565b925092509250611958868287613f12565b955061196b848460408a86171789613fb8565b5050505b50949350505050565b606081518351146119f15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161082a565b6000835167ffffffffffffffff811115611a0d57611a0d614f16565b604051908082528060200260200182016040528015611a36578160200160208202803683370190505b50905060005b8451811015611aae57611a81858281518110611a5a57611a5a6158f5565b6020026020010151858381518110611a7457611a746158f5565b60200260200101516107b0565b828281518110611a9357611a936158f5565b6020908102919091010152611aa781615953565b9050611a3c565b509392505050565b6000546001600160a01b03163314611b105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9c91906159d2565b50505050565b600061086b82614029565b6000546001600160a01b03163314611c075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b611c11600061403f565b565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870160208083019190915281830186905282518083038401815260609092019092528051910120611c6781336133f7565b611c8d5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b6001600160a01b038216611cd8576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260240161082a565b306001600160a01b03841603611d25576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260240161082a565b604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870160208083019190915281830187905282518083038401815260609092019092528051910120611d7a905b836140a7565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f616906342842e0e90606401600060405180830381600087803b158015611e0357600080fd5b505af1158015611e17573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611ea65760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c6572000000000000000000000000000000000000000000000000606482015260840161082a565b60008888604051611eb89291906159ef565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7191906159b9565b9150611fb889898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896139bb565b5050979650505050505050565b6001600160a01b03821633036120435760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161082a565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806120d984610871565b50841663ffffffff908116908516149250505092915050565b6000546001600160a01b0316331461214c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6006546001600160a01b03161561229e576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f69091169063a22cb46590604401600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0909116925063a22cb4659150604401600060405180830381600087803b15801561228557600080fd5b505af1158015612299573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515612415576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f69091169063a22cb46590604401600060405180830381600087803b15801561236157600080fd5b505af1158015612375573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0909116925063a22cb4659150604401600060405180830381600087803b15801561240157600080fd5b505af11580156115aa573d6000803e3d6000fd5b50565b60008261242581336133f7565b61244b5760405163168ab55d60e31b81526004810182905233602482015260440161082a565b836002600061245983610871565b5091505063ffffffff82821616156124875760405163a2a7201360e01b81526004810184905260240161082a565b61249187876141b2565b6000808061249e8a610871565b92509250925081891798506124b58a848b84613f5c565b509698975050505050505050565b6000866124d081336133f7565b6124f65760405163168ab55d60e31b81526004810182905233602482015260440161082a565b8787876040516125079291906159ef565b604051809103902060006125428383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f016906302571be390602401602060405180830381865afa1580156125c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ea91906158d8565b90506001600160a01b03811661263457600061260585610871565b50915050602081161561262e5760405163a2a7201360e01b81526004810184905260240161082a565b5061266a565b600061263f83610871565b5091505060408116156126685760405163a2a7201360e01b81526004810184905260240161082a565b505b60008b8b60405161267c9291906159ef565b604051809103902090506126b78d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506126c58d888b8b613b15565b97506126d0876137cf565b6127dd576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f016906306ab5923906064016020604051808303816000875af1158015612761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061278591906159b9565b506127d88d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613b5b565b61282f565b61282f8d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613c15565b5050505050509695505050505050565b8361284a81336133f7565b6128705760405163168ab55d60e31b81526004810182905233602482015260440161082a565b84601c600061287e83610871565b5091505063ffffffff82821616156128ac5760405163a2a7201360e01b81526004810184905260240161082a565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0169063cf40882390608401600060405180830381600087803b15801561294557600080fd5b505af1158015612959573d6000803e3d6000fd5b50505050600061296b8960001c610871565b5050905061298f81898b60001c6001604051806020016040528060008152506141e1565b505050505050505050565b604080516020808201869052818301859052825180830384018152606090920190925280519101206129cc81336133f7565b6129f25760405163168ab55d60e31b81526004810182905233602482015260440161082a565b7ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8401612a4b576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382161580612a6957506001600160a01b03821630145b15612aab576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260240161082a565b60408051602080820187905281830186905282518083038401815260609092019092528051910120611b9c90611d74565b6000546001600160a01b03163314612b365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b60008484604051612bc69291906159ef565b60405190819003902090506000612c247f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612c328361438f565b6006546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612c89908b908b908b90889088908d90600401615a2a565b600060405180830381600087803b158015612ca357600080fd5b505af1158015612cb7573d6000803e3d6000fd5b505050505050505050505050565b600080612d0c600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144249050565b915091506000612d558288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144db9050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507ff8f6fb0babfd440c66db8d41cbd39c99f6249b65713df575559a055502b478ff8201612dd9576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290526000907f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f06001600160a01b0316906302571be390602401602060405180830381865afa158015612e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7e91906158d8565b90506001600160a01b0381163314801590612f3f57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0169063e985e9c590604401602060405180830381865afa158015612f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f3d91906159d2565b155b15612f665760405163168ab55d60e31b81526004810183905233602482015260440161082a565b6001600160a01b03861615613011576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0387811660248301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690631896f70a90604401600060405180830381600087803b158015612ff857600080fd5b505af115801561300c573d6000803e3d6000fd5b505050505b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f06001600160a01b031690635b0fc9c390604401600060405180830381600087803b15801561309257600080fd5b505af11580156130a6573d6000803e3d6000fd5b5050505061298f828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d9350915081905061459a565b600084846040516130ff9291906159ef565b60405180910390209050600061313c8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060008061314a8361438f565b6006546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af44906131a6908c908c908c908c908c906000908b908b90600401615a80565b600060405180830381600087803b1580156131c057600080fd5b505af11580156131d4573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b03841661325f5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161082a565b6001600160a01b03851633148061329957506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b61330b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f7665640000000000000000000000000000000000000000000000606482015260840161082a565b6115aa85858585856141e1565b6000546001600160a01b031633146133725760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082a565b6001600160a01b0381166133ee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161082a565b6124158161403f565b60008061340384611ba2565b9050826001600160a01b0316816001600160a01b0316148061344a57506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b60008087876040516134659291906159ef565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b031690636352211e90602401602060405180830381865afa1580156134ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351291906158d8565b90506001600160a01b03811633148015906135d357506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f6169063e985e9c590604401602060405180830381865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d191906159d2565b155b1561364357604080517f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b87016020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a40161082a565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f616906323b872dd90606401600060405180830381600087803b1580156136cc57600080fd5b505af11580156136e0573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b15801561376557600080fd5b505af1158015613779573d6000803e3d6000fd5b505050506137c289898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886139bb565b9998505050505050505050565b6000806137db83611ba2565b6001600160a01b03161415801561086b57506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f016906302571be390602401602060405180830381865afa15801561386d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061389191906158d8565b6001600160a01b03161492915050565b6000818152600160205260408120549060c082901c82428210156138c857600092506138d0565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a2600000000000000000000000000000000000000000000000000000000148061396b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061086b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461086b565b8451602086012060009081613a177f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b870183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000613a26828488614604565b97509150613a5d90507f070904f45402bbf3992472be342c636609db649a8ec20a8aaa65faaafd4b8701838b8b60408c178b613b5b565b6001600160a01b03851615613b08576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690631896f70a90604401600060405180830381600087803b158015613aef57600080fd5b505af1158015613b03573d6000803e3d6000fd5b505050505b5093979650505050505050565b600080613b2185610871565b92505050600080613b348860001c610871565b9250925050613b44878784613edc565b613b4f858483613f12565b98975050505050505050565b60008681526005602052604081208054613bfd918791613b7a90615885565b80601f0160208091040260200160405190810160405280929190818152602001828054613ba690615885565b8015613bf35780601f10613bc857610100808354040283529160200191613bf3565b820191906000526020600020905b815481529060010190602001808311613bd657829003601f168201915b50505050506146dc565b9050613c0c868286868661459a565b50505050505050565b6000613c2086611ba2565b90506000613c4686600560008b81526020019081526020016000208054613b7a90615885565b6000888152600560205260409020805491925090613c6390615885565b9050600003613c86576000878152600560205260409020613c848282615b2e565b505b613c9287838686613f5c565b6001600160a01b038516613cb057613cab8760006140a7565b611e17565b611e1782868960001c6001604051806020016040528060008152506141e1565b6001600160a01b0384163b15613ed4576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613d2d9089908990889088908890600401615c2a565b6020604051808303816000875af1925050508015613d68575060408051601f3d908101601f19168201909252613d6591810190615c7c565b60015b613e1d57613d74615c99565b806308c379a003613dad5750613d88615cb5565b80613d935750613daf565b8060405162461bcd60e51b815260040161082a9190614db1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161082a565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613c0c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b505050505050565b6040828116146001821615818015613ef15750805b156115aa5760405163a2a7201360e01b81526004810186905260240161082a565b60008167ffffffffffffffff168467ffffffffffffffff161115613f34578193505b8267ffffffffffffffff168467ffffffffffffffff161015613f54578293505b509192915050565b613f6884848484613fb8565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b613fc28483614785565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b16179055611b9c565b60008061403583610871565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6140b28260016120cd565b156140d35760405163a2a7201360e01b81526004810183905260240161082a565b6140dc826147be565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f01690635b0fc9c390604401600060405180830381600087803b15801561415f57600080fd5b505af1158015614173573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612ba8565b60408116156141dd5760405163168ab55d60e31b81526004810183905233602482015260440161082a565b5050565b60008060006141ef86610871565b925092509250614200826004161590565b6142205760405163a2a7201360e01b81526004810187905260240161082a565b8460011480156142415750876001600160a01b0316836001600160a01b0316145b6142b35760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161082a565b866001600160a01b0316836001600160a01b0316036142d4575050506115aa565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e17338989898989614879565b60065460009081906001600160a01b03166143d6576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6143e083336133f7565b6144065760405163168ab55d60e31b81526004810184905233602482015260440161082a565b61440f83610871565b909350915061441f9050836147be565b915091565b600080835183106144775760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e64730000604482015260640161082a565b600084848151811061448b5761448b6158f5565b016020015160f81c905080156144b7576144b0856144aa866001615d5d565b836149d4565b92506144bc565b600092505b6144c68185615d5d565b6144d1906001615d5d565b9150509250929050565b60008060006144ea8585614424565b90925090508161455c57600185516145029190615d70565b84146145505760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d65000000604482015260640161082a565b506000915061086b9050565b61456685826144db565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b60008581526005602052604090206145b28582615b2e565b506145bf858484846149f8565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516145f59493929190615d83565b60405180910390a25050505050565b600080808061461287610871565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f66001600160a01b03169063d6e4fa8690602401602060405180830381865afa15801561469b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146bf91906159b9565b90506146cc868383613f12565b9550859250505093509350939050565b606060018351101561471a576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561475857826040517fe3ba295f00000000000000000000000000000000000000000000000000000000815260040161082a9190614db1565b8251838360405160200161476e93929190615dcb565b604051602081830303815290604052905092915050565b63ffffffbf81161580159061479d5750604181811614155b156141dd5760405163a2a7201360e01b81526004810183905260240161082a565b60008060006147cc84610871565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b6001600160a01b0384163b15613ed4576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906148d69089908990889088908890600401615e2c565b6020604051808303816000875af1925050508015614911575060408051601f3d908101601f1916820190925261490e91810190615c7c565b60015b61491d57613d74615c99565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613c0c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161082a565b82516000906149e38385615d5d565b11156149ee57600080fd5b5091016020012090565b614a028483614785565b6000614a0d85611ba2565b90506001600160a01b03811615614a5e57614a27856147be565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6115aa858585858360008080614a7384610871565b9250925092508467ffffffffffffffff168167ffffffffffffffff161115614a99578094505b6001600160a01b03831615614af05760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e00604482015260640161082a565b6001600160a01b038716614b6c5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161082a565b306001600160a01b03881603614bea5760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e7472616374000000000000000000000000606482015260840161082a565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e173360008987600160405180602001604052806000815250614879565b6001600160a01b038116811461241557600080fd5b60008060408385031215614cdd57600080fd5b8235614ce881614cb5565b946020939093013593505050565b600060208284031215614d0857600080fd5b5035919050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461241557600080fd5b600060208284031215614d4f57600080fd5b8135614d5a81614d0f565b9392505050565b60005b83811015614d7c578181015183820152602001614d64565b50506000910152565b60008151808452614d9d816020860160208601614d61565b601f01601f19169290920160200192915050565b602081526000614d5a6020830184614d85565b803567ffffffffffffffff81168114614ddc57600080fd5b919050565b60008060408385031215614df457600080fd5b82359150614e0460208401614dc4565b90509250929050565b60008083601f840112614e1f57600080fd5b50813567ffffffffffffffff811115614e3757600080fd5b602083019150836020828501011115614e4f57600080fd5b9250929050565b600080600080600060808688031215614e6e57600080fd5b8535614e7981614cb5565b94506020860135614e8981614cb5565b935060408601359250606086013567ffffffffffffffff811115614eac57600080fd5b614eb888828901614e0d565b969995985093965092949392505050565b600060208284031215614edb57600080fd5b8135614d5a81614cb5565b60008060408385031215614ef957600080fd5b823591506020830135614f0b81614cb5565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614f6b57614f6b614f16565b6040525050565b600067ffffffffffffffff821115614f8c57614f8c614f16565b50601f01601f191660200190565b600082601f830112614fab57600080fd5b8135614fb681614f72565b604051614fc38282614f45565b828152856020848701011115614fd857600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614ddc57600080fd5b600080600080600080600060e0888a03121561502557600080fd5b87359650602088013567ffffffffffffffff81111561504357600080fd5b61504f8a828b01614f9a565b965050604088013561506081614cb5565b9450606088013561507081614cb5565b935061507e60808901614dc4565b925061508c60a08901614ff6565b915061509a60c08901614dc4565b905092959891949750929550565b600067ffffffffffffffff8211156150c2576150c2614f16565b5060051b60200190565b600082601f8301126150dd57600080fd5b813560206150ea826150a8565b6040516150f78282614f45565b83815260059390931b850182019282810191508684111561511757600080fd5b8286015b84811015615132578035835291830191830161511b565b509695505050505050565b600080600080600060a0868803121561515557600080fd5b853561516081614cb5565b9450602086013561517081614cb5565b9350604086013567ffffffffffffffff8082111561518d57600080fd5b61519989838a016150cc565b945060608801359150808211156151af57600080fd5b6151bb89838a016150cc565b935060808801359150808211156151d157600080fd5b506151de88828901614f9a565b9150509295509295909350565b6000806000806080858703121561520157600080fd5b843593506020850135925061521860408601614ff6565b915061522660608601614dc4565b905092959194509250565b6000806040838503121561524457600080fd5b823567ffffffffffffffff8082111561525c57600080fd5b818501915085601f83011261527057600080fd5b8135602061527d826150a8565b60405161528a8282614f45565b83815260059390931b85018201928281019150898411156152aa57600080fd5b948201945b838610156152d15785356152c281614cb5565b825294820194908201906152af565b965050860135925050808211156152e757600080fd5b506144d1858286016150cc565b600081518084526020808501945080840160005b8381101561532457815187529582019590820190600101615308565b509495945050505050565b602081526000614d5a60208301846152f4565b60008060006060848603121561535757600080fd5b833561536281614cb5565b9250602084013561537281614cb5565b929592945050506040919091013590565b60008060006060848603121561539857600080fd5b8335925060208401356153aa81614cb5565b915060408401356153ba81614cb5565b809150509250925092565b600080600080600080600060c0888a0312156153e057600080fd5b873567ffffffffffffffff8111156153f757600080fd5b6154038a828b01614e0d565b909850965050602088013561541781614cb5565b945060408801359350606088013561542e81614cb5565b925061543c60808901614ff6565b915061509a60a08901614dc4565b801515811461241557600080fd5b6000806040838503121561546b57600080fd5b823561547681614cb5565b91506020830135614f0b8161544a565b6000806040838503121561549957600080fd5b82359150614e0460208401614ff6565b60008060008060008060a087890312156154c257600080fd5b86359550602087013567ffffffffffffffff8111156154e057600080fd5b6154ec89828a01614e0d565b909650945050604087013561550081614cb5565b925061550e60608801614ff6565b915061551c60808801614dc4565b90509295509295509295565b6000806000806080858703121561553e57600080fd5b84359350602085013561555081614cb5565b9250604085013561521881614cb5565b60008060006060848603121561557557600080fd5b833592506020840135915060408401356153ba81614cb5565b600080600080606085870312156155a457600080fd5b843567ffffffffffffffff8111156155bb57600080fd5b6155c787828801614e0d565b90955093505060208501356155db81614cb5565b915060408501356155eb81614cb5565b939692955090935050565b6000806040838503121561560957600080fd5b823561561481614cb5565b91506020830135614f0b81614cb5565b60008060008060006080868803121561563c57600080fd5b85359450602086013567ffffffffffffffff81111561565a57600080fd5b61566688828901614e0d565b909550935050604086013561567a81614cb5565b9150606086013561568a81614cb5565b809150509295509295909350565b600080600080600060a086880312156156b057600080fd5b85356156bb81614cb5565b945060208601356156cb81614cb5565b93506040860135925060608601359150608086013567ffffffffffffffff8111156156f557600080fd5b6151de88828901614f9a565b60008060008060008060a0878903121561571a57600080fd5b863567ffffffffffffffff81111561573157600080fd5b61573d89828a01614e0d565b909750955050602087013561575181614cb5565b935061575f60408801614ff6565b925061576d60608801614dc4565b9150608087013561577d81614cb5565b809150509295509295509295565b60006020828403121561579d57600080fd5b815167ffffffffffffffff8111156157b457600080fd5b8201601f810184136157c557600080fd5b80516157d081614f72565b6040516157dd8282614f45565b8281528660208486010111156157f257600080fd5b615803836020830160208701614d61565b9695505050505050565b600080600080600060a0868803121561582557600080fd5b853567ffffffffffffffff81111561583c57600080fd5b61584888828901614f9a565b955050602086013561585981614cb5565b935061586760408701614ff6565b925061587560608701614dc4565b9150608086013561568a81614cb5565b600181811c9082168061589957607f821691505b6020821081036158d2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000602082840312156158ea57600080fd5b8151614d5a81614cb5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361598457615984615924565b5060010190565b60408152600061599e60408301856152f4565b82810360208401526159b081856152f4565b95945050505050565b6000602082840312156159cb57600080fd5b5051919050565b6000602082840312156159e457600080fd5b8151614d5a8161544a565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60a081526000615a3e60a08301888a6159ff565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b88815260e060208201526000615a9a60e08301898b6159ff565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b601f821115615b2957600081815260208120601f850160051c81016020861015615b0a5750805b601f850160051c820191505b81811015613ed457828155600101615b16565b505050565b815167ffffffffffffffff811115615b4857615b48614f16565b615b5c81615b568454615885565b84615ae3565b602080601f831160018114615baf5760008415615b795750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613ed4565b600085815260208120601f198616915b82811015615bde57888601518255948401946001909101908401615bbf565b5085821015615c1a57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615c5660a08301866152f4565b8281036060840152615c6881866152f4565b90508281036080840152613b4f8185614d85565b600060208284031215615c8e57600080fd5b8151614d5a81614d0f565b600060033d1115615cb25760046000803e5060005160e01c5b90565b600060443d1015615cc35790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615d1157505050505090565b8285019150815181811115615d295750505050505090565b843d8701016020828501011115615d435750505050505090565b615d5260208286010187614f45565b509095945050505050565b8082018082111561086b5761086b615924565b8181038181111561086b5761086b615924565b608081526000615d966080830187614d85565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615e08816001850160208801614d61565b835190830190615e1f816001840160208801614d61565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615e6460a0830184614d85565b97965050505050505056fea2646970667358221220ff2d4fd741de92ccee9086b9290fa0622b3c01649162875d3b66e100c6cb928a64736f6c63430008110033

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

000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f600000000000000000000000014237fedfd5f2784ef75ab126ef06db3cb280a2b

-----Decoded View---------------
Arg [0] : _ons (address): 0xf81dC90085379ACC1B5c3C876F92A6cE55dB53F0
Arg [1] : _registrar (address): 0xbE416295d2c3afA7A903886a7725a3ed06A382f6
Arg [2] : _metadataService (address): 0x14237fEdFD5F2784ef75aB126eF06Db3Cb280a2B

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f81dc90085379acc1b5c3c876f92a6ce55db53f0
Arg [1] : 000000000000000000000000be416295d2c3afa7a903886a7725a3ed06a382f6
Arg [2] : 00000000000000000000000014237fedfd5f2784ef75ab126ef06db3cb280a2b


[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.