pragma solidity ^0.8.0;















contract SubDomainMarket is
    WrapNFT,
    Order,
    Whitelist,
    Ownable,
    ISubDomainMarket
{
    ENS public ens;
    ISubDomainNFTMinter public minter;
    mapping(bytes32 => uint64) subNodeExpiries;
    mapping(uint256 => uint64) subNodeMaxExpiries;
    bool public isPausing;

    modifier whenNotPaused() {
        require(!isPausing, "is pausing");
        _;
    }

    function initialize(
        address owner_,
        address beneficiary_,
        address originalAddress_,
        address ens_,
        address minter_
    ) public initializer {
        __ReentrancyGuard_init();
        initOwnable(owner_);
        beneficiary = payable(beneficiary_);
        originalAddress = originalAddress_;
        ens = ENS(ens_);
        minter = ISubDomainNFTMinter(minter_);
        _fee = 10000;
    }

    function initList(
        uint256 parentId,
        address token,
        uint256 pricePerYear,
        uint64 minDuration,
        uint64 expiry
    ) external whenNotPaused override {
        stake(parentId);
        IBaseRegistrar(originalAddress).reclaim(parentId, address(this));
        list(parentId, token, pricePerYear, minDuration, expiry);
        minter.deploySubDomainNFT(parentId, msg.sender);
    }

    function list(
        uint256 parentId,
        address token,
        uint256 pricePerYear,
        uint64 minDuration,
        uint64 expiry
    ) public whenNotPaused override {
        require(
            IBaseRegistrar(originalAddress).nameExpires(parentId) >= expiry,
            "invalid expiry"
        );
        super.list(parentId, token, pricePerYear, minDuration, expiry);
    }

    function registerSubnode(
        RegisterParam calldata registerParam,
        MerkleParam calldata merkleParam
    ) external payable whenNotPaused override {
        require(
            inWhiteList(registerParam.parentId, msg.sender, merkleParam),
            "not in whitelist "
        );
        bytes32 label = ENSUtils.getLabel(registerParam.subName);
        bytes32 node = ENSUtils.getNode(registerParam.parentId);
        bytes32 subnode = keccak256(abi.encodePacked(node, label));
        require(subNodeExpiries[subnode] < block.timestamp, "not expired");
        ens.setSubnodeRecord(
            node,
            label,
            registerParam.to,
            registerParam.ens_resolver,
            0
        );
        uint64 expiry = fulfill(
            registerParam.parentId,
            registerParam.subName,
            uint64(block.timestamp),
            registerParam.duration,
            registerParam.token,
            registerParam.pricePerYear
        );
        subNodeExpiries[subnode] = expiry;
        updateMaxExpiry(registerParam.parentId, expiry);
        addMerkleMinted(registerParam.parentId, msg.sender);
        minter.mintSubDomainNFT(
            registerParam.parentId,
            subnode,
            expiry,
            registerParam.to
        );
        emit RegisterSubnode(
            registerParam.parentId,
            registerParam.subName,
            expiry,
            registerParam.to
        );
    }

    function renewSubnode(
        uint256 parentId,
        string calldata subName,
        uint64 duration,
        address token,
        uint256 pricePerYear
    ) external payable whenNotPaused  {
        bytes32 label = ENSUtils.getLabel(subName);
        bytes32 node = ENSUtils.getNode(parentId);
        bytes32 subnode = keccak256(abi.encodePacked(node, label));
        require(ens.recordExists(subnode), "record not exists");
        require(
            subNodeExpiries[subnode] > block.timestamp,
            "subnode is expired"
        );
        uint64 expiry = fulfill(
            parentId,
            subName,
            subNodeExpiries[subnode],
            duration,
            token,
            pricePerYear
        );
        subNodeExpiries[subnode] = expiry;
        updateMaxExpiry(parentId, expiry);
        emit RenewSubnode(parentId, subName, expiry);
        minter.renewSubDomainNFT(parentId, subnode, expiry);
    }

    function setSubnodeOwner(
        uint256 parentId,
        bytes32 label,
        address to
    ) public {
        address _owner = minter.ownerOfSubDomainNFT(parentId, label);
        require(_owner == msg.sender, "only owner of subDomainNFT");
        bytes32 node = ENSUtils.getNode(parentId);
        ens.setSubnodeOwner(node, label, to);
    }

    function expireOf(bytes32 subNode) public view returns (uint64) {
        return subNodeExpiries[subNode];
    }

    function setABI(
        uint256 parentId,
        uint256 contentType,
        bytes calldata data
    ) external onlyApprovedOrOwner(parentId) {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setABI(node, contentType, data);
    }

    function setAddr(uint256 parentId, address addr)
        external
        onlyApprovedOrOwner(parentId)
    {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setAddr(node, addr);
    }

    function setAddr(
        uint256 parentId,
        uint256 coinType,
        bytes calldata a
    ) external onlyApprovedOrOwner(parentId) {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setAddr(node, coinType, a);
    }

    function setContenthash(uint256 parentId, bytes calldata hash)
        external
        onlyApprovedOrOwner(parentId)
    {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setContenthash(node, hash);
    }

    function setDnsrr(uint256 parentId, bytes calldata data)
        external
        onlyApprovedOrOwner(parentId)
    {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setDnsrr(node, data);
    }

    function setName(uint256 parentId, string calldata _name)
        external
        onlyApprovedOrOwner(parentId)
    {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setName(node, _name);
    }

    function setPubkey(
        uint256 parentId,
        bytes32 x,
        bytes32 y
    ) external onlyApprovedOrOwner(parentId) {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setPubkey(node, x, y);
    }

    function setText(
        uint256 parentId,
        string calldata key,
        string calldata value
    ) external onlyApprovedOrOwner(parentId) {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setText(node, key, value);
    }

    function setInterface(
        uint256 parentId,
        bytes4 interfaceID,
        address implementer
    ) external onlyApprovedOrOwner(parentId) {
        bytes32 node = ENSUtils.getNode(parentId);
        IResolver(ens.resolver(node)).setInterface(
            node,
            interfaceID,
            implementer
        );
    }

    function multicall(bytes[] calldata data)
        external
        returns (bytes[] memory results)
    {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(
                data[i]
            );
            require(success);
            results[i] = result;
        }
        return results;
    }

    function setPause(bool pause_) public onlyOwner {
        isPausing = pause_;
        if (isPausing) {
            emit Paused(address(this));
        } else {
            emit Unpaused(address(this));
        }
    }

    function updateMaxExpiry(uint256 parentId, uint64 expiry) internal {
        if (expiry > subNodeMaxExpiries[parentId]) {
            subNodeMaxExpiries[parentId] = expiry;
        }
    }

    function delist(uint256 parentId)
        public
        virtual
        override
        whenNotPaused
        onlyApprovedOrOwner(parentId)
    {
        delete whitelistType[parentId];
        delete merkleRootMapping[parentId];
        super.delist(parentId);
    }

    function redeem(uint256 parentId) public virtual override whenNotPaused{
        require(
            subNodeMaxExpiries[parentId] < block.timestamp,
            "some subnodes are not expired"
        );
        delist(parentId);
        super.redeem(parentId);
    }

    function isAuthorised(uint256 parentId)
        internal
        view
        virtual
        override
        returns (bool)
    {
        return _isApprovedOrOwner(msg.sender, parentId);
    }
}
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"paymentTokens","type":"address[]"}],"name":"ClaimFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"Delist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"},{"indexed":false,"internalType":"string","name":"subName","type":"string"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"income","type":"uint256"}],"name":"Fulfill","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"pricePerYear","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"minDuration","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"List","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingOwner","type":"address"}],"name":"NewPendingOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"},{"indexed":false,"internalType":"string","name":"subName","type":"string"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"RegisterSubnode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"},{"indexed":false,"internalType":"string","name":"subName","type":"string"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"RenewSubnode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"fee","type":"uint16"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"parentId","type":"uint256"},{"indexed":false,"internalType":"enum IWhitelist.WhitelistType","name":"value","type":"uint8"}],"name":"UpdeteWhitelistType","type":"event"},{"inputs":[],"name":"acceptOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOfFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address","name":"who","type":"address"}],"name":"balanceOfIncomes","outputs":[{"internalType":"uint256[]","name":"incomes","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"claimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"claimIncomes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"delist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ens","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"subNode","type":"bytes32"}],"name":"expireOf","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"addr","type":"address"}],"name":"getMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"getOrderForm","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"pricePerYear","type":"uint256"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint64","name":"minDuration","type":"uint64"}],"internalType":"struct IOrder.OrderForm","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"addr","type":"address"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct IWhitelist.MerkleParam","name":"merkleParam","type":"tuple"}],"name":"inWhiteList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"pricePerYear","type":"uint256"},{"internalType":"uint64","name":"minDuration","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"initList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"beneficiary_","type":"address"},{"internalType":"address","name":"originalAddress_","type":"address"},{"internalType":"address","name":"ens_","type":"address"},{"internalType":"address","name":"minter_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPausing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"pricePerYear","type":"uint256"},{"internalType":"uint64","name":"minDuration","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"list","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"contract ISubDomainNFTMinter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"originalAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"string","name":"subName","type":"string"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint64","name":"duration","type":"uint64"},{"internalType":"address","name":"ens_resolver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"pricePerYear","type":"uint256"}],"internalType":"struct ISubDomainMarket.RegisterParam","name":"registerParam","type":"tuple"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct IWhitelist.MerkleParam","name":"merkleParam","type":"tuple"}],"name":"registerSubnode","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"string","name":"subName","type":"string"},{"internalType":"uint64","name":"duration","type":"uint64"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"pricePerYear","type":"uint256"}],"name":"renewSubnode","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"uint256","name":"contentType","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setABI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"addr","type":"address"}],"name":"setAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"uint256","name":"coinType","type":"uint256"},{"internalType":"bytes","name":"a","type":"bytes"}],"name":"setAddr","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":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes","name":"hash","type":"bytes"}],"name":"setContenthash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setDnsrr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"fee","type":"uint16"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes4","name":"interfaceID","type":"bytes4"},{"internalType":"address","name":"implementer","type":"address"}],"name":"setInterface","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pause_","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes32","name":"x","type":"bytes32"},{"internalType":"bytes32","name":"y","type":"bytes32"}],"name":"setPubkey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"to","type":"address"}],"name":"setSubnodeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"value","type":"string"}],"name":"setText","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"enum IWhitelist.WhitelistType","name":"value","type":"uint8"}],"name":"setWhitelistType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"stake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pendingOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"},{"internalType":"address","name":"who","type":"address"}],"name":"whitelistOf","outputs":[{"internalType":"enum IWhitelist.WhitelistType","name":"type_","type":"uint8"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"uint256","name":"minted_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"parentId","type":"uint256"}],"name":"whitelistTypeOf","outputs":[{"internalType":"enum IWhitelist.WhitelistType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]