Feature Tip: Add private address tag to any address under My Name Tag !
Token migration announcement. QueenE token contract has migrated to a new address.
ERC-721
NFT
Overview
Max Total Supply
44 QUEENE
Holders
37
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 QUEENELoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
QueenE
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 700 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 {QueenParliament} from "./base/QueenParliament.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 QueenE is IQueenE, QueenParliament { 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); event StorageLocked(); event LabLocked(); event MinterLocked(); using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.UintSet; using RoyalLibrary for string; // 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 minter has not been locked. */ modifier whenMinterNotLocked() { require(!isMinterLocked, "QueenE::Minter locked"); _; } /** * @notice Require that the QueenE Trait Storage has not been locked. */ modifier whenTraitStorageNotLocked() { require(!isTraitStorageLocked, "QueenE::Storage locked"); _; } /** * @notice Require that the QueenE Lab has not been locked. */ modifier whenLabNotLocked() { require(!isLabLocked, "QueenE::Lab locked"); _; } /** * @notice Require that the sender is a Sir or DAO Executor. */ modifier onlySirOrDAO() { isSirOrDAO(); _; } /** * Return if given address have Sir Title * */ function isSirOrDAO() private view { require( IsSir(msg.sender) || msg.sender == queenPalace.daoExecutor(), "QueenE::Not sir" ); } function _isLabNotLocked() private view { require(!isLabLocked, "QueenE::Lab locked"); } /************************** ^MODIFIERS REGION *************************************************** */ /************************** vCONSTRUCTOR REGION *************************************************** */ constructor( IQueenPalace _queenPalace, address[] memory founders, IProxyRegistry _proxyRegistry, string memory _ipfsProviderUri, string memory _ipfsContractHash ) ERC721("QueenE", "QUEENE") EIP712("QueenE", "1.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; } /************************** ^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); sirs[getSirIdx(sirAddress)].queene = _currentAuctionQueenE; emit SirAwarded(sirQueenE, sirAddress); } else { //mint to the vault uint256 museumQueenE = _mintTo( queenPalace.royalMuseum(), _currentAuctionQueenE++, false ); emit MuseumAwarded(museumQueenE, queenPalace.royalMuseum()); } } return _mintTo(queenPalace.minter(), _currentAuctionQueenE++, false); } /** * @notice Return QueenE from Id */ 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 A distinct Uniform Resource Identifier (URI) for a given asset. * @dev See {IERC721Metadata-tokenURI}. */ function setFinalArtHash(uint256 tokenId, string calldata _finalArtHash) external onlyOwner { require(_exists(tokenId), "QueenE::invalid id"); require( //queenes[tokenId].finalArt.stringEquals(""), keccak256(abi.encodePacked(queenes[tokenId].finalArt)) == keccak256(abi.encodePacked("")), "QueenE::Art set" ); queenes[tokenId].finalArt = _finalArtHash; emit FinalArtSet(tokenId, _finalArtHash); } /** * @notice Lock the minter. * @dev This cannot be reversed and is only callable by the owner when not locked. */ function lockMinter() external override onlyOwnerOrChiefDeveloper whenMinterNotLocked { isMinterLocked = true; emit MinterLocked(); } /** * @notice Lock the QueenE Trait Storage contract. * @dev This cannot be reversed and is only callable by the owner when not locked. */ function lockQueenTraitStorage() external override onlyOwnerOrChiefDeveloper whenTraitStorageNotLocked { isTraitStorageLocked = true; emit StorageLocked(); } /** * @notice Lock the Queen Lab Contract. * @dev This cannot be reversed and is only callable by the owner when not locked. */ 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 ) internal returns (uint256) { RoyalLibrary.sQUEEN memory 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 Adjusts votes when tokens are transferred. * * Emits a {Votes-DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal override { super._afterTokenTransfer(from, to, tokenId); //first lets take the seat from the old owner, if necessary if (!_takeParliamentSeat(from, tokenId)) { revert("QueenE::error taking seat"); } //now lets give a seat to the new owner, if he deserves it if (!_giveParliamentSeat(to, tokenId)) { revert("QueenE::error giving seat"); } if (ownerOfQueenEs[from].contains(tokenId)) ownerOfQueenEs[from].remove(tokenId); if (!ownerOfQueenEs[to].contains(tokenId)) ownerOfQueenEs[to].add(tokenId); } /** * @dev nominate a subject to the sir title. * * Emits a {ChangedLordVoteMultiplier} event. */ function setLordMultiplier(uint256 _multiplier) external onlyOwnerOrDeveloperOrDAO onlyOnImplementationOrDAO { require(_multiplier >= 1, "QueenE::Invalid value"); lordMultiplier = _multiplier; emit ChangedLordVoteMultiplier(_multiplier); } /** * @dev nominate a subject to the sir title. * * Emits a {NominatedForHouseOfLord} or {NominatedForHouseOfCommons} event. * Emits a {BannedFromHousesRejection} event if subject was banned. */ function nominateSir(address _sir) external override onlySirOrDAO onlyOnImplementationOrDAO returns (bool) { require(_sir != address(0), "QueenE::Invalid address(0)"); require(!houseOfBanned.contains(_sir), "QueenE::Banned"); require(!IsSir(_sir), "QueenE::Already 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, QueenParliament) 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) == queenPalace.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; } }
// 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); } }
// 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; } }
// 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 } }
// 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); }
// 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); }
// 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); }
// 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 "./ERC721Enumerable.sol"; import {ERC721} from "./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 QueenParliament 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); event ChangedLordVoteMultiplier(uint256 indexed _multiplier); 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; uint256 internal lordMultiplier; 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 == queenPalace.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)) { //emit NominatedRejectionBannedFromHouses(to, queeneId); 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)) houseOfLords.remove(to); houseOfCommons.add(to); emit NominatedForHouseOfCommons(to, queeneId); } return true; } /** * @dev take seat from QueenE previous owner. * * Emits a {ParliamentEndOfMandate} event if succeded. */ 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); emit NominatedForHouseOfCommons(from, tokenId); } return true; } /** * @dev ban subject from houses. * */ function banFromHouses(address _subject) external whenNotPaused onlyOwnerOrDAO onlyOnImplementationOrDAO { require( !houseOfBanned.contains(_subject), "QueenParliament::already banned!" ); if (houseOfLords.contains(_subject)) houseOfLords.remove(_subject); else if (houseOfCommons.contains(_subject)) houseOfCommons.remove(_subject); houseOfBanned.add(_subject); _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; uint256 fromVotesToTake; uint256 toVotesToGive; if (houseOfLords.contains(from)) fromVotesToTake = 2; else fromVotesToTake = queenVotingPower; if (houseOfLords.contains(to)) toVotesToGive = 2; else toVotesToGive = queenVotingPower; if ( to == queenPalace.royalMuseum() || to == queenPalace.minter() || (queenes[tokenId].sirAward == 1 && IsSir(to)) ) { toVotesToGive = 0; } if ( from == queenPalace.royalMuseum() || from == queenPalace.minter() || (queenes[tokenId].sirAward == 1 && IsSir(from)) ) { fromVotesToTake = 0; } if (fromVotesToTake > 0) _transferVotingUnits(from, address(0), fromVotesToTake); if (toVotesToGive > 0) _transferVotingUnits(address(0), to, toVotesToGive); 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IProxyRegistry { function proxies(address) external view returns (address); }
// 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 {} }
// 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; }
// 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); }
// 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)); } }
// 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); } }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/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); }
// 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; }
// 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; }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/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); }
// 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); }
// 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(); } }
// 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; } }
// 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; } }
// 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)); } }
// 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); } }
// 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); } }
// 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); }
// 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); }
// 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); } } } }
// 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" ); } }
// 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); }
// 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()); } }
// 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; } }
// 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); } }
// 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; } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 700 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}],"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":"uint256","name":"_multiplier","type":"uint256"}],"name":"ChangedLordVoteMultiplier","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":[],"name":"LabLocked","type":"event"},{"anonymous":false,"inputs":[],"name":"MinterLocked","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":[],"name":"StorageLocked","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":[{"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":[],"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":"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":[{"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":"uint256","name":"_multiplier","type":"uint256"}],"name":"setLordMultiplier","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"}]
Contract Creation Code
6101a0604052600761016081905266697066733a2f2f60c81b6101809081526200002d9160219190620003a5565b503480156200003b57600080fd5b5060405162006705380380620067058339810160408190526200005e9162000554565b604080518082018252600680825265517565656e4560d01b60208084018290528451808601865260038152620312e360ec1b818301528551808701875284815280830193909352855180870190965292855265515545454e4560d01b908501526001805460ff191681556002559192909190620000db33620002cf565b8151620000f0906005906020850190620003a5565b50805162000106906006906020840190620003a5565b50620001196380ac58cd60e01b62000321565b6200012b635b5e139f60e01b62000321565b5050815160209283012081519183019190912060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919095012090529190915261012052620001ce6313f68ee360e11b62000321565b600480546001600160a01b0319166001600160a01b038716179055600160209081558251620002049160219190850190620003a5565b5080516200021a906022906020840190620003a5565b5060005b8451811015620002b657601960405180604001604052808784815181106200024a576200024a6200068b565b6020908102919091018101516001600160a01b039081168352600092820183905284546001808201875595845292829020845160029094020180546001600160a01b03191693909116929092178255919091015191015580620002ad81620006a1565b9150506200021e565b5050506001600160a01b03166101405250620007089050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160e01b03198082161415620003805760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015260640160405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b828054620003b390620006cb565b90600052602060002090601f016020900481019282620003d7576000855562000422565b82601f10620003f257805160ff191683800117855562000422565b8280016001018555821562000422579182015b828111156200042257825182559160200191906001019062000405565b506200043092915062000434565b5090565b5b8082111562000430576000815560010162000435565b6001600160a01b03811681146200046157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620004a557620004a562000464565b604052919050565b8051620004ba816200044b565b919050565b600082601f830112620004d157600080fd5b81516001600160401b03811115620004ed57620004ed62000464565b602062000503601f8301601f191682016200047a565b82815285828487010111156200051857600080fd5b60005b83811015620005385785810183015182820184015282016200051b565b838111156200054a5760008385840101525b5095945050505050565b600080600080600060a086880312156200056d57600080fd5b85516200057a816200044b565b602087810151919650906001600160401b03808211156200059a57600080fd5b818901915089601f830112620005af57600080fd5b815181811115620005c457620005c462000464565b8060051b620005d58582016200047a565b918252838101850191858101908d841115620005f057600080fd5b948601945b838610156200061e57855192506200060d836200044b565b8282529486019490860190620005f5565b9950620006329250505060408a01620004ad565b955060608901519250808311156200064957600080fd5b620006578a848b01620004bf565b945060808901519250808311156200066e57600080fd5b50506200067e88828901620004bf565b9150509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620006c457634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c90821680620006e057607f821691505b602082108114156200070257634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161014051615f9b6200076a600039600081816106e901526122500152600061307e015260006130cd015260006130a8015260006130010152600061302b015260006130550152615f9b6000f3fe608060405234801561001057600080fd5b50600436106103835760003560e01c80636352211e116101de578063a22cb4651161010f578063c3cda520116100ad578063e985e9c51161007c578063e985e9c514610772578063eac8861d14610785578063f2fde38b146107b4578063fa78096e146107c757600080fd5b8063c3cda52014610731578063c87b56dd14610744578063e3bbe4f214610757578063e8a3d4851461076a57600080fd5b8063abbae092116100e9578063abbae092146106d1578063b50cbd9f146106e4578063b765a13f1461070b578063b88d4fde1461071e57600080fd5b8063a22cb465146106a4578063a6ca337f146106b7578063aa616313146106bf57600080fd5b806380ad222b1161017c5780638da5cb5b116101565780638da5cb5b146106655780638e539e8c1461067657806395d89b41146106895780639ab24eb01461069157600080fd5b806380ad222b14610641578063819c142f146106545780638456cb591461065d57600080fd5b8063715018a6116101b8578063715018a61461060b57806376afd30b1461061357806376daebe1146106265780637ecebe001461062e57600080fd5b80636352211e146105d25780636d0ace3a146105e557806370a08231146105f857600080fd5b80633003c941116102b857806342842e0e116102565780634f6ccce7116102305780634f6ccce714610575578063587cde1e146105885780635c19a95c146105b45780635c975abb146105c757600080fd5b806342842e0e1461054457806342966c681461055757806344c2fb191461056a57600080fd5b80633644e515116102925780633644e5151461050e578063395062ce146105165780633a46b1a8146105295780633f4ba83a1461053c57600080fd5b80633003c941146104ce578063313ce567146104e15780633257137f146104fb57600080fd5b806318160ddd1161032557806323b872dd116102ff57806323b872dd146104825780632c56a340146104955780632f54bf6e146104a85780632f745c59146104bb57600080fd5b806318160ddd146104465780631e688e101461044e57806323b2cfcf1461046257600080fd5b8063081812fc11610361578063081812fc146103e8578063095ea7b3146104135780631249c58b14610428578063180a238a1461043e57600080fd5b806301e75bd21461038857806301ffc9a7146103c057806306fdde03146103d3575b600080fd5b6103ab6103963660046153c3565b6000908152601b602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6103ab6103ce3660046153f2565b6107da565b6103db61081a565b6040516103b79190615467565b6103fb6103f63660046153c3565b6108ac565b6040516001600160a01b0390911681526020016103b7565b61042661042136600461548f565b610946565b005b610430610a5c565b6040519081526020016103b7565b610426610d40565b600d54610430565b601f546103ab906301000000900460ff1681565b6104756104703660046153c3565b610dda565b6040516103b791906154bb565b610426610490366004615570565b610f7d565b6104306104a33660046155b1565b610fc7565b6103ab6104b63660046155b1565b61101e565b6104306104c936600461548f565b61104c565b6103ab6104dc3660046155b1565b6110f4565b6104e9600081565b60405160ff90911681526020016103b7565b610426610509366004615610565b6112cf565b61043061147f565b6104266105243660046155b1565b611489565b61043061053736600461548f565b61155b565b610426611584565b610426610552366004615570565b611631565b6104266105653660046153c3565b61164c565b601f5460ff166103ab565b6104306105833660046153c3565b61168b565b6103fb6105963660046155b1565b6001600160a01b039081166000908152600f60205260409020541690565b6104266105c23660046155b1565b61172f565b60015460ff166103ab565b6103fb6105e03660046153c3565b61173e565b6104306105f336600461566b565b6117c9565b6104306106063660046155b1565b611857565b6104266118f1565b6104266106213660046153c3565b611955565b6104266119e9565b61043061063c3660046155b1565b611a89565b6103ab61064f3660046155b1565b611aa7565b61043060205481565b610426611ab2565b6003546001600160a01b03166103fb565b6104306106843660046153c3565b611b5a565b6103db611bb6565b61043061069f3660046155b1565b611bc5565b6104266106b2366004615696565b611be6565b610426611cab565b601f546103ab90610100900460ff1681565b6103ab6106df3660046153c3565b611d48565b6103fb7f000000000000000000000000000000000000000000000000000000000000000081565b601f546103ab9062010000900460ff1681565b61042661072c36600461578a565b611de2565b61042661073f366004615839565b611e64565b6103db6107523660046153c3565b611f9a565b6104266107653660046155b1565b6120bc565b6103db6121ff565b6103ab610780366004615895565b61222a565b6103ab6107933660046153c3565b6000908152601a602052604090206004015460ff6101009091041660011490565b6104266107c23660046155b1565b61230f565b6104266107d53660046158c3565b6123da565b60006301ffc9a760e01b6001600160e01b03198316148061081457506001600160e01b0319821660009081526020819052604090205460ff165b92915050565b6060600580546108299061592f565b80601f01602080910402602001604051908101604052809291908181526020018280546108559061592f565b80156108a25780601f10610877576101008083540402835291602001916108a2565b820191906000526020600020905b81548152906001019060200180831161088557829003601f168201915b5050505050905090565b6000818152600760205260408120546001600160a01b031661092a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600960205260409020546001600160a01b031690565b60006109518261173e565b9050806001600160a01b0316836001600160a01b031614156109bf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610921565b336001600160a01b03821614806109db57506109db813361222a565b610a4d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610921565b610a57838361240a565b505050565b6000610a66612478565b600a602054610a75919061597a565b158015610a86575061071c60205411155b15610cea576000610a98602054612552565b90506001600160a01b03811615801590610ae7575060205460141480610ac057506020546028145b80610acd5750602054603c145b80610ada57506020546050145b80610ae75750605a602054115b15610b885760208054600091610b0e91849184610b03836159a4565b9190505560016127b6565b90506020546019610b1e84612b3b565b81548110610b2e57610b2e6159bf565b6000918252602091829020600160029092020101919091556040516001600160a01b038416815282917fbccd19743a5aa0c18dd02d3cad5ca26e300128f40418c480d07feab6b5bb5c48910160405180910390a250610ce8565b6004805460408051633497f78760e01b81529051600093610c21936001600160a01b031692633497f7879281830192602092829003018186803b158015610bce57600080fd5b505afa158015610be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0691906159d5565b60208054906000610c16836159a4565b9190505560006127b6565b9050807f951a2b0c1d3c654804666f9b892617a00656b04ddb04c068dd9b881413d6e784600460009054906101000a90046001600160a01b03166001600160a01b0316633497f7876040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9357600080fd5b505afa158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb91906159d5565b6040516001600160a01b03909116815260200160405180910390a2505b505b610d3b600460009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015610bce57600080fd5b905090565b610d48612ba7565b601f54610100900460ff1615610da05760405162461bcd60e51b815260206004820152601660248201527f517565656e453a3a53746f72616765206c6f636b6564000000000000000000006044820152606401610921565b601f805461ff0019166101001790556040517ffe446b66a3eaed7d367c48de0bf673aaaaccf99610072a6b0ef61b3b915a408290600090a1565b610e196040518060c0016040528060008152602001600081526020016060815260200160608152602001600060ff168152602001600060ff1681525090565b601a60008381526020019081526020016000206040518060c00160405290816000820154815260200160018201548152602001600282018054610e5b9061592f565b80601f0160208091040260200160405190810160405280929190818152602001828054610e879061592f565b8015610ed45780601f10610ea957610100808354040283529160200191610ed4565b820191906000526020600020905b815481529060010190602001808311610eb757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610f525783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190610f02565b505050908252506004919091015460ff80821660208401526101009091041660409091015292915050565b6001600160a01b03821615801590610fad57506001600160a01b038281166000908152600f602052604090205416155b15610fbc57610fbc8283612c96565b610a57838383612d08565b6000610fd4601783612d83565b15610fe157506003919050565b610fec601383612d83565b15610ff957506001919050565b611004601583612d83565b1561101157506002919050565b506000919050565b919050565b6000816001600160a01b031661103c6003546001600160a01b031690565b6001600160a01b03161492915050565b600061105783611857565b82106110cb5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610921565b506001600160a01b03919091166000908152600b60209081526040808320938352929052205490565b60006110fe612da5565b611106612e8f565b6001600160a01b03821661115c5760405162461bcd60e51b815260206004820152601a60248201527f517565656e453a3a496e76616c696420616464726573732830290000000000006044820152606401610921565b611167601783612d83565b156111b45760405162461bcd60e51b815260206004820152600e60248201527f517565656e453a3a42616e6e65640000000000000000000000000000000000006044820152606401610921565b6111bd82611aa7565b1561120a5760405162461bcd60e51b815260206004820152601360248201527f517565656e453a3a416c726561647920536972000000000000000000000000006044820152606401610921565b6040805180820182526001600160a01b038481168083526000602084018181526019805460018101825590835294517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9695600290960295860180546001600160a01b031916919095161790935591517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969690930192909255915190917fc0816b75c26a3c5443dc95e17b4ec9d1c8a9fa00f58b61b084f596c7f87f374391a2506001919050565b6003546001600160a01b031633146113295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b6000838152600760205260409020546001600160a01b031661138d5760405162461bcd60e51b815260206004820152601260248201527f517565656e453a3a696e76616c696420696400000000000000000000000000006044820152606401610921565b604080516000808252602080830180855283519020878352601a9091529083902090926113c09260029092019101615a61565b60405160208183030381529060405280519060200120146114235760405162461bcd60e51b815260206004820152600f60248201527f517565656e453a3a4172742073657400000000000000000000000000000000006044820152606401610921565b6000838152601a6020526040902061143f906002018383615333565b50827fc3bc11bf296abe698cfd1592e10f978d1813fbc2f809a295a1a033f8e200dde28383604051611472929190615a6d565b60405180910390a2505050565b6000610d3b612ff4565b6002805414156114db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610921565b6002805560015460ff166115285760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b61153061311b565b611538612e8f565b600480546001600160a01b0319166001600160a01b038316179055506001600255565b6001600160a01b038216600090815260106020526040812061157d908361320a565b9392505050565b6003546001600160a01b031633146115de5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b60015460ff166116275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b61162f613319565b565b610a5783838360405180602001604052806000815250611de2565b611654612478565b61165d816133ac565b60405181907f0aef40badbe2a4dec80cad4153b69c6d30bb8a64c1358c09af2cbf650ceba45e90600090a250565b6000611696600d5490565b821061170a5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610921565b600d828154811061171d5761171d6159bf565b90600052602060002001549050919050565b3361173a8183612c96565b5050565b6000818152600760205260408120546001600160a01b0316806108145760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610921565b600060ff821615806117de57508160ff166003145b6117e95760006117f3565b6117f3601761345b565b60ff8316158061180657508260ff166002145b61181157600061181b565b61181b601561345b565b60ff8416158061182e57508360ff166001145b611839576000611843565b611843601361345b565b61184d9190615a9c565b6108149190615a9c565b60006001600160a01b0382166118d55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610921565b506001600160a01b031660009081526008602052604090205490565b6003546001600160a01b0316331461194b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b61162f6000613465565b61195d6134b7565b611965612e8f565b60018110156119b65760405162461bcd60e51b815260206004820152601560248201527f517565656e453a3a496e76616c69642076616c756500000000000000000000006044820152606401610921565b601e81905560405181907f3933ecc9c81c53e373a9810470ffc27bdec317d94addddd50e314f9c0009ea9b90600090a250565b6119f1612ba7565b601f546301000000900460ff1615611a4b5760405162461bcd60e51b815260206004820152601560248201527f517565656e453a3a4d696e746572206c6f636b656400000000000000000000006044820152606401610921565b601f805463ff000000191663010000001790556040517f192417b3f16b1ce69e0c59b0376549666650245ffc05e4b2569089dda8589b6690600090a1565b6001600160a01b038116600090815260126020526040812054610814565b600061081482613628565b6003546001600160a01b03163314611b0c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b60015460ff1615611b525760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b61162f6136ad565b6000438210611bab5760405162461bcd60e51b815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e65640000000000006044820152606401610921565b61081460118361320a565b6060600680546108299061592f565b6001600160a01b038116600090815260106020526040812061081490613726565b6001600160a01b038216331415611c3f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610921565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611cb3612ba7565b601f5462010000900460ff1615611d0c5760405162461bcd60e51b815260206004820152601260248201527f517565656e453a3a4c6162206c6f636b656400000000000000000000000000006044820152606401610921565b601f805462ff00001916620100001790556040517f30b8eb6e772dc11a4e9e191a36c0a8f5eb8c87c6be2be6d8adef06cf922efd6890600090a1565b6000600460009054906101000a90046001600160a01b03166001600160a01b0316633497f7876040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9857600080fd5b505afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd091906159d5565b6001600160a01b031661103c8361173e565b611dec3383613782565b611e525760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610921565b611e5e84848484613859565b50505050565b83421115611eb45760405162461bcd60e51b815260206004820152601860248201527f566f7465733a207369676e6174757265206578706972656400000000000000006044820152606401610921565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611f2e90611f269060a001604051602081830303815290604052805190602001206138d7565b858585613925565b9050611f398161394d565b8614611f875760405162461bcd60e51b815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e63650000000000000000000000006044820152606401610921565b611f918188612c96565b50505050505050565b6060600460009054906101000a90046001600160a01b03166001600160a01b031663f9e917566040518163ffffffff1660e01b815260040160206040518083038186803b158015611fea57600080fd5b505afa158015611ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202291906159d5565b6001600160a01b0316636f81354e601a600085815260200190815260200160002061204b6121ff565b6040518363ffffffff1660e01b8152600401612068929190615b0a565b60006040518083038186803b15801561208057600080fd5b505afa158015612094573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108149190810190615c48565b60015460ff16156121025760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b61210a61311b565b612112612e8f565b61211d601782612d83565b1561216a5760405162461bcd60e51b815260206004820181905260248201527f517565656e5061726c69616d656e743a3a616c72656164792062616e6e6564216044820152606401610921565b612175601382612d83565b1561218b57612185601382613975565b506121a8565b612196601582612d83565b156121a8576121a6601582613975565b505b6121b360178261398a565b506121c88160006121c384611bc5565b61399f565b6040516001600160a01b038216907f4675b3cb6fe3fe878134eda008b70f1b70874566513cbb335a7d612595a6f66c90600090a250565b606060216022604051602001612216929190615c7d565b604051602081830303815290604052905090565b60405163c455279160e01b81526001600160a01b038381166004830152600091818416917f0000000000000000000000000000000000000000000000000000000000000000169063c45527919060240160206040518083038186803b15801561229257600080fd5b505afa1580156122a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ca91906159d5565b6001600160a01b031614156122e157506001610814565b6001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff1661157d565b6003546001600160a01b031633146123695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b6001600160a01b0381166123ce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610921565b6123d781613465565b50565b6123e26134b7565b6123ea612e8f565b6123f660218585615333565b5061240360228383615333565b5050505050565b600081815260096020526040902080546001600160a01b0319166001600160a01b038416908117909155819061243f8261173e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b1580156124ba57600080fd5b505afa1580156124ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f291906159d5565b6001600160a01b0316336001600160a01b03161461162f5760405162461bcd60e51b815260206004820152600a60248201527f4e6f74204d696e746572000000000000000000000000000000000000000000006044820152606401610921565b60008080805b6019548110156125f05760198181548110612575576125756159bf565b90600052602060002090600202016001015460001480156125cb57506125c9601982815481106125a7576125a76159bf565b60009182526020909120600290910201546017906001600160a01b0316612d83565b155b156125de57826125da816159a4565b9350505b806125e8816159a4565b915050612558565b5060008267ffffffffffffffff81111561260c5761260c6156cf565b604051908082528060200260200182016040528015612635578160200160208202803683370190505b50905060005b60195481101561270e5760198181548110612658576126586159bf565b906000526020600020906002020160010154600014801561268c575061268a601982815481106125a7576125a76159bf565b155b156126fc57601981815481106126a4576126a46159bf565b60009182526020909120600290910201546001600160a01b031682846126c9816159a4565b9550815181106126db576126db6159bf565b60200260200101906001600160a01b031690816001600160a01b0316815250505b80612706816159a4565b91505061263b565b5080516001141561273e578060008151811061272c5761272c6159bf565b60200260200101519350505050919050565b6001815111156127ab5780518190612757600143615c92565b60408051914060208301528101889052444060608201524240608082015260a0016040516020818303038152906040528051906020012060001c61279b919061597a565b8151811061272c5761272c6159bf565b506000949350505050565b6004805460408051637cf48bab60e11b8152905160009384936001600160a01b03169263f9e917569281830192602092829003018186803b1580156127fa57600080fd5b505afa15801561280e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283291906159d5565b604051631be4100960e21b81526004810186905284151560248201526001600160a01b039190911690636f9040249060440160006040518083038186803b15801561287c57600080fd5b505afa158015612890573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526128b89190810190615d62565b80516000868152601a6020526040812091825560808301516004909201805460a085015160ff9081166101000261ffff19909216941693909317929092179091559091505b81606001515181101561298857601a600086815260200190815260200160002060030182606001518281518110612936576129366159bf565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519282019290925560409091015160029091015580612980816159a4565b9150506128fd565b506020808201516000868152601a8352604080822060018082019490945590519293601b936129bb926003019101615e29565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600480548251637cf48bab60e11b815292516001600160a01b039091169363f9e91756938084019391929190829003018186803b158015612a3257600080fd5b505afa158015612a46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a6a91906159d5565b6001600160a01b031663a58454e682606001516040518263ffffffff1660e01b8152600401612a999190615e3c565b60206040518083038186803b158015612ab157600080fd5b505afa158015612ac5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae99190615e98565b6000858152601c60205260409020805460ff19166001836003811115612b1157612b11615eb9565b0217905550612b32612b2b6003546001600160a01b031690565b8686613a0f565b50919392505050565b6000805b601954811015612b9e57826001600160a01b031660198281548110612b6657612b666159bf565b60009182526020909120600290910201546001600160a01b03161415612b8c5792915050565b80612b96816159a4565b915050612b3f565b50600092915050565b6003546001600160a01b0316331480612c4a5750600480546040805163ca4b208b60e01b815290516001600160a01b039092169263ca4b208b928282019260209290829003018186803b158015612bfd57600080fd5b505afa158015612c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3591906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152601a60248201527f4e6f74204f776e65722c20436869656620446576656c6f7065720000000000006044820152606401610921565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610a578183612d0386613bac565b613bb7565b612d123382613782565b612d785760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610921565b610a57838383613cf4565b6001600160a01b0381166000908152600183016020526040812054151561157d565b612dae33611aa7565b80612e435750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612df657600080fd5b505afa158015612e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2e91906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152600f60248201527f517565656e453a3a4e6f742073697200000000000000000000000000000000006044820152606401610921565b60048054604080516302b2897560e11b815290516001600160a01b039092169263056512ea928282019260209290829003018186803b158015612ed157600080fd5b505afa158015612ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f099190615ecf565b80612f9e5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612f5157600080fd5b505afa158015612f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8991906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420496d706c656d656e746174696f6e2073656e646572206e6f742044416044820152604f60f81b6064820152608401610921565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561304d57507f000000000000000000000000000000000000000000000000000000000000000046145b1561307757507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6003546001600160a01b03163314806131be5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b15801561317157600080fd5b505afa158015613185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a991906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152600e60248201527f4e6f74204f776e65722c2044414f0000000000000000000000000000000000006044820152606401610921565b600043821061325b5760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610921565b825460005b818110156132c05760006132748284613eb9565b90508486600001828154811061328c5761328c6159bf565b60009182526020909120015463ffffffff1611156132ac578092506132ba565b6132b7816001615a9c565b91505b50613260565b811561330457846132d2600184615c92565b815481106132e2576132e26159bf565b60009182526020909120015464010000000090046001600160e01b0316613307565b60005b6001600160e01b031695945050505050565b60015460ff166133625760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006133b78261173e565b90506133c581600084613ed4565b6133d060008361240a565b6001600160a01b03811660009081526008602052604081208054600192906133f9908490615c92565b909155505060008281526007602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a461173a81600084613edf565b6000610814825490565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6003546001600160a01b03163314806135475750600480546040516305eca4a760e41b815233928101929092526001600160a01b031690635eca4a709060240160206040518083038186803b15801561350f57600080fd5b505afa158015613523573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135479190615ecf565b806135dc5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b15801561358f57600080fd5b505afa1580156135a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135c791906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152601960248201527f4e6f74204f776e65722c20446576656c6f7065722c2044414f000000000000006044820152606401610921565b6000805b601954811015612b9e57826001600160a01b031660198281548110613653576136536159bf565b60009182526020909120600290910201546001600160a01b031614801561368d575061368b601982815481106125a7576125a76159bf565b155b1561369b5750600192915050565b806136a5816159a4565b91505061362c565b60015460ff16156136f35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361338f565b8054600090801561376f578261373d600183615c92565b8154811061374d5761374d6159bf565b60009182526020909120015464010000000090046001600160e01b0316613772565b60005b6001600160e01b03169392505050565b6000818152600760205260408120546001600160a01b03166137fb5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610921565b60006138068361173e565b9050806001600160a01b0316846001600160a01b031614806138415750836001600160a01b0316613836846108ac565b6001600160a01b0316145b806138515750613851818561222a565b949350505050565b613864848484613cf4565b61387084848484614029565b611e5e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610921565b60006108146138e4612ff4565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006139368787878761417e565b915091506139438161426b565b5095945050505050565b6001600160a01b03811660009081526012602052604090208054600181018255905b50919050565b600061157d836001600160a01b038416614426565b600061157d836001600160a01b038416614519565b6001600160a01b0383166139be576139bb601161456883614574565b50505b6001600160a01b0382166139dd576139da60116145a283614574565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054610a5792918216911683613bb7565b6001600160a01b038216613a655760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610921565b6000818152600760205260409020546001600160a01b031615613aca5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610921565b613ad660008383613ed4565b6001600160a01b0382166000908152600860205260408120805460019290613aff908490615a9c565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03868116919091179091559051839291861691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610a5760008383613edf565b600061081482611bc5565b816001600160a01b0316836001600160a01b031614158015613bd95750600081115b15610a57576001600160a01b03831615613c67576001600160a01b03831660009081526010602052604081208190613c14906145a285614574565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613c5c929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615610a57576001600160a01b03821660009081526010602052604081208190613c9d9061456885614574565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613ce5929190918252602082015260400190565b60405180910390a25050505050565b826001600160a01b0316613d078261173e565b6001600160a01b031614613d835760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610921565b6001600160a01b038216613de55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610921565b613df0838383613ed4565b613dfb60008261240a565b6001600160a01b0383166000908152600860205260408120805460019290613e24908490615c92565b90915550506001600160a01b0382166000908152600860205260408120805460019290613e52908490615a9c565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610a57838383613edf565b6000613ec86002848418615eec565b61157d90848416615a9c565b610a578383836145ae565b613eea838383614666565b613ef483826149ea565b613f405760405162461bcd60e51b815260206004820152601960248201527f517565656e453a3a6572726f722074616b696e672073656174000000000000006044820152606401610921565b613f4a8282614c26565b613f965760405162461bcd60e51b815260206004820152601960248201527f517565656e453a3a6572726f7220676976696e672073656174000000000000006044820152606401610921565b6001600160a01b0383166000908152601d60205260409020613fb89082614f40565b15613fe1576001600160a01b0383166000908152601d60205260409020613fdf9082614f58565b505b6001600160a01b0382166000908152601d602052604090206140039082614f40565b610a57576001600160a01b0382166000908152601d60205260409020611e5e9082614f64565b60006001600160a01b0384163b1561417657604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061406d903390899088908890600401615f00565b602060405180830381600087803b15801561408757600080fd5b505af19250505080156140b7575060408051601f3d908101601f191682019092526140b491810190615f32565b60015b61415c573d8080156140e5576040519150601f19603f3d011682016040523d82523d6000602084013e6140ea565b606091505b5080516141545760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610921565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613851565b506001613851565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156141b55750600090506003614262565b8460ff16601b141580156141cd57508460ff16601c14155b156141de5750600090506004614262565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614232573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661425b57600060019250925050614262565b9150600090505b94509492505050565b600081600481111561427f5761427f615eb9565b14156142885750565b600181600481111561429c5761429c615eb9565b14156142ea5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610921565b60028160048111156142fe576142fe615eb9565b141561434c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610921565b600381600481111561436057614360615eb9565b14156143b95760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610921565b60048160048111156143cd576143cd615eb9565b14156123d75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610921565b6000818152600183016020526040812054801561450f57600061444a600183615c92565b855490915060009061445e90600190615c92565b90508181146144c357600086600001828154811061447e5761447e6159bf565b90600052602060002001549050808760000184815481106144a1576144a16159bf565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806144d4576144d4615f4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610814565b6000915050610814565b600081815260018301602052604081205461456057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610814565b506000610814565b600061157d8284615a9c565b6000806145968561459161458788613726565b868863ffffffff16565b614f70565b91509150935093915050565b600061157d8284615c92565b6001600160a01b0383166146095761460481600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b61462c565b816001600160a01b0316836001600160a01b03161461462c5761462c838261509b565b6001600160a01b03821661464357610a5781615138565b826001600160a01b0316826001600160a01b031614610a5757610a5782826151e7565b6000806000838152601c602052604090205460ff16600381111561468c5761468c615eb9565b11806146ac57506000828152601a602052604090206004015460ff166001145b6146b75760016146ba565b60025b90506000806146ca601387612d83565b156146d857600291506146df565b8260ff1691505b6146ea601386612d83565b156146f7575060026146fd565b5060ff82165b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b15801561473f57600080fd5b505afa158015614753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061477791906159d5565b6001600160a01b0316856001600160a01b03161480614820575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b1580156147d357600080fd5b505afa1580156147e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061480b91906159d5565b6001600160a01b0316856001600160a01b0316145b8061485457506000848152601a602052604090206004015460ff610100909104166001148015614854575061485485611aa7565b1561485d575060005b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b15801561489f57600080fd5b505afa1580156148b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148d791906159d5565b6001600160a01b0316866001600160a01b03161480614980575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561493357600080fd5b505afa158015614947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061496b91906159d5565b6001600160a01b0316866001600160a01b0316145b806149b457506000848152601a602052604090206004015460ff6101009091041660011480156149b457506149b486611aa7565b156149be57600091505b81156149d0576149d08660008461399f565b80156149e2576149e26000868361399f565b505050505050565b60006149f7601384612d83565b158015614a0c5750614a0a601584612d83565b155b15614a1957506001610814565b6000614a2484611857565b11614ac957614a34601384612d83565b15614a4657614a44601384613975565b505b614a51601584612d83565b15614a6357614a61601584613975565b505b826001600160a01b03167f0545cfc7cd520388d4a182a7c4f82bb4c947ab8033f01089cb57a8359acfce0683604051614ab99181526040602082018190526003908201526210531360ea1b606082015260800190565b60405180910390a2506001610814565b6000805b6001600160a01b0385166000908152601d60205260409020614aee9061345b565b811015614ba65760006001600160a01b0386166000908152601d60205260408120601c9190614b1d908561522b565b815260208101919091526040016000205460ff166003811115614b4257614b42615eb9565b1180614b8a57506001600160a01b0385166000908152601d60205260408120601a9190614b6f908461522b565b815260208101919091526040016000206004015460ff166001145b15614b9457600191505b80614b9e816159a4565b915050614acd565b5080158015614bbb5750614bbb601385612d83565b15614c1c57614bcb601385613975565b50614bd760158561398a565b50836001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960784604051614c1391815260200190565b60405180910390a25b5060019392505050565b60006001600160a01b038316614c3e57506001610814565b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b158015614c8057600080fd5b505afa158015614c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cb891906159d5565b6001600160a01b0316836001600160a01b03161480614d61575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b158015614d1457600080fd5b505afa158015614d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d4c91906159d5565b6001600160a01b0316836001600160a01b0316145b15614d6e57506001610814565b614d7783611aa7565b8015614d9d57506000828152601a602052604090206004015460ff610100909104166001145b15614daa57506001610814565b614db5601784612d83565b15614dc257506001610814565b6000828152601c602052604081205460ff166003811115614de557614de5615eb9565b1180614e0557506000828152601a602052604090206004015460ff166001145b80614e135750601f5460ff16155b15614eca57614e23601384612d83565b15614e3057506001610814565b614e3b601584612d83565b614e4c57614e4a601584613975565b505b614e5760138461398a565b50826001600160a01b03167fbd647e07d2ec1441b6f77851436c4478a1db786b005668bab0ed84d7ecb56e1483604051614e9391815260200190565b60405180910390a2601f5460ff16614ec557600f614eb1601361345b565b601f805460ff191692909110159190911790555b614f37565b614ed5601384612d83565b15614ee757614ee5601384613975565b505b614ef260158461398a565b50826001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960783604051614f2e91815260200190565b60405180910390a25b50600192915050565b6000818152600183016020526040812054151561157d565b600061157d8383614426565b600061157d8383614519565b8154600090819081614f8186613726565b9050600082118015614fbf57504386614f9b600185615c92565b81548110614fab57614fab6159bf565b60009182526020909120015463ffffffff16145b1561501f57614fcd85615237565b86614fd9600185615c92565b81548110614fe957614fe96159bf565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b0316021790555061508d565b856000016040518060400160405280615037436152a4565b63ffffffff16815260200161504b88615237565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b600060016150a884611857565b6150b29190615c92565b6000838152600c6020526040902054909150808214615105576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d5460009061514a90600190615c92565b6000838152600e6020526040812054600d8054939450909284908110615172576151726159bf565b9060005260206000200154905080600d8381548110615193576151936159bf565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d8054806151cb576151cb615f4f565b6001900381819060005260206000200160009055905550505050565b60006151f283611857565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b600061157d8383615309565b60006001600160e01b038211156152a05760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608401610921565b5090565b600063ffffffff8211156152a05760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610921565b6000826000018281548110615320576153206159bf565b9060005260206000200154905092915050565b82805461533f9061592f565b90600052602060002090601f01602090048101928261536157600085556153a7565b82601f1061537a5782800160ff198235161785556153a7565b828001600101855582156153a7579182015b828111156153a757823582559160200191906001019061538c565b506152a09291505b808211156152a057600081556001016153af565b6000602082840312156153d557600080fd5b5035919050565b6001600160e01b0319811681146123d757600080fd5b60006020828403121561540457600080fd5b813561157d816153dc565b60005b8381101561542a578181015183820152602001615412565b83811115611e5e5750506000910152565b6000815180845261545381602086016020860161540f565b601f01601f19169290920160200192915050565b60208152600061157d602083018461543b565b6001600160a01b03811681146123d757600080fd5b600080604083850312156154a257600080fd5b82356154ad8161547a565b946020939093013593505050565b60006020808352835181840152808401516040840152604084015160c060608501526154ea60e085018261543b565b6060860151858203601f19016080870152805180835290840192506000918401905b80831015615544578351805183526020808201519084015260409081015190830152606082019150848401935060018301925061550c565b50608087015160ff811660a0880152935060a087015160ff811660c088015293505b9695505050505050565b60008060006060848603121561558557600080fd5b83356155908161547a565b925060208401356155a08161547a565b929592945050506040919091013590565b6000602082840312156155c357600080fd5b813561157d8161547a565b60008083601f8401126155e057600080fd5b50813567ffffffffffffffff8111156155f857600080fd5b60208301915083602082850101111561509457600080fd5b60008060006040848603121561562557600080fd5b83359250602084013567ffffffffffffffff81111561564357600080fd5b61564f868287016155ce565b9497909650939450505050565b60ff811681146123d757600080fd5b60006020828403121561567d57600080fd5b813561157d8161565c565b80151581146123d757600080fd5b600080604083850312156156a957600080fd5b82356156b48161547a565b915060208301356156c481615688565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615708576157086156cf565b60405290565b60405160c0810167ffffffffffffffff81118282101715615708576157086156cf565b604051601f8201601f1916810167ffffffffffffffff8111828210171561575a5761575a6156cf565b604052919050565b600067ffffffffffffffff82111561577c5761577c6156cf565b50601f01601f191660200190565b600080600080608085870312156157a057600080fd5b84356157ab8161547a565b935060208501356157bb8161547a565b925060408501359150606085013567ffffffffffffffff8111156157de57600080fd5b8501601f810187136157ef57600080fd5b80356158026157fd82615762565b615731565b81815288602083850101111561581757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060008060008060c0878903121561585257600080fd5b863561585d8161547a565b95506020870135945060408701359350606087013561587b8161565c565b9598949750929560808101359460a0909101359350915050565b600080604083850312156158a857600080fd5b82356158b38161547a565b915060208301356156c48161547a565b600080600080604085870312156158d957600080fd5b843567ffffffffffffffff808211156158f157600080fd5b6158fd888389016155ce565b9096509450602087013591508082111561591657600080fd5b50615923878288016155ce565b95989497509550505050565b600181811c9082168061594357607f821691505b6020821081141561396f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261598957615989615964565b500690565b634e487b7160e01b600052601160045260246000fd5b60006000198214156159b8576159b861598e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156159e757600080fd5b815161157d8161547a565b600081546159ff8161592f565b60018281168015615a175760018114615a2857615a57565b60ff19841687528287019450615a57565b8560005260208060002060005b85811015615a4e5781548a820152908401908201615a35565b50505082870194505b5050505092915050565b600061157d82846159f2565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60008219821115615aaf57615aaf61598e565b500190565b6000815480845260208085019450836000528060002060005b83811015615aff5781548752600180830154848901526002830154604089015260609097019660039092019101615acd565b509495945050505050565b6040815282546040820152600060018085015460608401526002850160c0608085015260008154615b3a8161592f565b8061010088015261012085831660008114615b5c5760018114615b7157615ba2565b60ff1984168983015261014089019450615ba2565b8560005260208060002060005b85811015615b995781548c8201860152908901908201615b7e565b8b018401965050505b50505050848103603f190160a0860152615bbf8160038901615ab4565b925050506004850154615bda60c0850160ff831660ff169052565b600881901c60ff1660e0850152508281036020840152615bfa818561543b565b95945050505050565b600082601f830112615c1457600080fd5b8151615c226157fd82615762565b818152846020838601011115615c3757600080fd5b61385182602083016020870161540f565b600060208284031215615c5a57600080fd5b815167ffffffffffffffff811115615c7157600080fd5b61385184828501615c03565b6000613851615c8c83866159f2565b846159f2565b600082821015615ca457615ca461598e565b500390565b600082601f830112615cba57600080fd5b8151602067ffffffffffffffff821115615cd657615cd66156cf565b615ce4818360051b01615731565b82815260609283028501820192828201919087851115615d0357600080fd5b8387015b85811015615d4a5781818a031215615d1f5760008081fd5b615d276156e5565b815181528582015186820152604080830151908201528452928401928101615d07565b5090979650505050505050565b80516110198161565c565b600060208284031215615d7457600080fd5b815167ffffffffffffffff80821115615d8c57600080fd5b9083019060c08286031215615da057600080fd5b615da861570e565b8251815260208301516020820152604083015182811115615dc857600080fd5b615dd487828601615c03565b604083015250606083015182811115615dec57600080fd5b615df887828601615ca9565b606083015250615e0a60808401615d57565b6080820152615e1b60a08401615d57565b60a082015295945050505050565b60208152600061157d6020830184615ab4565b6020808252825182820181905260009190848201906040850190845b81811015615e8c57835180518452602080820151908501526040908101519084015260608301938501939250600101615e58565b50909695505050505050565b600060208284031215615eaa57600080fd5b81516004811061157d57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215615ee157600080fd5b815161157d81615688565b600082615efb57615efb615964565b500490565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615566608083018461543b565b600060208284031215615f4457600080fd5b815161157d816153dc565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad87f18ef2a64b5793120fa1af757572f65e307cf15493db3d249ec8cc3dacc864736f6c634300080900330000000000000000000000002fa631c48374a280eb04cd41490665eca635a35500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c10000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a860000000000000000000000001822d8c387a786ec671b63186b99c51072595278000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be200000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103835760003560e01c80636352211e116101de578063a22cb4651161010f578063c3cda520116100ad578063e985e9c51161007c578063e985e9c514610772578063eac8861d14610785578063f2fde38b146107b4578063fa78096e146107c757600080fd5b8063c3cda52014610731578063c87b56dd14610744578063e3bbe4f214610757578063e8a3d4851461076a57600080fd5b8063abbae092116100e9578063abbae092146106d1578063b50cbd9f146106e4578063b765a13f1461070b578063b88d4fde1461071e57600080fd5b8063a22cb465146106a4578063a6ca337f146106b7578063aa616313146106bf57600080fd5b806380ad222b1161017c5780638da5cb5b116101565780638da5cb5b146106655780638e539e8c1461067657806395d89b41146106895780639ab24eb01461069157600080fd5b806380ad222b14610641578063819c142f146106545780638456cb591461065d57600080fd5b8063715018a6116101b8578063715018a61461060b57806376afd30b1461061357806376daebe1146106265780637ecebe001461062e57600080fd5b80636352211e146105d25780636d0ace3a146105e557806370a08231146105f857600080fd5b80633003c941116102b857806342842e0e116102565780634f6ccce7116102305780634f6ccce714610575578063587cde1e146105885780635c19a95c146105b45780635c975abb146105c757600080fd5b806342842e0e1461054457806342966c681461055757806344c2fb191461056a57600080fd5b80633644e515116102925780633644e5151461050e578063395062ce146105165780633a46b1a8146105295780633f4ba83a1461053c57600080fd5b80633003c941146104ce578063313ce567146104e15780633257137f146104fb57600080fd5b806318160ddd1161032557806323b872dd116102ff57806323b872dd146104825780632c56a340146104955780632f54bf6e146104a85780632f745c59146104bb57600080fd5b806318160ddd146104465780631e688e101461044e57806323b2cfcf1461046257600080fd5b8063081812fc11610361578063081812fc146103e8578063095ea7b3146104135780631249c58b14610428578063180a238a1461043e57600080fd5b806301e75bd21461038857806301ffc9a7146103c057806306fdde03146103d3575b600080fd5b6103ab6103963660046153c3565b6000908152601b602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6103ab6103ce3660046153f2565b6107da565b6103db61081a565b6040516103b79190615467565b6103fb6103f63660046153c3565b6108ac565b6040516001600160a01b0390911681526020016103b7565b61042661042136600461548f565b610946565b005b610430610a5c565b6040519081526020016103b7565b610426610d40565b600d54610430565b601f546103ab906301000000900460ff1681565b6104756104703660046153c3565b610dda565b6040516103b791906154bb565b610426610490366004615570565b610f7d565b6104306104a33660046155b1565b610fc7565b6103ab6104b63660046155b1565b61101e565b6104306104c936600461548f565b61104c565b6103ab6104dc3660046155b1565b6110f4565b6104e9600081565b60405160ff90911681526020016103b7565b610426610509366004615610565b6112cf565b61043061147f565b6104266105243660046155b1565b611489565b61043061053736600461548f565b61155b565b610426611584565b610426610552366004615570565b611631565b6104266105653660046153c3565b61164c565b601f5460ff166103ab565b6104306105833660046153c3565b61168b565b6103fb6105963660046155b1565b6001600160a01b039081166000908152600f60205260409020541690565b6104266105c23660046155b1565b61172f565b60015460ff166103ab565b6103fb6105e03660046153c3565b61173e565b6104306105f336600461566b565b6117c9565b6104306106063660046155b1565b611857565b6104266118f1565b6104266106213660046153c3565b611955565b6104266119e9565b61043061063c3660046155b1565b611a89565b6103ab61064f3660046155b1565b611aa7565b61043060205481565b610426611ab2565b6003546001600160a01b03166103fb565b6104306106843660046153c3565b611b5a565b6103db611bb6565b61043061069f3660046155b1565b611bc5565b6104266106b2366004615696565b611be6565b610426611cab565b601f546103ab90610100900460ff1681565b6103ab6106df3660046153c3565b611d48565b6103fb7f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c181565b601f546103ab9062010000900460ff1681565b61042661072c36600461578a565b611de2565b61042661073f366004615839565b611e64565b6103db6107523660046153c3565b611f9a565b6104266107653660046155b1565b6120bc565b6103db6121ff565b6103ab610780366004615895565b61222a565b6103ab6107933660046153c3565b6000908152601a602052604090206004015460ff6101009091041660011490565b6104266107c23660046155b1565b61230f565b6104266107d53660046158c3565b6123da565b60006301ffc9a760e01b6001600160e01b03198316148061081457506001600160e01b0319821660009081526020819052604090205460ff165b92915050565b6060600580546108299061592f565b80601f01602080910402602001604051908101604052809291908181526020018280546108559061592f565b80156108a25780601f10610877576101008083540402835291602001916108a2565b820191906000526020600020905b81548152906001019060200180831161088557829003601f168201915b5050505050905090565b6000818152600760205260408120546001600160a01b031661092a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600960205260409020546001600160a01b031690565b60006109518261173e565b9050806001600160a01b0316836001600160a01b031614156109bf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610921565b336001600160a01b03821614806109db57506109db813361222a565b610a4d5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610921565b610a57838361240a565b505050565b6000610a66612478565b600a602054610a75919061597a565b158015610a86575061071c60205411155b15610cea576000610a98602054612552565b90506001600160a01b03811615801590610ae7575060205460141480610ac057506020546028145b80610acd5750602054603c145b80610ada57506020546050145b80610ae75750605a602054115b15610b885760208054600091610b0e91849184610b03836159a4565b9190505560016127b6565b90506020546019610b1e84612b3b565b81548110610b2e57610b2e6159bf565b6000918252602091829020600160029092020101919091556040516001600160a01b038416815282917fbccd19743a5aa0c18dd02d3cad5ca26e300128f40418c480d07feab6b5bb5c48910160405180910390a250610ce8565b6004805460408051633497f78760e01b81529051600093610c21936001600160a01b031692633497f7879281830192602092829003018186803b158015610bce57600080fd5b505afa158015610be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0691906159d5565b60208054906000610c16836159a4565b9190505560006127b6565b9050807f951a2b0c1d3c654804666f9b892617a00656b04ddb04c068dd9b881413d6e784600460009054906101000a90046001600160a01b03166001600160a01b0316633497f7876040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9357600080fd5b505afa158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb91906159d5565b6040516001600160a01b03909116815260200160405180910390a2505b505b610d3b600460009054906101000a90046001600160a01b03166001600160a01b031663075461726040518163ffffffff1660e01b815260040160206040518083038186803b158015610bce57600080fd5b905090565b610d48612ba7565b601f54610100900460ff1615610da05760405162461bcd60e51b815260206004820152601660248201527f517565656e453a3a53746f72616765206c6f636b6564000000000000000000006044820152606401610921565b601f805461ff0019166101001790556040517ffe446b66a3eaed7d367c48de0bf673aaaaccf99610072a6b0ef61b3b915a408290600090a1565b610e196040518060c0016040528060008152602001600081526020016060815260200160608152602001600060ff168152602001600060ff1681525090565b601a60008381526020019081526020016000206040518060c00160405290816000820154815260200160018201548152602001600282018054610e5b9061592f565b80601f0160208091040260200160405190810160405280929190818152602001828054610e879061592f565b8015610ed45780601f10610ea957610100808354040283529160200191610ed4565b820191906000526020600020905b815481529060010190602001808311610eb757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610f525783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505081526020019060010190610f02565b505050908252506004919091015460ff80821660208401526101009091041660409091015292915050565b6001600160a01b03821615801590610fad57506001600160a01b038281166000908152600f602052604090205416155b15610fbc57610fbc8283612c96565b610a57838383612d08565b6000610fd4601783612d83565b15610fe157506003919050565b610fec601383612d83565b15610ff957506001919050565b611004601583612d83565b1561101157506002919050565b506000919050565b919050565b6000816001600160a01b031661103c6003546001600160a01b031690565b6001600160a01b03161492915050565b600061105783611857565b82106110cb5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610921565b506001600160a01b03919091166000908152600b60209081526040808320938352929052205490565b60006110fe612da5565b611106612e8f565b6001600160a01b03821661115c5760405162461bcd60e51b815260206004820152601a60248201527f517565656e453a3a496e76616c696420616464726573732830290000000000006044820152606401610921565b611167601783612d83565b156111b45760405162461bcd60e51b815260206004820152600e60248201527f517565656e453a3a42616e6e65640000000000000000000000000000000000006044820152606401610921565b6111bd82611aa7565b1561120a5760405162461bcd60e51b815260206004820152601360248201527f517565656e453a3a416c726561647920536972000000000000000000000000006044820152606401610921565b6040805180820182526001600160a01b038481168083526000602084018181526019805460018101825590835294517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9695600290960295860180546001600160a01b031916919095161790935591517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969690930192909255915190917fc0816b75c26a3c5443dc95e17b4ec9d1c8a9fa00f58b61b084f596c7f87f374391a2506001919050565b6003546001600160a01b031633146113295760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b6000838152600760205260409020546001600160a01b031661138d5760405162461bcd60e51b815260206004820152601260248201527f517565656e453a3a696e76616c696420696400000000000000000000000000006044820152606401610921565b604080516000808252602080830180855283519020878352601a9091529083902090926113c09260029092019101615a61565b60405160208183030381529060405280519060200120146114235760405162461bcd60e51b815260206004820152600f60248201527f517565656e453a3a4172742073657400000000000000000000000000000000006044820152606401610921565b6000838152601a6020526040902061143f906002018383615333565b50827fc3bc11bf296abe698cfd1592e10f978d1813fbc2f809a295a1a033f8e200dde28383604051611472929190615a6d565b60405180910390a2505050565b6000610d3b612ff4565b6002805414156114db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610921565b6002805560015460ff166115285760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b61153061311b565b611538612e8f565b600480546001600160a01b0319166001600160a01b038316179055506001600255565b6001600160a01b038216600090815260106020526040812061157d908361320a565b9392505050565b6003546001600160a01b031633146115de5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b60015460ff166116275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b61162f613319565b565b610a5783838360405180602001604052806000815250611de2565b611654612478565b61165d816133ac565b60405181907f0aef40badbe2a4dec80cad4153b69c6d30bb8a64c1358c09af2cbf650ceba45e90600090a250565b6000611696600d5490565b821061170a5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610921565b600d828154811061171d5761171d6159bf565b90600052602060002001549050919050565b3361173a8183612c96565b5050565b6000818152600760205260408120546001600160a01b0316806108145760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610921565b600060ff821615806117de57508160ff166003145b6117e95760006117f3565b6117f3601761345b565b60ff8316158061180657508260ff166002145b61181157600061181b565b61181b601561345b565b60ff8416158061182e57508360ff166001145b611839576000611843565b611843601361345b565b61184d9190615a9c565b6108149190615a9c565b60006001600160a01b0382166118d55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610921565b506001600160a01b031660009081526008602052604090205490565b6003546001600160a01b0316331461194b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b61162f6000613465565b61195d6134b7565b611965612e8f565b60018110156119b65760405162461bcd60e51b815260206004820152601560248201527f517565656e453a3a496e76616c69642076616c756500000000000000000000006044820152606401610921565b601e81905560405181907f3933ecc9c81c53e373a9810470ffc27bdec317d94addddd50e314f9c0009ea9b90600090a250565b6119f1612ba7565b601f546301000000900460ff1615611a4b5760405162461bcd60e51b815260206004820152601560248201527f517565656e453a3a4d696e746572206c6f636b656400000000000000000000006044820152606401610921565b601f805463ff000000191663010000001790556040517f192417b3f16b1ce69e0c59b0376549666650245ffc05e4b2569089dda8589b6690600090a1565b6001600160a01b038116600090815260126020526040812054610814565b600061081482613628565b6003546001600160a01b03163314611b0c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b60015460ff1615611b525760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b61162f6136ad565b6000438210611bab5760405162461bcd60e51b815260206004820152601a60248201527f566f7465733a20626c6f636b206e6f7420796574206d696e65640000000000006044820152606401610921565b61081460118361320a565b6060600680546108299061592f565b6001600160a01b038116600090815260106020526040812061081490613726565b6001600160a01b038216331415611c3f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610921565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611cb3612ba7565b601f5462010000900460ff1615611d0c5760405162461bcd60e51b815260206004820152601260248201527f517565656e453a3a4c6162206c6f636b656400000000000000000000000000006044820152606401610921565b601f805462ff00001916620100001790556040517f30b8eb6e772dc11a4e9e191a36c0a8f5eb8c87c6be2be6d8adef06cf922efd6890600090a1565b6000600460009054906101000a90046001600160a01b03166001600160a01b0316633497f7876040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9857600080fd5b505afa158015611dac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd091906159d5565b6001600160a01b031661103c8361173e565b611dec3383613782565b611e525760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610921565b611e5e84848484613859565b50505050565b83421115611eb45760405162461bcd60e51b815260206004820152601860248201527f566f7465733a207369676e6174757265206578706972656400000000000000006044820152606401610921565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090611f2e90611f269060a001604051602081830303815290604052805190602001206138d7565b858585613925565b9050611f398161394d565b8614611f875760405162461bcd60e51b815260206004820152601460248201527f566f7465733a20696e76616c6964206e6f6e63650000000000000000000000006044820152606401610921565b611f918188612c96565b50505050505050565b6060600460009054906101000a90046001600160a01b03166001600160a01b031663f9e917566040518163ffffffff1660e01b815260040160206040518083038186803b158015611fea57600080fd5b505afa158015611ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202291906159d5565b6001600160a01b0316636f81354e601a600085815260200190815260200160002061204b6121ff565b6040518363ffffffff1660e01b8152600401612068929190615b0a565b60006040518083038186803b15801561208057600080fd5b505afa158015612094573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108149190810190615c48565b60015460ff16156121025760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b61210a61311b565b612112612e8f565b61211d601782612d83565b1561216a5760405162461bcd60e51b815260206004820181905260248201527f517565656e5061726c69616d656e743a3a616c72656164792062616e6e6564216044820152606401610921565b612175601382612d83565b1561218b57612185601382613975565b506121a8565b612196601582612d83565b156121a8576121a6601582613975565b505b6121b360178261398a565b506121c88160006121c384611bc5565b61399f565b6040516001600160a01b038216907f4675b3cb6fe3fe878134eda008b70f1b70874566513cbb335a7d612595a6f66c90600090a250565b606060216022604051602001612216929190615c7d565b604051602081830303815290604052905090565b60405163c455279160e01b81526001600160a01b038381166004830152600091818416917f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1169063c45527919060240160206040518083038186803b15801561229257600080fd5b505afa1580156122a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ca91906159d5565b6001600160a01b031614156122e157506001610814565b6001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff1661157d565b6003546001600160a01b031633146123695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610921565b6001600160a01b0381166123ce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610921565b6123d781613465565b50565b6123e26134b7565b6123ea612e8f565b6123f660218585615333565b5061240360228383615333565b5050505050565b600081815260096020526040902080546001600160a01b0319166001600160a01b038416908117909155819061243f8261173e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b1580156124ba57600080fd5b505afa1580156124ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f291906159d5565b6001600160a01b0316336001600160a01b03161461162f5760405162461bcd60e51b815260206004820152600a60248201527f4e6f74204d696e746572000000000000000000000000000000000000000000006044820152606401610921565b60008080805b6019548110156125f05760198181548110612575576125756159bf565b90600052602060002090600202016001015460001480156125cb57506125c9601982815481106125a7576125a76159bf565b60009182526020909120600290910201546017906001600160a01b0316612d83565b155b156125de57826125da816159a4565b9350505b806125e8816159a4565b915050612558565b5060008267ffffffffffffffff81111561260c5761260c6156cf565b604051908082528060200260200182016040528015612635578160200160208202803683370190505b50905060005b60195481101561270e5760198181548110612658576126586159bf565b906000526020600020906002020160010154600014801561268c575061268a601982815481106125a7576125a76159bf565b155b156126fc57601981815481106126a4576126a46159bf565b60009182526020909120600290910201546001600160a01b031682846126c9816159a4565b9550815181106126db576126db6159bf565b60200260200101906001600160a01b031690816001600160a01b0316815250505b80612706816159a4565b91505061263b565b5080516001141561273e578060008151811061272c5761272c6159bf565b60200260200101519350505050919050565b6001815111156127ab5780518190612757600143615c92565b60408051914060208301528101889052444060608201524240608082015260a0016040516020818303038152906040528051906020012060001c61279b919061597a565b8151811061272c5761272c6159bf565b506000949350505050565b6004805460408051637cf48bab60e11b8152905160009384936001600160a01b03169263f9e917569281830192602092829003018186803b1580156127fa57600080fd5b505afa15801561280e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283291906159d5565b604051631be4100960e21b81526004810186905284151560248201526001600160a01b039190911690636f9040249060440160006040518083038186803b15801561287c57600080fd5b505afa158015612890573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526128b89190810190615d62565b80516000868152601a6020526040812091825560808301516004909201805460a085015160ff9081166101000261ffff19909216941693909317929092179091559091505b81606001515181101561298857601a600086815260200190815260200160002060030182606001518281518110612936576129366159bf565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519282019290925560409091015160029091015580612980816159a4565b9150506128fd565b506020808201516000868152601a8352604080822060018082019490945590519293601b936129bb926003019101615e29565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600480548251637cf48bab60e11b815292516001600160a01b039091169363f9e91756938084019391929190829003018186803b158015612a3257600080fd5b505afa158015612a46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a6a91906159d5565b6001600160a01b031663a58454e682606001516040518263ffffffff1660e01b8152600401612a999190615e3c565b60206040518083038186803b158015612ab157600080fd5b505afa158015612ac5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae99190615e98565b6000858152601c60205260409020805460ff19166001836003811115612b1157612b11615eb9565b0217905550612b32612b2b6003546001600160a01b031690565b8686613a0f565b50919392505050565b6000805b601954811015612b9e57826001600160a01b031660198281548110612b6657612b666159bf565b60009182526020909120600290910201546001600160a01b03161415612b8c5792915050565b80612b96816159a4565b915050612b3f565b50600092915050565b6003546001600160a01b0316331480612c4a5750600480546040805163ca4b208b60e01b815290516001600160a01b039092169263ca4b208b928282019260209290829003018186803b158015612bfd57600080fd5b505afa158015612c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3591906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152601a60248201527f4e6f74204f776e65722c20436869656620446576656c6f7065720000000000006044820152606401610921565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610a578183612d0386613bac565b613bb7565b612d123382613782565b612d785760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610921565b610a57838383613cf4565b6001600160a01b0381166000908152600183016020526040812054151561157d565b612dae33611aa7565b80612e435750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612df657600080fd5b505afa158015612e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2e91906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152600f60248201527f517565656e453a3a4e6f742073697200000000000000000000000000000000006044820152606401610921565b60048054604080516302b2897560e11b815290516001600160a01b039092169263056512ea928282019260209290829003018186803b158015612ed157600080fd5b505afa158015612ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f099190615ecf565b80612f9e5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b158015612f5157600080fd5b505afa158015612f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8991906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420496d706c656d656e746174696f6e2073656e646572206e6f742044416044820152604f60f81b6064820152608401610921565b6000306001600160a01b037f000000000000000000000000d0bf16f1ed8fdf70097e9b26c76d30352d6560a21614801561304d57507f000000000000000000000000000000000000000000000000000000000000000146145b1561307757507fd1cbfa60c11480cc5e1adf768ad3f7993c23cbbf7def32f884772bc0d664d80d90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f2f3eaf74732635410cfeef202e4c84c8b6a5a81e12b3dc9748aa1d9fd4d99c41828401527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b360608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6003546001600160a01b03163314806131be5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b15801561317157600080fd5b505afa158015613185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a991906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152600e60248201527f4e6f74204f776e65722c2044414f0000000000000000000000000000000000006044820152606401610921565b600043821061325b5760405162461bcd60e51b815260206004820181905260248201527f436865636b706f696e74733a20626c6f636b206e6f7420796574206d696e65646044820152606401610921565b825460005b818110156132c05760006132748284613eb9565b90508486600001828154811061328c5761328c6159bf565b60009182526020909120015463ffffffff1611156132ac578092506132ba565b6132b7816001615a9c565b91505b50613260565b811561330457846132d2600184615c92565b815481106132e2576132e26159bf565b60009182526020909120015464010000000090046001600160e01b0316613307565b60005b6001600160e01b031695945050505050565b60015460ff166133625760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610921565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60006133b78261173e565b90506133c581600084613ed4565b6133d060008361240a565b6001600160a01b03811660009081526008602052604081208054600192906133f9908490615c92565b909155505060008281526007602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a461173a81600084613edf565b6000610814825490565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6003546001600160a01b03163314806135475750600480546040516305eca4a760e41b815233928101929092526001600160a01b031690635eca4a709060240160206040518083038186803b15801561350f57600080fd5b505afa158015613523573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135479190615ecf565b806135dc5750600480546040805163406194c560e01b815290516001600160a01b039092169263406194c5928282019260209290829003018186803b15801561358f57600080fd5b505afa1580156135a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135c791906159d5565b6001600160a01b0316336001600160a01b0316145b61162f5760405162461bcd60e51b815260206004820152601960248201527f4e6f74204f776e65722c20446576656c6f7065722c2044414f000000000000006044820152606401610921565b6000805b601954811015612b9e57826001600160a01b031660198281548110613653576136536159bf565b60009182526020909120600290910201546001600160a01b031614801561368d575061368b601982815481106125a7576125a76159bf565b155b1561369b5750600192915050565b806136a5816159a4565b91505061362c565b60015460ff16156136f35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610921565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361338f565b8054600090801561376f578261373d600183615c92565b8154811061374d5761374d6159bf565b60009182526020909120015464010000000090046001600160e01b0316613772565b60005b6001600160e01b03169392505050565b6000818152600760205260408120546001600160a01b03166137fb5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610921565b60006138068361173e565b9050806001600160a01b0316846001600160a01b031614806138415750836001600160a01b0316613836846108ac565b6001600160a01b0316145b806138515750613851818561222a565b949350505050565b613864848484613cf4565b61387084848484614029565b611e5e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610921565b60006108146138e4612ff4565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006139368787878761417e565b915091506139438161426b565b5095945050505050565b6001600160a01b03811660009081526012602052604090208054600181018255905b50919050565b600061157d836001600160a01b038416614426565b600061157d836001600160a01b038416614519565b6001600160a01b0383166139be576139bb601161456883614574565b50505b6001600160a01b0382166139dd576139da60116145a283614574565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054610a5792918216911683613bb7565b6001600160a01b038216613a655760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610921565b6000818152600760205260409020546001600160a01b031615613aca5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610921565b613ad660008383613ed4565b6001600160a01b0382166000908152600860205260408120805460019290613aff908490615a9c565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b03868116919091179091559051839291861691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610a5760008383613edf565b600061081482611bc5565b816001600160a01b0316836001600160a01b031614158015613bd95750600081115b15610a57576001600160a01b03831615613c67576001600160a01b03831660009081526010602052604081208190613c14906145a285614574565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613c5c929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615610a57576001600160a01b03821660009081526010602052604081208190613c9d9061456885614574565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051613ce5929190918252602082015260400190565b60405180910390a25050505050565b826001600160a01b0316613d078261173e565b6001600160a01b031614613d835760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610921565b6001600160a01b038216613de55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610921565b613df0838383613ed4565b613dfb60008261240a565b6001600160a01b0383166000908152600860205260408120805460019290613e24908490615c92565b90915550506001600160a01b0382166000908152600860205260408120805460019290613e52908490615a9c565b909155505060008181526007602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610a57838383613edf565b6000613ec86002848418615eec565b61157d90848416615a9c565b610a578383836145ae565b613eea838383614666565b613ef483826149ea565b613f405760405162461bcd60e51b815260206004820152601960248201527f517565656e453a3a6572726f722074616b696e672073656174000000000000006044820152606401610921565b613f4a8282614c26565b613f965760405162461bcd60e51b815260206004820152601960248201527f517565656e453a3a6572726f7220676976696e672073656174000000000000006044820152606401610921565b6001600160a01b0383166000908152601d60205260409020613fb89082614f40565b15613fe1576001600160a01b0383166000908152601d60205260409020613fdf9082614f58565b505b6001600160a01b0382166000908152601d602052604090206140039082614f40565b610a57576001600160a01b0382166000908152601d60205260409020611e5e9082614f64565b60006001600160a01b0384163b1561417657604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061406d903390899088908890600401615f00565b602060405180830381600087803b15801561408757600080fd5b505af19250505080156140b7575060408051601f3d908101601f191682019092526140b491810190615f32565b60015b61415c573d8080156140e5576040519150601f19603f3d011682016040523d82523d6000602084013e6140ea565b606091505b5080516141545760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610921565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613851565b506001613851565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156141b55750600090506003614262565b8460ff16601b141580156141cd57508460ff16601c14155b156141de5750600090506004614262565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614232573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661425b57600060019250925050614262565b9150600090505b94509492505050565b600081600481111561427f5761427f615eb9565b14156142885750565b600181600481111561429c5761429c615eb9565b14156142ea5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610921565b60028160048111156142fe576142fe615eb9565b141561434c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610921565b600381600481111561436057614360615eb9565b14156143b95760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610921565b60048160048111156143cd576143cd615eb9565b14156123d75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610921565b6000818152600183016020526040812054801561450f57600061444a600183615c92565b855490915060009061445e90600190615c92565b90508181146144c357600086600001828154811061447e5761447e6159bf565b90600052602060002001549050808760000184815481106144a1576144a16159bf565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806144d4576144d4615f4f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610814565b6000915050610814565b600081815260018301602052604081205461456057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610814565b506000610814565b600061157d8284615a9c565b6000806145968561459161458788613726565b868863ffffffff16565b614f70565b91509150935093915050565b600061157d8284615c92565b6001600160a01b0383166146095761460481600d80546000838152600e60205260408120829055600182018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155565b61462c565b816001600160a01b0316836001600160a01b03161461462c5761462c838261509b565b6001600160a01b03821661464357610a5781615138565b826001600160a01b0316826001600160a01b031614610a5757610a5782826151e7565b6000806000838152601c602052604090205460ff16600381111561468c5761468c615eb9565b11806146ac57506000828152601a602052604090206004015460ff166001145b6146b75760016146ba565b60025b90506000806146ca601387612d83565b156146d857600291506146df565b8260ff1691505b6146ea601386612d83565b156146f7575060026146fd565b5060ff82165b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b15801561473f57600080fd5b505afa158015614753573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061477791906159d5565b6001600160a01b0316856001600160a01b03161480614820575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b1580156147d357600080fd5b505afa1580156147e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061480b91906159d5565b6001600160a01b0316856001600160a01b0316145b8061485457506000848152601a602052604090206004015460ff610100909104166001148015614854575061485485611aa7565b1561485d575060005b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b15801561489f57600080fd5b505afa1580156148b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148d791906159d5565b6001600160a01b0316866001600160a01b03161480614980575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b15801561493357600080fd5b505afa158015614947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061496b91906159d5565b6001600160a01b0316866001600160a01b0316145b806149b457506000848152601a602052604090206004015460ff6101009091041660011480156149b457506149b486611aa7565b156149be57600091505b81156149d0576149d08660008461399f565b80156149e2576149e26000868361399f565b505050505050565b60006149f7601384612d83565b158015614a0c5750614a0a601584612d83565b155b15614a1957506001610814565b6000614a2484611857565b11614ac957614a34601384612d83565b15614a4657614a44601384613975565b505b614a51601584612d83565b15614a6357614a61601584613975565b505b826001600160a01b03167f0545cfc7cd520388d4a182a7c4f82bb4c947ab8033f01089cb57a8359acfce0683604051614ab99181526040602082018190526003908201526210531360ea1b606082015260800190565b60405180910390a2506001610814565b6000805b6001600160a01b0385166000908152601d60205260409020614aee9061345b565b811015614ba65760006001600160a01b0386166000908152601d60205260408120601c9190614b1d908561522b565b815260208101919091526040016000205460ff166003811115614b4257614b42615eb9565b1180614b8a57506001600160a01b0385166000908152601d60205260408120601a9190614b6f908461522b565b815260208101919091526040016000206004015460ff166001145b15614b9457600191505b80614b9e816159a4565b915050614acd565b5080158015614bbb5750614bbb601385612d83565b15614c1c57614bcb601385613975565b50614bd760158561398a565b50836001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960784604051614c1391815260200190565b60405180910390a25b5060019392505050565b60006001600160a01b038316614c3e57506001610814565b6004805460408051633497f78760e01b815290516001600160a01b0390921692633497f787928282019260209290829003018186803b158015614c8057600080fd5b505afa158015614c94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cb891906159d5565b6001600160a01b0316836001600160a01b03161480614d61575060048054604080516303aa30b960e11b815290516001600160a01b03909216926307546172928282019260209290829003018186803b158015614d1457600080fd5b505afa158015614d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d4c91906159d5565b6001600160a01b0316836001600160a01b0316145b15614d6e57506001610814565b614d7783611aa7565b8015614d9d57506000828152601a602052604090206004015460ff610100909104166001145b15614daa57506001610814565b614db5601784612d83565b15614dc257506001610814565b6000828152601c602052604081205460ff166003811115614de557614de5615eb9565b1180614e0557506000828152601a602052604090206004015460ff166001145b80614e135750601f5460ff16155b15614eca57614e23601384612d83565b15614e3057506001610814565b614e3b601584612d83565b614e4c57614e4a601584613975565b505b614e5760138461398a565b50826001600160a01b03167fbd647e07d2ec1441b6f77851436c4478a1db786b005668bab0ed84d7ecb56e1483604051614e9391815260200190565b60405180910390a2601f5460ff16614ec557600f614eb1601361345b565b601f805460ff191692909110159190911790555b614f37565b614ed5601384612d83565b15614ee757614ee5601384613975565b505b614ef260158461398a565b50826001600160a01b03167f1116948b92f2d24f8506a2c8d1dbb47dbfab2c8c055e84f7405a8ae4a7b3960783604051614f2e91815260200190565b60405180910390a25b50600192915050565b6000818152600183016020526040812054151561157d565b600061157d8383614426565b600061157d8383614519565b8154600090819081614f8186613726565b9050600082118015614fbf57504386614f9b600185615c92565b81548110614fab57614fab6159bf565b60009182526020909120015463ffffffff16145b1561501f57614fcd85615237565b86614fd9600185615c92565b81548110614fe957614fe96159bf565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b0316021790555061508d565b856000016040518060400160405280615037436152a4565b63ffffffff16815260200161504b88615237565b6001600160e01b0390811690915282546001810184556000938452602093849020835194909301519091166401000000000263ffffffff909316929092179101555b9250839150505b9250929050565b600060016150a884611857565b6150b29190615c92565b6000838152600c6020526040902054909150808214615105576001600160a01b0384166000908152600b602090815260408083208584528252808320548484528184208190558352600c90915290208190555b506000918252600c602090815260408084208490556001600160a01b039094168352600b81528383209183525290812055565b600d5460009061514a90600190615c92565b6000838152600e6020526040812054600d8054939450909284908110615172576151726159bf565b9060005260206000200154905080600d8381548110615193576151936159bf565b6000918252602080832090910192909255828152600e9091526040808220849055858252812055600d8054806151cb576151cb615f4f565b6001900381819060005260206000200160009055905550505050565b60006151f283611857565b6001600160a01b039093166000908152600b602090815260408083208684528252808320859055938252600c9052919091209190915550565b600061157d8383615309565b60006001600160e01b038211156152a05760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608401610921565b5090565b600063ffffffff8211156152a05760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610921565b6000826000018281548110615320576153206159bf565b9060005260206000200154905092915050565b82805461533f9061592f565b90600052602060002090601f01602090048101928261536157600085556153a7565b82601f1061537a5782800160ff198235161785556153a7565b828001600101855582156153a7579182015b828111156153a757823582559160200191906001019061538c565b506152a09291505b808211156152a057600081556001016153af565b6000602082840312156153d557600080fd5b5035919050565b6001600160e01b0319811681146123d757600080fd5b60006020828403121561540457600080fd5b813561157d816153dc565b60005b8381101561542a578181015183820152602001615412565b83811115611e5e5750506000910152565b6000815180845261545381602086016020860161540f565b601f01601f19169290920160200192915050565b60208152600061157d602083018461543b565b6001600160a01b03811681146123d757600080fd5b600080604083850312156154a257600080fd5b82356154ad8161547a565b946020939093013593505050565b60006020808352835181840152808401516040840152604084015160c060608501526154ea60e085018261543b565b6060860151858203601f19016080870152805180835290840192506000918401905b80831015615544578351805183526020808201519084015260409081015190830152606082019150848401935060018301925061550c565b50608087015160ff811660a0880152935060a087015160ff811660c088015293505b9695505050505050565b60008060006060848603121561558557600080fd5b83356155908161547a565b925060208401356155a08161547a565b929592945050506040919091013590565b6000602082840312156155c357600080fd5b813561157d8161547a565b60008083601f8401126155e057600080fd5b50813567ffffffffffffffff8111156155f857600080fd5b60208301915083602082850101111561509457600080fd5b60008060006040848603121561562557600080fd5b83359250602084013567ffffffffffffffff81111561564357600080fd5b61564f868287016155ce565b9497909650939450505050565b60ff811681146123d757600080fd5b60006020828403121561567d57600080fd5b813561157d8161565c565b80151581146123d757600080fd5b600080604083850312156156a957600080fd5b82356156b48161547a565b915060208301356156c481615688565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615708576157086156cf565b60405290565b60405160c0810167ffffffffffffffff81118282101715615708576157086156cf565b604051601f8201601f1916810167ffffffffffffffff8111828210171561575a5761575a6156cf565b604052919050565b600067ffffffffffffffff82111561577c5761577c6156cf565b50601f01601f191660200190565b600080600080608085870312156157a057600080fd5b84356157ab8161547a565b935060208501356157bb8161547a565b925060408501359150606085013567ffffffffffffffff8111156157de57600080fd5b8501601f810187136157ef57600080fd5b80356158026157fd82615762565b615731565b81815288602083850101111561581757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060008060008060c0878903121561585257600080fd5b863561585d8161547a565b95506020870135945060408701359350606087013561587b8161565c565b9598949750929560808101359460a0909101359350915050565b600080604083850312156158a857600080fd5b82356158b38161547a565b915060208301356156c48161547a565b600080600080604085870312156158d957600080fd5b843567ffffffffffffffff808211156158f157600080fd5b6158fd888389016155ce565b9096509450602087013591508082111561591657600080fd5b50615923878288016155ce565b95989497509550505050565b600181811c9082168061594357607f821691505b6020821081141561396f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261598957615989615964565b500690565b634e487b7160e01b600052601160045260246000fd5b60006000198214156159b8576159b861598e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156159e757600080fd5b815161157d8161547a565b600081546159ff8161592f565b60018281168015615a175760018114615a2857615a57565b60ff19841687528287019450615a57565b8560005260208060002060005b85811015615a4e5781548a820152908401908201615a35565b50505082870194505b5050505092915050565b600061157d82846159f2565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60008219821115615aaf57615aaf61598e565b500190565b6000815480845260208085019450836000528060002060005b83811015615aff5781548752600180830154848901526002830154604089015260609097019660039092019101615acd565b509495945050505050565b6040815282546040820152600060018085015460608401526002850160c0608085015260008154615b3a8161592f565b8061010088015261012085831660008114615b5c5760018114615b7157615ba2565b60ff1984168983015261014089019450615ba2565b8560005260208060002060005b85811015615b995781548c8201860152908901908201615b7e565b8b018401965050505b50505050848103603f190160a0860152615bbf8160038901615ab4565b925050506004850154615bda60c0850160ff831660ff169052565b600881901c60ff1660e0850152508281036020840152615bfa818561543b565b95945050505050565b600082601f830112615c1457600080fd5b8151615c226157fd82615762565b818152846020838601011115615c3757600080fd5b61385182602083016020870161540f565b600060208284031215615c5a57600080fd5b815167ffffffffffffffff811115615c7157600080fd5b61385184828501615c03565b6000613851615c8c83866159f2565b846159f2565b600082821015615ca457615ca461598e565b500390565b600082601f830112615cba57600080fd5b8151602067ffffffffffffffff821115615cd657615cd66156cf565b615ce4818360051b01615731565b82815260609283028501820192828201919087851115615d0357600080fd5b8387015b85811015615d4a5781818a031215615d1f5760008081fd5b615d276156e5565b815181528582015186820152604080830151908201528452928401928101615d07565b5090979650505050505050565b80516110198161565c565b600060208284031215615d7457600080fd5b815167ffffffffffffffff80821115615d8c57600080fd5b9083019060c08286031215615da057600080fd5b615da861570e565b8251815260208301516020820152604083015182811115615dc857600080fd5b615dd487828601615c03565b604083015250606083015182811115615dec57600080fd5b615df887828601615ca9565b606083015250615e0a60808401615d57565b6080820152615e1b60a08401615d57565b60a082015295945050505050565b60208152600061157d6020830184615ab4565b6020808252825182820181905260009190848201906040850190845b81811015615e8c57835180518452602080820151908501526040908101519084015260608301938501939250600101615e58565b50909695505050505050565b600060208284031215615eaa57600080fd5b81516004811061157d57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215615ee157600080fd5b815161157d81615688565b600082615efb57615efb615964565b500490565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615566608083018461543b565b600060208284031215615f4457600080fd5b815161157d816153dc565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ad87f18ef2a64b5793120fa1af757572f65e307cf15493db3d249ec8cc3dacc864736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002fa631c48374a280eb04cd41490665eca635a35500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c10000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000040000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a860000000000000000000000001822d8c387a786ec671b63186b99c51072595278000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be200000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d0000000000000000000000000000000000000000000000000000000000000007697066733a2f2f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----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):
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000002fa631c48374a280eb04cd41490665eca635a355
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 0000000000000000000000009b09c5c4085e7887388e5cdecfdacf3c5cf99a86
Arg [7] : 0000000000000000000000001822d8c387a786ec671b63186b99c51072595278
Arg [8] : 000000000000000000000000172f19c6066441f6806556fcf5a97b1a86042be2
Arg [9] : 00000000000000000000000050c528e9401673b199e6d9e5d3a56d9a26e86b5d
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [11] : 697066733a2f2f00000000000000000000000000000000000000000000000000
Arg [12] : 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.