ETH Price: $3,685.01 (+1.52%)
 

Overview

Max Total Supply

96 QUEENE

Holders

63

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
equious.eth
Balance
5 QUEENE
0xb54ca849f322dcc18d54030109ec89b2dc62a282
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Portraits collection of Beloved QueenE. Queene is an experimental attempt to improve the formation of on-chain avatar communities.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
QueenEV2

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 700 runs

Other Settings:
default evmVersion
File 1 of 39 : QueenEV2.sol
// SPDX-License-Identifier: MIT

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

pragma solidity ^0.8.9;

import {EIP712} from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {RoyalLibrary} from "../lib/RoyalLibrary.sol";
import {IQueenTraits} from "../../interfaces/IQueenTraits.sol";
import {IQueenE} from "../../interfaces/IQueenE.sol";
import {IQueenPalace} from "../../interfaces/IQueenPalace.sol";
import {QueenParliamentV2} from "./QueenParliamentV2.sol";
import {IProxyRegistry} from "../external/opensea/IProxyRegistry.sol";
import {ERC721} from "../base/ERC721.sol";
import {IERC721} from "../../interfaces/IERC721.sol";
import {IQueenLab} from "../../interfaces/IQueenLab.sol";

contract QueenEV2 is IQueenE, QueenParliamentV2 {
  event FinalArtSet(uint256 indexed queeneId, string artUri);
  event QueenEBurned(uint256 indexed queeneId);

  event SirAwarded(uint256 indexed queeneId, address sirAddress);
  event MuseumAwarded(uint256 indexed queeneId, address museumAddress);

  using EnumerableSet for EnumerableSet.AddressSet;
  using EnumerableSet for EnumerableSet.UintSet;
  IQueenE public oldContract;
  // if trait storage contract can be updated
  bool public isTraitStorageLocked;
  // if lab contract can be updated
  bool public isLabLocked;
  // if minter contract can be updated
  bool public isMinterLocked;

  // QueenE id that will be used for next auction
  uint256 public override _currentAuctionQueenE;

  string private _ipfsProvider = "ipfs://";
  string private _ipfsContractURIHash;

  // OpenSea's Proxy Registry
  IProxyRegistry public immutable proxyRegistry;

  /************************** vMODIFIERS REGION *************************************************** */

  /**
   * @notice Require that the sender is a Sir or DAO Executor.
   */
  modifier onlySirOrDAO() {
    isSirOrDAO();
    _;
  }
  modifier onlyOwnerOrArtist() {
    require(
      msg.sender == owner() || queenPalace.isArtist(msg.sender),
      "Not Owner, Artist"
    );
    _;
  }

  /**
   *  Return if given address have Sir Title
   *
   */
  function isSirOrDAO() private view {
    require(
      IsSir(msg.sender) || msg.sender == queenPalace.daoExecutor(),
      "Nosir"
    );
  }

  /************************** ^MODIFIERS REGION *************************************************** */

  /************************** vCONSTRUCTOR REGION *************************************************** */

  constructor(
    IQueenPalace _queenPalace,
    address[] memory founders,
    IProxyRegistry _proxyRegistry,
    string memory _ipfsProviderUri,
    string memory _ipfsContractHash,
    IQueenE _oldContract,
    address _royalMuseum
  ) ERC721("QueenE", "QUEENE") EIP712("QueenE", "2.0") {
    _registerInterface(type(IQueenE).interfaceId);
    queenPalace = _queenPalace;

    _currentAuctionQueenE = 1;

    _ipfsProvider = _ipfsProviderUri;
    _ipfsContractURIHash = _ipfsContractHash;

    for (uint256 idx = 0; idx < founders.length; idx++)
      sirs.push(RoyalLibrary.sSIR({sirAddress: founders[idx], queene: 0}));
    proxyRegistry = _proxyRegistry;
    oldContract = _oldContract;
    royalMuseum = _royalMuseum;
  }

  /************************** ^CONSTRUCTOR REGION *************************************************** */

  /**
   * @notice The IPFS URI and contract hash.
   */
  function setIpfsContractURIHash(
    string calldata _providerUri,
    string calldata _contractHash
  ) external onlyOwnerOrDeveloperOrDAO onlyOnImplementationOrDAO {
    _ipfsProvider = _providerUri;
    _ipfsContractURIHash = _contractHash;
  }

  /**
   * @notice The IPFS URI of contract-level metadata.
   */
  function contractURI() public view override returns (string memory) {
    return string(abi.encodePacked(_ipfsProvider, _ipfsContractURIHash));
  }

  /**
   * @notice Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings.
   */
  function isApprovedForAll(address owner, address operator)
    public
    view
    override(ERC721, IERC721)
    returns (bool)
  {
    // Whitelist OpenSea proxy contract for easy trading.
    if (proxyRegistry.proxies(owner) == operator) {
      return true;
    }
    return super.isApprovedForAll(owner, operator);
  }

  /**
   * @notice Mint QueenE to the minter, along with a possible Sir reward
   * QueenE and a museum art.
   *Sir reward QueenEs are minted on 10th mint whenever there is a Sir
   * with no reward. It mint's only one QueenE reward for each Sir
   * Tokens 20, 40, 60 and 80 are minted for the founders with sir title
   * Except when there is a new sir with pending reward, every 10th QueenE is
   *minted for the museum for the first 1820 token (~5 years)
   * @dev Call _mintTo with the minter address.
   */
  function mint() public override onlyMinter returns (uint256) {
    if (_currentAuctionQueenE % 10 == 0 && _currentAuctionQueenE <= 1820) {
      address sirAddress = _getSirWithPendingAward(_currentAuctionQueenE);
      if (
        sirAddress != address(0) &&
        //send to founders sirs intercalated with museum and to sir after 90 if there is any
        (_currentAuctionQueenE == 20 ||
          _currentAuctionQueenE == 40 ||
          _currentAuctionQueenE == 60 ||
          _currentAuctionQueenE == 80 ||
          _currentAuctionQueenE > 90)
      ) {
        uint256 sirQueenE = _mintTo(
          sirAddress,
          _currentAuctionQueenE++,
          true,
          queenes[0]
        );
        sirs[getSirIdx(sirAddress)].queene = _currentAuctionQueenE;

        emit SirAwarded(sirQueenE, sirAddress);
      } else {
        //mint to the vault
        uint256 museumQueenE = _mintTo(
          royalMuseum,
          //queenPalace.royalMuseum(),
          _currentAuctionQueenE++,
          false,
          queenes[0]
        );

        emit MuseumAwarded(museumQueenE, royalMuseum);
      }
    }

    return
      _mintTo(queenPalace.minter(), _currentAuctionQueenE++, false, queenes[0]);
  }

  /**
   * @notice Return QueenE from tokenId
   */
  function getQueenE(uint256 _queeneId)
    public
    view
    returns (RoyalLibrary.sQUEEN memory)
  {
    return queenes[_queeneId];
  }

  /**
   * @notice Burn a QueenE.
   */
  function burn(uint256 queeneId) public override onlyMinter {
    _burn(queeneId);
    emit QueenEBurned(queeneId);
  }

  /**
   * @notice A distinct Uniform Resource Identifier (URI) for a given asset.
   * @dev See {IERC721Metadata-tokenURI}.
   */
  function tokenURI(uint256 tokenId)
    public
    view
    override
    returns (string memory)
  {
    return
      queenPalace.QueenLab().constructTokenUri(queenes[tokenId], contractURI());
  }

  /**
   * @notice set QueenE final art hash built off-chain.
   * Emits a {FinalArtSet} event after the update.
   */
  function setFinalArtHash(uint256 tokenId, string calldata _finalArtHash)
    external
    onlyOwnerOrArtist
  {
    require(_exists(tokenId), "uknw id");
    require(
      //queenes[tokenId].finalArt.stringEquals(""),
      keccak256(abi.encodePacked(queenes[tokenId].finalArt)) ==
        keccak256(abi.encodePacked("")),
      "Art set"
    );
    queenes[tokenId].finalArt = _finalArtHash;

    emit FinalArtSet(tokenId, _finalArtHash);
  }

  /**
   * @notice Lock the minter.
   * @dev disabled after the token upgrade.
   */
  function lockMinter() external override //onlyOwnerOrChiefDeveloper
  //whenMinterNotLocked
  {
    //isMinterLocked = true;
    //emit MinterLocked();
  }

  /**
   * @notice Lock the QueenE Trait Storage contract.
   * @dev disabled after the token upgrade.
   */
  function lockQueenTraitStorage() external override //onlyOwnerOrChiefDeveloper
  //whenTraitStorageNotLocked
  {
    //isTraitStorageLocked = true;
    //emit StorageLocked();
  }

  /**
   * @notice Lock the Queen Lab Contract.
   * @dev disabled after the token upgrade.
   */
  function lockQueenLab() external override //onlyOwnerOrChiefDeveloper
  //whenLabNotLocked
  {
    //isLabLocked = true;
    //emit LabLocked();
  }

  /**
   * @notice Mint a QueenE with `queeneId` to the provided `to` address.
   */
  function _mintTo(
    address _to,
    uint256 _queeneId,
    bool isSirAward,
    RoyalLibrary.sQUEEN memory queene
  ) internal returns (uint256) {
    if (queene.queeneId <= 0)
      queene = queenPalace.QueenLab().generateQueen(_queeneId, isSirAward);

    queenes[_queeneId].queeneId = queene.queeneId;
    queenes[_queeneId].queenesGallery = queene.queenesGallery;
    queenes[_queeneId].sirAward = queene.sirAward;

    for (uint256 idx = 0; idx < queene.dna.length; idx++) {
      queenes[_queeneId].dna.push(queene.dna[idx]);
    }

    queenes[_queeneId].description = queene.description;

    dnaMapping[uint256(keccak256(abi.encode(queenes[_queeneId].dna)))] = true;
    queeneRarityMap[_queeneId] = queenPalace.QueenLab().getQueenRarity(
      queene.dna
    );
    _mint(owner(), _to, _queeneId);
    return _queeneId;
  }

  /**
   * @dev nominate a subject to the sir title.
   *
   * Emits a {SirNominated} event.
   *
   */
  function nominateSir(address _sir)
    external
    override
    onlySirOrDAO
    onlyOnImplementationOrDAO
    returns (bool)
  {
    require(_sir != address(0), "addr0");
    require(!houseOfBanned.contains(_sir), "Ban");
    require(!IsSir(_sir), "Sir");

    sirs.push(RoyalLibrary.sSIR({sirAddress: _sir, queene: 0}));
    emit SirNominated(_sir);

    return true;
  }

  /**
   *  Return house seats depending on seat type
   *
   * 0 - Sum of Lord and Common seats
   * 1 - Lord Seats
   * 2 - Common Seats
   * 3 - Banned from Seats
   *
   */
  function getHouseSeats(uint8 _seatType)
    external
    view
    override
    returns (uint256)
  {
    return
      ((_seatType == 0 || _seatType == 1) ? houseOfLords.length() : 0) +
      ((_seatType == 0 || _seatType == 2) ? houseOfCommons.length() : 0) +
      ((_seatType == 0 || _seatType == 3) ? houseOfBanned.length() : 0);
  }

  /**
   *  Return house seat for given address
   *
   * 1 - House of Lords
   * 2 - House of Commons
   * 3 - House of Banned
   * 0 - No House
   *
   */
  function getHouseSeat(address addr) external view override returns (uint256) {
    if (houseOfBanned.contains(addr)) return 3;
    else if (houseOfLords.contains(addr)) return 1;
    else if (houseOfCommons.contains(addr)) return 2;
    else return 0;
  }

  /**
   *  Return if given address have Sir Title
   *
   */
  function IsSir(address _address)
    public
    view
    override(IQueenE, QueenParliamentV2)
    returns (bool)
  {
    return super.IsSir(_address);
  }

  /**
   * @dev return if given QueenE was a reward.
   *
   */
  function isSirReward(uint256 queeneId) public view override returns (bool) {
    return queenes[queeneId].sirAward == 1;
  }

  /**
   * @dev return if given QueenE belongs to the museum.
   *
   */
  function isMuseum(uint256 queeneId) public view override returns (bool) {
    return ownerOf(queeneId) == royalMuseum;
  }

  /**
   * @dev return if dna was already used
   *
   */
  function dnaMapped(uint256 dnaHash) external view override returns (bool) {
    return dnaMapping[dnaHash];
  }

  function isHouseOfLordsFull() external view override returns (bool) {
    return houseOfLordsFull;
  }

  /**
   * @dev Mints QueenE with given tokenId only if it exists in the obsolete contract and was not minted yet
   *
   */
  function mintInherited(uint256 tokenId) external onlyOwner {
    //get QueenE from old contract
    require(_currentAuctionQueenE == tokenId, "Invalid id");
    RoyalLibrary.sQUEEN memory _oldQueenE = oldContract.getQueenE(tokenId);
    require(_oldQueenE.queeneId == tokenId, "Old QueenE don't exists");
    //mint token
    _mintTo(owner(), _currentAuctionQueenE++, false, _oldQueenE);
    queenes[tokenId].finalArt = _oldQueenE.finalArt;
    //see if token exists in old contract
    try oldContract.ownerOf(tokenId) returns (address rightOwner) {
      //transfer to rightful owner
      transferFrom(owner(), rightOwner, tokenId);
    } catch {
      //probably burned. burn.
      _burn(tokenId);
    }
  }

  /**
   * @dev get registered QueenPalace address
   *
   */
  function getQueenPalace() external view returns (address) {
    return address(queenPalace);
  }
}

File 2 of 39 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

File 3 of 39 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 4 of 39 : RoyalLibrary.sol
// SPDX-License-Identifier: MIT

/// @title A library to hold our Queen's Royal Knowledge

pragma solidity 0.8.9;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

library RoyalLibrary {
    struct sTRAIT {
        uint256 id;
        string traitName;
        uint8 enabled; //0 - disabled; 1 - enabled;
    }

    struct sRARITY {
        uint256 id;
        string rarityName;
        uint256 percentage; //1 ~ 100
    }

    struct sART {
        uint256 traitId;
        uint256 rarityId;
        bytes artName;
        bytes uri;
    }

    struct sDNA {
        uint256 traitId;
        uint256 rarityId;
        uint256 trace;
    }

    struct sBLOOD {
        uint256 traitId;
        uint256 rarityId;
        string artName;
        string artUri;
    }

    struct sQUEEN {
        uint256 queeneId;
        uint256 description; //index of the description
        string finalArt;
        sDNA[] dna;
        uint8 queenesGallery;
        uint8 sirAward;
    }

    struct sSIR {
        address sirAddress;
        uint256 queene;
    }

    struct sAUCTION {
        uint256 queeneId;
        uint256 lastBidAmount;
        uint256 auctionStartTime;
        uint256 auctionEndTime;
        uint256 initialBidPrice;
        address payable bidder;
        bool ended;
    }

    enum queeneRarity {
        COMMON,
        RARE,
        SUPER_RARE,
        LEGENDARY
    }

    address constant burnAddress = 0x0000000000000000000000000000000000000000;
    uint8 constant houseOfLords = 1;
    uint8 constant houseOfCommons = 2;
    uint8 constant houseOfBanned = 3;

    error InvalidAddressError(string _caller, string _msg, address _address);
    error AuthorizationError(string _caller, string _msg, address _address);
    error MinterLockedError(
        string _caller,
        string _msg,
        address _minterAddress
    );
    error StorageLockedError(
        string _caller,
        string _msg,
        address _storageAddress
    );
    error LabLockedError(string _caller, string _msg, address _labAddress);
    error InvalidParametersError(
        string _caller,
        string _msg,
        string _arg1,
        string _arg2,
        string _arg3
    );

    function concat(string memory self, string memory part2)
        public
        pure
        returns (string memory)
    {
        return string(abi.encodePacked(self, part2));
    }

    function stringEquals(string storage self, string memory b)
        public
        view
        returns (bool)
    {
        if (bytes(self).length != bytes(b).length) {
            return false;
        } else {
            return
                keccak256(abi.encodePacked(self)) ==
                keccak256(abi.encodePacked(b));
        }
    }

    function extractRevertReason(bytes memory _returnData)
        internal
        pure
        returns (string memory)
    {
        // If the _res length is less than 68, then the transaction failed silently (without a revert message)
        if (_returnData.length < 68) return "Transaction reverted silently";

        assembly {
            // Slice the sighash.
            _returnData := add(_returnData, 0x04)
        }
        return abi.decode(_returnData, (string)); // All that remains is the revert string
    }
}

File 5 of 39 : IQueenTraits.sol
// SPDX-License-Identifier: MIT

/// @title Interface for QueenE Traits contract

pragma solidity ^0.8.9;

//import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import {IRoyalContractBase} from "../interfaces/IRoyalContractBase.sol";
import {RoyalLibrary} from "../contracts/lib/RoyalLibrary.sol";

interface IQueenTraits is IRoyalContractBase {
  event RarityCreated(
    uint256 indexed rarityId,
    string rarityName,
    uint256 _percentage
  );
  event RarityUpdated(
    uint256 indexed rarityId,
    string rarityName,
    uint256 _percentage
  );

  event TraitCreated(
    uint256 indexed traitId,
    string _traitName,
    uint8 _enabled
  );

  event TraitEnabled(uint256 indexed traitId, string _traitName);
  event TraitDisabled(uint256 indexed traitId, string _traitName);

  event ArtCreated(
    uint256 traitId,
    uint256 rarityId,
    bytes artName,
    bytes artUri
  );
  event ArtRemoved(uint256 traitId, uint256 rarityId, bytes artUri);

  function rarityPool() external view returns (uint256[] memory);

  function getRarityById(uint256 _rarityId)
    external
    view
    returns (RoyalLibrary.sRARITY memory rarity);

  function getRarityByName(string memory _rarityName)
    external
    returns (RoyalLibrary.sRARITY memory rarity);

  function getRarities(bool onlyWithArt, uint256 _traitId)
    external
    view
    returns (RoyalLibrary.sRARITY[] memory raritiesList);

  function getTrait(uint256 _id)
    external
    view
    returns (RoyalLibrary.sTRAIT memory trait);

  function getTraitByName(string memory _traitName)
    external
    returns (RoyalLibrary.sTRAIT memory trait);

  function getTraits(bool _onlyEnabled)
    external
    view
    returns (RoyalLibrary.sTRAIT[] memory _traits);

  function getDescriptionByIdx(uint256 _rarityId, uint256 _index)
    external
    view
    returns (bytes memory description);

  function getDescriptionsCount(uint256 _rarityId)
    external
    view
    returns (uint256);

  function getArtByUri(
    uint256 _traitId,
    uint256 _rarityId,
    bytes memory _artUri
  ) external returns (RoyalLibrary.sART memory art);

  function getArtCount(uint256 _traitId, uint256 _rarityId)
    external
    view
    returns (uint256 quantity);

  function getArt(
    uint256 _traitId,
    uint256 _rarityId,
    uint256 _artIdx
  ) external view returns (RoyalLibrary.sART memory art);

  function getArts(uint256 _traitId, uint256 _rarityId)
    external
    returns (RoyalLibrary.sART[] memory artsList);
}

File 6 of 39 : IQueenE.sol
// SPDX-License-Identifier: MIT

/// @title Interface for QueenE NFT Token

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/governance/utils/IVotes.sol";

import {IQueenTraits} from "./IQueenTraits.sol";
import {IQueenLab} from "./IQueenLab.sol";
import {RoyalLibrary} from "../contracts/lib/RoyalLibrary.sol";
import {IRoyalContractBase} from "./IRoyalContractBase.sol";
import {IERC721} from "./IERC721.sol";

interface IQueenE is IRoyalContractBase, IERC721 {
  function _currentAuctionQueenE() external view returns (uint256);

  function contractURI() external view returns (string memory);

  function mint() external returns (uint256);

  function getQueenE(uint256 _queeneId)
    external
    view
    returns (RoyalLibrary.sQUEEN memory);

  function burn(uint256 queeneId) external;

  function lockMinter() external;

  function lockQueenTraitStorage() external;

  function lockQueenLab() external;

  function nominateSir(address _sir) external returns (bool);

  function getHouseSeats(uint8 _seatType) external view returns (uint256);

  function getHouseSeat(address addr) external view returns (uint256);

  function IsSir(address _address) external view returns (bool);

  function isSirReward(uint256 queeneId) external view returns (bool);

  function isMuseum(uint256 queeneId) external view returns (bool);

  function dnaMapped(uint256 dnaHash) external view returns (bool);

  function isHouseOfLordsFull() external view returns (bool);
}

File 7 of 39 : IQueenPalace.sol
// SPDX-License-Identifier: MIT

/// @title Interface for Queen Staff Contract

pragma solidity ^0.8.9;

import {IQueenLab} from "../interfaces/IQueenLab.sol";
import {IQueenTraits} from "../interfaces/IQueenTraits.sol";
import {IQueenE} from "../interfaces/IQueenE.sol";
import {IQueenAuctionHouse} from "../interfaces/IQueenAuctionHouse.sol";

interface IQueenPalace {
    function royalMuseum() external view returns (address);

    function isOnImplementation() external view returns (bool status);

    function artist() external view returns (address);

    function isArtist(address addr) external view returns (bool);

    function dao() external view returns (address);

    function daoExecutor() external view returns (address);

    function RoyalTowerAddr() external view returns (address);

    function developer() external view returns (address);

    function isDeveloper(address devAddr) external view returns (bool);

    function minter() external view returns (address);

    function QueenLab() external view returns (IQueenLab);

    function QueenTraits() external view returns (IQueenTraits);

    function QueenAuctionHouse() external view returns (IQueenAuctionHouse);

    function QueenE() external view returns (IQueenE);

    function whiteListed() external view returns (uint256);

    function isWhiteListed(address _addr) external view returns (bool);

    function QueenAuctionHouseProxyAddr() external view returns (address);
}

File 8 of 39 : QueenParliamentV2.sol
// SPDX-License-Identifier: MIT

/// @title ERC721 Voters Extension

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

pragma solidity ^0.8.9;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {Votes} from "@openzeppelin/contracts/governance/utils/Votes.sol";

import {RoyalLibrary} from "../lib/RoyalLibrary.sol";
import {IQueenLab} from "../../interfaces/IQueenLab.sol";
import {ERC721Enumerable} from "../base/ERC721Enumerable.sol";
import {ERC721} from "../base/ERC721.sol";
import {IERC721} from "../../interfaces/IERC721.sol";

//extends openzeppelin draft-ERC721Votes.sol
//
/**
 * @dev This implements an extension to the QueenE {ERC721} contract to manage Common and Lord Houses
 * and the voters historic.
 */
abstract contract QueenParliamentV2 is ERC721Enumerable, Votes {
  using EnumerableSet for EnumerableSet.AddressSet;
  using EnumerableSet for EnumerableSet.UintSet;

  event NominatedForHouseOfLord(address indexed lord, uint256 queeneId);
  event NominatedForHouseOfCommons(address indexed common, uint256 queeneId);
  event BannedFromHouses(address indexed subject);

  event ParliamentEndOfMandate(
    address indexed subject,
    uint256 queeneId,
    string house
  );

  event SirNominated(address indexed subject);

  event ParliamentPromoted(address indexed subject);

  address public royalMuseum;

  EnumerableSet.AddressSet internal houseOfLords;
  EnumerableSet.AddressSet internal houseOfCommons;
  EnumerableSet.AddressSet internal houseOfBanned;
  RoyalLibrary.sSIR[] internal sirs;
  // QueenEs
  mapping(uint256 => RoyalLibrary.sQUEEN) internal queenes;
  mapping(uint256 => bool) internal dnaMapping;
  mapping(uint256 => RoyalLibrary.queeneRarity) internal queeneRarityMap;
  mapping(address => EnumerableSet.UintSet) internal ownerOfQueenEs;

  /// @notice Defines decimals as per ERC-20 convention to make integrations with 3rd party governance platforms easier
  uint8 public constant decimals = 0;

  bool internal houseOfLordsFull;

  /**
   * @dev return if exists sir with pending reward.
   *
   */
  function _haveSirWithPendingReward() internal view returns (bool) {
    for (uint256 idx; idx < sirs.length; idx++) {
      if (
        sirs[idx].queene == 0 && !houseOfBanned.contains(sirs[idx].sirAddress)
      ) {
        return true;
      }
    }
    return false;
  }

  /**
   * @dev return sir with pending reward.
   *
   */
  function _getSirWithPendingAward(uint256 _queeneId)
    internal
    view
    returns (address)
  {
    uint256 sirsPending;
    uint256 nextIdx;
    for (uint256 idx = 0; idx < sirs.length; idx++) {
      if (
        sirs[idx].queene == 0 && !houseOfBanned.contains(sirs[idx].sirAddress)
      ) {
        sirsPending++;
      }
    }

    address[] memory sirsToBeWarded = new address[](sirsPending);

    for (uint256 idx = 0; idx < sirs.length; idx++) {
      if (
        sirs[idx].queene == 0 && !houseOfBanned.contains(sirs[idx].sirAddress)
      ) {
        sirsToBeWarded[nextIdx++] = sirs[idx].sirAddress;
      }
    }

    if (sirsToBeWarded.length == 1) {
      return sirsToBeWarded[0];
    } else if (sirsToBeWarded.length > 1) {
      return
        sirsToBeWarded[
          uint256(
            keccak256(
              abi.encodePacked(
                blockhash(block.number - 1),
                _queeneId,
                blockhash(block.difficulty),
                blockhash(block.timestamp)
              )
            )
          ) % sirsToBeWarded.length
        ];
    }

    return address(0);
  }

  /**
   * @dev give new QueenE owner a seat in one house.
   *
   * Emits a {NominatedForHouseOfLord} or {NominatedForHouseOfCommons} event.
   * Emits a {BannedFromHousesRejection} event if subject was banned.
   */
  function _giveParliamentSeat(address to, uint256 queeneId)
    internal
    returns (bool)
  {
    if (to == address(0)) return true; //burn address dont get seats

    if (to == royalMuseum || to == queenPalace.minter()) return true; //museum and minter dont get seats

    if (IsSir(to) && queenes[queeneId].sirAward == 1) return true; //sir dont get vote from sir award

    if (houseOfBanned.contains(to)) {
      return true; //seat must be vacant anyways
    }

    if (
      queeneRarityMap[queeneId] > RoyalLibrary.queeneRarity.COMMON ||
      queenes[queeneId].queenesGallery == 1 ||
      !houseOfLordsFull
    ) {
      //give lord seat
      if (houseOfLords.contains(to)) return true; //already have seat

      if (!houseOfCommons.contains(to)) houseOfCommons.remove(to);

      houseOfLords.add(to);
      emit NominatedForHouseOfLord(to, queeneId);
      //update if house  of lords is full
      if (!houseOfLordsFull) houseOfLordsFull = houseOfLords.length() >= 15;
    } else {
      if (houseOfLords.contains(to) || houseOfCommons.contains(to)) return true; //already have a seat

      houseOfCommons.add(to);

      emit NominatedForHouseOfCommons(to, queeneId);
    }

    return true;
  }

  /**
   * @dev take seat from QueenE previous owner.
   *
   * Emits a {ParliamentEndOfMandate} event if ends with no seats.
   */
  function _takeParliamentSeat(address from, uint256 tokenId)
    internal
    returns (bool seatTaken)
  {
    if (!houseOfLords.contains(from) && !houseOfCommons.contains(from))
      return true; //have no seat to take

    if (balanceOf(from) <= 0) {
      if (houseOfLords.contains(from)) houseOfLords.remove(from);
      if (houseOfCommons.contains(from)) houseOfCommons.remove(from);

      emit ParliamentEndOfMandate(from, tokenId, "ALL");

      return true;
    }
    //if have no rare queenE, cant stay in House of Lords
    bool haveRareQueene;
    for (uint256 idx = 0; idx < ownerOfQueenEs[from].length(); idx++) {
      if (
        queeneRarityMap[ownerOfQueenEs[from].at(idx)] >
        RoyalLibrary.queeneRarity.COMMON ||
        queenes[ownerOfQueenEs[from].at(idx)].queenesGallery == 1
      ) {
        haveRareQueene = true;
      }
    }

    if (!haveRareQueene && houseOfLords.contains(from)) {
      houseOfLords.remove(from);
      houseOfCommons.add(from);
    }
    return true;
  }

  /**
   * @dev ban subject from houses.
   *
   */
  function banFromHouses(address _subject)
    external
    whenNotPaused
    onlyOwnerOrDAO
    onlyOnImplementationOrDAO
  {
    if (!houseOfBanned.contains(_subject)) houseOfBanned.add(_subject);
    if (houseOfLords.contains(_subject)) houseOfLords.remove(_subject);
    if (houseOfCommons.contains(_subject)) houseOfCommons.remove(_subject);

    if (getVotes(_subject) > 0)
      _transferVotingUnits(_subject, address(0), getVotes(_subject));

    emit BannedFromHouses(_subject);
  }

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

  /**
   * @dev Adjusts votes when tokens are transferred.
   *
   * Emits a {Votes-DelegateVotesChanged} event.
   */
  function _afterTokenTransfer(
    address from,
    address to,
    uint256 tokenId
  ) internal virtual override {
    //get queenE voting power
    uint8 queenVotingPower = ((queeneRarityMap[tokenId] >
      RoyalLibrary.queeneRarity.COMMON) || queenes[tokenId].queenesGallery == 1)
      ? 2
      : 1;
    //move Queen Weight from to
    uint256 fromVotesToTake = queenVotingPower;
    uint256 toVotesToGive = queenVotingPower;
    //if to special address or banned, give no votes
    if (
      to == royalMuseum ||
      to == queenPalace.minter() ||
      (queenes[tokenId].sirAward == 1 && IsSir(to)) ||
      houseOfBanned.contains(to)
    ) {
      toVotesToGive = 0;
    }
    //if from special address or banned, no votes to take
    if (
      from == royalMuseum ||
      from == queenPalace.minter() ||
      (queenes[tokenId].sirAward == 1 && IsSir(from)) ||
      houseOfBanned.contains(from)
    ) {
      fromVotesToTake = 0;
    }

    if (fromVotesToTake > 0)
      _transferVotingUnits(from, address(0), fromVotesToTake);

    if (toVotesToGive > 0) _transferVotingUnits(address(0), to, toVotesToGive);

    //change owner
    if (ownerOfQueenEs[from].contains(tokenId))
      ownerOfQueenEs[from].remove(tokenId);

    if (!ownerOfQueenEs[to].contains(tokenId)) ownerOfQueenEs[to].add(tokenId);

    //now we make the throne dance
    //first lets take the seat from the old owner, if necessary
    if (!_takeParliamentSeat(from, tokenId)) {
      revert("tkseat");
    }

    //now lets give a seat to the new owner, if he deserves it
    if (!_giveParliamentSeat(to, tokenId)) {
      revert("gvseat");
    }
    super._afterTokenTransfer(from, to, tokenId);
  }

  /**
   * @dev Returns the balance of `account`.
   */
  function _getVotingUnits(address account)
    internal
    view
    virtual
    override
    returns (uint256)
  {
    return getVotes(account);
  }

  /**
   * @dev override from ERC721.
   */
  function transferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public virtual override(ERC721) {
    if (to != address(0) && delegates(to) == address(0)) _delegate(to, to);
    super.transferFrom(from, to, tokenId);
  }

  /**
   *  Return if given address have Sir Title
   *
   */
  function IsSir(address _address) public view virtual returns (bool) {
    for (uint256 idx; idx < sirs.length; idx++) {
      if (
        sirs[idx].sirAddress == _address &&
        !houseOfBanned.contains(sirs[idx].sirAddress)
      ) {
        return true;
      }
    }
    return false;
  }

  /**
   *  Return sir object index for given address
   *
   */
  function getSirIdx(address _address) internal view returns (uint256) {
    for (uint256 idx; idx < sirs.length; idx++) {
      if (sirs[idx].sirAddress == _address) {
        return idx;
      }
    }
    return 0;
  }
}

File 9 of 39 : IProxyRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

interface IProxyRegistry {
    function proxies(address) external view returns (address);
}

File 10 of 39 : ERC721.sol
// SPDX-License-Identifier: MIT
/// @title ERC721 QueenE Token

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

// LICENSE
// ERC721.sol modifies OpenZeppelin's ERC721.sol:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol
// Inspired by Nouns contract modifications to better NFT atribution control on various marketplaces
//
// ERC721.sol source code copyright OpenZeppelin licensed under the MIT License.
// ERC721.sol source code copyright Nouns DAO licensed under the MIT License.
// Modified by QueenE DAO.
//
//
// CHANGES:
// inherits from our own interface controller (ERC721Base) instead of the pure ERC165 standard controller.
// base controller has other implementations to control authorizations to use contract, implementations status etc

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

import {ERC721Base} from "../base/ERC721Base.sol";
import {IERC721} from "../../interfaces/IERC721.sol";
import {IERC721Metadata} from "../../interfaces/IERC721Metadata.sol";

contract ERC721 is Context, ERC721Base, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

        _registerInterface(type(IERC721).interfaceId);
        _registerInterface(type(IERC721Metadata).interfaceId);
    }

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

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

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

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

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

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

    /**
     * @dev Safely mints `tokenId`, transfers it to `to`, and emits two log events -
     * 1. Credits the `minter` with the mint.
     * 2. Shows transfer from the `minter` to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address creator,
        address to,
        uint256 tokenId
    ) internal virtual {
        _safeMint(creator, to, tokenId, "");
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

File 11 of 39 : IERC721.sol
// SPDX-License-Identifier: MIT
/// @title IERC721 Interface

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

// LICENSE
// IERC721.sol modifies OpenZeppelin's interface IERC721.sol to user our own ERC165 standard:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721.sol
//
// MODIFICATIONS:
// Its the latest `IERC721` interface from OpenZeppelin (v4.4.5) using our own ERC165 controller.

pragma solidity ^0.8.9;

import {IRoyalContractBase} from "../interfaces/IRoyalContractBase.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IRoyalContractBase {
    /**
     * @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 12 of 39 : IQueenLab.sol
// SPDX-License-Identifier: MIT

/// @title Interface for Noun Auction Houses

pragma solidity ^0.8.9;

import {IRoyalContractBase} from "./IRoyalContractBase.sol";
import {RoyalLibrary} from "../contracts/lib//RoyalLibrary.sol";
import {IQueenTraits} from "./IQueenTraits.sol";
import {IQueenE} from "./IQueenE.sol";

interface IQueenLab is IRoyalContractBase {
    function buildDna(uint256 queeneId, bool isSir)
        external
        view
        returns (RoyalLibrary.sDNA[] memory dna);

    function produceBlueBlood(RoyalLibrary.sDNA[] memory dna)
        external
        view
        returns (RoyalLibrary.sBLOOD[] memory blood);

    function generateQueen(uint256 _queenId, bool isSir)
        external
        view
        returns (RoyalLibrary.sQUEEN memory);

    function getQueenRarity(RoyalLibrary.sDNA[] memory _dna)
        external
        pure
        returns (RoyalLibrary.queeneRarity finalRarity);

    function getQueenRarityBidIncrement(
        RoyalLibrary.sDNA[] memory _dna,
        uint256[] calldata map
    ) external pure returns (uint256 value);

    function getQueenRarityName(RoyalLibrary.sDNA[] memory _dna)
        external
        pure
        returns (string memory rarityName);

    function constructTokenUri(
        RoyalLibrary.sQUEEN memory _queene,
        string memory _ipfsUri
    ) external view returns (string memory);
}

File 13 of 39 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 15 of 39 : IRoyalContractBase.sol
// SPDX-License-Identifier: MIT

/// @title Interface for Base Contract Controller

pragma solidity ^0.8.9;
import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";

interface IRoyalContractBase is IERC165 {
    //function supportsInterface(bytes4 interfaceID) external view returns (bool);

    function isOwner(address _address) external view returns (bool);
}

File 16 of 39 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

File 17 of 39 : 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 18 of 39 : IVotes.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/IVotes.sol)
pragma solidity ^0.8.0;

/**
 * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.
 *
 * _Available since v4.5._
 */
interface IVotes {
    /**
     * @dev Emitted when an account changes their delegate.
     */
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    /**
     * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.
     */
    event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);

    /**
     * @dev Returns the current amount of votes that `account` has.
     */
    function getVotes(address account) external view returns (uint256);

    /**
     * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`).
     */
    function getPastVotes(address account, uint256 blockNumber) external view returns (uint256);

    /**
     * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`).
     *
     * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.
     * Votes that have not been delegated are still part of total supply, even though they would not participate in a
     * vote.
     */
    function getPastTotalSupply(uint256 blockNumber) external view returns (uint256);

    /**
     * @dev Returns the delegate that `account` has chosen.
     */
    function delegates(address account) external view returns (address);

    /**
     * @dev Delegates votes from the sender to `delegatee`.
     */
    function delegate(address delegatee) external;

    /**
     * @dev Delegates votes from signer to `delegatee`.
     */
    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

File 19 of 39 : IQueenAuctionHouse.sol
// SPDX-License-Identifier: MIT

/// @title Interface for QueenE NFT Token

pragma solidity ^0.8.9;

import {IBaseContractControllerUpgradeable} from "./IBaseContractControllerUpgradeable.sol";

interface IQueenAuctionHouse is IBaseContractControllerUpgradeable {
  event WithdrawnFallbackFunds(address withdrawer, uint256 amount);
  event AuctionSettled(
    uint256 indexed queeneId,
    address settler,
    uint256 amount
  );

  event AuctionStarted(
    uint256 indexed queeneId,
    uint256 startTime,
    uint256 endTime,
    uint256 initialBid
  );
  event AuctionExtended(uint256 indexed queeneId, uint256 endTime);

  event AuctionBid(
    uint256 indexed queeneId,
    address sender,
    uint256 value,
    bool extended
  );

  event AuctionEnded(uint256 indexed queeneId, address winner, uint256 amount);

  event AuctionTimeToleranceUpdated(uint256 timeBuffer);

  event AuctionInitialBidUpdated(uint256 initialBid);

  event AuctionDurationUpdated(uint256 duration);

  event AuctionMinBidIncrementPercentageUpdated(
    uint256 minBidIncrementPercentage
  );

  function endAuction() external;

  function bid(uint256 queeneId) external payable;

  function pause() external;

  function unpause() external;

  function setTimeTolerance(uint256 _timeTolerance) external;

  function setBidRaiseRate(uint8 _bidRaiseRate) external;

  function setInitialBid(uint256 _initialBid) external;

  function setDuration(uint256 _duration) external;
}

File 20 of 39 : IBaseContractControllerUpgradeable.sol
// SPDX-License-Identifier: MIT

/// @title Interface for Base Contract Controller

pragma solidity ^0.8.9;
import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol";

interface IBaseContractControllerUpgradeable is IERC165Upgradeable {
    //function supportsInterface(bytes4 interfaceID) external view returns (bool);

    function isOwner(address _address) external view returns (bool);
}

File 21 of 39 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

File 23 of 39 : Votes.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (governance/utils/Votes.sol)
pragma solidity ^0.8.0;

import "../../utils/Context.sol";
import "../../utils/Counters.sol";
import "../../utils/Checkpoints.sol";
import "../../utils/cryptography/draft-EIP712.sol";
import "./IVotes.sol";

/**
 * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be
 * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of
 * "representative" that will pool delegated voting units from different accounts and can then use it to vote in
 * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to
 * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.
 *
 * This contract is often combined with a token contract such that voting units correspond to token units. For an
 * example, see {ERC721Votes}.
 *
 * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed
 * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the
 * cost of this history tracking optional.
 *
 * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return
 * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the
 * previous example, it would be included in {ERC721-_beforeTokenTransfer}).
 *
 * _Available since v4.5._
 */
abstract contract Votes is IVotes, Context, EIP712 {
    using Checkpoints for Checkpoints.History;
    using Counters for Counters.Counter;

    bytes32 private constant _DELEGATION_TYPEHASH =
        keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

    mapping(address => address) private _delegation;
    mapping(address => Checkpoints.History) private _delegateCheckpoints;
    Checkpoints.History private _totalCheckpoints;

    mapping(address => Counters.Counter) private _nonces;

    /**
     * @dev Returns the current amount of votes that `account` has.
     */
    function getVotes(address account) public view virtual override returns (uint256) {
        return _delegateCheckpoints[account].latest();
    }

    /**
     * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`).
     *
     * Requirements:
     *
     * - `blockNumber` must have been already mined
     */
    function getPastVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) {
        return _delegateCheckpoints[account].getAtBlock(blockNumber);
    }

    /**
     * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`).
     *
     * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.
     * Votes that have not been delegated are still part of total supply, even though they would not participate in a
     * vote.
     *
     * Requirements:
     *
     * - `blockNumber` must have been already mined
     */
    function getPastTotalSupply(uint256 blockNumber) public view virtual override returns (uint256) {
        require(blockNumber < block.number, "Votes: block not yet mined");
        return _totalCheckpoints.getAtBlock(blockNumber);
    }

    /**
     * @dev Returns the current total supply of votes.
     */
    function _getTotalSupply() internal view virtual returns (uint256) {
        return _totalCheckpoints.latest();
    }

    /**
     * @dev Returns the delegate that `account` has chosen.
     */
    function delegates(address account) public view virtual override returns (address) {
        return _delegation[account];
    }

    /**
     * @dev Delegates votes from the sender to `delegatee`.
     */
    function delegate(address delegatee) public virtual override {
        address account = _msgSender();
        _delegate(account, delegatee);
    }

    /**
     * @dev Delegates votes from signer to `delegatee`.
     */
    function delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual override {
        require(block.timestamp <= expiry, "Votes: signature expired");
        address signer = ECDSA.recover(
            _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))),
            v,
            r,
            s
        );
        require(nonce == _useNonce(signer), "Votes: invalid nonce");
        _delegate(signer, delegatee);
    }

    /**
     * @dev Delegate all of `account`'s voting units to `delegatee`.
     *
     * Emits events {DelegateChanged} and {DelegateVotesChanged}.
     */
    function _delegate(address account, address delegatee) internal virtual {
        address oldDelegate = delegates(account);
        _delegation[account] = delegatee;

        emit DelegateChanged(account, oldDelegate, delegatee);
        _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));
    }

    /**
     * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`
     * should be zero. Total supply of voting units will be adjusted with mints and burns.
     */
    function _transferVotingUnits(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        if (from == address(0)) {
            _totalCheckpoints.push(_add, amount);
        }
        if (to == address(0)) {
            _totalCheckpoints.push(_subtract, amount);
        }
        _moveDelegateVotes(delegates(from), delegates(to), amount);
    }

    /**
     * @dev Moves delegated votes from one delegate to another.
     */
    function _moveDelegateVotes(
        address from,
        address to,
        uint256 amount
    ) private {
        if (from != to && amount > 0) {
            if (from != address(0)) {
                (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount);
                emit DelegateVotesChanged(from, oldValue, newValue);
            }
            if (to != address(0)) {
                (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[to].push(_add, amount);
                emit DelegateVotesChanged(to, oldValue, newValue);
            }
        }
    }

    function _add(uint256 a, uint256 b) private pure returns (uint256) {
        return a + b;
    }

    function _subtract(uint256 a, uint256 b) private pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Consumes a nonce.
     *
     * Returns the current value and increments nonce.
     */
    function _useNonce(address owner) internal virtual returns (uint256 current) {
        Counters.Counter storage nonce = _nonces[owner];
        current = nonce.current();
        nonce.increment();
    }

    /**
     * @dev Returns an address nonce.
     */
    function nonces(address owner) public view virtual returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @dev Returns the contract's {EIP712} domain separator.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev Must return the voting units held by an account.
     */
    function _getVotingUnits(address) internal view virtual returns (uint256);
}

File 24 of 39 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

/// @title ERC721 Enumerable Extension

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

// LICENSE
// ERC721.sol modifies OpenZeppelin's ERC721Enumerable.sol:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721Enumerable.sol
//
// ERC721Enumerable.sol source code copyright OpenZeppelin licensed under the MIT License.
// With modifications by QueenE DAO.
//
// MODIFICATIONS:
// Its the latest `ERC721` contract from OpenZeppelin (v4.4.1) using our modified ERC721 contract.

pragma solidity ^0.8.9;

import {ERC721} from "./ERC721.sol";
import "../../interfaces/IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
        public
        view
        virtual
        override
        returns (uint256)
    {
        require(
            index < ERC721.balanceOf(owner),
            "ERC721Enumerable: owner index out of bounds"
        );
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index)
        public
        view
        virtual
        override
        returns (uint256)
    {
        require(
            index < ERC721Enumerable.totalSupply(),
            "ERC721Enumerable: global index out of bounds"
        );
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId)
        private
    {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 25 of 39 : 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 26 of 39 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 27 of 39 : Checkpoints.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Checkpoints.sol)
pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SafeCast.sol";

/**
 * @dev This library defines the `History` struct, for checkpointing values as they change at different points in
 * time, and later looking up past values by block number. See {Votes} as an example.
 *
 * To create a history of checkpoints define a variable type `Checkpoints.History` in your contract, and store a new
 * checkpoint for the current transaction block using the {push} function.
 *
 * _Available since v4.5._
 */
library Checkpoints {
    struct Checkpoint {
        uint32 _blockNumber;
        uint224 _value;
    }

    struct History {
        Checkpoint[] _checkpoints;
    }

    /**
     * @dev Returns the value in the latest checkpoint, or zero if there are no checkpoints.
     */
    function latest(History storage self) internal view returns (uint256) {
        uint256 pos = self._checkpoints.length;
        return pos == 0 ? 0 : self._checkpoints[pos - 1]._value;
    }

    /**
     * @dev Returns the value at a given block number. If a checkpoint is not available at that block, the closest one
     * before it is returned, or zero otherwise.
     */
    function getAtBlock(History storage self, uint256 blockNumber) internal view returns (uint256) {
        require(blockNumber < block.number, "Checkpoints: block not yet mined");

        uint256 high = self._checkpoints.length;
        uint256 low = 0;
        while (low < high) {
            uint256 mid = Math.average(low, high);
            if (self._checkpoints[mid]._blockNumber > blockNumber) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }
        return high == 0 ? 0 : self._checkpoints[high - 1]._value;
    }

    /**
     * @dev Pushes a value onto a History so that it is stored as the checkpoint for the current block.
     *
     * Returns previous value and new value.
     */
    function push(History storage self, uint256 value) internal returns (uint256, uint256) {
        uint256 pos = self._checkpoints.length;
        uint256 old = latest(self);
        if (pos > 0 && self._checkpoints[pos - 1]._blockNumber == block.number) {
            self._checkpoints[pos - 1]._value = SafeCast.toUint224(value);
        } else {
            self._checkpoints.push(
                Checkpoint({_blockNumber: SafeCast.toUint32(block.number), _value: SafeCast.toUint224(value)})
            );
        }
        return (old, value);
    }

    /**
     * @dev Pushes a value onto a History, by updating the latest value using binary operation `op`. The new value will
     * be set to `op(latest, delta)`.
     *
     * Returns previous value and new value.
     */
    function push(
        History storage self,
        function(uint256, uint256) view returns (uint256) op,
        uint256 delta
    ) internal returns (uint256, uint256) {
        return push(self, op(latest(self), delta));
    }
}

File 28 of 39 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 30 of 39 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
/// @title IERC721Enumerable Extension Interface

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

// LICENSE
// IERC721Enumerable.sol modifies OpenZeppelin's interface IERC721Enumerable.sol to use our modified IERC721 interface:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Enumerable.sol
//
// MODIFICATIONS:
// Its the latest `IERC721Enumerable` interface from OpenZeppelin (v4.4.5) using our modified IERC721 interface.
pragma solidity ^0.8.9;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
        external
        view
        returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

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

File 32 of 39 : 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 33 of 39 : ERC721Base.sol
// SPDX-License-Identifier: MIT

/// @title A base contract with implementation control

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

pragma solidity ^0.8.9;

//import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC165Storage} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import {RoyalLibrary} from "../lib/RoyalLibrary.sol";
import {IRoyalContractBase} from "../../interfaces/IRoyalContractBase.sol";
import {IQueenPalace} from "../../interfaces/IQueenPalace.sol";

contract ERC721Base is
  ERC165Storage,
  IRoyalContractBase,
  Pausable,
  ReentrancyGuard,
  Ownable
{
  IQueenPalace internal queenPalace;

  /************************** vCONTROLLER REGION *************************************************** */

  /**
   * @dev Triggers stopped state.
   *
   * Requirements:
   *
   * - The contract must not be paused.
   */
  function pause() external virtual onlyOwner whenNotPaused {
    _pause();
  }

  /**
   * @dev Returns to normal state.
   *
   * Requirements:
   *
   * - The contract must be paused.
   */
  function unpause() external virtual onlyOwner whenPaused {
    _unpause();
  }

  /**
   *IN
   *_queenPalace: address of queen palace contract
   *OUT
   */
  function setQueenPalace(IQueenPalace _queenPalace)
    external
    nonReentrant
    whenPaused
    onlyOwnerOrDAO
    onlyOnImplementationOrDAO
  {
    _setQueenPalace(_queenPalace);
  }

  /**
   *IN
   *_queenPalace: address of queen palace contract
   *OUT
   */
  function _setQueenPalace(IQueenPalace _queenPalace) internal {
    queenPalace = _queenPalace;
  }

  /************************** ^vCONTROLLER REGION *************************************************** */

  /************************** vMODIFIERS REGION ***************************************************** */
  modifier onlyOwnerOrDeveloperOrDAO() {
    isOwnerOrDeveloperOrDAO();
    _;
  }
  modifier onlyOwnerOrChiefDeveloperOrDAO() {
    isOwnerOrChiefDeveloperOrDAO();
    _;
  }
  modifier onlyOwnerOrArtistOrDAO() {
    isOwnerOrArtistOrDAO();
    _;
  }
  modifier onlyOwnerOrChiefArtistOrDAO() {
    isOwnerOrChiefArtistOrDAO();
    _;
  }
  modifier onlyOnImplementationOrDAO() {
    isOnImplementationOrDAO();
    _;
  }
  modifier onlyOwnerOrDAO() {
    isOwnerOrDAO();
    _;
  }
  modifier onlyOnImplementationOrPaused() {
    isOnImplementationOrPaused();
    _;
  }
  modifier onlyMinter() {
    isMinter();
    _;
  }
  modifier onlyOwnerOrChiefDeveloper() {
    isOwnerOrChiefDeveloper();
    _;
  }

  /************************** ^MODIFIERS REGION ***************************************************** */

  /**
   *IN
   *OUT
   *if given address is owner
   */
  function isOwner(address _address) external view override returns (bool) {
    return owner() == _address;
  }

  function isOwnerOrChiefArtistOrDAO() internal view {
    require(
      msg.sender == owner() ||
        msg.sender == queenPalace.artist() ||
        msg.sender == queenPalace.daoExecutor(),
      "Not Owner, Artist, DAO"
    );
  }

  function isOwnerOrChiefDeveloperOrDAO() internal view {
    require(
      msg.sender == owner() ||
        msg.sender == queenPalace.developer() ||
        msg.sender == queenPalace.daoExecutor(),
      "Not Owner, Chief Developer, DAO"
    );
  }

  function isOwnerOrArtistOrDAO() internal view {
    require(
      msg.sender == owner() ||
        queenPalace.isArtist(msg.sender) ||
        msg.sender == queenPalace.daoExecutor(),
      "Not Owner, Artist, DAO"
    );
  }

  function isOnImplementationOrDAO() internal view {
    require(
      queenPalace.isOnImplementation() ||
        msg.sender == queenPalace.daoExecutor(),
      "Not Implementation sender not DAO"
    );
  }

  function isOnImplementationOrPaused() internal view {
    require(
      queenPalace.isOnImplementation() || paused(),
      "Not Implementation,Paused"
    );
  }

  function isOwnerOrDAO() internal view {
    require(
      msg.sender == owner() || msg.sender == queenPalace.daoExecutor(),
      "Not Owner, DAO"
    );
  }

  function isOwnerOrDeveloperOrDAO() internal view {
    require(
      msg.sender == owner() ||
        queenPalace.isDeveloper(msg.sender) ||
        msg.sender == queenPalace.daoExecutor(),
      "Not Owner, Developer, DAO"
    );
  }

  function isMinter() internal view {
    require(msg.sender == queenPalace.minter(), "Not Minter");
  }

  function isOwnerOrChiefDeveloper() internal view {
    require(
      msg.sender == owner() || msg.sender == queenPalace.developer(),
      "Not Owner, Chief Developer"
    );
  }
}

File 34 of 39 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
/// @title IERC721Metadata Extension Interface

/************************************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░██░░░░░░░░░░░░████░░░░░░░░░░░░██░░░░░░░ *
 * ░░░░░████░░░░░░░░░░██░░██░░░░░░░░░░████░░░░░░ *
 * ░░░░██████░░░░░░░░██░░░░██░░░░░░░░██████░░░░░ *
 * ░░░███░░███░░░░░░████░░████░░░░░░███░░███░░░░ *
 * ░░██████████░░░░████████████░░░░██████████░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░███░░░░███████████░░░░███████████░░░░███░░░ *
 * ░░████░░█████████████░░█████████████░░████░░░ *
 * ░░████████████████████████████████████████░░░ *
 *************************************************/

// LICENSE
// IERC721Metadata.sol modifies OpenZeppelin's interface IERC721Metadata.sol to use our modified IERC721 interface:
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Metadata.sol
//
// MODIFICATIONS:
// Its the latest `IERC721Metadata` interface from OpenZeppelin (v4.4.5) using our modified IERC721 interface.

pragma solidity ^0.8.9;

import "./IERC721.sol";

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

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

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

File 35 of 39 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 36 of 39 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 37 of 39 : 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 38 of 39 : ERC165Storage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol)

pragma solidity ^0.8.0;

import "./ERC165.sol";

/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165Storage is ERC165 {
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IQueenPalace","name":"_queenPalace","type":"address"},{"internalType":"address[]","name":"founders","type":"address[]"},{"internalType":"contract IProxyRegistry","name":"_proxyRegistry","type":"address"},{"internalType":"string","name":"_ipfsProviderUri","type":"string"},{"internalType":"string","name":"_ipfsContractHash","type":"string"},{"internalType":"contract IQueenE","name":"_oldContract","type":"address"},{"internalType":"address","name":"_royalMuseum","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subject","type":"address"}],"name":"BannedFromHouses","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"queeneId","type":"uint256"},{"indexed":false,"internalType":"string","name":"artUri","type":"string"}],"name":"FinalArtSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"queeneId","type":"uint256"},{"indexed":false,"internalType":"address","name":"museumAddress","type":"address"}],"name":"MuseumAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"common","type":"address"},{"indexed":false,"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"NominatedForHouseOfCommons","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lord","type":"address"},{"indexed":false,"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"NominatedForHouseOfLord","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":"subject","type":"address"},{"indexed":false,"internalType":"uint256","name":"queeneId","type":"uint256"},{"indexed":false,"internalType":"string","name":"house","type":"string"}],"name":"ParliamentEndOfMandate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subject","type":"address"}],"name":"ParliamentPromoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"QueenEBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"queeneId","type":"uint256"},{"indexed":false,"internalType":"address","name":"sirAddress","type":"address"}],"name":"SirAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subject","type":"address"}],"name":"SirNominated","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"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"IsSir","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_currentAuctionQueenE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"_subject","type":"address"}],"name":"banFromHouses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dnaHash","type":"uint256"}],"name":"dnaMapped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getHouseSeat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_seatType","type":"uint8"}],"name":"getHouseSeats","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_queeneId","type":"uint256"}],"name":"getQueenE","outputs":[{"components":[{"internalType":"uint256","name":"queeneId","type":"uint256"},{"internalType":"uint256","name":"description","type":"uint256"},{"internalType":"string","name":"finalArt","type":"string"},{"components":[{"internalType":"uint256","name":"traitId","type":"uint256"},{"internalType":"uint256","name":"rarityId","type":"uint256"},{"internalType":"uint256","name":"trace","type":"uint256"}],"internalType":"struct RoyalLibrary.sDNA[]","name":"dna","type":"tuple[]"},{"internalType":"uint8","name":"queenesGallery","type":"uint8"},{"internalType":"uint8","name":"sirAward","type":"uint8"}],"internalType":"struct RoyalLibrary.sQUEEN","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getQueenPalace","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"isHouseOfLordsFull","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLabLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMinterLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"isMuseum","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"queeneId","type":"uint256"}],"name":"isSirReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTraitStorageLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockQueenLab","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockQueenTraitStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintInherited","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sir","type":"address"}],"name":"nominateSir","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldContract","outputs":[{"internalType":"contract IQueenE","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyRegistry","outputs":[{"internalType":"contract IProxyRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalMuseum","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_finalArtHash","type":"string"}],"name":"setFinalArtHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_providerUri","type":"string"},{"internalType":"string","name":"_contractHash","type":"string"}],"name":"setIpfsContractURIHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IQueenPalace","name":"_queenPalace","type":"address"}],"name":"setQueenPalace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101a0604052600761016081905266697066733a2f2f60c81b6101809081526200002d9160219190620003dd565b503480156200003b57600080fd5b5060405162006662380380620066628339810160408190526200005e916200058c565b604080518082018252600680825265517565656e4560d01b60208084018290528451808601865260038152620322e360ec1b818301528551808701875284815280830193909352855180870190965292855265515545454e4560d01b908501526001805460ff191681556002559192909190620000db3362000307565b8151620000f0906005906020850190620003dd565b50805162000106906006906020840190620003dd565b50620001196380ac58cd60e01b62000359565b6200012b635b5e139f60e01b62000359565b5050815160209283012081519183019190912060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919095012090529190915261012052620001ce6313f68ee360e11b62000359565b600480546001600160a01b0319166001600160a01b038916179055600160209081558451620002049160219190870190620003dd565b5082516200021a906022906020860190620003dd565b5060005b8651811015620002b657601a60405180604001604052808984815181106200024a576200024a620006e8565b6020908102919091018101516001600160a01b039081168352600092820183905284546001808201875595845292829020845160029094020180546001600160a01b03191693909116929092178255919091015191015580620002ad81620006fe565b9150506200021e565b506001600160a01b0394851661014052601f8054610100600160a81b0319166101009387169390930292909217909155601380546001600160a01b0319169190941617909255506200076592505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160e01b03198082161415620003b85760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b828054620003eb9062000728565b90600052602060002090601f0160209004810192826200040f57600085556200045a565b82601f106200042a57805160ff19168380011785556200045a565b828001600101855582156200045a579182015b828111156200045a5782518255916020019190600101906200043d565b50620004689291506200046c565b5090565b5b808211156200046857600081556001016200046d565b6001600160a01b03811681146200049957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620004dd57620004dd6200049c565b604052919050565b8051620004f28162000483565b919050565b600082601f8301126200050957600080fd5b81516001600160401b038111156200052557620005256200049c565b60206200053b601f8301601f19168201620004b2565b82815285828487010111156200055057600080fd5b60005b838110156200057057858101830151828201840152820162000553565b83811115620005825760008385840101525b5095945050505050565b600080600080600080600060e0888a031215620005a857600080fd5b8751620005b58162000483565b602089810151919850906001600160401b0380821115620005d557600080fd5b818b0191508b601f830112620005ea57600080fd5b815181811115620005ff57620005ff6200049c565b8060051b62000610858201620004b2565b918252838101850191858101908f8411156200062b57600080fd5b948601945b83861015620006595785519250620006488362000483565b828252948601949086019062000630565b9b506200066d9250505060408c01620004e5565b975060608b01519250808311156200068457600080fd5b620006928c848d01620004f7565b965060808b0151925080831115620006a957600080fd5b5050620006b98a828b01620004f7565b935050620006ca60a08901620004e5565b9150620006da60c08901620004e5565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200072157634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806200073d57607f821691505b602082108114156200075f57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161014051615e9b620007c76000396000818161073201526123d90152600061310901526000613158015260006131330152600061308c015260006130b6015260006130e00152615e9b6000f3fe608060405234801561001057600080fd5b50600436106103a45760003560e01c80636352211e116101e9578063aa6163131161010f578063e16a9099116100ad578063e985e9c51161007c578063e985e9c5146107f3578063eac8861d14610806578063f2fde38b14610835578063fa78096e1461084857600080fd5b8063e16a9099146107b4578063e2067199146107c5578063e3bbe4f2146107d8578063e8a3d485146107eb57600080fd5b8063b765a13f116100e9578063b765a13f14610754578063b88d4fde1461077b578063c3cda5201461078e578063c87b56dd146107a157600080fd5b8063aa616313146106f4578063abbae0921461071a578063b50cbd9f1461072d57600080fd5b8063819c142f1161018757806395d89b411161015657806395d89b41146106c65780639ab24eb0146106ce578063a22cb465146106e1578063a6ca337f1461044757600080fd5b8063819c142f146106915780638456cb591461069a5780638da5cb5b146106a25780638e539e8c146106b357600080fd5b8063715018a6116101c3578063715018a61461066357806376daebe1146104475780637ecebe001461066b57806380ad222b1461067e57600080fd5b80636352211e1461062a5780636d0ace3a1461063d57806370a082311461065057600080fd5b806330503c4e116102ce5780633f4ba83a1161026c5780634f6ccce71161023b5780634f6ccce7146105cd578063587cde1e146105e05780635c19a95c1461060c5780635c975abb1461061f57600080fd5b80633f4ba83a1461059457806342842e0e1461059c57806342966c68146105af57806344c2fb19146105c257600080fd5b80633497f787116102a85780633497f787146105535780633644e51514610566578063395062ce1461056e5780633a46b1a81461058157600080fd5b806330503c4e1461050e578063313ce567146105265780633257137f1461054057600080fd5b806318160ddd116103465780632c56a340116103155780632c56a340146104c25780632f54bf6e146104d55780632f745c59146104e85780633003c941146104fb57600080fd5b806318160ddd1461045f5780631e688e101461046757806323b2cfcf1461048f57806323b872dd146104af57600080fd5b8063081812fc11610382578063081812fc14610409578063095ea7b3146104345780631249c58b14610449578063180a238a1461044757600080fd5b806301e75bd2146103a957806301ffc9a7146103e157806306fdde03146103f4575b600080fd5b6103cc6103b73660046152c3565b6000908152601c602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6103cc6103ef3660046152f2565b61085b565b6103fc61089b565b6040516103d89190615367565b61041c6104173660046152c3565b61092d565b6040516001600160a01b0390911681526020016103d8565b61044761044236600461538f565b6109c7565b005b610451610add565b6040519081526020016103d8565b600d54610451565b601f546103cc9077010000000000000000000000000000000000000000000000900460ff1681565b6104a261049d3660046152c3565b610f63565b6040516103d891906153bb565b6104476104bd366004615470565b611106565b6104516104d03660046154b1565b611150565b6103cc6104e33660046154b1565b6111a7565b6104516104f636600461538f565b6111d5565b6103cc6105093660046154b1565b61127d565b601f5461041c9061010090046001600160a01b031681565b61052e600081565b60405160ff90911681526020016103d8565b61044761054e366004615510565b61140c565b60135461041c906001600160a01b031681565b610451611612565b61044761057c3660046154b1565b61161c565b61045161058f36600461538f565b6116ee565b610447611717565b6104476105aa366004615470565b6117c2565b6104476105bd3660046152c3565b6117dd565b601f5460ff166103cc565b6104516105db3660046152c3565b61181c565b61041c6105ee3660046154b1565b6001600160a01b039081166000908152600f60205260409020541690565b61044761061a3660046154b1565b6118c0565b60015460ff166103cc565b61041c6106383660046152c3565b6118cf565b61045161064b36600461556b565b61195a565b61045161065e3660046154b1565b6119e8565b610447611a82565b6104516106793660046154b1565b611ae6565b6103cc61068c3660046154b1565b611b04565b61045160205481565b610447611b0f565b6003546001600160a01b031661041c565b6104516106c13660046152c3565b611bb7565b6103fc611c13565b6104516106dc3660046154b1565b611c22565b6104476106ef366004615596565b611c43565b601f546103cc907501000000000000000000000000000000000000000000900460ff1681565b6103cc6107283660046152c3565b611d08565b61041c7f000000000000000000000000000000000000000000000000000000000000000081565b601f546103cc90760100000000000000000000000000000000000000000000900460ff1681565b61044761078936600461568a565b611d20565b61044761079c366004615739565b611da2565b6103fc6107af3660046152c3565b611ed8565b6004546001600160a01b031661041c565b6104476107d33660046152c3565b611ffa565b6104476107e63660046154b1565b612280565b6103fc612388565b6103cc610801366004615795565b6123b3565b6103cc6108143660046152c3565b6000908152601b602052604090206004015460ff6101009091041660011490565b6104476108433660046154b1565b612498565b6104476108563660046157c3565b612563565b60006301ffc9a760e01b6001600160e01b03198316148061089557506001600160e01b0319821660009081526020819052604090205460ff165b92915050565b6060600580546108aa9061582f565b80601f01602080910402602001604051908101604052809291908181526020018280546108d69061582f565b80156109235780601f106108f857610100808354040283529160200191610923565b820191906000526020600020905b81548152906001019060200180831161090657829003601f168201915b5050505050905090565b6000818152600760205260408120546001600160a01b03166109ab5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600960205260409020546001600160a01b031690565b60006109d2826118cf565b9050806001600160a01b0316836001600160a01b03161415610a405760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109a2565b336001600160a01b0382161480610a5c5750610a5c81336123b3565b610ace5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109a2565b610ad88383612593565b505050565b6000610ae7612601565b600a602054610af6919061587a565b158015610b07575061071c60205411155b15610ec3576000610b196020546126db565b90506001600160a01b03811615801590610b68575060205460141480610b4157506020546028145b80610b4e5750602054603c145b80610b5b57506020546050145b80610b685750605a602054115b15610dbb5760208054600091610d4191849184610b84836158a4565b9091555060008052601b60209081526040805160c0810182527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea805482527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026eb54938201939093527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ec8054600194929384019190610c209061582f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c4c9061582f565b8015610c995780601f10610c6e57610100808354040283529160200191610c99565b820191906000526020600020905b815481529060010190602001808311610c7c57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610d175783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190610cc7565b505050908252506004919091015460ff80821660208401526101009091041660409091015261293f565b9050602054601a610d5184612ccd565b81548110610d6157610d616158bf565b6000918252602091829020600160029092020101919091556040516001600160a01b038416815282917fbccd19743a5aa0c18dd02d3cad5ca26e300128f40418c480d07feab6b5bb5c48910160405180910390a250610ec1565b60135460208054600092610e7a926001600160a01b03909116919084610de0836158a4565b909155506000808052601b60209081526040805160c0810182527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea805482527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026eb54938201939093527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ec8054919392840191610c209061582f565b6013546040516001600160a01b03909116815290915081907f951a2b0c1d3c654804666f9b892617a00656b04ddb04c068dd9b881413d6e7849060200160405180910390a2505b505b610f5c600460009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015610f1457600080fd5b505afa158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906158d5565b60208054906000610de0836158a4565b905090565b565b610fa26040518060c0016040528060008152602001600081526020016060815260200160608152602001600060ff168152602001600060ff1681525090565b601b60008381526020019081526020016000206040518060c00160405290816000820154815260200160018201548152602001600282018054610fe49061582f565b80601f01602080910402602001604051908101604052809291908181526020018280546110109061582f565b801561105d5780601f106110325761010080835404028352916020019161105d565b820191906000526020600020905b81548152906001019060200180831161104057829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156110db578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061108b565b505050908252506004919091015460ff80821660208401526101009091041660409091015292915050565b6001600160a01b0382161580159061113657506001600160a01b038281166000908152600f602052604090205416155b15611145576111458283612d39565b610ad8838383612dab565b600061115d601883612e26565b1561116a57506003919050565b611175601483612e26565b1561118257506001919050565b61118d601683612e26565b1561119a57506002919050565b506000919050565b919050565b6000816001600160a01b03166111c56003546001600160a01b031690565b6001600160a01b03161492915050565b60006111e0836119e8565b82106112545760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016109a2565b506001600160a01b03919091166000908152600b60209081526040808320938352929052205490565b6000611287612e48565b61128f612f1a565b6001600160a01b0382166112cd5760405162461bcd60e51b8152602060048201526005602482015264061646472360dc1b60448201526064016109a2565b6112d8601883612e26565b1561130b5760405162461bcd60e51b81526020600482015260036024820152622130b760e91b60448201526064016109a2565b61131482611b04565b156113475760405162461bcd60e51b815260206004820152600360248201526229b4b960e91b60448201526064016109a2565b6040805180820182526001600160a01b03848116808352600060208401818152601a805460018101825590835294517f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e600290960295860180546001600160a01b031916919095161790935591517f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63f90930192909255915190917fc0816b75c26a3c5443dc95e17b4ec9d1c8a9fa00f58b61b084f596c7f87f374391a2506001919050565b6003546001600160a01b031633148061149c5750600480546040516306b2f65b60e41b815233928101929092526001600160a01b031690636b2f65b09060240160206040518083038186803b15801561146457600080fd5b505afa158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c91906158f2565b6114e85760405162461bcd60e51b815260206004820152601160248201527f4e6f74204f776e65722c2041727469737400000000000000000000000000000060448201526064016109a2565b6000838152600760205260409020546001600160a01b03166115365760405162461bcd60e51b81526020600482015260076024820152661d5adb9dc81a5960ca1b60448201526064016109a2565b604080516000808252602080830180855283519020878352601b909152908390209092611569926002909201910161597e565b60405160208183030381529060405280519060200120146115b65760405162461bcd60e51b8152602060048201526007602482015266105c9d081cd95d60ca1b60448201526064016109a2565b6000838152601b602052604090206115d29060020183836151ba565b50827fc3bc11bf296abe698cfd1592e10f978d1813fbc2f809a295a1a033f8e200dde2838360405161160592919061598a565b60405180910390a2505050565b6000610f5c61307f565b60028054141561166e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a2565b6002805560015460ff166116bb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b6116c36131a6565b6116cb612f1a565b600480546001600160a01b0319166001600160a01b038316179055506001600255565b6001600160a01b03821660009081526010602052604081206117109083613295565b9392505050565b6003546001600160a01b031633146117715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b60015460ff166117ba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b610f616133a4565b610ad883838360405180602001604052806000815250611d20565b6117e5612601565b6117ee81613437565b60405181907f0aef40badbe2a4dec80cad4153b69c6d30bb8a64c1358c09af2cbf650ceba45e90600090a250565b6000611827600d5490565b821061189b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016109a2565b600d82815481106118ae576118ae6158bf565b90600052602060002001549050919050565b336118cb8183612d39565b5050565b6000818152600760205260408120546001600160a01b0316806108955760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016109a2565b600060ff8216158061196f57508160ff166003145b61197a576000611984565b61198460186134e6565b60ff8316158061199757508260ff166002145b6119a25760006119ac565b6119ac60166134e6565b60ff841615806119bf57508360ff166001145b6119ca5760006119d4565b6119d460146134e6565b6119de91906159b9565b61089591906159b9565b60006001600160a01b038216611a665760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016109a2565b506001600160a01b031660009081526008602052604090205490565b6003546001600160a01b03163314611adc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b610f6160006134f0565b6001600160a01b038116600090815260126020526040812054610895565b600061089582613542565b6003546001600160a01b03163314611b695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b60015460ff1615611baf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b610f616135c7565b6000438210611c085760405162461bcd60e51b815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e656400000000000060448201526064016109a2565b610895601183613295565b6060600680546108aa9061582f565b6001600160a01b038116600090815260106020526040812061089590613640565b6001600160a01b038216331415611c9c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109a2565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6013546000906001600160a01b03166111c5836118cf565b611d2a338361369c565b611d905760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b60648201526084016109a2565b611d9c8484848461376b565b50505050565b83421115611df25760405162461bcd60e51b815260206004820152601860248201527f566f7465733a207369676e61747572652065787069726564000000000000000060448201526064016109a2565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611e6c90611e649060a001604051602081830303815290604052805190602001206137e9565b858585613837565b9050611e778161385f565b8614611ec55760405162461bcd60e51b815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e636500000000000000000000000060448201526064016109a2565b611ecf8188612d39565b50505050505050565b6060600460009054906101000a90046001600160a01b03166001600160a01b031663f9e917566040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2857600080fd5b505afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f6091906158d5565b6001600160a01b0316636f81354e601b6000858152602001908152602001600020611f89612388565b6040518363ffffffff1660e01b8152600401611fa6929190615a27565b60006040518083038186803b158015611fbe57600080fd5b505afa158015611fd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108959190810190615b65565b6003546001600160a01b031633146120545760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b80602054146120a55760405162461bcd60e51b815260206004820152600a60248201527f496e76616c69642069640000000000000000000000000000000000000000000060448201526064016109a2565b601f546040516323b2cfcf60e01b81526004810183905260009161010090046001600160a01b0316906323b2cfcf9060240160006040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261212b9190810190615c53565b8051909150821461217e5760405162461bcd60e51b815260206004820152601760248201527f4f6c6420517565656e4520646f6e27742065786973747300000000000000000060448201526064016109a2565b6121af6121936003546001600160a01b031690565b602080549060006121a3836158a4565b9190505560008461293f565b508060400151601b600084815260200190815260200160002060020190805190602001906121de92919061523a565b50601f546040516331a9108f60e11b8152600481018490526101009091046001600160a01b031690636352211e9060240160206040518083038186803b15801561222757600080fd5b505afa925050508015612257575060408051601f3d908101601f19168201909252612254918101906158d5565b60015b612264576118cb82613437565b610ad86122796003546001600160a01b031690565b8285611106565b60015460ff16156122c65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b6122ce6131a6565b6122d6612f1a565b6122e1601882612e26565b6122f2576122f0601882613887565b505b6122fd601482612e26565b1561230f5761230d60148261389c565b505b61231a601682612e26565b1561232c5761232a60168261389c565b505b600061233782611c22565b11156123515761235181600061234c84611c22565b6138b1565b6040516001600160a01b038216907f4675b3cb6fe3fe878134eda008b70f1b70874566513cbb335a7d612595a6f66c90600090a250565b60606021602260405160200161239f929190615d1a565b604051602081830303815290604052905090565b60405163c455279160e01b81526001600160a01b038381166004830152600091818416917f0000000000000000000000000000000000000000000000000000000000000000169063c45527919060240160206040518083038186803b15801561241b57600080fd5b505afa15801561242f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245391906158d5565b6001600160a01b0316141561246a57506001610895565b6001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff16611710565b6003546001600160a01b031633146124f25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b6001600160a01b0381166125575760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a2565b612560816134f0565b50565b61256b613921565b612573612f1a565b61257f602185856151ba565b5061258c602283836151ba565b5050505050565b600081815260096020526040902080546001600160a01b0319166001600160a01b03841690811790915581906125c8826118cf565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561264357600080fd5b505afa158015612657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267b91906158d5565b6001600160a01b0316336001600160a01b031614610f615760405162461bcd60e51b815260206004820152600a60248201527f4e6f74204d696e7465720000000000000000000000000000000000000000000060448201526064016109a2565b60008080805b601a5481101561277957601a81815481106126fe576126fe6158bf565b90600052602060002090600202016001015460001480156127545750612752601a8281548110612730576127306158bf565b60009182526020909120600290910201546018906001600160a01b0316612e26565b155b156127675782612763816158a4565b9350505b80612771816158a4565b9150506126e1565b5060008267ffffffffffffffff811115612795576127956155cf565b6040519080825280602002602001820160405280156127be578160200160208202803683370190505b50905060005b601a5481101561289757601a81815481106127e1576127e16158bf565b90600052602060002090600202016001015460001480156128155750612813601a8281548110612730576127306158bf565b155b1561288557601a818154811061282d5761282d6158bf565b60009182526020909120600290910201546001600160a01b03168284612852816158a4565b955081518110612864576128646158bf565b60200260200101906001600160a01b031690816001600160a01b0316815250505b8061288f816158a4565b9150506127c4565b508051600114156128c757806000815181106128b5576128b56158bf565b60200260200101519350505050919050565b60018151111561293457805181906128e0600143615d2f565b60408051914060208301528101889052444060608201524240608082015260a0016040516020818303038152906040528051906020012060001c612924919061587a565b815181106128b5576128b56158bf565b506000949350505050565b8051600090612a4b576004805460408051637cf48bab60e11b815290516001600160a01b039092169263f9e91756928282019260209290829003018186803b15801561298a57600080fd5b505afa15801561299e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c291906158d5565b604051631be4100960e21b81526004810186905284151560248201526001600160a01b039190911690636f9040249060440160006040518083038186803b158015612a0c57600080fd5b505afa158015612a20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a489190810190615c53565b91505b81516000858152601b6020526040812091825560808401516004909201805460a086015160ff9081166101000261ffff19909216941693909317929092179091555b826060015151811015612b1857601b600086815260200190815260200160002060030183606001518281518110612ac657612ac66158bf565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519282019290925560409091015160029091015580612b10816158a4565b915050612a8d565b506020808301516000868152601b8352604080822060018082019490945590519293601c93612b4b926003019101615d46565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600480548251637cf48bab60e11b815292516001600160a01b039091169363f9e91756938084019391929190829003018186803b158015612bc257600080fd5b505afa158015612bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bfa91906158d5565b6001600160a01b031663a58454e683606001516040518263ffffffff1660e01b8152600401612c299190615d59565b60206040518083038186803b158015612c4157600080fd5b505afa158015612c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c799190615db5565b6000858152601d60205260409020805460ff19166001836003811115612ca157612ca1615dd6565b0217905550612cc2612cbb6003546001600160a01b031690565b8686613a92565b50825b949350505050565b6000805b601a54811015612d3057826001600160a01b0316601a8281548110612cf857612cf86158bf565b60009182526020909120600290910201546001600160a01b03161415612d1e5792915050565b80612d28816158a4565b915050612cd1565b50600092915050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610ad88183612da686613c2f565b613c3a565b612db5338261369c565b612e1b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b60648201526084016109a2565b610ad8838383613d77565b6001600160a01b03811660009081526001830160205260408120541515611710565b612e5133611b04565b80612ee65750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612e9957600080fd5b505afa158015612ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed191906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b81526020600482015260056024820152642737b9b4b960d91b60448201526064016109a2565b60048054604080516302b2897560e11b815290516001600160a01b039092169263056512ea928282019260209290829003018186803b158015612f5c57600080fd5b505afa158015612f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9491906158f2565b806130295750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612fdc57600080fd5b505afa158015612ff0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301491906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152602160248201527f4e6f7420496d706c656d656e746174696f6e2073656e646572206e6f742044416044820152604f60f81b60648201526084016109a2565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156130d857507f000000000000000000000000000000000000000000000000000000000000000046145b1561310257507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6003546001600160a01b03163314806132495750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b1580156131fc57600080fd5b505afa158015613210573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323491906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152600e60248201527f4e6f74204f776e65722c2044414f00000000000000000000000000000000000060448201526064016109a2565b60004382106132e65760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e656460448201526064016109a2565b825460005b8181101561334b5760006132ff8284613f3c565b905084866000018281548110613317576133176158bf565b60009182526020909120015463ffffffff16111561333757809250613345565b6133428160016159b9565b91505b506132eb565b811561338f578461335d600184615d2f565b8154811061336d5761336d6158bf565b60009182526020909120015464010000000090046001600160e01b0316613392565b60005b6001600160e01b031695945050505050565b60015460ff166133ed5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000613442826118cf565b905061345081600084613f57565b61345b600083612593565b6001600160a01b0381166000908152600860205260408120805460019290613484908490615d2f565b909155505060008281526007602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a46118cb81600084613f62565b6000610895825490565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000805b601a54811015612d3057826001600160a01b0316601a828154811061356d5761356d6158bf565b60009182526020909120600290910201546001600160a01b03161480156135a757506135a5601a8281548110612730576127306158bf565b155b156135b55750600192915050565b806135bf816158a4565b915050613546565b60015460ff161561360d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361341a565b805460009080156136895782613657600183615d2f565b81548110613667576136676158bf565b60009182526020909120015464010000000090046001600160e01b031661368c565b60005b6001600160e01b03169392505050565b6000818152600760205260408120546001600160a01b03166137155760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109a2565b6000613720836118cf565b9050806001600160a01b0316846001600160a01b0316148061375b5750836001600160a01b03166137508461092d565b6001600160a01b0316145b80612cc55750612cc581856123b3565b613776848484613d77565b613782848484846142e8565b611d9c5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109a2565b60006108956137f661307f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006138488787878761443d565b915091506138558161452a565b5095945050505050565b6001600160a01b03811660009081526012602052604090208054600181018255905b50919050565b6000611710836001600160a01b0384166146e5565b6000611710836001600160a01b038416614734565b6001600160a01b0383166138d0576138cd601161482783614833565b50505b6001600160a01b0382166138ef576138ec601161486183614833565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054610ad892918216911683613c3a565b6003546001600160a01b03163314806139b15750600480546040516305eca4a760e41b815233928101929092526001600160a01b031690635eca4a709060240160206040518083038186803b15801561397957600080fd5b505afa15801561398d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b191906158f2565b80613a465750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b1580156139f957600080fd5b505afa158015613a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3191906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152601960248201527f4e6f74204f776e65722c20446576656c6f7065722c2044414f0000000000000060448201526064016109a2565b6001600160a01b038216613ae85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109a2565b6000818152600760205260409020546001600160a01b031615613b4d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109a2565b613b5960008383613f57565b6001600160a01b0382166000908152600860205260408120805460019290613b829084906159b9565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03868116919091179091559051839291861691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610ad860008383613f62565b600061089582611c22565b816001600160a01b0316836001600160a01b031614158015613c5c5750600081115b15610ad8576001600160a01b03831615613cea576001600160a01b03831660009081526010602052604081208190613c979061486185614833565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613cdf929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615610ad8576001600160a01b03821660009081526010602052604081208190613d209061482785614833565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613d68929190918252602082015260400190565b60405180910390a25050505050565b826001600160a01b0316613d8a826118cf565b6001600160a01b031614613e065760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016109a2565b6001600160a01b038216613e685760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109a2565b613e73838383613f57565b613e7e600082612593565b6001600160a01b0383166000908152600860205260408120805460019290613ea7908490615d2f565b90915550506001600160a01b0382166000908152600860205260408120805460019290613ed59084906159b9565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ad8838383613f62565b6000613f4b6002848418615dec565b611710908484166159b9565b610ad883838361486d565b6000806000838152601d602052604090205460ff166003811115613f8857613f88615dd6565b1180613fa857506000828152601b602052604090206004015460ff166001145b613fb3576001613fb6565b60025b60135490915060ff82169081906001600160a01b0386811691161480614066575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561401957600080fd5b505afa15801561402d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061405191906158d5565b6001600160a01b0316856001600160a01b0316145b8061409a57506000848152601b602052604090206004015460ff61010090910416600114801561409a575061409a85611b04565b806140ab57506140ab601886612e26565b156140b4575060005b6013546001600160a01b038781169116148061415a575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561410d57600080fd5b505afa158015614121573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061414591906158d5565b6001600160a01b0316866001600160a01b0316145b8061418e57506000848152601b602052604090206004015460ff61010090910416600114801561418e575061418e86611b04565b8061419f575061419f601887612e26565b156141a957600091505b81156141bb576141bb866000846138b1565b80156141cd576141cd600086836138b1565b6001600160a01b0386166000908152601e602052604090206141ef9085614925565b15614218576001600160a01b0386166000908152601e60205260409020614216908561493d565b505b6001600160a01b0385166000908152601e6020526040902061423a9085614925565b614262576001600160a01b0385166000908152601e602052604090206142609085614949565b505b61426c8685614955565b6142a15760405162461bcd60e51b81526020600482015260066024820152651d1adcd9585d60d21b60448201526064016109a2565b6142ab8585614b4e565b6142e05760405162461bcd60e51b815260206004820152600660248201526519dd9cd9585d60d21b60448201526064016109a2565b505050505050565b60006001600160a01b0384163b1561443557604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061432c903390899088908890600401615e00565b602060405180830381600087803b15801561434657600080fd5b505af1925050508015614376575060408051601f3d908101601f1916820190925261437391810190615e32565b60015b61441b573d8080156143a4576040519150601f19603f3d011682016040523d82523d6000602084013e6143a9565b606091505b5080516144135760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109a2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612cc5565b506001612cc5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156144745750600090506003614521565b8460ff16601b1415801561448c57508460ff16601c14155b1561449d5750600090506004614521565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156144f1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661451a57600060019250925050614521565b9150600090505b94509492505050565b600081600481111561453e5761453e615dd6565b14156145475750565b600181600481111561455b5761455b615dd6565b14156145a95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a2565b60028160048111156145bd576145bd615dd6565b141561460b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a2565b600381600481111561461f5761461f615dd6565b14156146785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a2565b600481600481111561468c5761468c615dd6565b14156125605760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109a2565b600081815260018301602052604081205461472c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610895565b506000610895565b6000818152600183016020526040812054801561481d576000614758600183615d2f565b855490915060009061476c90600190615d2f565b90508181146147d157600086600001828154811061478c5761478c6158bf565b90600052602060002001549050808760000184815481106147af576147af6158bf565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806147e2576147e2615e4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610895565b6000915050610895565b600061171082846159b9565b6000806148558561485061484688613640565b868863ffffffff16565b614df7565b91509150935093915050565b60006117108284615d2f565b6001600160a01b0383166148c8576148c381600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b6148eb565b816001600160a01b0316836001600160a01b0316146148eb576148eb8382614f22565b6001600160a01b03821661490257610ad881614fbf565b826001600160a01b0316826001600160a01b031614610ad857610ad8828261506e565b60008181526001830160205260408120541515611710565b60006117108383614734565b600061171083836146e5565b6000614962601484612e26565b1580156149775750614975601684612e26565b155b1561498457506001610895565b600061498f846119e8565b11614a345761499f601484612e26565b156149b1576149af60148461389c565b505b6149bc601684612e26565b156149ce576149cc60168461389c565b505b826001600160a01b03167f0545cfc7cd520388d4a182a7c4f82bb4c947ab8033f01089cb57a8359acfce0683604051614a249181526040602082018190526003908201526210531360ea1b606082015260800190565b60405180910390a2506001610895565b6000805b6001600160a01b0385166000908152601e60205260409020614a59906134e6565b811015614b115760006001600160a01b0386166000908152601e60205260408120601d9190614a8890856150b2565b815260208101919091526040016000205460ff166003811115614aad57614aad615dd6565b1180614af557506001600160a01b0385166000908152601e60205260408120601b9190614ada90846150b2565b815260208101919091526040016000206004015460ff166001145b15614aff57600191505b80614b09816158a4565b915050614a38565b5080158015614b265750614b26601485612e26565b15614b4457614b3660148561389c565b50614b42601685613887565b505b5060019392505050565b60006001600160a01b038316614b6657506001610895565b6013546001600160a01b0384811691161480614c0c575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b158015614bbf57600080fd5b505afa158015614bd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bf791906158d5565b6001600160a01b0316836001600160a01b0316145b15614c1957506001610895565b614c2283611b04565b8015614c4857506000828152601b602052604090206004015460ff610100909104166001145b15614c5557506001610895565b614c60601884612e26565b15614c6d57506001610895565b6000828152601d602052604081205460ff166003811115614c9057614c90615dd6565b1180614cb057506000828152601b602052604090206004015460ff166001145b80614cbe5750601f5460ff16155b15614d7557614cce601484612e26565b15614cdb57506001610895565b614ce6601684612e26565b614cf757614cf560168461389c565b505b614d02601484613887565b50826001600160a01b03167fbd647e07d2ec1441b6f77851436c4478a1db786b005668bab0ed84d7ecb56e1483604051614d3e91815260200190565b60405180910390a2601f5460ff16614d7057600f614d5c60146134e6565b601f805460ff191692909110159190911790555b614dee565b614d80601484612e26565b80614d915750614d91601684612e26565b15614d9e57506001610895565b614da9601684613887565b50826001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960783604051614de591815260200190565b60405180910390a25b50600192915050565b8154600090819081614e0886613640565b9050600082118015614e4657504386614e22600185615d2f565b81548110614e3257614e326158bf565b60009182526020909120015463ffffffff16145b15614ea657614e54856150be565b86614e60600185615d2f565b81548110614e7057614e706158bf565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550614f14565b856000016040518060400160405280614ebe4361512b565b63ffffffff168152602001614ed2886150be565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b60006001614f2f846119e8565b614f399190615d2f565b6000838152600c6020526040902054909150808214614f8c576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d54600090614fd190600190615d2f565b6000838152600e6020526040812054600d8054939450909284908110614ff957614ff96158bf565b9060005260206000200154905080600d838154811061501a5761501a6158bf565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d80548061505257615052615e4f565b6001900381819060005260206000200160009055905550505050565b6000615079836119e8565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b60006117108383615190565b60006001600160e01b038211156151275760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b60648201526084016109a2565b5090565b600063ffffffff8211156151275760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b60648201526084016109a2565b60008260000182815481106151a7576151a76158bf565b9060005260206000200154905092915050565b8280546151c69061582f565b90600052602060002090601f0160209004810192826151e8576000855561522e565b82601f106152015782800160ff1982351617855561522e565b8280016001018555821561522e579182015b8281111561522e578235825591602001919060010190615213565b506151279291506152ae565b8280546152469061582f565b90600052602060002090601f016020900481019282615268576000855561522e565b82601f1061528157805160ff191683800117855561522e565b8280016001018555821561522e579182015b8281111561522e578251825591602001919060010190615293565b5b8082111561512757600081556001016152af565b6000602082840312156152d557600080fd5b5035919050565b6001600160e01b03198116811461256057600080fd5b60006020828403121561530457600080fd5b8135611710816152dc565b60005b8381101561532a578181015183820152602001615312565b83811115611d9c5750506000910152565b6000815180845261535381602086016020860161530f565b601f01601f19169290920160200192915050565b602081526000611710602083018461533b565b6001600160a01b038116811461256057600080fd5b600080604083850312156153a257600080fd5b82356153ad8161537a565b946020939093013593505050565b60006020808352835181840152808401516040840152604084015160c060608501526153ea60e085018261533b565b6060860151858203601f19016080870152805180835290840192506000918401905b80831015615444578351805183526020808201519084015260409081015190830152606082019150848401935060018301925061540c565b50608087015160ff811660a0880152935060a087015160ff811660c088015293505b9695505050505050565b60008060006060848603121561548557600080fd5b83356154908161537a565b925060208401356154a08161537a565b929592945050506040919091013590565b6000602082840312156154c357600080fd5b81356117108161537a565b60008083601f8401126154e057600080fd5b50813567ffffffffffffffff8111156154f857600080fd5b602083019150836020828501011115614f1b57600080fd5b60008060006040848603121561552557600080fd5b83359250602084013567ffffffffffffffff81111561554357600080fd5b61554f868287016154ce565b9497909650939450505050565b60ff8116811461256057600080fd5b60006020828403121561557d57600080fd5b81356117108161555c565b801515811461256057600080fd5b600080604083850312156155a957600080fd5b82356155b48161537a565b915060208301356155c481615588565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615608576156086155cf565b60405290565b60405160c0810167ffffffffffffffff81118282101715615608576156086155cf565b604051601f8201601f1916810167ffffffffffffffff8111828210171561565a5761565a6155cf565b604052919050565b600067ffffffffffffffff82111561567c5761567c6155cf565b50601f01601f191660200190565b600080600080608085870312156156a057600080fd5b84356156ab8161537a565b935060208501356156bb8161537a565b925060408501359150606085013567ffffffffffffffff8111156156de57600080fd5b8501601f810187136156ef57600080fd5b80356157026156fd82615662565b615631565b81815288602083850101111561571757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060008060008060c0878903121561575257600080fd5b863561575d8161537a565b95506020870135945060408701359350606087013561577b8161555c565b9598949750929560808101359460a0909101359350915050565b600080604083850312156157a857600080fd5b82356157b38161537a565b915060208301356155c48161537a565b600080600080604085870312156157d957600080fd5b843567ffffffffffffffff808211156157f157600080fd5b6157fd888389016154ce565b9096509450602087013591508082111561581657600080fd5b50615823878288016154ce565b95989497509550505050565b600181811c9082168061584357607f821691505b6020821081141561388157634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261588957615889615864565b500690565b634e487b7160e01b600052601160045260246000fd5b60006000198214156158b8576158b861588e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156158e757600080fd5b81516117108161537a565b60006020828403121561590457600080fd5b815161171081615588565b6000815461591c8161582f565b60018281168015615934576001811461594557615974565b60ff19841687528287019450615974565b8560005260208060002060005b8581101561596b5781548a820152908401908201615952565b50505082870194505b5050505092915050565b6000611710828461590f565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082198211156159cc576159cc61588e565b500190565b6000815480845260208085019450836000528060002060005b83811015615a1c57815487526001808301548489015260028301546040890152606090970196600390920191016159ea565b509495945050505050565b6040815282546040820152600060018085015460608401526002850160c0608085015260008154615a578161582f565b8061010088015261012085831660008114615a795760018114615a8e57615abf565b60ff1984168983015261014089019450615abf565b8560005260208060002060005b85811015615ab65781548c8201860152908901908201615a9b565b8b018401965050505b50505050848103603f190160a0860152615adc81600389016159d1565b925050506004850154615af760c0850160ff831660ff169052565b600881901c60ff1660e0850152508281036020840152615b17818561533b565b95945050505050565b600082601f830112615b3157600080fd5b8151615b3f6156fd82615662565b818152846020838601011115615b5457600080fd5b612cc582602083016020870161530f565b600060208284031215615b7757600080fd5b815167ffffffffffffffff811115615b8e57600080fd5b612cc584828501615b20565b600082601f830112615bab57600080fd5b8151602067ffffffffffffffff821115615bc757615bc76155cf565b615bd5818360051b01615631565b82815260609283028501820192828201919087851115615bf457600080fd5b8387015b85811015615c3b5781818a031215615c105760008081fd5b615c186155e5565b815181528582015186820152604080830151908201528452928401928101615bf8565b5090979650505050505050565b80516111a28161555c565b600060208284031215615c6557600080fd5b815167ffffffffffffffff80821115615c7d57600080fd5b9083019060c08286031215615c9157600080fd5b615c9961560e565b8251815260208301516020820152604083015182811115615cb957600080fd5b615cc587828601615b20565b604083015250606083015182811115615cdd57600080fd5b615ce987828601615b9a565b606083015250615cfb60808401615c48565b6080820152615d0c60a08401615c48565b60a082015295945050505050565b6000612cc5615d29838661590f565b8461590f565b600082821015615d4157615d4161588e565b500390565b60208152600061171060208301846159d1565b6020808252825182820181905260009190848201906040850190845b81811015615da957835180518452602080820151908501526040908101519084015260608301938501939250600101615d75565b50909695505050505050565b600060208284031215615dc757600080fd5b81516004811061171057600080fd5b634e487b7160e01b600052602160045260246000fd5b600082615dfb57615dfb615864565b500490565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615466608083018461533b565b600060208284031215615e4457600080fd5b8151611710816152dc565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b07ecfd0203c4b682481f06274c178a0fa07deb5707c1699aa7e99753777f6e664736f6c634300080900330000000000000000000000002fa631c48374a280eb04cd41490665eca635a35500000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000d0bf16f1ed8fdf70097e9b26c76d30352d6560a20000000000000000000000006db0530a1a147cf9788b356232e905c02606cd0c00000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a860000000000000000000000001822d8c387a786ec671b63186b99c51072595278000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be200000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103a45760003560e01c80636352211e116101e9578063aa6163131161010f578063e16a9099116100ad578063e985e9c51161007c578063e985e9c5146107f3578063eac8861d14610806578063f2fde38b14610835578063fa78096e1461084857600080fd5b8063e16a9099146107b4578063e2067199146107c5578063e3bbe4f2146107d8578063e8a3d485146107eb57600080fd5b8063b765a13f116100e9578063b765a13f14610754578063b88d4fde1461077b578063c3cda5201461078e578063c87b56dd146107a157600080fd5b8063aa616313146106f4578063abbae0921461071a578063b50cbd9f1461072d57600080fd5b8063819c142f1161018757806395d89b411161015657806395d89b41146106c65780639ab24eb0146106ce578063a22cb465146106e1578063a6ca337f1461044757600080fd5b8063819c142f146106915780638456cb591461069a5780638da5cb5b146106a25780638e539e8c146106b357600080fd5b8063715018a6116101c3578063715018a61461066357806376daebe1146104475780637ecebe001461066b57806380ad222b1461067e57600080fd5b80636352211e1461062a5780636d0ace3a1461063d57806370a082311461065057600080fd5b806330503c4e116102ce5780633f4ba83a1161026c5780634f6ccce71161023b5780634f6ccce7146105cd578063587cde1e146105e05780635c19a95c1461060c5780635c975abb1461061f57600080fd5b80633f4ba83a1461059457806342842e0e1461059c57806342966c68146105af57806344c2fb19146105c257600080fd5b80633497f787116102a85780633497f787146105535780633644e51514610566578063395062ce1461056e5780633a46b1a81461058157600080fd5b806330503c4e1461050e578063313ce567146105265780633257137f1461054057600080fd5b806318160ddd116103465780632c56a340116103155780632c56a340146104c25780632f54bf6e146104d55780632f745c59146104e85780633003c941146104fb57600080fd5b806318160ddd1461045f5780631e688e101461046757806323b2cfcf1461048f57806323b872dd146104af57600080fd5b8063081812fc11610382578063081812fc14610409578063095ea7b3146104345780631249c58b14610449578063180a238a1461044757600080fd5b806301e75bd2146103a957806301ffc9a7146103e157806306fdde03146103f4575b600080fd5b6103cc6103b73660046152c3565b6000908152601c602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6103cc6103ef3660046152f2565b61085b565b6103fc61089b565b6040516103d89190615367565b61041c6104173660046152c3565b61092d565b6040516001600160a01b0390911681526020016103d8565b61044761044236600461538f565b6109c7565b005b610451610add565b6040519081526020016103d8565b600d54610451565b601f546103cc9077010000000000000000000000000000000000000000000000900460ff1681565b6104a261049d3660046152c3565b610f63565b6040516103d891906153bb565b6104476104bd366004615470565b611106565b6104516104d03660046154b1565b611150565b6103cc6104e33660046154b1565b6111a7565b6104516104f636600461538f565b6111d5565b6103cc6105093660046154b1565b61127d565b601f5461041c9061010090046001600160a01b031681565b61052e600081565b60405160ff90911681526020016103d8565b61044761054e366004615510565b61140c565b60135461041c906001600160a01b031681565b610451611612565b61044761057c3660046154b1565b61161c565b61045161058f36600461538f565b6116ee565b610447611717565b6104476105aa366004615470565b6117c2565b6104476105bd3660046152c3565b6117dd565b601f5460ff166103cc565b6104516105db3660046152c3565b61181c565b61041c6105ee3660046154b1565b6001600160a01b039081166000908152600f60205260409020541690565b61044761061a3660046154b1565b6118c0565b60015460ff166103cc565b61041c6106383660046152c3565b6118cf565b61045161064b36600461556b565b61195a565b61045161065e3660046154b1565b6119e8565b610447611a82565b6104516106793660046154b1565b611ae6565b6103cc61068c3660046154b1565b611b04565b61045160205481565b610447611b0f565b6003546001600160a01b031661041c565b6104516106c13660046152c3565b611bb7565b6103fc611c13565b6104516106dc3660046154b1565b611c22565b6104476106ef366004615596565b611c43565b601f546103cc907501000000000000000000000000000000000000000000900460ff1681565b6103cc6107283660046152c3565b611d08565b61041c7f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c181565b601f546103cc90760100000000000000000000000000000000000000000000900460ff1681565b61044761078936600461568a565b611d20565b61044761079c366004615739565b611da2565b6103fc6107af3660046152c3565b611ed8565b6004546001600160a01b031661041c565b6104476107d33660046152c3565b611ffa565b6104476107e63660046154b1565b612280565b6103fc612388565b6103cc610801366004615795565b6123b3565b6103cc6108143660046152c3565b6000908152601b602052604090206004015460ff6101009091041660011490565b6104476108433660046154b1565b612498565b6104476108563660046157c3565b612563565b60006301ffc9a760e01b6001600160e01b03198316148061089557506001600160e01b0319821660009081526020819052604090205460ff165b92915050565b6060600580546108aa9061582f565b80601f01602080910402602001604051908101604052809291908181526020018280546108d69061582f565b80156109235780601f106108f857610100808354040283529160200191610923565b820191906000526020600020905b81548152906001019060200180831161090657829003601f168201915b5050505050905090565b6000818152600760205260408120546001600160a01b03166109ab5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600960205260409020546001600160a01b031690565b60006109d2826118cf565b9050806001600160a01b0316836001600160a01b03161415610a405760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016109a2565b336001600160a01b0382161480610a5c5750610a5c81336123b3565b610ace5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109a2565b610ad88383612593565b505050565b6000610ae7612601565b600a602054610af6919061587a565b158015610b07575061071c60205411155b15610ec3576000610b196020546126db565b90506001600160a01b03811615801590610b68575060205460141480610b4157506020546028145b80610b4e5750602054603c145b80610b5b57506020546050145b80610b685750605a602054115b15610dbb5760208054600091610d4191849184610b84836158a4565b9091555060008052601b60209081526040805160c0810182527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea805482527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026eb54938201939093527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ec8054600194929384019190610c209061582f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c4c9061582f565b8015610c995780601f10610c6e57610100808354040283529160200191610c99565b820191906000526020600020905b815481529060010190602001808311610c7c57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610d175783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190610cc7565b505050908252506004919091015460ff80821660208401526101009091041660409091015261293f565b9050602054601a610d5184612ccd565b81548110610d6157610d616158bf565b6000918252602091829020600160029092020101919091556040516001600160a01b038416815282917fbccd19743a5aa0c18dd02d3cad5ca26e300128f40418c480d07feab6b5bb5c48910160405180910390a250610ec1565b60135460208054600092610e7a926001600160a01b03909116919084610de0836158a4565b909155506000808052601b60209081526040805160c0810182527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ea805482527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026eb54938201939093527f584f46c60af19681376031579adb04a2416e54ee5505351c2a8435e3766026ec8054919392840191610c209061582f565b6013546040516001600160a01b03909116815290915081907f951a2b0c1d3c654804666f9b892617a00656b04ddb04c068dd9b881413d6e7849060200160405180910390a2505b505b610f5c600460009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015610f1457600080fd5b505afa158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906158d5565b60208054906000610de0836158a4565b905090565b565b610fa26040518060c0016040528060008152602001600081526020016060815260200160608152602001600060ff168152602001600060ff1681525090565b601b60008381526020019081526020016000206040518060c00160405290816000820154815260200160018201548152602001600282018054610fe49061582f565b80601f01602080910402602001604051908101604052809291908181526020018280546110109061582f565b801561105d5780601f106110325761010080835404028352916020019161105d565b820191906000526020600020905b81548152906001019060200180831161104057829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156110db578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508152602001906001019061108b565b505050908252506004919091015460ff80821660208401526101009091041660409091015292915050565b6001600160a01b0382161580159061113657506001600160a01b038281166000908152600f602052604090205416155b15611145576111458283612d39565b610ad8838383612dab565b600061115d601883612e26565b1561116a57506003919050565b611175601483612e26565b1561118257506001919050565b61118d601683612e26565b1561119a57506002919050565b506000919050565b919050565b6000816001600160a01b03166111c56003546001600160a01b031690565b6001600160a01b03161492915050565b60006111e0836119e8565b82106112545760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016109a2565b506001600160a01b03919091166000908152600b60209081526040808320938352929052205490565b6000611287612e48565b61128f612f1a565b6001600160a01b0382166112cd5760405162461bcd60e51b8152602060048201526005602482015264061646472360dc1b60448201526064016109a2565b6112d8601883612e26565b1561130b5760405162461bcd60e51b81526020600482015260036024820152622130b760e91b60448201526064016109a2565b61131482611b04565b156113475760405162461bcd60e51b815260206004820152600360248201526229b4b960e91b60448201526064016109a2565b6040805180820182526001600160a01b03848116808352600060208401818152601a805460018101825590835294517f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e600290960295860180546001600160a01b031916919095161790935591517f057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63f90930192909255915190917fc0816b75c26a3c5443dc95e17b4ec9d1c8a9fa00f58b61b084f596c7f87f374391a2506001919050565b6003546001600160a01b031633148061149c5750600480546040516306b2f65b60e41b815233928101929092526001600160a01b031690636b2f65b09060240160206040518083038186803b15801561146457600080fd5b505afa158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c91906158f2565b6114e85760405162461bcd60e51b815260206004820152601160248201527f4e6f74204f776e65722c2041727469737400000000000000000000000000000060448201526064016109a2565b6000838152600760205260409020546001600160a01b03166115365760405162461bcd60e51b81526020600482015260076024820152661d5adb9dc81a5960ca1b60448201526064016109a2565b604080516000808252602080830180855283519020878352601b909152908390209092611569926002909201910161597e565b60405160208183030381529060405280519060200120146115b65760405162461bcd60e51b8152602060048201526007602482015266105c9d081cd95d60ca1b60448201526064016109a2565b6000838152601b602052604090206115d29060020183836151ba565b50827fc3bc11bf296abe698cfd1592e10f978d1813fbc2f809a295a1a033f8e200dde2838360405161160592919061598a565b60405180910390a2505050565b6000610f5c61307f565b60028054141561166e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109a2565b6002805560015460ff166116bb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b6116c36131a6565b6116cb612f1a565b600480546001600160a01b0319166001600160a01b038316179055506001600255565b6001600160a01b03821660009081526010602052604081206117109083613295565b9392505050565b6003546001600160a01b031633146117715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b60015460ff166117ba5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b610f616133a4565b610ad883838360405180602001604052806000815250611d20565b6117e5612601565b6117ee81613437565b60405181907f0aef40badbe2a4dec80cad4153b69c6d30bb8a64c1358c09af2cbf650ceba45e90600090a250565b6000611827600d5490565b821061189b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016109a2565b600d82815481106118ae576118ae6158bf565b90600052602060002001549050919050565b336118cb8183612d39565b5050565b6000818152600760205260408120546001600160a01b0316806108955760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016109a2565b600060ff8216158061196f57508160ff166003145b61197a576000611984565b61198460186134e6565b60ff8316158061199757508260ff166002145b6119a25760006119ac565b6119ac60166134e6565b60ff841615806119bf57508360ff166001145b6119ca5760006119d4565b6119d460146134e6565b6119de91906159b9565b61089591906159b9565b60006001600160a01b038216611a665760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016109a2565b506001600160a01b031660009081526008602052604090205490565b6003546001600160a01b03163314611adc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b610f6160006134f0565b6001600160a01b038116600090815260126020526040812054610895565b600061089582613542565b6003546001600160a01b03163314611b695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b60015460ff1615611baf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b610f616135c7565b6000438210611c085760405162461bcd60e51b815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e656400000000000060448201526064016109a2565b610895601183613295565b6060600680546108aa9061582f565b6001600160a01b038116600090815260106020526040812061089590613640565b6001600160a01b038216331415611c9c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109a2565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6013546000906001600160a01b03166111c5836118cf565b611d2a338361369c565b611d905760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b60648201526084016109a2565b611d9c8484848461376b565b50505050565b83421115611df25760405162461bcd60e51b815260206004820152601860248201527f566f7465733a207369676e61747572652065787069726564000000000000000060448201526064016109a2565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611e6c90611e649060a001604051602081830303815290604052805190602001206137e9565b858585613837565b9050611e778161385f565b8614611ec55760405162461bcd60e51b815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e636500000000000000000000000060448201526064016109a2565b611ecf8188612d39565b50505050505050565b6060600460009054906101000a90046001600160a01b03166001600160a01b031663f9e917566040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2857600080fd5b505afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f6091906158d5565b6001600160a01b0316636f81354e601b6000858152602001908152602001600020611f89612388565b6040518363ffffffff1660e01b8152600401611fa6929190615a27565b60006040518083038186803b158015611fbe57600080fd5b505afa158015611fd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108959190810190615b65565b6003546001600160a01b031633146120545760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b80602054146120a55760405162461bcd60e51b815260206004820152600a60248201527f496e76616c69642069640000000000000000000000000000000000000000000060448201526064016109a2565b601f546040516323b2cfcf60e01b81526004810183905260009161010090046001600160a01b0316906323b2cfcf9060240160006040518083038186803b1580156120ef57600080fd5b505afa158015612103573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261212b9190810190615c53565b8051909150821461217e5760405162461bcd60e51b815260206004820152601760248201527f4f6c6420517565656e4520646f6e27742065786973747300000000000000000060448201526064016109a2565b6121af6121936003546001600160a01b031690565b602080549060006121a3836158a4565b9190505560008461293f565b508060400151601b600084815260200190815260200160002060020190805190602001906121de92919061523a565b50601f546040516331a9108f60e11b8152600481018490526101009091046001600160a01b031690636352211e9060240160206040518083038186803b15801561222757600080fd5b505afa925050508015612257575060408051601f3d908101601f19168201909252612254918101906158d5565b60015b612264576118cb82613437565b610ad86122796003546001600160a01b031690565b8285611106565b60015460ff16156122c65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b6122ce6131a6565b6122d6612f1a565b6122e1601882612e26565b6122f2576122f0601882613887565b505b6122fd601482612e26565b1561230f5761230d60148261389c565b505b61231a601682612e26565b1561232c5761232a60168261389c565b505b600061233782611c22565b11156123515761235181600061234c84611c22565b6138b1565b6040516001600160a01b038216907f4675b3cb6fe3fe878134eda008b70f1b70874566513cbb335a7d612595a6f66c90600090a250565b60606021602260405160200161239f929190615d1a565b604051602081830303815290604052905090565b60405163c455279160e01b81526001600160a01b038381166004830152600091818416917f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1169063c45527919060240160206040518083038186803b15801561241b57600080fd5b505afa15801561242f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245391906158d5565b6001600160a01b0316141561246a57506001610895565b6001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff16611710565b6003546001600160a01b031633146124f25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109a2565b6001600160a01b0381166125575760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a2565b612560816134f0565b50565b61256b613921565b612573612f1a565b61257f602185856151ba565b5061258c602283836151ba565b5050505050565b600081815260096020526040902080546001600160a01b0319166001600160a01b03841690811790915581906125c8826118cf565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561264357600080fd5b505afa158015612657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267b91906158d5565b6001600160a01b0316336001600160a01b031614610f615760405162461bcd60e51b815260206004820152600a60248201527f4e6f74204d696e7465720000000000000000000000000000000000000000000060448201526064016109a2565b60008080805b601a5481101561277957601a81815481106126fe576126fe6158bf565b90600052602060002090600202016001015460001480156127545750612752601a8281548110612730576127306158bf565b60009182526020909120600290910201546018906001600160a01b0316612e26565b155b156127675782612763816158a4565b9350505b80612771816158a4565b9150506126e1565b5060008267ffffffffffffffff811115612795576127956155cf565b6040519080825280602002602001820160405280156127be578160200160208202803683370190505b50905060005b601a5481101561289757601a81815481106127e1576127e16158bf565b90600052602060002090600202016001015460001480156128155750612813601a8281548110612730576127306158bf565b155b1561288557601a818154811061282d5761282d6158bf565b60009182526020909120600290910201546001600160a01b03168284612852816158a4565b955081518110612864576128646158bf565b60200260200101906001600160a01b031690816001600160a01b0316815250505b8061288f816158a4565b9150506127c4565b508051600114156128c757806000815181106128b5576128b56158bf565b60200260200101519350505050919050565b60018151111561293457805181906128e0600143615d2f565b60408051914060208301528101889052444060608201524240608082015260a0016040516020818303038152906040528051906020012060001c612924919061587a565b815181106128b5576128b56158bf565b506000949350505050565b8051600090612a4b576004805460408051637cf48bab60e11b815290516001600160a01b039092169263f9e91756928282019260209290829003018186803b15801561298a57600080fd5b505afa15801561299e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c291906158d5565b604051631be4100960e21b81526004810186905284151560248201526001600160a01b039190911690636f9040249060440160006040518083038186803b158015612a0c57600080fd5b505afa158015612a20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a489190810190615c53565b91505b81516000858152601b6020526040812091825560808401516004909201805460a086015160ff9081166101000261ffff19909216941693909317929092179091555b826060015151811015612b1857601b600086815260200190815260200160002060030183606001518281518110612ac657612ac66158bf565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519282019290925560409091015160029091015580612b10816158a4565b915050612a8d565b506020808301516000868152601b8352604080822060018082019490945590519293601c93612b4b926003019101615d46565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600480548251637cf48bab60e11b815292516001600160a01b039091169363f9e91756938084019391929190829003018186803b158015612bc257600080fd5b505afa158015612bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bfa91906158d5565b6001600160a01b031663a58454e683606001516040518263ffffffff1660e01b8152600401612c299190615d59565b60206040518083038186803b158015612c4157600080fd5b505afa158015612c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c799190615db5565b6000858152601d60205260409020805460ff19166001836003811115612ca157612ca1615dd6565b0217905550612cc2612cbb6003546001600160a01b031690565b8686613a92565b50825b949350505050565b6000805b601a54811015612d3057826001600160a01b0316601a8281548110612cf857612cf86158bf565b60009182526020909120600290910201546001600160a01b03161415612d1e5792915050565b80612d28816158a4565b915050612cd1565b50600092915050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610ad88183612da686613c2f565b613c3a565b612db5338261369c565b612e1b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b60648201526084016109a2565b610ad8838383613d77565b6001600160a01b03811660009081526001830160205260408120541515611710565b612e5133611b04565b80612ee65750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612e9957600080fd5b505afa158015612ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed191906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b81526020600482015260056024820152642737b9b4b960d91b60448201526064016109a2565b60048054604080516302b2897560e11b815290516001600160a01b039092169263056512ea928282019260209290829003018186803b158015612f5c57600080fd5b505afa158015612f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9491906158f2565b806130295750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612fdc57600080fd5b505afa158015612ff0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301491906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152602160248201527f4e6f7420496d706c656d656e746174696f6e2073656e646572206e6f742044416044820152604f60f81b60648201526084016109a2565b6000306001600160a01b037f000000000000000000000000c8f23f3849d07c69dfba8c79d669ffbf2e0f2983161480156130d857507f000000000000000000000000000000000000000000000000000000000000000146145b1561310257507f736b32eed212bfe07862a97ab187cf54daf89408e9304b516caf98959e073b5d90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f2f3eaf74732635410cfeef202e4c84c8b6a5a81e12b3dc9748aa1d9fd4d99c41828401527f88f72b566ae0c96f6fffac4bc8ac74909f61512ac0c06a8124d5ed420d306f9060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6003546001600160a01b03163314806132495750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b1580156131fc57600080fd5b505afa158015613210573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323491906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152600e60248201527f4e6f74204f776e65722c2044414f00000000000000000000000000000000000060448201526064016109a2565b60004382106132e65760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e656460448201526064016109a2565b825460005b8181101561334b5760006132ff8284613f3c565b905084866000018281548110613317576133176158bf565b60009182526020909120015463ffffffff16111561333757809250613345565b6133428160016159b9565b91505b506132eb565b811561338f578461335d600184615d2f565b8154811061336d5761336d6158bf565b60009182526020909120015464010000000090046001600160e01b0316613392565b60005b6001600160e01b031695945050505050565b60015460ff166133ed5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109a2565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000613442826118cf565b905061345081600084613f57565b61345b600083612593565b6001600160a01b0381166000908152600860205260408120805460019290613484908490615d2f565b909155505060008281526007602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a46118cb81600084613f62565b6000610895825490565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000805b601a54811015612d3057826001600160a01b0316601a828154811061356d5761356d6158bf565b60009182526020909120600290910201546001600160a01b03161480156135a757506135a5601a8281548110612730576127306158bf565b155b156135b55750600192915050565b806135bf816158a4565b915050613546565b60015460ff161561360d5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109a2565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361341a565b805460009080156136895782613657600183615d2f565b81548110613667576136676158bf565b60009182526020909120015464010000000090046001600160e01b031661368c565b60005b6001600160e01b03169392505050565b6000818152600760205260408120546001600160a01b03166137155760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109a2565b6000613720836118cf565b9050806001600160a01b0316846001600160a01b0316148061375b5750836001600160a01b03166137508461092d565b6001600160a01b0316145b80612cc55750612cc581856123b3565b613776848484613d77565b613782848484846142e8565b611d9c5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109a2565b60006108956137f661307f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006138488787878761443d565b915091506138558161452a565b5095945050505050565b6001600160a01b03811660009081526012602052604090208054600181018255905b50919050565b6000611710836001600160a01b0384166146e5565b6000611710836001600160a01b038416614734565b6001600160a01b0383166138d0576138cd601161482783614833565b50505b6001600160a01b0382166138ef576138ec601161486183614833565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054610ad892918216911683613c3a565b6003546001600160a01b03163314806139b15750600480546040516305eca4a760e41b815233928101929092526001600160a01b031690635eca4a709060240160206040518083038186803b15801561397957600080fd5b505afa15801561398d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139b191906158f2565b80613a465750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b1580156139f957600080fd5b505afa158015613a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3191906158d5565b6001600160a01b0316336001600160a01b0316145b610f615760405162461bcd60e51b815260206004820152601960248201527f4e6f74204f776e65722c20446576656c6f7065722c2044414f0000000000000060448201526064016109a2565b6001600160a01b038216613ae85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109a2565b6000818152600760205260409020546001600160a01b031615613b4d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109a2565b613b5960008383613f57565b6001600160a01b0382166000908152600860205260408120805460019290613b829084906159b9565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03868116919091179091559051839291861691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610ad860008383613f62565b600061089582611c22565b816001600160a01b0316836001600160a01b031614158015613c5c5750600081115b15610ad8576001600160a01b03831615613cea576001600160a01b03831660009081526010602052604081208190613c979061486185614833565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613cdf929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615610ad8576001600160a01b03821660009081526010602052604081208190613d209061482785614833565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613d68929190918252602082015260400190565b60405180910390a25050505050565b826001600160a01b0316613d8a826118cf565b6001600160a01b031614613e065760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016109a2565b6001600160a01b038216613e685760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109a2565b613e73838383613f57565b613e7e600082612593565b6001600160a01b0383166000908152600860205260408120805460019290613ea7908490615d2f565b90915550506001600160a01b0382166000908152600860205260408120805460019290613ed59084906159b9565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610ad8838383613f62565b6000613f4b6002848418615dec565b611710908484166159b9565b610ad883838361486d565b6000806000838152601d602052604090205460ff166003811115613f8857613f88615dd6565b1180613fa857506000828152601b602052604090206004015460ff166001145b613fb3576001613fb6565b60025b60135490915060ff82169081906001600160a01b0386811691161480614066575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561401957600080fd5b505afa15801561402d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061405191906158d5565b6001600160a01b0316856001600160a01b0316145b8061409a57506000848152601b602052604090206004015460ff61010090910416600114801561409a575061409a85611b04565b806140ab57506140ab601886612e26565b156140b4575060005b6013546001600160a01b038781169116148061415a575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561410d57600080fd5b505afa158015614121573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061414591906158d5565b6001600160a01b0316866001600160a01b0316145b8061418e57506000848152601b602052604090206004015460ff61010090910416600114801561418e575061418e86611b04565b8061419f575061419f601887612e26565b156141a957600091505b81156141bb576141bb866000846138b1565b80156141cd576141cd600086836138b1565b6001600160a01b0386166000908152601e602052604090206141ef9085614925565b15614218576001600160a01b0386166000908152601e60205260409020614216908561493d565b505b6001600160a01b0385166000908152601e6020526040902061423a9085614925565b614262576001600160a01b0385166000908152601e602052604090206142609085614949565b505b61426c8685614955565b6142a15760405162461bcd60e51b81526020600482015260066024820152651d1adcd9585d60d21b60448201526064016109a2565b6142ab8585614b4e565b6142e05760405162461bcd60e51b815260206004820152600660248201526519dd9cd9585d60d21b60448201526064016109a2565b505050505050565b60006001600160a01b0384163b1561443557604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061432c903390899088908890600401615e00565b602060405180830381600087803b15801561434657600080fd5b505af1925050508015614376575060408051601f3d908101601f1916820190925261437391810190615e32565b60015b61441b573d8080156143a4576040519150601f19603f3d011682016040523d82523d6000602084013e6143a9565b606091505b5080516144135760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109a2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612cc5565b506001612cc5565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156144745750600090506003614521565b8460ff16601b1415801561448c57508460ff16601c14155b1561449d5750600090506004614521565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156144f1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661451a57600060019250925050614521565b9150600090505b94509492505050565b600081600481111561453e5761453e615dd6565b14156145475750565b600181600481111561455b5761455b615dd6565b14156145a95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a2565b60028160048111156145bd576145bd615dd6565b141561460b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a2565b600381600481111561461f5761461f615dd6565b14156146785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a2565b600481600481111561468c5761468c615dd6565b14156125605760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109a2565b600081815260018301602052604081205461472c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610895565b506000610895565b6000818152600183016020526040812054801561481d576000614758600183615d2f565b855490915060009061476c90600190615d2f565b90508181146147d157600086600001828154811061478c5761478c6158bf565b90600052602060002001549050808760000184815481106147af576147af6158bf565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806147e2576147e2615e4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610895565b6000915050610895565b600061171082846159b9565b6000806148558561485061484688613640565b868863ffffffff16565b614df7565b91509150935093915050565b60006117108284615d2f565b6001600160a01b0383166148c8576148c381600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b6148eb565b816001600160a01b0316836001600160a01b0316146148eb576148eb8382614f22565b6001600160a01b03821661490257610ad881614fbf565b826001600160a01b0316826001600160a01b031614610ad857610ad8828261506e565b60008181526001830160205260408120541515611710565b60006117108383614734565b600061171083836146e5565b6000614962601484612e26565b1580156149775750614975601684612e26565b155b1561498457506001610895565b600061498f846119e8565b11614a345761499f601484612e26565b156149b1576149af60148461389c565b505b6149bc601684612e26565b156149ce576149cc60168461389c565b505b826001600160a01b03167f0545cfc7cd520388d4a182a7c4f82bb4c947ab8033f01089cb57a8359acfce0683604051614a249181526040602082018190526003908201526210531360ea1b606082015260800190565b60405180910390a2506001610895565b6000805b6001600160a01b0385166000908152601e60205260409020614a59906134e6565b811015614b115760006001600160a01b0386166000908152601e60205260408120601d9190614a8890856150b2565b815260208101919091526040016000205460ff166003811115614aad57614aad615dd6565b1180614af557506001600160a01b0385166000908152601e60205260408120601b9190614ada90846150b2565b815260208101919091526040016000206004015460ff166001145b15614aff57600191505b80614b09816158a4565b915050614a38565b5080158015614b265750614b26601485612e26565b15614b4457614b3660148561389c565b50614b42601685613887565b505b5060019392505050565b60006001600160a01b038316614b6657506001610895565b6013546001600160a01b0384811691161480614c0c575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b158015614bbf57600080fd5b505afa158015614bd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bf791906158d5565b6001600160a01b0316836001600160a01b0316145b15614c1957506001610895565b614c2283611b04565b8015614c4857506000828152601b602052604090206004015460ff610100909104166001145b15614c5557506001610895565b614c60601884612e26565b15614c6d57506001610895565b6000828152601d602052604081205460ff166003811115614c9057614c90615dd6565b1180614cb057506000828152601b602052604090206004015460ff166001145b80614cbe5750601f5460ff16155b15614d7557614cce601484612e26565b15614cdb57506001610895565b614ce6601684612e26565b614cf757614cf560168461389c565b505b614d02601484613887565b50826001600160a01b03167fbd647e07d2ec1441b6f77851436c4478a1db786b005668bab0ed84d7ecb56e1483604051614d3e91815260200190565b60405180910390a2601f5460ff16614d7057600f614d5c60146134e6565b601f805460ff191692909110159190911790555b614dee565b614d80601484612e26565b80614d915750614d91601684612e26565b15614d9e57506001610895565b614da9601684613887565b50826001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960783604051614de591815260200190565b60405180910390a25b50600192915050565b8154600090819081614e0886613640565b9050600082118015614e4657504386614e22600185615d2f565b81548110614e3257614e326158bf565b60009182526020909120015463ffffffff16145b15614ea657614e54856150be565b86614e60600185615d2f565b81548110614e7057614e706158bf565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550614f14565b856000016040518060400160405280614ebe4361512b565b63ffffffff168152602001614ed2886150be565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b60006001614f2f846119e8565b614f399190615d2f565b6000838152600c6020526040902054909150808214614f8c576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d54600090614fd190600190615d2f565b6000838152600e6020526040812054600d8054939450909284908110614ff957614ff96158bf565b9060005260206000200154905080600d838154811061501a5761501a6158bf565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d80548061505257615052615e4f565b6001900381819060005260206000200160009055905550505050565b6000615079836119e8565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b60006117108383615190565b60006001600160e01b038211156151275760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b60648201526084016109a2565b5090565b600063ffffffff8211156151275760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b60648201526084016109a2565b60008260000182815481106151a7576151a76158bf565b9060005260206000200154905092915050565b8280546151c69061582f565b90600052602060002090601f0160209004810192826151e8576000855561522e565b82601f106152015782800160ff1982351617855561522e565b8280016001018555821561522e579182015b8281111561522e578235825591602001919060010190615213565b506151279291506152ae565b8280546152469061582f565b90600052602060002090601f016020900481019282615268576000855561522e565b82601f1061528157805160ff191683800117855561522e565b8280016001018555821561522e579182015b8281111561522e578251825591602001919060010190615293565b5b8082111561512757600081556001016152af565b6000602082840312156152d557600080fd5b5035919050565b6001600160e01b03198116811461256057600080fd5b60006020828403121561530457600080fd5b8135611710816152dc565b60005b8381101561532a578181015183820152602001615312565b83811115611d9c5750506000910152565b6000815180845261535381602086016020860161530f565b601f01601f19169290920160200192915050565b602081526000611710602083018461533b565b6001600160a01b038116811461256057600080fd5b600080604083850312156153a257600080fd5b82356153ad8161537a565b946020939093013593505050565b60006020808352835181840152808401516040840152604084015160c060608501526153ea60e085018261533b565b6060860151858203601f19016080870152805180835290840192506000918401905b80831015615444578351805183526020808201519084015260409081015190830152606082019150848401935060018301925061540c565b50608087015160ff811660a0880152935060a087015160ff811660c088015293505b9695505050505050565b60008060006060848603121561548557600080fd5b83356154908161537a565b925060208401356154a08161537a565b929592945050506040919091013590565b6000602082840312156154c357600080fd5b81356117108161537a565b60008083601f8401126154e057600080fd5b50813567ffffffffffffffff8111156154f857600080fd5b602083019150836020828501011115614f1b57600080fd5b60008060006040848603121561552557600080fd5b83359250602084013567ffffffffffffffff81111561554357600080fd5b61554f868287016154ce565b9497909650939450505050565b60ff8116811461256057600080fd5b60006020828403121561557d57600080fd5b81356117108161555c565b801515811461256057600080fd5b600080604083850312156155a957600080fd5b82356155b48161537a565b915060208301356155c481615588565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615608576156086155cf565b60405290565b60405160c0810167ffffffffffffffff81118282101715615608576156086155cf565b604051601f8201601f1916810167ffffffffffffffff8111828210171561565a5761565a6155cf565b604052919050565b600067ffffffffffffffff82111561567c5761567c6155cf565b50601f01601f191660200190565b600080600080608085870312156156a057600080fd5b84356156ab8161537a565b935060208501356156bb8161537a565b925060408501359150606085013567ffffffffffffffff8111156156de57600080fd5b8501601f810187136156ef57600080fd5b80356157026156fd82615662565b615631565b81815288602083850101111561571757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060008060008060c0878903121561575257600080fd5b863561575d8161537a565b95506020870135945060408701359350606087013561577b8161555c565b9598949750929560808101359460a0909101359350915050565b600080604083850312156157a857600080fd5b82356157b38161537a565b915060208301356155c48161537a565b600080600080604085870312156157d957600080fd5b843567ffffffffffffffff808211156157f157600080fd5b6157fd888389016154ce565b9096509450602087013591508082111561581657600080fd5b50615823878288016154ce565b95989497509550505050565b600181811c9082168061584357607f821691505b6020821081141561388157634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261588957615889615864565b500690565b634e487b7160e01b600052601160045260246000fd5b60006000198214156158b8576158b861588e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156158e757600080fd5b81516117108161537a565b60006020828403121561590457600080fd5b815161171081615588565b6000815461591c8161582f565b60018281168015615934576001811461594557615974565b60ff19841687528287019450615974565b8560005260208060002060005b8581101561596b5781548a820152908401908201615952565b50505082870194505b5050505092915050565b6000611710828461590f565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082198211156159cc576159cc61588e565b500190565b6000815480845260208085019450836000528060002060005b83811015615a1c57815487526001808301548489015260028301546040890152606090970196600390920191016159ea565b509495945050505050565b6040815282546040820152600060018085015460608401526002850160c0608085015260008154615a578161582f565b8061010088015261012085831660008114615a795760018114615a8e57615abf565b60ff1984168983015261014089019450615abf565b8560005260208060002060005b85811015615ab65781548c8201860152908901908201615a9b565b8b018401965050505b50505050848103603f190160a0860152615adc81600389016159d1565b925050506004850154615af760c0850160ff831660ff169052565b600881901c60ff1660e0850152508281036020840152615b17818561533b565b95945050505050565b600082601f830112615b3157600080fd5b8151615b3f6156fd82615662565b818152846020838601011115615b5457600080fd5b612cc582602083016020870161530f565b600060208284031215615b7757600080fd5b815167ffffffffffffffff811115615b8e57600080fd5b612cc584828501615b20565b600082601f830112615bab57600080fd5b8151602067ffffffffffffffff821115615bc757615bc76155cf565b615bd5818360051b01615631565b82815260609283028501820192828201919087851115615bf457600080fd5b8387015b85811015615c3b5781818a031215615c105760008081fd5b615c186155e5565b815181528582015186820152604080830151908201528452928401928101615bf8565b5090979650505050505050565b80516111a28161555c565b600060208284031215615c6557600080fd5b815167ffffffffffffffff80821115615c7d57600080fd5b9083019060c08286031215615c9157600080fd5b615c9961560e565b8251815260208301516020820152604083015182811115615cb957600080fd5b615cc587828601615b20565b604083015250606083015182811115615cdd57600080fd5b615ce987828601615b9a565b606083015250615cfb60808401615c48565b6080820152615d0c60a08401615c48565b60a082015295945050505050565b6000612cc5615d29838661590f565b8461590f565b600082821015615d4157615d4161588e565b500390565b60208152600061171060208301846159d1565b6020808252825182820181905260009190848201906040850190845b81811015615da957835180518452602080820151908501526040908101519084015260608301938501939250600101615d75565b50909695505050505050565b600060208284031215615dc757600080fd5b81516004811061171057600080fd5b634e487b7160e01b600052602160045260246000fd5b600082615dfb57615dfb615864565b500490565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615466608083018461533b565b600060208284031215615e4457600080fd5b8151611710816152dc565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b07ecfd0203c4b682481f06274c178a0fa07deb5707c1699aa7e99753777f6e664736f6c63430008090033

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

0000000000000000000000002fa631c48374a280eb04cd41490665eca635a35500000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000d0bf16f1ed8fdf70097e9b26c76d30352d6560a20000000000000000000000006db0530a1a147cf9788b356232e905c02606cd0c00000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a860000000000000000000000001822d8c387a786ec671b63186b99c51072595278000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be200000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _queenPalace (address): 0x2fa631c48374A280Eb04cd41490665ecA635A355
Arg [1] : founders (address[]): 0x9b09c5C4085e7887388e5CDECFdAcf3c5Cf99a86,0x1822d8c387a786ec671b63186B99C51072595278,0x172F19C6066441f6806556FCF5a97B1a86042bE2,0x50c528e9401673B199E6d9E5d3a56D9A26e86B5D
Arg [2] : _proxyRegistry (address): 0xa5409ec958C83C3f309868babACA7c86DCB077c1
Arg [3] : _ipfsProviderUri (string): ipfs://
Arg [4] : _ipfsContractHash (string):
Arg [5] : _oldContract (address): 0xd0bf16f1ed8fdf70097E9b26c76d30352D6560a2
Arg [6] : _royalMuseum (address): 0x6DB0530A1a147cF9788B356232e905c02606Cd0c

-----Encoded View---------------
15 Constructor Arguments found :
Arg [0] : 0000000000000000000000002fa631c48374a280eb04cd41490665eca635a355
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [4] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [5] : 000000000000000000000000d0bf16f1ed8fdf70097e9b26c76d30352d6560a2
Arg [6] : 0000000000000000000000006db0530a1a147cf9788b356232e905c02606cd0c
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 0000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a86
Arg [9] : 0000000000000000000000001822d8c387a786ec671b63186b99c51072595278
Arg [10] : 000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be2
Arg [11] : 00000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [13] : 697066733a2f2f00000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ 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.