ZNS Connect (.speed)

Overview

TokenID

8

Total Transfers

-

Market

Onchain Market Cap

-

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
ZNSRegistry

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 22 : ZNSRegistryURI.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.21;

pragma abicoder v2;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import { ZNSOracle } from "./ZNSOracle.sol";
import { ZNSGiftCard } from "./ZNSGiftCard.sol";

contract ZNSRegistry is
	ERC721URIStorage,
	Pausable,
	ReentrancyGuard,
	AccessControl
{
	using Strings for uint256;

	/*//////////////////////////////////////////////////////////////
                            INITIALIZATION
    //////////////////////////////////////////////////////////////*/
	uint256 public tokenID;

	bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");
	string public tld;

	string public baseUri;

	address[] profitSharingPartners = [
		0xD00c70F9b78C63a36519C488F862DF95b7A73d90
	];

	uint256[] profitSharesOfPartners = [10000];
	address public oracle;
	address public giftCard;

	struct RegistryData {
		address owner;
		string domainName;
		uint16 lengthOfDomain;
		uint256 expirationDate;
	}

	struct UserData {
		uint256[] ownedGiftCards;
		uint256 credits;
	}

	struct UserConfig {
		uint256 primaryDomain;
		uint256[] allOwnedDomains;
		uint256 numberOfReferrals;
		uint256 totalEarnings;
	}

	enum domainStatus {
		AVAILABLE,
		REGISTERED,
		EXPIRED
	}

	mapping(uint256 => RegistryData) internal registryLookup;
	mapping(address => UserConfig) internal userLookup;
	mapping(string => uint256) public domainLookup;
	mapping(uint256 => string) public idToDomain;
	mapping(string => bool) public protectedDomains;
	mapping(address => uint256) public partnerReferrals;
	mapping(uint256 => uint256) public mintToExpire;

	uint256[] public totalRegisteredDomains;

	uint256[5] internal domainPricing = [990e18, 490e18, 90e18, 20e18, 5e18];
	uint256[5] internal renewPricing = [99e18, 49e18, 9e18, 2e18, 5e17];

	// 1 invites - 5%
	// 10 invites - 10-%
	// 30 invites - 15%
	// 60 invites - 20%
	// 100 invites - 25%
	uint256[5] referTicks = [500, 1000, 1500, 2000, 2500];

	constructor(
		address _oracle,
		address _giftCard,
		string memory _symbol,
		string memory _tld
	) ERC721("ZNS Connect", _symbol) {
		tokenID++;
		_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
		_grantRole(MAINTAINER_ROLE, msg.sender);

		oracle = _oracle;
		giftCard = _giftCard;

		tld = _tld;

		baseUri = "https://api.znsconnect.io/v1/metadata";
	}

	/*//////////////////////////////////////////////////////////////
                            CUSTOM MODIFIERS
    //////////////////////////////////////////////////////////////*/

	modifier onlyMaintainer() {
		require(
			hasRole(MAINTAINER_ROLE, msg.sender),
			"maintainer role required"
		);
		_;
	}

	modifier onlyAdmin() {
		require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "admin role required");
		_;
	}

	/*//////////////////////////////////////////////////////////////
                            CUSTOM ERRORS
    //////////////////////////////////////////////////////////////*/

	error InvalidLength();
	error AlreadyRegistered();
	error SelfReferral();
	error DomainExpired();
	error NotRegistered();
	error cannotBeMoreThan100Percent();
	error InvalidAddress();
	error LengthsDoNotMatch();
	error NoCredits();
	error NotOwner();
	error NotEnoughCredits();
	error RefferalEarningCannotBeCalculated();
	error DomainNotExpired();
	error NotEnoughNativeTokenPaid();
	error DomainIn30dayPeriod();
	error PriceCannotBeZero();
	error DomainExpiredButNotBurned();
	error InvalidExpiry();
	error DomainIsProtected();
	error AmountMoreThanShare();
	error InvalidDomainName();

	/*//////////////////////////////////////////////////////////////
                            CUSTOM EVENTS
    //////////////////////////////////////////////////////////////*/

	event MintedDomain(
		string domainName,
		uint256 indexed tokenId,
		address indexed owner,
		uint256 indexed expiry
	);
	event PrimaryDomainSet(
		uint256 indexed tokenId,
		address indexed owner,
		string domainName
	);
	event RenewedDomain(
		uint256 indexed tokenId,
		uint256 indexed expiry,
		string domainName
	);
	event TransferredDomain(
		string domainName,
		uint256 indexed tokenId,
		address indexed from,
		address indexed to
	);

	/*//////////////////////////////////////////////////////////////
                            PUBLIC READ FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function registryLookupByName(
		string memory domainName
	) external view returns (RegistryData memory) {
		if (checkDomainStatus(domainLookup[domainName]) == domainStatus.EXPIRED)
			revert DomainExpired();
		return registryLookup[domainLookup[domainName]];
	}

	function registryLookupById(
		uint256 tokenId
	) external view returns (RegistryData memory) {
		if (checkDomainStatus(tokenId) == domainStatus.EXPIRED)
			revert DomainExpired();
		return registryLookup[tokenId];
	}

	function checkDomainStatus(
		uint256 tokenId
	) public view returns (domainStatus status) {
		RegistryData memory _registryData = registryLookup[tokenId];
		if (
			_registryData.owner == address(0) &&
			_registryData.expirationDate == 0 &&
			_registryData.lengthOfDomain == 0
		) return domainStatus.AVAILABLE;
		else if (
			_registryData.owner != address(0) &&
			_registryData.expirationDate > block.timestamp
		) return domainStatus.REGISTERED;
		else if (
			_registryData.owner != address(0) &&
			_registryData.expirationDate < block.timestamp
		) return domainStatus.EXPIRED;
	}

	function priceToRegister(uint16 len) public view returns (uint256) {
		uint256 currentUSDPrice = getOraclePrice();
		if (len <= 0 || len > 24) revert InvalidLength();
		if (len == 1) return (domainPricing[0] * 1e18) / currentUSDPrice;
		else if (len == 2) return (domainPricing[1] * 1e18) / currentUSDPrice;
		else if (len == 3) return (domainPricing[2] * 1e18) / currentUSDPrice;
		else if (len == 4) return (domainPricing[3] * 1e18) / currentUSDPrice;
		else if (len >= 5 && len <= 24)
			return (domainPricing[4] * 1e18) / currentUSDPrice;
		else revert InvalidLength();
	}

	function priceToRenew(uint16 len) public view returns (uint256) {
		uint256 currentUSDPrice = getOraclePrice();
		if (len <= 0 || len > 24) revert InvalidLength();

		if (len == 1) return (renewPricing[0] * 1e18) / currentUSDPrice;
		else if (len == 2) return (renewPricing[1] * 1e18) / currentUSDPrice;
		else if (len == 3) return (renewPricing[2] * 1e18) / currentUSDPrice;
		else if (len == 4) return (renewPricing[3] * 1e18) / currentUSDPrice;
		else if (len >= 5 && len <= 24)
			return (renewPricing[4] * 1e18) / currentUSDPrice;
		else revert InvalidLength();
	}

	function userLookupByAddress(
		address user
	) external view returns (UserConfig memory) {
		return userLookup[user];
	}

	function getOraclePrice() public view returns (uint256) {
		return ZNSOracle(oracle).priceToUSD();
	}

	function getTotalRegisteredDomains()
		external
		view
		returns (uint256[] memory)
	{
		return totalRegisteredDomains;
	}

	/*//////////////////////////////////////////////////////////////
                            ADMIN WRITE FUNCTIONS
    //////////////////////////////////////////////////////////////*/
	function setPartnerReferral(
		address referral,
		uint sharePercent
	) public onlyAdmin nonReentrant whenNotPaused {
		if (sharePercent > 10000) {
			revert cannotBeMoreThan100Percent();
		}
		partnerReferrals[referral] = sharePercent;
	}

	function setProfitSharingData(
		address[] memory _partners,
		uint256[] memory _percentages
	) public onlyAdmin nonReentrant whenNotPaused {
		if (_partners.length != _percentages.length) {
			revert LengthsDoNotMatch();
		}
		uint256 sum;
		for (uint256 i = 0; i < _percentages.length; i++) {
			sum += _percentages[i];
			if (isInvalidAddress(_partners[i])) revert InvalidAddress();
		}
		if (sum > 10000) {
			revert cannotBeMoreThan100Percent();
		}
		profitSharingPartners = _partners;
		profitSharesOfPartners = _percentages;
	}

	function setOracle(address _oracleAddress) public onlyAdmin nonReentrant {
		if (isInvalidAddress(_oracleAddress)) revert InvalidAddress();
		oracle = _oracleAddress;
	}

	function setGiftCard(
		address _giftCardAddress
	) public onlyAdmin nonReentrant {
		if (isInvalidAddress(_giftCardAddress)) revert InvalidAddress();
		giftCard = _giftCardAddress;
	}

	function setReferTicks(
		uint256[5] memory _ticks
	) public onlyAdmin nonReentrant whenNotPaused {
		for (uint256 i = 0; i < 5; i++) {
			if (_ticks[i] > 10000) {
				revert cannotBeMoreThan100Percent();
			}
		}
		referTicks = _ticks;
	}

	function setDomainPricing(
		uint256[5] memory _domainPricing
	) external onlyAdmin nonReentrant whenNotPaused {
		if (_domainPricing.length != 5) revert InvalidLength();
		for (uint256 i = 0; i < _domainPricing.length; i++) {
			if (_domainPricing[i] == 0) revert PriceCannotBeZero();
		}
		domainPricing = _domainPricing;
	}

	function setRenewPricing(
		uint256[5] memory _renewPricing
	) external onlyAdmin nonReentrant {
		if (_renewPricing.length != 5) revert InvalidLength();
		for (uint256 i = 0; i < _renewPricing.length; i++) {
			if (_renewPricing[i] == 0) revert PriceCannotBeZero();
		}
		renewPricing = _renewPricing;
	}

	function adminWithdraw() public onlyAdmin nonReentrant {
		payable(msg.sender).transfer(address(this).balance);
	}

	function adminRegisterDomains(
		address[] memory owners,
		string[] memory domainNames,
		uint256[] memory expiries
	) public onlyAdmin nonReentrant whenNotPaused {
		uint16[] memory lengthsOfDomains = new uint16[](domainNames.length);

		for (uint256 i = 0; i < domainNames.length; i++) {
			uint16 lengthOfDomain = uint16(strlen(domainNames[i]));
			lengthsOfDomains[i] = lengthOfDomain;
		}

		mintDomains(owners, domainNames, lengthsOfDomains, expiries);
	}

	function pause() external onlyAdmin nonReentrant {
		_pause();
	}

	function unpause() external onlyAdmin nonReentrant {
		_unpause();
	}

	function protectDomains(
		string[] memory domainNames,
		bool[] memory isProtectedValues
	) external onlyAdmin nonReentrant whenNotPaused {
		if (domainNames.length != isProtectedValues.length) {
			revert LengthsDoNotMatch();
		}
		for (uint256 i = 0; i < domainNames.length; i++) {
			protectedDomains[domainNames[i]] = isProtectedValues[i];
		}
	}

	function burnExpiredDomains(
		uint256[] memory tokenIds
	) external onlyMaintainer nonReentrant whenNotPaused {
		for (uint256 i = 0; i < tokenIds.length; i++) {
			uint256 tokenId = tokenIds[i];
			if (registryLookup[tokenId].expirationDate > block.timestamp)
				revert DomainNotExpired();

			if (
				registryLookup[tokenId].expirationDate + 30 days >
				block.timestamp
			) revert DomainIn30dayPeriod();
			maintainerBurn(tokenId);
		}
	}

	function setBaseUri(string memory _baseUri) public onlyAdmin {
		baseUri = _baseUri;
	}

	function setTld(string memory _tld) public onlyAdmin {
		tld = _tld;
	}

	function transferAdminRole(address _newAdmin) public onlyAdmin {
		_grantRole(DEFAULT_ADMIN_ROLE, _newAdmin);
	}

	function transferMaintainerRole(address _newMaintainer) public onlyAdmin {
		_grantRole(MAINTAINER_ROLE, _newMaintainer);
	}

	function transferAdminAndMaintainerRole(
		address _newOwner
	) public onlyAdmin {
		_grantRole(DEFAULT_ADMIN_ROLE, _newOwner);
		_grantRole(MAINTAINER_ROLE, _newOwner);
	}

	/*//////////////////////////////////////////////////////////////
                            PUBLIC WRITE FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function registerDomains(
		address[] memory owners,
		string[] memory domainNames,
		uint256[] memory expiries,
		address referral,
		uint256 credits
	) external payable nonReentrant whenNotPaused {
		uint256 totalPrice;
		uint16[] memory lengthsOfDomains = new uint16[](domainNames.length);

		for (uint256 i = 0; i < domainNames.length; i++) {
			uint256 expiry = expiries[i];
			string memory domainName = domainNames[i];
			if (!isValidDomainName(domainName)) {
				revert InvalidDomainName();
			}
			if (protectedDomains[domainName]) revert DomainIsProtected();
			uint16 lengthOfDomain = uint16(strlen(domainName));
			lengthsOfDomains[i] = lengthOfDomain;

			if (!isValidLength(lengthOfDomain)) revert InvalidLength();
			if (referral == msg.sender) revert SelfReferral();

			uint256 price = priceToRegister(lengthOfDomain);
			totalPrice += price;

			if (expiry > 1) {
				totalPrice += priceToRenew(lengthOfDomain) * (expiry - 1);
			}
		}

		if (credits > 0) {
			if (ZNSGiftCard(giftCard).getUserCredits(msg.sender) < credits) {
				revert NotEnoughCredits();
			}
			uint256 creditValue = getValueFromCredits(credits);
			ZNSGiftCard(giftCard).registryBurnCredits(msg.sender, credits);
			totalPrice -= creditValue;
		}

		if (msg.value < totalPrice) revert NotEnoughNativeTokenPaid();

		uint256 earnings = totalPrice;

		if (referral != address(0)) {
			uint256 referralBand = getReferralBand(referral);
			uint256 referralInBIPS = calculateActualFromBIPS(
				totalPrice,
				referralBand
			);
			userLookup[referral].numberOfReferrals += domainNames.length;
			userLookup[referral].totalEarnings += referralInBIPS;
			payable(referral).transfer(referralInBIPS);

			earnings -= referralInBIPS;
		}
		for (uint256 i = 0; i < profitSharingPartners.length; i++) {
			payable(profitSharingPartners[i]).transfer(
				calculateActualFromBIPS(earnings, profitSharesOfPartners[i])
			);
		}
		mintDomains(owners, domainNames, lengthsOfDomains, expiries);
	}

	function renewDomain(
		uint256 _tokenId,
		uint256 _years
	) external payable nonReentrant whenNotPaused {
		if (registryLookup[_tokenId].owner != msg.sender) revert NotOwner();
		if (_years == 0) revert InvalidExpiry();
		uint256 price = priceToRenew(registryLookup[_tokenId].lengthOfDomain) *
			_years;
		if (msg.value < price) revert NotEnoughNativeTokenPaid();
		for (uint256 i = 0; i < profitSharingPartners.length; i++) {
			payable(profitSharingPartners[i]).transfer(
				calculateActualFromBIPS(price, profitSharesOfPartners[i])
			);
		}
		registryLookup[_tokenId].expirationDate += 365 days * _years;
		emit RenewedDomain(
			_tokenId,
			registryLookup[_tokenId].expirationDate,
			addTLD(registryLookup[_tokenId].domainName)
		);
	}

	function setPrimaryDomain(
		uint256 _tokenId
	) external nonReentrant whenNotPaused {
		address owner = registryLookup[_tokenId].owner;
		if (owner != msg.sender) revert NotOwner();
		userLookup[owner].primaryDomain = _tokenId;
		emit PrimaryDomainSet(
			_tokenId,
			owner,
			addTLD(registryLookup[_tokenId].domainName)
		);
	}

	function burnDomain(uint256 _tokenId) external nonReentrant whenNotPaused {
		address owner = registryLookup[_tokenId].owner;
		if (owner != msg.sender) revert NotOwner();
		uint256[] memory ownedDomains = userLookup[owner].allOwnedDomains;
		uint256[] memory newOwnedDomains = new uint256[](
			ownedDomains.length - 1
		);
		uint256 counter = 0;
		for (uint256 i = 0; i < ownedDomains.length; i++) {
			if (ownedDomains[i] != _tokenId) {
				newOwnedDomains[counter] = ownedDomains[i];
				counter++;
			}
		}
		userLookup[owner].allOwnedDomains = newOwnedDomains;
		if (
			newOwnedDomains.length > 0 &&
			userLookup[owner].primaryDomain == _tokenId
		) {
			userLookup[owner].primaryDomain = newOwnedDomains[0];
			emit PrimaryDomainSet(
				newOwnedDomains[0],
				owner,
				addTLD(registryLookup[newOwnedDomains[0]].domainName)
			);
		} else {
			userLookup[owner].primaryDomain = 0;
			emit PrimaryDomainSet(0, owner, "");
		}
		delete registryLookup[_tokenId];
		_burn(_tokenId);

		clearDomain(_tokenId);
	}

	/*//////////////////////////////////////////////////////////////
                            INTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function addTLD(
		string memory domainName
	) internal view returns (string memory) {
		return string.concat(domainName, string.concat(".", tld));
	}

	function getValueFromCredits(
		uint256 credits
	) internal view returns (uint256) {
		uint256 currentUSDPrice = getOraclePrice();
		return (credits * 1e18) / currentUSDPrice;
	}

	function isValidDomainName(
		string memory domainName
	) internal pure returns (bool) {
		bytes memory domainBytes = bytes(domainName);
		for (uint i = 0; i < domainBytes.length; i++) {
			// Check for lowercase letters, numbers, and the "-" character
			if (
				!(domainBytes[i] >= 0x30 && domainBytes[i] <= 0x39) && // 0-9
				!(domainBytes[i] >= 0x61 && domainBytes[i] <= 0x7A) && // a-z
				!(domainBytes[i] == 0x2D) && // "-" character
				!(domainBytes[i] > 0x7F) // Allow non-ASCII characters (basic check for emojis and other languages)
			) {
				// If the character is not a lowercase letter, number, "-", or > 0x7F (basic non-ASCII),
				// then it's invalid based on our criteria.
				return false;
			}
		}
		// Passed all checks
		return true;
	}

	function createTokenURI(
		uint256 _tokenId
	) internal view returns (string memory) {
		string memory tokenId = _tokenId.toString();

		uint256 id;
		assembly {
			id := chainid()
		}

		string memory tokenUri = string(
			abi.encodePacked(baseUri, "/", id.toString(), "/", tokenId)
		);

		return tokenUri;
	}

	function strlen(string memory s) internal pure returns (uint256) {
		uint256 len;
		uint256 i = 0;
		uint256 bytelength = bytes(s).length;
		for (len = 0; i < bytelength; len++) {
			bytes1 b = bytes(s)[i];
			if (b < 0x80) {
				i += 1;
			} else if (b < 0xE0) {
				i += 2;
			} else if (b < 0xF0) {
				i += 3;
			} else if (b < 0xF8) {
				i += 4;
			} else if (b < 0xFC) {
				i += 5;
			} else {
				i += 6;
			}
		}
		return len;
	}

	function isInvalidAddress(address _address) internal view returns (bool) {
		return _address == address(this) || _address == address(0);
	}

	function isValidLength(uint16 len) internal pure returns (bool) {
		return len > 0 && len <= 24;
	}

	function getReferralBand(address referral) public view returns (uint256) {
		if (partnerReferrals[referral] != 0) {
			return partnerReferrals[referral];
		}
		uint256 numberOfReferrals = userLookup[referral].numberOfReferrals;
		if (numberOfReferrals >= 0 && numberOfReferrals < 10)
			return referTicks[0];
		else if (numberOfReferrals >= 10 && numberOfReferrals < 30)
			return referTicks[1];
		else if (numberOfReferrals >= 30 && numberOfReferrals < 60)
			return referTicks[2];
		else if (numberOfReferrals >= 60 && numberOfReferrals < 100)
			return referTicks[3];
		else if (numberOfReferrals >= 100) return referTicks[4];
		else revert RefferalEarningCannotBeCalculated();
	}

	function calculateActualFromBIPS(
		uint256 price,
		uint256 bips
	) public pure returns (uint256) {
		return (price * bips) / 10000;
	}

	function mintDomains(
		address[] memory owners,
		string[] memory domainNames,
		uint16[] memory lengthsOfDomains,
		uint256[] memory expiries
	) internal whenNotPaused {
		if (
			domainNames.length != owners.length ||
			owners.length != expiries.length ||
			lengthsOfDomains.length != owners.length
		) {
			revert LengthsDoNotMatch();
		}

		uint256[] memory newTokenIds = new uint256[](domainNames.length);
		for (uint256 i = 0; i < domainNames.length; i++) {
			address owner = owners[i];
			string memory domainName = domainNames[i];
			uint256 expiry = expiries[i];
			uint16 lengthOfDomain = lengthsOfDomains[i];
			uint256 newRecordId = tokenID;
			newTokenIds[i] = newRecordId;

			if (isInvalidAddress(owners[i])) revert InvalidAddress();
			if (
				checkDomainStatus(domainLookup[domainName]) ==
				domainStatus.REGISTERED
			) revert AlreadyRegistered();
			if (
				checkDomainStatus(domainLookup[domainName]) ==
				domainStatus.EXPIRED
			) revert DomainExpiredButNotBurned();

			unchecked {
				tokenID++;
			}

			registryLookup[newRecordId] = RegistryData({
				owner: owner,
				domainName: domainName,
				lengthOfDomain: lengthOfDomain,
				expirationDate: block.timestamp + (365 days * expiry)
			});
			userLookup[owner].allOwnedDomains.push(newRecordId);
			domainLookup[domainName] = newRecordId;

			if (userLookup[owner].primaryDomain == 0) {
				userLookup[owner].primaryDomain = newRecordId;
				emit PrimaryDomainSet(newRecordId, owner, addTLD(domainName));
			}

			_safeMint(owner, newRecordId);
			_setTokenURI(newRecordId, createTokenURI(newRecordId));

			totalRegisteredDomains.push(newRecordId);
			idToDomain[newRecordId] = domainName;
			mintToExpire[newRecordId] = expiry;

			emit MintedDomain(
				addTLD(domainName),
				newRecordId,
				owner,
				registryLookup[newRecordId].expirationDate
			);
		}
	}

	function _beforeTokenTransfer(
		address from,
		address to,
		uint256 firstTokenId,
		uint256 batchSize
	) internal virtual override {
		super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
		if (from != address(0) && to != address(0)) {
			if (checkDomainStatus(firstTokenId) == domainStatus.EXPIRED)
				revert DomainExpired();
			uint256[] memory ownedDomains = userLookup[from].allOwnedDomains;
			uint256[] memory newOwnedDomains = new uint256[](
				ownedDomains.length - batchSize
			);
			uint256 counter = 0;
			for (uint256 i = 0; i < ownedDomains.length; i++) {
				if (ownedDomains[i] != firstTokenId) {
					newOwnedDomains[counter] = ownedDomains[i];
					counter++;
				}
			}
			userLookup[from].allOwnedDomains = newOwnedDomains;
			if (
				newOwnedDomains.length > 0 &&
				userLookup[from].primaryDomain == firstTokenId
			) {
				userLookup[from].primaryDomain = newOwnedDomains[0];
				emit PrimaryDomainSet(
					newOwnedDomains[0],
					from,
					addTLD(registryLookup[newOwnedDomains[0]].domainName)
				);
			} else {
				userLookup[from].primaryDomain = 0;
				emit PrimaryDomainSet(0, from, "");
			}
			userLookup[to].allOwnedDomains.push(firstTokenId);
			if (userLookup[to].primaryDomain == 0) {
				userLookup[to].primaryDomain = firstTokenId;
				emit PrimaryDomainSet(
					firstTokenId,
					to,
					addTLD(registryLookup[firstTokenId].domainName)
				);
			}
			registryLookup[firstTokenId].owner = to;
		}
		emit TransferredDomain(
			addTLD(registryLookup[firstTokenId].domainName),
			firstTokenId,
			from,
			to
		);
	}

	function maintainerBurn(uint256 tokenId) internal {
		if (tokenId == 0) revert NotRegistered();
		address owner = registryLookup[tokenId].owner;
		uint256[] memory ownedDomains = userLookup[owner].allOwnedDomains;
		uint256[] memory newOwnedDomains = new uint256[](
			ownedDomains.length - 1
		);
		uint256 counter = 0;
		for (uint256 i = 0; i < ownedDomains.length; i++) {
			if (ownedDomains[i] != tokenId) {
				newOwnedDomains[counter] = ownedDomains[i];
				counter++;
			}
		}
		userLookup[owner].allOwnedDomains = newOwnedDomains;
		if (
			newOwnedDomains.length > 0 &&
			userLookup[owner].primaryDomain == tokenId
		) {
			userLookup[owner].primaryDomain = newOwnedDomains[0];
			emit PrimaryDomainSet(
				newOwnedDomains[0],
				owner,
				addTLD(registryLookup[newOwnedDomains[0]].domainName)
			);
		} else {
			userLookup[owner].primaryDomain = 0;
			emit PrimaryDomainSet(0, owner, "");
		}
		delete registryLookup[tokenId];
		_burn(tokenId);

		clearDomain(tokenId);
	}

	function clearDomain(uint256 _tokenId) internal {
		idToDomain[_tokenId] = "";

		for (uint256 i = 0; i < totalRegisteredDomains.length; i++) {
			if (totalRegisteredDomains[i] == _tokenId) {
				totalRegisteredDomains[i] = totalRegisteredDomains[
					totalRegisteredDomains.length - 1
				];
				totalRegisteredDomains.pop();
			}
		}
	}

	/*//////////////////////////////////////////////////////////////
                            DEPENDANCY FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function supportsInterface(
		bytes4 interfaceId
	)
		public
		view
		virtual
		override(ERC721URIStorage, AccessControl)
		returns (bool)
	{
		return super.supportsInterface(interfaceId);
	}
}

File 2 of 22 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 22 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;

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

File 5 of 22 : IERC4906.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";
import "./IERC721.sol";

/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
    /// @dev This event emits when the metadata of a token is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFT.
    event MetadataUpdate(uint256 _tokenId);

    /// @dev This event emits when the metadata of a range of tokens is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFTs.
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

File 6 of 22 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 7 of 22 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

File 8 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 9 of 22 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, 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_;
    }

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

        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 overridden 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 token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

    /**
     * @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 from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

File 10 of 22 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "../../../interfaces/IERC4906.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is IERC4906, ERC721 {
	using Strings for uint256;

	// Optional mapping for token URIs
	mapping(uint256 => string) private _tokenURIs;

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

	/**
	 * @dev See {IERC721Metadata-tokenURI}.
	 */
	function tokenURI(
		uint256 tokenId
	) public view virtual override returns (string memory) {
		_requireMinted(tokenId);

		string memory _tokenURI = _tokenURIs[tokenId];
		string memory base = _baseURI();

		// If there is no base URI, return the token URI.
		if (bytes(base).length == 0) {
			return _tokenURI;
		}
		// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
		if (bytes(_tokenURI).length > 0) {
			return string(abi.encodePacked(base, _tokenURI));
		}

		return super.tokenURI(tokenId);
	}

	/**
	 * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
	 *
	 * Emits {MetadataUpdate}.
	 *
	 * Requirements:
	 *
	 * - `tokenId` must exist.
	 */
	function _setTokenURI(
		uint256 tokenId,
		string memory _tokenURI
	) internal virtual {
		require(
			_exists(tokenId),
			"ERC721URIStorage: URI set of nonexistent token"
		);
		_tokenURIs[tokenId] = _tokenURI;

		emit MetadataUpdate(tokenId);
	}

	/**
	 * @dev See {ERC721-_burn}. This override additionally checks to see if a
	 * token-specific URI was set for the token, and if so, it deletes the token URI from
	 * the storage mapping.
	 */
	function _burn(uint256 tokenId) internal virtual override {
		super._burn(tokenId);

		if (bytes(_tokenURIs[tokenId]).length != 0) {
			delete _tokenURIs[tokenId];
		}
	}
}

File 11 of 22 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 12 of 22 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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;

    /**
     * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}

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

pragma solidity ^0.8.0;

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

File 14 of 22 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 15 of 22 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 18 of 22 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @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 == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 19 of 22 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 20 of 22 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 21 of 22 : ZNSGiftCard.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.21;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import { ZNSOracle } from "./ZNSOracle.sol";

contract ZNSGiftCard is
	ERC721URIStorage,
	Pausable,
	ReentrancyGuard,
	AccessControl
{
	/*//////////////////////////////////////////////////////////////
                            INITIALIZATION
    //////////////////////////////////////////////////////////////*/

	uint256 public giftTokenID;
	mapping(uint256 => uint256) public giftCardBalances;
	string public tokenURI;

	address public oracle = 0xc11eE6C94A86e18481d9206c29ECDd3B40C59898;

	struct UserData {
		uint256 credits;
		uint256[] ownedGiftCards;
	}

	mapping(address => UserData) internal userData;
	address public treasury = 0xD00c70F9b78C63a36519C488F862DF95b7A73d90;
	address public registry;

	bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");

	constructor(
		string memory _tokenURI
	) ERC721("ZNS Gift Cards", "ZNSGiftCard") {
		tokenURI = _tokenURI;
		giftTokenID++;
		_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
		_grantRole(MAINTAINER_ROLE, msg.sender);
	}

	/*//////////////////////////////////////////////////////////////
                            CUSTOM MODIFIERS
    //////////////////////////////////////////////////////////////*/

	modifier onlyMaintainer() {
		require(
			hasRole(MAINTAINER_ROLE, msg.sender),
			"maintainer role required"
		);
		_;
	}

	modifier onlyAdmin() {
		require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "admin role required");
		_;
	}

	/*//////////////////////////////////////////////////////////////
                            CUSTOM ERRORS
    //////////////////////////////////////////////////////////////*/

	error InvalidAddress();
	error NotEnoughNativeTokenPaid();
	error AmountMustBeGreaterThanZero();
	error NotOwner();
	error NotEnoughCredits();
	error LengthsDoNotMatch();

	/*//////////////////////////////////////////////////////////////
                            USER READ FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function getUserCredits(address _user) public view returns (uint256) {
		return userData[_user].credits;
	}

	function getUserOwnedGiftCards(
		address _user
	) public view returns (uint256[] memory) {
		return userData[_user].ownedGiftCards;
	}

	function getOraclePrice() public view returns (uint256) {
		return ZNSOracle(oracle).priceToUSD();
	}

	/*//////////////////////////////////////////////////////////////
                            USER WRITE FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function mintGiftCard(
		address _to
	) public payable whenNotPaused nonReentrant {
		if (msg.value <= 0) revert AmountMustBeGreaterThanZero();
		if (isInvalidAddress(_to)) revert InvalidAddress();
		uint256 credits = getCreditsFromValue(msg.value);
		if (credits <= 0) revert NotEnoughNativeTokenPaid();
		giftCardBalances[giftTokenID] = credits;
		userData[_to].ownedGiftCards.push(giftTokenID);
		_safeMint(_to, giftTokenID);
		_setTokenURI(giftTokenID, tokenURI);
		payable(treasury).transfer(msg.value);
		unchecked {
			giftTokenID++;
		}
	}

	function burnGiftCard(uint256 _tokenId) public whenNotPaused nonReentrant {
		if (msg.sender != ownerOf(_tokenId)) revert NotOwner();
		userData[msg.sender].credits += giftCardBalances[_tokenId];
		giftCardBalances[_tokenId] = 0;
		uint256[] memory newOwnedCards = new uint256[](
			userData[msg.sender].ownedGiftCards.length - 1
		);
		uint256 counter = 0;
		uint256[] memory ownedCards = userData[msg.sender].ownedGiftCards;
		for (uint256 i = 0; i < ownedCards.length; i++) {
			if (ownedCards[i] != _tokenId) {
				newOwnedCards[counter] = ownedCards[i];
				counter++;
			}
		}
		userData[msg.sender].ownedGiftCards = newOwnedCards;
		_burn(_tokenId);
	}

	/*//////////////////////////////////////////////////////////////
                            ADMIN WRITE FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function adminMintGiftCards(
		address[] memory _to,
		uint256[] memory _amountOfCredits
	) public onlyAdmin nonReentrant whenNotPaused {
		if (_to.length != _amountOfCredits.length) revert LengthsDoNotMatch();

		for (uint256 i = 0; i < _to.length; i++) {
			if (isInvalidAddress(_to[i])) revert InvalidAddress();
			uint newGiftTokenID = giftTokenID;
			userData[_to[i]].ownedGiftCards.push(newGiftTokenID);
			giftCardBalances[newGiftTokenID] = _amountOfCredits[i];
			_safeMint(_to[i], newGiftTokenID);
			_setTokenURI(newGiftTokenID, tokenURI);
			unchecked {
				giftTokenID++;
			}
		}
	}

	function setTreasury(
		address _treasury
	) public onlyAdmin nonReentrant whenNotPaused {
		if (isInvalidAddress(_treasury)) revert InvalidAddress();
		treasury = _treasury;
	}

	function adminWithdraw() public onlyAdmin nonReentrant whenNotPaused {
		payable(msg.sender).transfer(address(this).balance);
	}

	function setRegistry(
		address _registry
	) public onlyAdmin nonReentrant whenNotPaused {
		if (isInvalidAddress(_registry)) revert InvalidAddress();
		registry = _registry;
		_grantRole(MAINTAINER_ROLE, registry);
	}

	function registryBurnCredits(
		address _to,
		uint256 _amountOfCredits
	) public onlyMaintainer nonReentrant whenNotPaused {
		if (_amountOfCredits <= 0) revert AmountMustBeGreaterThanZero();
		if (isInvalidAddress(_to)) revert InvalidAddress();
		if (userData[_to].credits < _amountOfCredits) revert NotEnoughCredits();
		userData[_to].credits -= _amountOfCredits;
	}

	function setTokenURI(
		string memory _tokenURI
	) public onlyAdmin whenNotPaused nonReentrant {
		tokenURI = _tokenURI;
	}

	function setOracle(
		address _oracleAddress
	) public onlyAdmin nonReentrant whenNotPaused {
		if (isInvalidAddress(_oracleAddress)) revert InvalidAddress();
		oracle = _oracleAddress;
	}

	/*//////////////////////////////////////////////////////////////
                            INTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function isInvalidAddress(address _address) internal view returns (bool) {
		return _address == address(this) || _address == address(0);
	}

	function getCreditsFromValue(
		uint256 _value
	) internal view returns (uint256) {
		uint256 currentUSDPrice = getOraclePrice();
		return (_value * currentUSDPrice) / 1e18;
	}

	/*//////////////////////////////////////////////////////////////
                            DEPENDANCY FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function supportsInterface(
		bytes4 interfaceId
	)
		public
		view
		virtual
		override(ERC721URIStorage, AccessControl)
		returns (bool)
	{
		return super.supportsInterface(interfaceId);
	}
}

File 22 of 22 : ZNSOracle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.21;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

contract ZNSOracle is AccessControl, ReentrancyGuard, Pausable {
	/*//////////////////////////////////////////////////////////////
                            INITIALIZATION
    //////////////////////////////////////////////////////////////*/
	uint256 public priceToUSD = 1e18;

	bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");

	constructor() {
		_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
		_grantRole(MAINTAINER_ROLE, msg.sender);
	}

	/*//////////////////////////////////////////////////////////////
                            CUSTOM MODIFIERS
    //////////////////////////////////////////////////////////////*/

	modifier onlyMaintainer() {
		require(
			hasRole(MAINTAINER_ROLE, msg.sender),
			"maintainer role required"
		);
		_;
	}

	modifier onlyAdmin() {
		require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "admin role required");
		_;
	}

	/*//////////////////////////////////////////////////////////////
                            ADMIN WRITE FUNCTIONS
    //////////////////////////////////////////////////////////////*/

	function setPrice(
		uint256 _currentPrice
	) public onlyMaintainer nonReentrant whenNotPaused {
		priceToUSD = _currentPrice;
	}
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_giftCard","type":"address"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_tld","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyRegistered","type":"error"},{"inputs":[],"name":"AmountMoreThanShare","type":"error"},{"inputs":[],"name":"DomainExpired","type":"error"},{"inputs":[],"name":"DomainExpiredButNotBurned","type":"error"},{"inputs":[],"name":"DomainIn30dayPeriod","type":"error"},{"inputs":[],"name":"DomainIsProtected","type":"error"},{"inputs":[],"name":"DomainNotExpired","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidDomainName","type":"error"},{"inputs":[],"name":"InvalidExpiry","type":"error"},{"inputs":[],"name":"InvalidLength","type":"error"},{"inputs":[],"name":"LengthsDoNotMatch","type":"error"},{"inputs":[],"name":"NoCredits","type":"error"},{"inputs":[],"name":"NotEnoughCredits","type":"error"},{"inputs":[],"name":"NotEnoughNativeTokenPaid","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotRegistered","type":"error"},{"inputs":[],"name":"PriceCannotBeZero","type":"error"},{"inputs":[],"name":"RefferalEarningCannotBeCalculated","type":"error"},{"inputs":[],"name":"SelfReferral","type":"error"},{"inputs":[],"name":"cannotBeMoreThan100Percent","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"domainName","type":"string"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"MintedDomain","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":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"string","name":"domainName","type":"string"}],"name":"PrimaryDomainSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"expiry","type":"uint256"},{"indexed":false,"internalType":"string","name":"domainName","type":"string"}],"name":"RenewedDomain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":"string","name":"domainName","type":"string"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDomain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTAINER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"string[]","name":"domainNames","type":"string[]"},{"internalType":"uint256[]","name":"expiries","type":"uint256[]"}],"name":"adminRegisterDomains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burnDomain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnExpiredDomains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"bips","type":"uint256"}],"name":"calculateActualFromBIPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"checkDomainStatus","outputs":[{"internalType":"enum ZNSRegistry.domainStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"domainLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOraclePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"referral","type":"address"}],"name":"getReferralBand","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRegisteredDomains","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"giftCard","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"idToDomain","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintToExpire","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"partnerReferrals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"uint16","name":"len","type":"uint16"}],"name":"priceToRegister","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"len","type":"uint16"}],"name":"priceToRenew","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"domainNames","type":"string[]"},{"internalType":"bool[]","name":"isProtectedValues","type":"bool[]"}],"name":"protectDomains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"protectedDomains","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"string[]","name":"domainNames","type":"string[]"},{"internalType":"uint256[]","name":"expiries","type":"uint256[]"},{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"credits","type":"uint256"}],"name":"registerDomains","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"registryLookupById","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"domainName","type":"string"},{"internalType":"uint16","name":"lengthOfDomain","type":"uint16"},{"internalType":"uint256","name":"expirationDate","type":"uint256"}],"internalType":"struct ZNSRegistry.RegistryData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"domainName","type":"string"}],"name":"registryLookupByName","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"domainName","type":"string"},{"internalType":"uint16","name":"lengthOfDomain","type":"uint16"},{"internalType":"uint256","name":"expirationDate","type":"uint256"}],"internalType":"struct ZNSRegistry.RegistryData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_years","type":"uint256"}],"name":"renewDomain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_domainPricing","type":"uint256[5]"}],"name":"setDomainPricing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_giftCardAddress","type":"address"}],"name":"setGiftCard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracleAddress","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referral","type":"address"},{"internalType":"uint256","name":"sharePercent","type":"uint256"}],"name":"setPartnerReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"setPrimaryDomain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_partners","type":"address[]"},{"internalType":"uint256[]","name":"_percentages","type":"uint256[]"}],"name":"setProfitSharingData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_ticks","type":"uint256[5]"}],"name":"setReferTicks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_renewPricing","type":"uint256[5]"}],"name":"setRenewPricing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tld","type":"string"}],"name":"setTld","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":[],"name":"tld","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenID","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalRegisteredDomains","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferAdminAndMaintainerRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"transferAdminRole","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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMaintainer","type":"address"}],"name":"transferMaintainerRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userLookupByAddress","outputs":[{"components":[{"internalType":"uint256","name":"primaryDomain","type":"uint256"},{"internalType":"uint256[]","name":"allOwnedDomains","type":"uint256[]"},{"internalType":"uint256","name":"numberOfReferrals","type":"uint256"},{"internalType":"uint256","name":"totalEarnings","type":"uint256"}],"internalType":"struct ZNSRegistry.UserConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}]

60a060405273d00c70f9b78c63a36519c488f862df95b7a73d9060809081526200002e90600d90600162000343565b50604080516020810190915261271081526200004f90600e906001620003ad565b506040805160a0810182526835ab028ac154b800008152681a901db3de6568000060208201526804e1003b28d9280000918101919091526801158e460913d000006060820152674563918244f400006080820152620000b3906019906005620003f1565b506040805160a08101825268055de6a779bbac000081526802a802f8630a2400006020820152677ce66c50e284000091810191909152671bc16d674ec8000060608201526706f05b59d3b2000060808201526200011590601e906005620003f1565b506040805160a0810182526101f481526103e860208201526105dc918101919091526107d060608201526109c46080820152620001579060239060056200042d565b503480156200016557600080fd5b50604051620065ac380380620065ac83398101604081905262000188916200055c565b60408051808201909152600b81526a169394c810dbdb9b9958dd60aa1b6020820152826000620001b983826200067b565b506001620001c882826200067b565b50506007805460ff19169055506001600855600a8054906000620001ec8362000747565b90915550620001ff90506000336200029e565b6200022b7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95336200029e565b600f80546001600160a01b038087166001600160a01b0319928316179092556010805492861692909116919091179055600b6200026982826200067b565b506040518060600160405280602581526020016200658760259139600c906200029390826200067b565b50505050506200076f565b60008281526009602090815260408083206001600160a01b038516845290915290205460ff166200033f5760008281526009602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620002fe3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b8280548282559060005260206000209081019282156200039b579160200282015b828111156200039b57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000364565b50620003a992915062000463565b5090565b8280548282559060005260206000209081019282156200039b579160200282015b828111156200039b578251829061ffff16905591602001919060010190620003ce565b82600581019282156200039b579160200282015b828111156200039b57825182906001600160481b031690559160200191906001019062000405565b82600581019282156200039b57916020028201828111156200039b578251829061ffff16905591602001919060010190620003ce565b5b80821115620003a9576000815560010162000464565b80516001600160a01b03811681146200049257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620004bf57600080fd5b81516001600160401b0380821115620004dc57620004dc62000497565b604051601f8301601f19908116603f0116810190828211818310171562000507576200050762000497565b816040528381526020925086838588010111156200052457600080fd5b600091505b8382101562000548578582018301518183018401529082019062000529565b600093810190920192909252949350505050565b600080600080608085870312156200057357600080fd5b6200057e856200047a565b93506200058e602086016200047a565b60408601519093506001600160401b0380821115620005ac57600080fd5b620005ba88838901620004ad565b93506060870151915080821115620005d157600080fd5b50620005e087828801620004ad565b91505092959194509250565b600181811c908216806200060157607f821691505b6020821081036200062257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200067657600081815260208120601f850160051c81016020861015620006515750805b601f850160051c820191505b8181101562000672578281556001016200065d565b5050505b505050565b81516001600160401b0381111562000697576200069762000497565b620006af81620006a88454620005ec565b8462000628565b602080601f831160018114620006e75760008415620006ce5750858301515b600019600386901b1c1916600185901b17855562000672565b600085815260208120601f198616915b828110156200071857888601518255948401946001909101908401620006f7565b5085821015620007375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016200076857634e487b7160e01b600052601160045260246000fd5b5060010190565b615e08806200077f6000396000f3fe6080604052600436106103c35760003560e01c806391d14854116101f2578063b88d4fde1161010d578063db846463116100a0578063f18d20be1161006f578063f18d20be14610bbd578063f874225414610bd2578063fa794bf814610c06578063fabf48d014610c2657600080fd5b8063db84646314610afa578063e3d31eb014610b27578063e985e9c514610b54578063ea3f262514610b9d57600080fd5b8063d4dae89d116100dc578063d4dae89d14610a55578063d547741f14610a8d578063d95edfde14610aad578063d9efc6bd14610acd57600080fd5b8063b88d4fde146109d5578063b8d4d526146109f5578063c442374d14610a15578063c87b56dd14610a3557600080fd5b8063a22cb46511610185578063aa34d2bd11610154578063aa34d2bd14610955578063ada8f91914610975578063b717d1bc14610995578063b81cad16146109b557600080fd5b8063a22cb465146108df578063a2aa0e5a146108ff578063a4df32281461091f578063a5c42ef11461093f57600080fd5b80639abc8320116101c15780639abc8320146108825780639bb827cb14610897578063a0bcfc7f146108aa578063a217fddf146108ca57600080fd5b806391d148541461080057806395d89b41146108205780639642c4ab14610835578063972205d21461085557600080fd5b80633a99d4eb116102e25780635c610bbc11610275578063796da7af11610244578063796da7af146107965780637adbf973146107ab5780637dc0d1d0146107cb5780638456cb59146107eb57600080fd5b80635c610bbc1461071e5780635c975abb1461073e5780636352211e1461075657806370a082311461077657600080fd5b8063549623e6116102b1578063549623e61461069157806355cb0ed1146106b157806356d90462146106d1578063588957bd146106f157600080fd5b80633a99d4eb146106295780633f4ba83a1461063c57806342842e0e146106515780634ad280011461067157600080fd5b80632485c4fa1161035a5780633115c06b116103295780633115c06b1461058e578063362f079b146105ae57806336568abe146105ce57806338c4f1e4146105ee57600080fd5b80632485c4fa14610507578063248a9ca3146105295780632d551432146105595780632f2ff15d1461056e57600080fd5b80630a68a1ac116103965780630a68a1ac146104795780630d537e8d146104a757806322ea2eed146104c757806323b872dd146104e757600080fd5b806301ffc9a7146103c857806306fdde03146103fd578063081812fc1461041f578063095ea7b314610457575b600080fd5b3480156103d457600080fd5b506103e86103e3366004614f65565b610c46565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610412610c57565b6040516103f49190614fd2565b34801561042b57600080fd5b5061043f61043a366004614fe5565b610ce9565b6040516001600160a01b0390911681526020016103f4565b34801561046357600080fd5b5061047761047236600461501a565b610d10565b005b34801561048557600080fd5b50610499610494366004614fe5565b610e2a565b6040519081526020016103f4565b3480156104b357600080fd5b506104776104c2366004614fe5565b610e4b565b3480156104d357600080fd5b506104776104e236600461508a565b610f86565b3480156104f357600080fd5b50610477610502366004615107565b611023565b34801561051357600080fd5b5061051c611054565b6040516103f49190615143565b34801561053557600080fd5b50610499610544366004614fe5565b60009081526009602052604090206001015490565b34801561056557600080fd5b506104126110ab565b34801561057a57600080fd5b50610477610589366004615187565b611139565b34801561059a57600080fd5b506104996105a93660046151b3565b61115e565b3480156105ba57600080fd5b506104996105c93660046151d7565b61125f565b3480156105da57600080fd5b506104776105e9366004615187565b61126e565b3480156105fa57600080fd5b506103e8610609366004615270565b805160208183018101805160158252928201919093012091525460ff1681565b610477610637366004615413565b6112ec565b34801561064857600080fd5b506104776117af565b34801561065d57600080fd5b5061047761066c366004615107565b6117f2565b34801561067d57600080fd5b5060105461043f906001600160a01b031681565b34801561069d57600080fd5b506104776106ac3660046154b3565b61180d565b3480156106bd57600080fd5b506104996106cc3660046151b3565b61190e565b3480156106dd57600080fd5b506104776106ec366004614fe5565b6119cf565b3480156106fd57600080fd5b5061071161070c366004614fe5565b611d1d565b6040516103f4919061553a565b34801561072a57600080fd5b50610711610739366004615270565b611e6c565b34801561074a57600080fd5b5060075460ff166103e8565b34801561076257600080fd5b5061043f610771366004614fe5565b611f5b565b34801561078257600080fd5b5061049961079136600461558c565b611fbb565b3480156107a257600080fd5b50610499612041565b3480156107b757600080fd5b506104776107c636600461558c565b6120b4565b3480156107d757600080fd5b50600f5461043f906001600160a01b031681565b3480156107f757600080fd5b5061047761212d565b34801561080c57600080fd5b506103e861081b366004615187565b612164565b34801561082c57600080fd5b5061041261218f565b34801561084157600080fd5b50610412610850366004614fe5565b61219e565b34801561086157600080fd5b50610875610870366004614fe5565b6121b7565b6040516103f491906155bd565b34801561088e57600080fd5b5061041261231f565b6104776108a53660046151d7565b61232c565b3480156108b657600080fd5b506104776108c5366004615270565b61251e565b3480156108d657600080fd5b50610499600081565b3480156108eb57600080fd5b506104776108fa3660046155f5565b612551565b34801561090b57600080fd5b5061047761091a36600461508a565b61255c565b34801561092b57600080fd5b5061047761093a36600461558c565b6125f6565b34801561094b57600080fd5b50610499600a5481565b34801561096157600080fd5b5061047761097036600461561f565b61266f565b34801561098157600080fd5b5061047761099036600461558c565b6127a5565b3480156109a157600080fd5b506104776109b036600461558c565b6127d7565b3480156109c157600080fd5b506104996109d036600461558c565b612833565b3480156109e157600080fd5b506104776109f0366004615682565b612927565b348015610a0157600080fd5b50610477610a103660046156fd565b61295f565b348015610a2157600080fd5b50610477610a3036600461501a565b612a44565b348015610a4157600080fd5b50610412610a50366004614fe5565b612ac3565b348015610a6157600080fd5b50610499610a70366004615270565b805160208183018101805160138252928201919093012091525481565b348015610a9957600080fd5b50610477610aa8366004615187565b612bd3565b348015610ab957600080fd5b50610477610ac836600461558c565b612bf8565b348015610ad957600080fd5b50610aed610ae836600461558c565b612c1f565b6040516103f491906157be565b348015610b0657600080fd5b50610499610b15366004614fe5565b60176020526000908152604090205481565b348015610b3357600080fd5b50610499610b4236600461558c565b60166020526000908152604090205481565b348015610b6057600080fd5b506103e8610b6f36600461582e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610ba957600080fd5b50610477610bb8366004615858565b612ce4565b348015610bc957600080fd5b50610477612e27565b348015610bde57600080fd5b506104997f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610c1257600080fd5b50610477610c2136600461508a565b612e8d565b348015610c3257600080fd5b50610477610c41366004615270565b612f29565b6000610c5182612f5c565b92915050565b606060008054610c669061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c929061588c565b8015610cdf5780601f10610cb457610100808354040283529160200191610cdf565b820191906000526020600020905b815481529060010190602001808311610cc257829003601f168201915b5050505050905090565b6000610cf482612f81565b506000908152600460205260409020546001600160a01b031690565b6000610d1b82611f5b565b9050806001600160a01b0316836001600160a01b031603610d8d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610da95750610da98133610b6f565b610e1b5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610d84565b610e258383612fe0565b505050565b60188181548110610e3a57600080fd5b600091825260209091200154905081565b610e5361304e565b610e5b6130a7565b6000818152601160205260409020546001600160a01b0316338114610e93576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b03811660008181526012602090815260408083208690558583526011909152902060010180548491600080516020615db383398151915291610f639190610ee09061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054610f0c9061588c565b8015610f595780601f10610f2e57610100808354040283529160200191610f59565b820191906000526020600020905b815481529060010190602001808311610f3c57829003601f168201915b50505050506130ed565b604051610f709190614fd2565b60405180910390a350610f836001600855565b50565b610f91600033612164565b610fad5760405162461bcd60e51b8152600401610d84906158c0565b610fb561304e565b60005b600581101561100a57818160058110610fd357610fd36158ed565b6020020151600003610ff8576040516316334f8560e11b815260040160405180910390fd5b8061100281615919565b915050610fb8565b50611018601e826005614e33565b50610f836001600855565b61102d3382613136565b6110495760405162461bcd60e51b8152600401610d8490615932565b610e258383836131b4565b60606018805480602002602001604051908101604052809291908181526020018280548015610cdf57602002820191906000526020600020905b81548152602001906001019080831161108e575050505050905090565b600b80546110b89061588c565b80601f01602080910402602001604051908101604052809291908181526020018280546110e49061588c565b80156111315780601f1061110657610100808354040283529160200191611131565b820191906000526020600020905b81548152906001019060200180831161111457829003601f168201915b505050505081565b60008281526009602052604090206001015461115481613325565b610e25838361332f565b600080611169612041565b905061ffff83161580611180575060188361ffff16115b1561119e5760405163251f56a160e21b815260040160405180910390fd5b8261ffff166001036111d55780601960005b01546111c490670de0b6b3a764000061597f565b6111ce9190615996565b9392505050565b8261ffff166002036111eb5780601960016111b0565b8261ffff166003036112015780601960026111b0565b8261ffff166004036112175780601960036111b0565b60058361ffff1610158015611231575060188361ffff1611155b156112405780601960046111b0565b60405163251f56a160e21b815260040160405180910390fd5b50919050565b60006127106111c4838561597f565b6001600160a01b03811633146112de5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610d84565b6112e882826133b5565b5050565b6112f461304e565b6112fc6130a7565b60008085516001600160401b0381111561131857611318615044565b604051908082528060200260200182016040528015611341578160200160208202803683370190505b50905060005b86518110156114dc576000868281518110611364576113646158ed565b602002602001015190506000888381518110611382576113826158ed565b602002602001015190506113958161341c565b6113b257604051633f71cb2560e01b815260040160405180910390fd5b6015816040516113c291906159b8565b9081526040519081900360200190205460ff16156113f3576040516373f3c27b60e11b815260040160405180910390fd5b60006113fe82613570565b905080858581518110611413576114136158ed565b602002602001019061ffff16908161ffff168152505061143281613673565b61144f5760405163251f56a160e21b815260040160405180910390fd5b336001600160a01b0389160361147857604051632af47b8760e11b815260040160405180910390fd5b60006114838261115e565b905061148f81886159d4565b965060018411156114c5576114a56001856159e7565b6114ae8361190e565b6114b8919061597f565b6114c290886159d4565b96505b5050505080806114d490615919565b915050611347565b5082156115ee576010546040516340d936ed60e11b815233600482015284916001600160a01b0316906381b26dda90602401602060405180830381865afa15801561152b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154f91906159fa565b101561156e57604051630e19bf1b60e21b815260040160405180910390fd5b600061157984613691565b601054604051636978404360e01b8152336004820152602481018790529192506001600160a01b031690636978404390604401600060405180830381600087803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b5050505080836115ea91906159e7565b9250505b8134101561160f57604051631f4d0e4560e21b815260040160405180910390fd5b816001600160a01b038516156116e257600061162a86612833565b90506000611638858361125f565b89516001600160a01b0389166000908152601260205260408120600201805493945091926116679084906159d4565b90915550506001600160a01b038716600090815260126020526040812060030180548392906116979084906159d4565b90915550506040516001600160a01b0388169082156108fc029083906000818181858888f193505050501580156116d2573d6000803e3d6000fd5b506116dd81846159e7565b925050505b60005b600d5481101561178e57600d8181548110611702576117026158ed565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166108fc61175384600e8581548110611743576117436158ed565b906000526020600020015461125f565b6040518115909202916000818181858888f1935050505015801561177b573d6000803e3d6000fd5b508061178681615919565b9150506116e5565b5061179b888884896136b1565b5050506117a86001600855565b5050505050565b6117ba600033612164565b6117d65760405162461bcd60e51b8152600401610d84906158c0565b6117de61304e565b6117e6613b06565b6117f06001600855565b565b610e2583838360405180602001604052806000815250612927565b611818600033612164565b6118345760405162461bcd60e51b8152600401610d84906158c0565b61183c61304e565b6118446130a7565b600082516001600160401b0381111561185f5761185f615044565b604051908082528060200260200182016040528015611888578160200160208202803683370190505b50905060005b83518110156118f65760006118bb8583815181106118ae576118ae6158ed565b6020026020010151613570565b9050808383815181106118d0576118d06158ed565b61ffff9092166020928302919091019091015250806118ee81615919565b91505061188e565b50611903848483856136b1565b50610e256001600855565b600080611919612041565b905061ffff83161580611930575060188361ffff16115b1561194e5760405163251f56a160e21b815260040160405180910390fd5b8261ffff166001036119645780601e60006111b0565b8261ffff1660020361197a5780601e60016111b0565b8261ffff166003036119905780601e60026111b0565b8261ffff166004036119a65780601e60036111b0565b60058361ffff16101580156119c0575060188361ffff1611155b156112405780601e60046111b0565b6119d761304e565b6119df6130a7565b6000818152601160205260409020546001600160a01b0316338114611a17576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b038116600090815260126020908152604080832060010180548251818502810185019093528083529192909190830182828015611a7a57602002820191906000526020600020905b815481526020019060010190808311611a66575b50505050509050600060018251611a9191906159e7565b6001600160401b03811115611aa857611aa8615044565b604051908082528060200260200182016040528015611ad1578160200160208202803683370190505b5090506000805b8351811015611b585785848281518110611af457611af46158ed565b602002602001015114611b4657838181518110611b1357611b136158ed565b6020026020010151838381518110611b2d57611b2d6158ed565b602090810291909101015281611b4281615919565b9250505b80611b5081615919565b915050611ad8565b506001600160a01b03841660009081526012602090815260409091208351611b8892600190920191850190614e71565b5060008251118015611bb157506001600160a01b03841660009081526012602052604090205485145b15611c725781600081518110611bc957611bc96158ed565b6020908102919091018101516001600160a01b038616600081815260129093526040832091909155835190918491611c0357611c036158ed565b6020026020010151600080516020615db3833981519152611c586011600087600081518110611c3457611c346158ed565b602002602001015181526020019081526020016000206001018054610ee09061588c565b604051611c659190614fd2565b60405180910390a3611cbd565b6001600160a01b03841660008181526012602052604080822082905551600080516020615db383398151915290611cb490602080825260009082015260400190565b60405180910390a35b600085815260116020526040812080546001600160a01b031916815590611ce76001830182614eab565b5060028101805461ffff191690556000600390910155611d0685613b58565b611d0f85613b98565b50505050610f836001600855565b611d55604051806080016040528060006001600160a01b0316815260200160608152602001600061ffff168152602001600081525090565b6002611d60836121b7565b6002811115611d7157611d716155a7565b03611d8f57604051632db0646360e01b815260040160405180910390fd5b60008281526011602090815260409182902082516080810190935280546001600160a01b031683526001810180549192840191611dcb9061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054611df79061588c565b8015611e445780601f10611e1957610100808354040283529160200191611e44565b820191906000526020600020905b815481529060010190602001808311611e2757829003601f168201915b5050509183525050600282015461ffff16602082015260039091015460409091015292915050565b611ea4604051806080016040528060006001600160a01b0316815260200160608152602001600061ffff168152602001600081525090565b6002611ecd601384604051611eb991906159b8565b9081526020016040518091039020546121b7565b6002811115611ede57611ede6155a7565b03611efc57604051632db0646360e01b815260040160405180910390fd5b60116000601384604051611f1091906159b8565b90815260408051602092819003830190205483528282019390935290820160002082516080810190935280546001600160a01b031683526001810180549192840191611dcb9061588c565b6000818152600260205260408120546001600160a01b031680610c515760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610d84565b60006001600160a01b0382166120255760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610d84565b506001600160a01b031660009081526003602052604090205490565b600f5460408051636fdf583360e01b815290516000926001600160a01b031691636fdf58339160048083019260209291908290030181865afa15801561208b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120af91906159fa565b905090565b6120bf600033612164565b6120db5760405162461bcd60e51b8152600401610d84906158c0565b6120e361304e565b6120ec81613c75565b1561210a5760405163e6c4247b60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b038316179055600160085550565b612138600033612164565b6121545760405162461bcd60e51b8152600401610d84906158c0565b61215c61304e565b6117e6613c97565b60009182526009602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610c669061588c565b601460205260009081526040902080546110b89061588c565b600081815260116020908152604080832081516080810190925280546001600160a01b031682526001810180548594840191906121f39061588c565b80601f016020809104026020016040519081016040528092919081815260200182805461221f9061588c565b801561226c5780601f106122415761010080835404028352916020019161226c565b820191906000526020600020905b81548152906001019060200180831161224f57829003601f168201915b5050509183525050600282015461ffff16602082015260039091015460409091015280519091506001600160a01b03161580156122ab57506060810151155b80156122bd5750604081015161ffff16155b156122cb5750600092915050565b80516001600160a01b0316158015906122e75750428160600151115b156122f55750600192915050565b80516001600160a01b0316158015906123115750428160600151105b156112595750600292915050565b600c80546110b89061588c565b61233461304e565b61233c6130a7565b6000828152601160205260409020546001600160a01b03163314612373576040516330cd747160e01b815260040160405180910390fd5b806000036123935760405162d36c8560e81b815260040160405180910390fd5b60008281526011602052604081206002015482906123b49061ffff1661190e565b6123be919061597f565b9050803410156123e157604051631f4d0e4560e21b815260040160405180910390fd5b60005b600d5481101561247d57600d8181548110612401576124016158ed565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166108fc61244284600e8581548110611743576117436158ed565b6040518115909202916000818181858888f1935050505015801561246a573d6000803e3d6000fd5b508061247581615919565b9150506123e4565b5061248c826301e1338061597f565b600084815260116020526040812060030180549091906124ad9084906159d4565b9091555050600083815260116020526040902060038101546001909101805485917fa64e2b85ab1e5f2c0229d2b57dbd8cd4a1f512228662783d3a2ce0f4a6ecf6f3916124fe9190610ee09061588c565b60405161250b9190614fd2565b60405180910390a3506112e86001600855565b612529600033612164565b6125455760405162461bcd60e51b8152600401610d84906158c0565b600c6112e88282615a59565b6112e8338383613cd4565b612567600033612164565b6125835760405162461bcd60e51b8152600401610d84906158c0565b61258b61304e565b6125936130a7565b60005b60058110156125e8578181600581106125b1576125b16158ed565b60200201516000036125d6576040516316334f8560e11b815260040160405180910390fd5b806125e081615919565b915050612596565b506110186019826005614e33565b612601600033612164565b61261d5760405162461bcd60e51b8152600401610d84906158c0565b61262561304e565b61262e81613c75565b1561264c5760405163e6c4247b60e01b815260040160405180910390fd5b601080546001600160a01b0319166001600160a01b038316179055600160085550565b61267a600033612164565b6126965760405162461bcd60e51b8152600401610d84906158c0565b61269e61304e565b6126a66130a7565b80518251146126c85760405163aa81c86160e01b815260040160405180910390fd5b6000805b825181101561274e578281815181106126e7576126e76158ed565b6020026020010151826126fa91906159d4565b915061271e848281518110612711576127116158ed565b6020026020010151613c75565b1561273c5760405163e6c4247b60e01b815260040160405180910390fd5b8061274681615919565b9150506126cc565b50612710811115612772576040516302ce67a560e31b815260040160405180910390fd5b825161278590600d906020860190614ee5565b50815161279990600e906020850190614e71565b50506112e86001600855565b6127b0600033612164565b6127cc5760405162461bcd60e51b8152600401610d84906158c0565b610f8360008261332f565b6127e2600033612164565b6127fe5760405162461bcd60e51b8152600401610d84906158c0565b61280960008261332f565b610f837f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab958261332f565b6001600160a01b0381166000908152601660205260408120541561286d57506001600160a01b031660009081526016602052604090205490565b6001600160a01b038216600090815260126020526040902060020154600a8110156128a057602360005b01549392505050565b600a81101580156128b15750601e81105b156128bf5760236001612897565b601e81101580156128d05750603c81105b156128de5760236002612897565b603c81101580156128ef5750606481105b156128fd5760236003612897565b6064811061290e5760236004612897565b604051630778611b60e51b815260040160405180910390fd5b6129313383613136565b61294d5760405162461bcd60e51b8152600401610d8490615932565b61295984848484613da2565b50505050565b61296a600033612164565b6129865760405162461bcd60e51b8152600401610d84906158c0565b61298e61304e565b6129966130a7565b80518251146129b85760405163aa81c86160e01b815260040160405180910390fd5b60005b8251811015612a39578181815181106129d6576129d66158ed565b602002602001015160158483815181106129f2576129f26158ed565b6020026020010151604051612a0791906159b8565b908152604051908190036020019020805491151560ff1990921691909117905580612a3181615919565b9150506129bb565b506112e86001600855565b612a4f600033612164565b612a6b5760405162461bcd60e51b8152600401610d84906158c0565b612a7361304e565b612a7b6130a7565b612710811115612a9e576040516302ce67a560e31b815260040160405180910390fd5b6001600160a01b03821660009081526016602052604090208190556112e86001600855565b6060612ace82612f81565b60008281526006602052604081208054612ae79061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054612b139061588c565b8015612b605780601f10612b3557610100808354040283529160200191612b60565b820191906000526020600020905b815481529060010190602001808311612b4357829003601f168201915b505050505090506000612b7e60408051602081019091526000815290565b90508051600003612b90575092915050565b815115612bc2578082604051602001612baa929190615b18565b60405160208183030381529060405292505050919050565b612bcb84613dd5565b949350505050565b600082815260096020526040902060010154612bee81613325565b610e2583836133b5565b612c03600033612164565b6128095760405162461bcd60e51b8152600401610d84906158c0565b612c4a6040518060800160405280600081526020016060815260200160008152602001600081525090565b6001600160a01b03821660009081526012602090815260409182902082516080810184528154815260018201805485518186028101860190965280865291949293858101939290830182828015612cc057602002820191906000526020600020905b815481526020019060010190808311612cac575b50505050508152602001600282015481526020016003820154815250509050919050565b612d0e7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9533612164565b612d5a5760405162461bcd60e51b815260206004820152601860248201527f6d61696e7461696e657220726f6c6520726571756972656400000000000000006044820152606401610d84565b612d6261304e565b612d6a6130a7565b60005b8151811015611018576000828281518110612d8a57612d8a6158ed565b602002602001015190504260116000838152602001908152602001600020600301541115612dcb57604051632f77196360e21b815260040160405180910390fd5b6000818152601160205260409020600301544290612dec9062278d006159d4565b1115612e0b5760405163e2041e6160e01b815260040160405180910390fd5b612e1481613e48565b5080612e1f81615919565b915050612d6d565b612e32600033612164565b612e4e5760405162461bcd60e51b8152600401610d84906158c0565b612e5661304e565b60405133904780156108fc02916000818181858888f19350505050158015612e82573d6000803e3d6000fd5b506117f06001600855565b612e98600033612164565b612eb45760405162461bcd60e51b8152600401610d84906158c0565b612ebc61304e565b612ec46130a7565b60005b6005811015612f1b57612710828260058110612ee557612ee56158ed565b60200201511115612f09576040516302ce67a560e31b815260040160405180910390fd5b80612f1381615919565b915050612ec7565b506110186023826005614e33565b612f34600033612164565b612f505760405162461bcd60e51b8152600401610d84906158c0565b600b6112e88282615a59565b60006001600160e01b03198216637965db0b60e01b1480610c515750610c5182614148565b6000818152600260205260409020546001600160a01b0316610f835760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610d84565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061301582611f5b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6002600854036130a05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d84565b6002600855565b60075460ff16156117f05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d84565b606081600b6040516020016131029190615bba565b60408051601f19818403018152908290526131209291602001615b18565b6040516020818303038152906040529050919050565b60008061314283611f5b565b9050806001600160a01b0316846001600160a01b0316148061318957506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80612bcb5750836001600160a01b03166131a284610ce9565b6001600160a01b031614949350505050565b826001600160a01b03166131c782611f5b565b6001600160a01b0316146131ed5760405162461bcd60e51b8152600401610d8490615bd0565b6001600160a01b03821661324f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d84565b61325c838383600161416d565b826001600160a01b031661326f82611f5b565b6001600160a01b0316146132955760405162461bcd60e51b8152600401610d8490615bd0565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610f83813361458c565b6133398282612164565b6112e85760008281526009602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133713390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6133bf8282612164565b156112e85760008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815b815181101561356657603060f81b828281518110613441576134416158ed565b01602001516001600160f81b031916108015906134825750603960f81b828281518110613470576134706158ed565b01602001516001600160f81b03191611155b1580156134e45750606160f81b8282815181106134a1576134a16158ed565b01602001516001600160f81b031916108015906134e25750607a60f81b8282815181106134d0576134d06158ed565b01602001516001600160f81b03191611155b155b801561351557508181815181106134fd576134fd6158ed565b6020910101516001600160f81b031916602d60f81b14155b80156135455750607f60f81b828281518110613533576135336158ed565b01602001516001600160f81b03191611155b15613554575060009392505050565b8061355e81615919565b915050613421565b5060019392505050565b8051600090819081905b8082101561366a576000858381518110613596576135966158ed565b01602001516001600160f81b0319169050600160ff1b8110156135c5576135be6001846159d4565b9250613657565b600760fd1b6001600160f81b0319821610156135e6576135be6002846159d4565b600f60fc1b6001600160f81b031982161015613607576135be6003846159d4565b601f60fb1b6001600160f81b031982161015613628576135be6004846159d4565b603f60fa1b6001600160f81b031982161015613649576135be6005846159d4565b6136546006846159d4565b92505b508261366281615919565b93505061357a565b50909392505050565b6000808261ffff16118015610c51575050601861ffff909116111590565b60008061369c612041565b9050806111c484670de0b6b3a764000061597f565b6136b96130a7565b835183511415806136cc57508051845114155b806136d957508351825114155b156136f75760405163aa81c86160e01b815260040160405180910390fd5b600083516001600160401b0381111561371257613712615044565b60405190808252806020026020018201604052801561373b578160200160208202803683370190505b50905060005b8451811015613afe57600086828151811061375e5761375e6158ed565b60200260200101519050600086838151811061377c5761377c6158ed565b60200260200101519050600085848151811061379a5761379a6158ed565b6020026020010151905060008785815181106137b8576137b86158ed565b602002602001015190506000600a549050808787815181106137dc576137dc6158ed565b6020026020010181815250506137fd8b8781518110612711576127116158ed565b1561381b5760405163e6c4247b60e01b815260040160405180910390fd5b6001613830601386604051611eb991906159b8565b6002811115613841576138416155a7565b0361385f57604051630ea075bf60e21b815260040160405180910390fd5b6002613874601386604051611eb991906159b8565b6002811115613885576138856155a7565b036138a357604051635f16d58360e01b815260040160405180910390fd5b600a80546001019055604080516080810182526001600160a01b03871681526020810186905261ffff841691810191909152606081016138e7856301e1338061597f565b6138f190426159d4565b90526000828152601160209081526040909120825181546001600160a01b0319166001600160a01b039091161781559082015160018201906139339082615a59565b5060408281015160028301805461ffff191661ffff9092169190911790556060909201516003909101556001600160a01b038616600090815260126020908152828220600190810180549182018155835291200182905551819060139061399b9087906159b8565b9081526040805160209281900383019020929092556001600160a01b03871660009081526012909152908120549003613a18576001600160a01b038516600081815260126020526040902082905581600080516020615db3833981519152613a02876130ed565b604051613a0f9190614fd2565b60405180910390a35b613a2285826145e5565b613a3481613a2f836145ff565b614648565b60188054600181019091557fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e018190556000818152601460205260409020613a7c8582615a59565b50600081815260176020908152604080832086905560119091529020600301546001600160a01b038616827f2d764d30e21994e86d9ea9925aa0095caac83736bb99f47ae5eeb3f2256239a7613ad1886130ed565b604051613ade9190614fd2565b60405180910390a450505050508080613af690615919565b915050613741565b505050505050565b613b0e614713565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b613b618161475c565b60008181526006602052604090208054613b7a9061588c565b159050610f83576000818152600660205260408120610f8391614eab565b6040805160208082018352600080835284815260149091529190912090613bbf9082615a59565b5060005b6018548110156112e8578160188281548110613be157613be16158ed565b906000526020600020015403613c635760188054613c01906001906159e7565b81548110613c1157613c116158ed565b906000526020600020015460188281548110613c2f57613c2f6158ed565b6000918252602090912001556018805480613c4c57613c4c615c15565b600190038181906000526020600020016000905590555b80613c6d81615919565b915050613bc3565b60006001600160a01b038216301480610c515750506001600160a01b03161590565b613c9f6130a7565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613b3b3390565b816001600160a01b0316836001600160a01b031603613d355760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d84565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613dad8484846131b4565b613db9848484846147ff565b6129595760405162461bcd60e51b8152600401610d8490615c2b565b6060613de082612f81565b6000613df760408051602081019091526000815290565b90506000815111613e1757604051806020016040528060008152506111ce565b80613e2184614900565b604051602001613e32929190615b18565b6040516020818303038152906040529392505050565b80600003613e695760405163aba4733960e01b815260040160405180910390fd5b6000818152601160209081526040808320546001600160a01b0316808452601283528184206001018054835181860281018601909452808452919493909190830182828015613ed757602002820191906000526020600020905b815481526020019060010190808311613ec3575b50505050509050600060018251613eee91906159e7565b6001600160401b03811115613f0557613f05615044565b604051908082528060200260200182016040528015613f2e578160200160208202803683370190505b5090506000805b8351811015613fb55785848281518110613f5157613f516158ed565b602002602001015114613fa357838181518110613f7057613f706158ed565b6020026020010151838381518110613f8a57613f8a6158ed565b602090810291909101015281613f9f81615919565b9250505b80613fad81615919565b915050613f35565b506001600160a01b03841660009081526012602090815260409091208351613fe592600190920191850190614e71565b506000825111801561400e57506001600160a01b03841660009081526012602052604090205485145b156140ab5781600081518110614026576140266158ed565b6020908102919091018101516001600160a01b038616600081815260129093526040832091909155835190918491614060576140606158ed565b6020026020010151600080516020615db38339815191526140916011600087600081518110611c3457611c346158ed565b60405161409e9190614fd2565b60405180910390a36140f6565b6001600160a01b03841660008181526012602052604080822082905551600080516020615db3833981519152906140ed90602080825260009082015260400190565b60405180910390a35b600085815260116020526040812080546001600160a01b0319168155906141206001830182614eab565b5060028101805461ffff19169055600060039091015561413f85613b58565b6117a885613b98565b60006001600160e01b03198216632483248360e11b1480610c515750610c5182614992565b6001600160a01b0384161580159061418d57506001600160a01b03831615155b1561451757600261419d836121b7565b60028111156141ae576141ae6155a7565b036141cc57604051632db0646360e01b815260040160405180910390fd5b6001600160a01b03841660009081526012602090815260408083206001018054825181850281018501909352808352919290919083018282801561422f57602002820191906000526020600020905b81548152602001906001019080831161421b575b50505050509050600082825161424591906159e7565b6001600160401b0381111561425c5761425c615044565b604051908082528060200260200182016040528015614285578160200160208202803683370190505b5090506000805b835181101561430c57858482815181106142a8576142a86158ed565b6020026020010151146142fa578381815181106142c7576142c76158ed565b60200260200101518383815181106142e1576142e16158ed565b6020908102919091010152816142f681615919565b9250505b8061430481615919565b91505061428c565b506001600160a01b0387166000908152601260209081526040909120835161433c92600190920191850190614e71565b506000825111801561436557506001600160a01b03871660009081526012602052604090205485145b15614402578160008151811061437d5761437d6158ed565b6020908102919091018101516001600160a01b0389166000818152601290935260408320919091558351909184916143b7576143b76158ed565b6020026020010151600080516020615db38339815191526143e86011600087600081518110611c3457611c346158ed565b6040516143f59190614fd2565b60405180910390a361444d565b6001600160a01b03871660008181526012602052604080822082905551600080516020615db38339815191529061444490602080825260009082015260400190565b60405180910390a35b6001600160a01b038616600081815260126020908152604082206001808201805491820181558452918320909101889055918152905490036144ec576001600160a01b03861660008181526012602090815260408083208990558883526011909152902060010180548791600080516020615db3833981519152916144d69190610ee09061588c565b6040516144e39190614fd2565b60405180910390a35b505050600082815260116020526040902080546001600160a01b0319166001600160a01b0385161790555b826001600160a01b0316846001600160a01b0316837feb4f1cd49fe2485e1a9331e0a0c4e38223edb71dbc7df86be6731d7b3054c506614571601160008881526020019081526020016000206001018054610ee09061588c565b60405161457e9190614fd2565b60405180910390a450505050565b6145968282612164565b6112e8576145a3816149e2565b6145ae8360206149f4565b6040516020016145bf929190615c7d565b60408051601f198184030181529082905262461bcd60e51b8252610d8491600401614fd2565b6112e8828260405180602001604052806000815250614b8f565b6060600061460c83614900565b9050466000600c61461c83614900565b8460405160200161462f93929190615cf2565b60408051601f1981840301815291905295945050505050565b6000828152600260205260409020546001600160a01b03166146c35760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610d84565b60008281526006602052604090206146db8282615a59565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60075460ff166117f05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610d84565b600061476782611f5b565b905061477781600084600161416d565b61478082611f5b565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b156148f557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614843903390899088908890600401615d41565b6020604051808303816000875af192505050801561487e575060408051601f3d908101601f1916820190925261487b91810190615d7e565b60015b6148db573d8080156148ac576040519150601f19603f3d011682016040523d82523d6000602084013e6148b1565b606091505b5080516000036148d35760405162461bcd60e51b8152600401610d8490615c2b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bcb565b506001949350505050565b6060600061490d83614bc2565b60010190506000816001600160401b0381111561492c5761492c615044565b6040519080825280601f01601f191660200182016040528015614956576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461496057509392505050565b60006001600160e01b031982166380ac58cd60e01b14806149c357506001600160e01b03198216635b5e139f60e01b145b80610c5157506301ffc9a760e01b6001600160e01b0319831614610c51565b6060610c516001600160a01b03831660145b60606000614a0383600261597f565b614a0e9060026159d4565b6001600160401b03811115614a2557614a25615044565b6040519080825280601f01601f191660200182016040528015614a4f576020820181803683370190505b509050600360fc1b81600081518110614a6a57614a6a6158ed565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614a9957614a996158ed565b60200101906001600160f81b031916908160001a9053506000614abd84600261597f565b614ac89060016159d4565b90505b6001811115614b40576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614afc57614afc6158ed565b1a60f81b828281518110614b1257614b126158ed565b60200101906001600160f81b031916908160001a90535060049490941c93614b3981615d9b565b9050614acb565b5083156111ce5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d84565b614b998383614c9a565b614ba660008484846147ff565b610e255760405162461bcd60e51b8152600401610d8490615c2b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310614c015772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614c2d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310614c4b57662386f26fc10000830492506010015b6305f5e1008310614c63576305f5e100830492506008015b6127108310614c7757612710830492506004015b60648310614c89576064830492506002015b600a8310610c515760010192915050565b6001600160a01b038216614cf05760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d84565b6000818152600260205260409020546001600160a01b031615614d555760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d84565b614d6360008383600161416d565b6000818152600260205260409020546001600160a01b031615614dc85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d84565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8260058101928215614e61579160200282015b82811115614e61578251825591602001919060010190614e46565b50614e6d929150614f3a565b5090565b828054828255906000526020600020908101928215614e615791602002820182811115614e61578251825591602001919060010190614e46565b508054614eb79061588c565b6000825580601f10614ec7575050565b601f016020900490600052602060002090810190610f839190614f3a565b828054828255906000526020600020908101928215614e61579160200282015b82811115614e6157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614f05565b5b80821115614e6d5760008155600101614f3b565b6001600160e01b031981168114610f8357600080fd5b600060208284031215614f7757600080fd5b81356111ce81614f4f565b60005b83811015614f9d578181015183820152602001614f85565b50506000910152565b60008151808452614fbe816020860160208601614f82565b601f01601f19169290920160200192915050565b6020815260006111ce6020830184614fa6565b600060208284031215614ff757600080fd5b5035919050565b80356001600160a01b038116811461501557600080fd5b919050565b6000806040838503121561502d57600080fd5b61503683614ffe565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561508257615082615044565b604052919050565b600060a0828403121561509c57600080fd5b82601f8301126150ab57600080fd5b60405160a081018181106001600160401b03821117156150cd576150cd615044565b6040528060a08401858111156150e257600080fd5b845b818110156150fc5780358352602092830192016150e4565b509195945050505050565b60008060006060848603121561511c57600080fd5b61512584614ffe565b925061513360208501614ffe565b9150604084013590509250925092565b6020808252825182820181905260009190848201906040850190845b8181101561517b5783518352928401929184019160010161515f565b50909695505050505050565b6000806040838503121561519a57600080fd5b823591506151aa60208401614ffe565b90509250929050565b6000602082840312156151c557600080fd5b813561ffff811681146111ce57600080fd5b600080604083850312156151ea57600080fd5b50508035926020909101359150565b60006001600160401b0383111561521257615212615044565b615225601f8401601f191660200161505a565b905082815283838301111561523957600080fd5b828260208301376000602084830101529392505050565b600082601f83011261526157600080fd5b6111ce838335602085016151f9565b60006020828403121561528257600080fd5b81356001600160401b0381111561529857600080fd5b612bcb84828501615250565b60006001600160401b038211156152bd576152bd615044565b5060051b60200190565b600082601f8301126152d857600080fd5b813560206152ed6152e8836152a4565b61505a565b82815260059290921b8401810191818101908684111561530c57600080fd5b8286015b8481101561532e5761532181614ffe565b8352918301918301615310565b509695505050505050565b600082601f83011261534a57600080fd5b8135602061535a6152e8836152a4565b82815260059290921b8401810191818101908684111561537957600080fd5b8286015b8481101561532e5780356001600160401b0381111561539c5760008081fd5b6153aa8986838b0101615250565b84525091830191830161537d565b600082601f8301126153c957600080fd5b813560206153d96152e8836152a4565b82815260059290921b840181019181810190868411156153f857600080fd5b8286015b8481101561532e57803583529183019183016153fc565b600080600080600060a0868803121561542b57600080fd5b85356001600160401b038082111561544257600080fd5b61544e89838a016152c7565b9650602088013591508082111561546457600080fd5b61547089838a01615339565b9550604088013591508082111561548657600080fd5b50615493888289016153b8565b9350506154a260608701614ffe565b949793965091946080013592915050565b6000806000606084860312156154c857600080fd5b83356001600160401b03808211156154df57600080fd5b6154eb878388016152c7565b9450602086013591508082111561550157600080fd5b61550d87838801615339565b9350604086013591508082111561552357600080fd5b50615530868287016153b8565b9150509250925092565b602080825282516001600160a01b0316828201528201516080604083015260009061556860a0840182614fa6565b905061ffff6040850151166060840152606084015160808401528091505092915050565b60006020828403121561559e57600080fd5b6111ce82614ffe565b634e487b7160e01b600052602160045260246000fd5b60208101600383106155df57634e487b7160e01b600052602160045260246000fd5b91905290565b8035801515811461501557600080fd5b6000806040838503121561560857600080fd5b61561183614ffe565b91506151aa602084016155e5565b6000806040838503121561563257600080fd5b82356001600160401b038082111561564957600080fd5b615655868387016152c7565b9350602085013591508082111561566b57600080fd5b50615678858286016153b8565b9150509250929050565b6000806000806080858703121561569857600080fd5b6156a185614ffe565b93506156af60208601614ffe565b92506040850135915060608501356001600160401b038111156156d157600080fd5b8501601f810187136156e257600080fd5b6156f1878235602084016151f9565b91505092959194509250565b6000806040838503121561571057600080fd5b82356001600160401b038082111561572757600080fd5b61573386838701615339565b935060209150818501358181111561574a57600080fd5b85019050601f8101861361575d57600080fd5b803561576b6152e8826152a4565b81815260059190911b8201830190838101908883111561578a57600080fd5b928401925b828410156157af576157a0846155e5565b8252928401929084019061578f565b80955050505050509250929050565b60208082528251828201528281015160806040840152805160a0840181905260009291820190839060c08601905b8083101561580c57835182529284019260019290920191908401906157ec565b5060408701516060870152606087015160808701528094505050505092915050565b6000806040838503121561584157600080fd5b61584a83614ffe565b91506151aa60208401614ffe565b60006020828403121561586a57600080fd5b81356001600160401b0381111561588057600080fd5b612bcb848285016153b8565b600181811c908216806158a057607f821691505b60208210810361125957634e487b7160e01b600052602260045260246000fd5b60208082526013908201527218591b5a5b881c9bdb19481c995c5d5a5c9959606a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161592b5761592b615903565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b8082028115828204841417610c5157610c51615903565b6000826159b357634e487b7160e01b600052601260045260246000fd5b500490565b600082516159ca818460208701614f82565b9190910192915050565b80820180821115610c5157610c51615903565b81810381811115610c5157610c51615903565b600060208284031215615a0c57600080fd5b5051919050565b601f821115610e2557600081815260208120601f850160051c81016020861015615a3a5750805b601f850160051c820191505b81811015613afe57828155600101615a46565b81516001600160401b03811115615a7257615a72615044565b615a8681615a80845461588c565b84615a13565b602080601f831160018114615abb5760008415615aa35750858301515b600019600386901b1c1916600185901b178555613afe565b600085815260208120601f198616915b82811015615aea57888601518255948401946001909101908401615acb565b5085821015615b085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351615b2a818460208801614f82565b835190830190615b3e818360208801614f82565b01949350505050565b60008154615b548161588c565b60018281168015615b6c5760018114615b8157615bb0565b60ff1984168752821515830287019450615bb0565b8560005260208060002060005b85811015615ba75781548a820152908401908201615b8e565b50505082870194505b5050505092915050565b601760f91b815260006111ce6001830184615b47565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615cb5816017850160208801614f82565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615ce6816028840160208801614f82565b01602801949350505050565b6000615cfe8286615b47565b602f60f81b8082528551615d19816001850160208a01614f82565b60019201918201528351615d34816002840160208801614f82565b0160020195945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615d7490830184614fa6565b9695505050505050565b600060208284031215615d9057600080fd5b81516111ce81614f4f565b600081615daa57615daa615903565b50600019019056fe53946bf984072f5888fcb2d7d2b0587c8efeb9187d958f21809711cf00b4b4a5a2646970667358221220f3b94c777502545d9d9e0bb493645230eea712a4daefd5d27dd77dedd5de023664736f6c6343000815003368747470733a2f2f6170692e7a6e73636f6e6e6563742e696f2f76312f6d65746164617461000000000000000000000000c11ee6c94a86e18481d9206c29ecdd3b40c598980000000000000000000000000246d65ba41da3db6db55e489146eb25ca3634e5000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000062e7370656564000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057370656564000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106103c35760003560e01c806391d14854116101f2578063b88d4fde1161010d578063db846463116100a0578063f18d20be1161006f578063f18d20be14610bbd578063f874225414610bd2578063fa794bf814610c06578063fabf48d014610c2657600080fd5b8063db84646314610afa578063e3d31eb014610b27578063e985e9c514610b54578063ea3f262514610b9d57600080fd5b8063d4dae89d116100dc578063d4dae89d14610a55578063d547741f14610a8d578063d95edfde14610aad578063d9efc6bd14610acd57600080fd5b8063b88d4fde146109d5578063b8d4d526146109f5578063c442374d14610a15578063c87b56dd14610a3557600080fd5b8063a22cb46511610185578063aa34d2bd11610154578063aa34d2bd14610955578063ada8f91914610975578063b717d1bc14610995578063b81cad16146109b557600080fd5b8063a22cb465146108df578063a2aa0e5a146108ff578063a4df32281461091f578063a5c42ef11461093f57600080fd5b80639abc8320116101c15780639abc8320146108825780639bb827cb14610897578063a0bcfc7f146108aa578063a217fddf146108ca57600080fd5b806391d148541461080057806395d89b41146108205780639642c4ab14610835578063972205d21461085557600080fd5b80633a99d4eb116102e25780635c610bbc11610275578063796da7af11610244578063796da7af146107965780637adbf973146107ab5780637dc0d1d0146107cb5780638456cb59146107eb57600080fd5b80635c610bbc1461071e5780635c975abb1461073e5780636352211e1461075657806370a082311461077657600080fd5b8063549623e6116102b1578063549623e61461069157806355cb0ed1146106b157806356d90462146106d1578063588957bd146106f157600080fd5b80633a99d4eb146106295780633f4ba83a1461063c57806342842e0e146106515780634ad280011461067157600080fd5b80632485c4fa1161035a5780633115c06b116103295780633115c06b1461058e578063362f079b146105ae57806336568abe146105ce57806338c4f1e4146105ee57600080fd5b80632485c4fa14610507578063248a9ca3146105295780632d551432146105595780632f2ff15d1461056e57600080fd5b80630a68a1ac116103965780630a68a1ac146104795780630d537e8d146104a757806322ea2eed146104c757806323b872dd146104e757600080fd5b806301ffc9a7146103c857806306fdde03146103fd578063081812fc1461041f578063095ea7b314610457575b600080fd5b3480156103d457600080fd5b506103e86103e3366004614f65565b610c46565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610412610c57565b6040516103f49190614fd2565b34801561042b57600080fd5b5061043f61043a366004614fe5565b610ce9565b6040516001600160a01b0390911681526020016103f4565b34801561046357600080fd5b5061047761047236600461501a565b610d10565b005b34801561048557600080fd5b50610499610494366004614fe5565b610e2a565b6040519081526020016103f4565b3480156104b357600080fd5b506104776104c2366004614fe5565b610e4b565b3480156104d357600080fd5b506104776104e236600461508a565b610f86565b3480156104f357600080fd5b50610477610502366004615107565b611023565b34801561051357600080fd5b5061051c611054565b6040516103f49190615143565b34801561053557600080fd5b50610499610544366004614fe5565b60009081526009602052604090206001015490565b34801561056557600080fd5b506104126110ab565b34801561057a57600080fd5b50610477610589366004615187565b611139565b34801561059a57600080fd5b506104996105a93660046151b3565b61115e565b3480156105ba57600080fd5b506104996105c93660046151d7565b61125f565b3480156105da57600080fd5b506104776105e9366004615187565b61126e565b3480156105fa57600080fd5b506103e8610609366004615270565b805160208183018101805160158252928201919093012091525460ff1681565b610477610637366004615413565b6112ec565b34801561064857600080fd5b506104776117af565b34801561065d57600080fd5b5061047761066c366004615107565b6117f2565b34801561067d57600080fd5b5060105461043f906001600160a01b031681565b34801561069d57600080fd5b506104776106ac3660046154b3565b61180d565b3480156106bd57600080fd5b506104996106cc3660046151b3565b61190e565b3480156106dd57600080fd5b506104776106ec366004614fe5565b6119cf565b3480156106fd57600080fd5b5061071161070c366004614fe5565b611d1d565b6040516103f4919061553a565b34801561072a57600080fd5b50610711610739366004615270565b611e6c565b34801561074a57600080fd5b5060075460ff166103e8565b34801561076257600080fd5b5061043f610771366004614fe5565b611f5b565b34801561078257600080fd5b5061049961079136600461558c565b611fbb565b3480156107a257600080fd5b50610499612041565b3480156107b757600080fd5b506104776107c636600461558c565b6120b4565b3480156107d757600080fd5b50600f5461043f906001600160a01b031681565b3480156107f757600080fd5b5061047761212d565b34801561080c57600080fd5b506103e861081b366004615187565b612164565b34801561082c57600080fd5b5061041261218f565b34801561084157600080fd5b50610412610850366004614fe5565b61219e565b34801561086157600080fd5b50610875610870366004614fe5565b6121b7565b6040516103f491906155bd565b34801561088e57600080fd5b5061041261231f565b6104776108a53660046151d7565b61232c565b3480156108b657600080fd5b506104776108c5366004615270565b61251e565b3480156108d657600080fd5b50610499600081565b3480156108eb57600080fd5b506104776108fa3660046155f5565b612551565b34801561090b57600080fd5b5061047761091a36600461508a565b61255c565b34801561092b57600080fd5b5061047761093a36600461558c565b6125f6565b34801561094b57600080fd5b50610499600a5481565b34801561096157600080fd5b5061047761097036600461561f565b61266f565b34801561098157600080fd5b5061047761099036600461558c565b6127a5565b3480156109a157600080fd5b506104776109b036600461558c565b6127d7565b3480156109c157600080fd5b506104996109d036600461558c565b612833565b3480156109e157600080fd5b506104776109f0366004615682565b612927565b348015610a0157600080fd5b50610477610a103660046156fd565b61295f565b348015610a2157600080fd5b50610477610a3036600461501a565b612a44565b348015610a4157600080fd5b50610412610a50366004614fe5565b612ac3565b348015610a6157600080fd5b50610499610a70366004615270565b805160208183018101805160138252928201919093012091525481565b348015610a9957600080fd5b50610477610aa8366004615187565b612bd3565b348015610ab957600080fd5b50610477610ac836600461558c565b612bf8565b348015610ad957600080fd5b50610aed610ae836600461558c565b612c1f565b6040516103f491906157be565b348015610b0657600080fd5b50610499610b15366004614fe5565b60176020526000908152604090205481565b348015610b3357600080fd5b50610499610b4236600461558c565b60166020526000908152604090205481565b348015610b6057600080fd5b506103e8610b6f36600461582e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610ba957600080fd5b50610477610bb8366004615858565b612ce4565b348015610bc957600080fd5b50610477612e27565b348015610bde57600080fd5b506104997f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b348015610c1257600080fd5b50610477610c2136600461508a565b612e8d565b348015610c3257600080fd5b50610477610c41366004615270565b612f29565b6000610c5182612f5c565b92915050565b606060008054610c669061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c929061588c565b8015610cdf5780601f10610cb457610100808354040283529160200191610cdf565b820191906000526020600020905b815481529060010190602001808311610cc257829003601f168201915b5050505050905090565b6000610cf482612f81565b506000908152600460205260409020546001600160a01b031690565b6000610d1b82611f5b565b9050806001600160a01b0316836001600160a01b031603610d8d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610da95750610da98133610b6f565b610e1b5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610d84565b610e258383612fe0565b505050565b60188181548110610e3a57600080fd5b600091825260209091200154905081565b610e5361304e565b610e5b6130a7565b6000818152601160205260409020546001600160a01b0316338114610e93576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b03811660008181526012602090815260408083208690558583526011909152902060010180548491600080516020615db383398151915291610f639190610ee09061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054610f0c9061588c565b8015610f595780601f10610f2e57610100808354040283529160200191610f59565b820191906000526020600020905b815481529060010190602001808311610f3c57829003601f168201915b50505050506130ed565b604051610f709190614fd2565b60405180910390a350610f836001600855565b50565b610f91600033612164565b610fad5760405162461bcd60e51b8152600401610d84906158c0565b610fb561304e565b60005b600581101561100a57818160058110610fd357610fd36158ed565b6020020151600003610ff8576040516316334f8560e11b815260040160405180910390fd5b8061100281615919565b915050610fb8565b50611018601e826005614e33565b50610f836001600855565b61102d3382613136565b6110495760405162461bcd60e51b8152600401610d8490615932565b610e258383836131b4565b60606018805480602002602001604051908101604052809291908181526020018280548015610cdf57602002820191906000526020600020905b81548152602001906001019080831161108e575050505050905090565b600b80546110b89061588c565b80601f01602080910402602001604051908101604052809291908181526020018280546110e49061588c565b80156111315780601f1061110657610100808354040283529160200191611131565b820191906000526020600020905b81548152906001019060200180831161111457829003601f168201915b505050505081565b60008281526009602052604090206001015461115481613325565b610e25838361332f565b600080611169612041565b905061ffff83161580611180575060188361ffff16115b1561119e5760405163251f56a160e21b815260040160405180910390fd5b8261ffff166001036111d55780601960005b01546111c490670de0b6b3a764000061597f565b6111ce9190615996565b9392505050565b8261ffff166002036111eb5780601960016111b0565b8261ffff166003036112015780601960026111b0565b8261ffff166004036112175780601960036111b0565b60058361ffff1610158015611231575060188361ffff1611155b156112405780601960046111b0565b60405163251f56a160e21b815260040160405180910390fd5b50919050565b60006127106111c4838561597f565b6001600160a01b03811633146112de5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610d84565b6112e882826133b5565b5050565b6112f461304e565b6112fc6130a7565b60008085516001600160401b0381111561131857611318615044565b604051908082528060200260200182016040528015611341578160200160208202803683370190505b50905060005b86518110156114dc576000868281518110611364576113646158ed565b602002602001015190506000888381518110611382576113826158ed565b602002602001015190506113958161341c565b6113b257604051633f71cb2560e01b815260040160405180910390fd5b6015816040516113c291906159b8565b9081526040519081900360200190205460ff16156113f3576040516373f3c27b60e11b815260040160405180910390fd5b60006113fe82613570565b905080858581518110611413576114136158ed565b602002602001019061ffff16908161ffff168152505061143281613673565b61144f5760405163251f56a160e21b815260040160405180910390fd5b336001600160a01b0389160361147857604051632af47b8760e11b815260040160405180910390fd5b60006114838261115e565b905061148f81886159d4565b965060018411156114c5576114a56001856159e7565b6114ae8361190e565b6114b8919061597f565b6114c290886159d4565b96505b5050505080806114d490615919565b915050611347565b5082156115ee576010546040516340d936ed60e11b815233600482015284916001600160a01b0316906381b26dda90602401602060405180830381865afa15801561152b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154f91906159fa565b101561156e57604051630e19bf1b60e21b815260040160405180910390fd5b600061157984613691565b601054604051636978404360e01b8152336004820152602481018790529192506001600160a01b031690636978404390604401600060405180830381600087803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b5050505080836115ea91906159e7565b9250505b8134101561160f57604051631f4d0e4560e21b815260040160405180910390fd5b816001600160a01b038516156116e257600061162a86612833565b90506000611638858361125f565b89516001600160a01b0389166000908152601260205260408120600201805493945091926116679084906159d4565b90915550506001600160a01b038716600090815260126020526040812060030180548392906116979084906159d4565b90915550506040516001600160a01b0388169082156108fc029083906000818181858888f193505050501580156116d2573d6000803e3d6000fd5b506116dd81846159e7565b925050505b60005b600d5481101561178e57600d8181548110611702576117026158ed565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166108fc61175384600e8581548110611743576117436158ed565b906000526020600020015461125f565b6040518115909202916000818181858888f1935050505015801561177b573d6000803e3d6000fd5b508061178681615919565b9150506116e5565b5061179b888884896136b1565b5050506117a86001600855565b5050505050565b6117ba600033612164565b6117d65760405162461bcd60e51b8152600401610d84906158c0565b6117de61304e565b6117e6613b06565b6117f06001600855565b565b610e2583838360405180602001604052806000815250612927565b611818600033612164565b6118345760405162461bcd60e51b8152600401610d84906158c0565b61183c61304e565b6118446130a7565b600082516001600160401b0381111561185f5761185f615044565b604051908082528060200260200182016040528015611888578160200160208202803683370190505b50905060005b83518110156118f65760006118bb8583815181106118ae576118ae6158ed565b6020026020010151613570565b9050808383815181106118d0576118d06158ed565b61ffff9092166020928302919091019091015250806118ee81615919565b91505061188e565b50611903848483856136b1565b50610e256001600855565b600080611919612041565b905061ffff83161580611930575060188361ffff16115b1561194e5760405163251f56a160e21b815260040160405180910390fd5b8261ffff166001036119645780601e60006111b0565b8261ffff1660020361197a5780601e60016111b0565b8261ffff166003036119905780601e60026111b0565b8261ffff166004036119a65780601e60036111b0565b60058361ffff16101580156119c0575060188361ffff1611155b156112405780601e60046111b0565b6119d761304e565b6119df6130a7565b6000818152601160205260409020546001600160a01b0316338114611a17576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b038116600090815260126020908152604080832060010180548251818502810185019093528083529192909190830182828015611a7a57602002820191906000526020600020905b815481526020019060010190808311611a66575b50505050509050600060018251611a9191906159e7565b6001600160401b03811115611aa857611aa8615044565b604051908082528060200260200182016040528015611ad1578160200160208202803683370190505b5090506000805b8351811015611b585785848281518110611af457611af46158ed565b602002602001015114611b4657838181518110611b1357611b136158ed565b6020026020010151838381518110611b2d57611b2d6158ed565b602090810291909101015281611b4281615919565b9250505b80611b5081615919565b915050611ad8565b506001600160a01b03841660009081526012602090815260409091208351611b8892600190920191850190614e71565b5060008251118015611bb157506001600160a01b03841660009081526012602052604090205485145b15611c725781600081518110611bc957611bc96158ed565b6020908102919091018101516001600160a01b038616600081815260129093526040832091909155835190918491611c0357611c036158ed565b6020026020010151600080516020615db3833981519152611c586011600087600081518110611c3457611c346158ed565b602002602001015181526020019081526020016000206001018054610ee09061588c565b604051611c659190614fd2565b60405180910390a3611cbd565b6001600160a01b03841660008181526012602052604080822082905551600080516020615db383398151915290611cb490602080825260009082015260400190565b60405180910390a35b600085815260116020526040812080546001600160a01b031916815590611ce76001830182614eab565b5060028101805461ffff191690556000600390910155611d0685613b58565b611d0f85613b98565b50505050610f836001600855565b611d55604051806080016040528060006001600160a01b0316815260200160608152602001600061ffff168152602001600081525090565b6002611d60836121b7565b6002811115611d7157611d716155a7565b03611d8f57604051632db0646360e01b815260040160405180910390fd5b60008281526011602090815260409182902082516080810190935280546001600160a01b031683526001810180549192840191611dcb9061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054611df79061588c565b8015611e445780601f10611e1957610100808354040283529160200191611e44565b820191906000526020600020905b815481529060010190602001808311611e2757829003601f168201915b5050509183525050600282015461ffff16602082015260039091015460409091015292915050565b611ea4604051806080016040528060006001600160a01b0316815260200160608152602001600061ffff168152602001600081525090565b6002611ecd601384604051611eb991906159b8565b9081526020016040518091039020546121b7565b6002811115611ede57611ede6155a7565b03611efc57604051632db0646360e01b815260040160405180910390fd5b60116000601384604051611f1091906159b8565b90815260408051602092819003830190205483528282019390935290820160002082516080810190935280546001600160a01b031683526001810180549192840191611dcb9061588c565b6000818152600260205260408120546001600160a01b031680610c515760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610d84565b60006001600160a01b0382166120255760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610d84565b506001600160a01b031660009081526003602052604090205490565b600f5460408051636fdf583360e01b815290516000926001600160a01b031691636fdf58339160048083019260209291908290030181865afa15801561208b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120af91906159fa565b905090565b6120bf600033612164565b6120db5760405162461bcd60e51b8152600401610d84906158c0565b6120e361304e565b6120ec81613c75565b1561210a5760405163e6c4247b60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b038316179055600160085550565b612138600033612164565b6121545760405162461bcd60e51b8152600401610d84906158c0565b61215c61304e565b6117e6613c97565b60009182526009602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610c669061588c565b601460205260009081526040902080546110b89061588c565b600081815260116020908152604080832081516080810190925280546001600160a01b031682526001810180548594840191906121f39061588c565b80601f016020809104026020016040519081016040528092919081815260200182805461221f9061588c565b801561226c5780601f106122415761010080835404028352916020019161226c565b820191906000526020600020905b81548152906001019060200180831161224f57829003601f168201915b5050509183525050600282015461ffff16602082015260039091015460409091015280519091506001600160a01b03161580156122ab57506060810151155b80156122bd5750604081015161ffff16155b156122cb5750600092915050565b80516001600160a01b0316158015906122e75750428160600151115b156122f55750600192915050565b80516001600160a01b0316158015906123115750428160600151105b156112595750600292915050565b600c80546110b89061588c565b61233461304e565b61233c6130a7565b6000828152601160205260409020546001600160a01b03163314612373576040516330cd747160e01b815260040160405180910390fd5b806000036123935760405162d36c8560e81b815260040160405180910390fd5b60008281526011602052604081206002015482906123b49061ffff1661190e565b6123be919061597f565b9050803410156123e157604051631f4d0e4560e21b815260040160405180910390fd5b60005b600d5481101561247d57600d8181548110612401576124016158ed565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166108fc61244284600e8581548110611743576117436158ed565b6040518115909202916000818181858888f1935050505015801561246a573d6000803e3d6000fd5b508061247581615919565b9150506123e4565b5061248c826301e1338061597f565b600084815260116020526040812060030180549091906124ad9084906159d4565b9091555050600083815260116020526040902060038101546001909101805485917fa64e2b85ab1e5f2c0229d2b57dbd8cd4a1f512228662783d3a2ce0f4a6ecf6f3916124fe9190610ee09061588c565b60405161250b9190614fd2565b60405180910390a3506112e86001600855565b612529600033612164565b6125455760405162461bcd60e51b8152600401610d84906158c0565b600c6112e88282615a59565b6112e8338383613cd4565b612567600033612164565b6125835760405162461bcd60e51b8152600401610d84906158c0565b61258b61304e565b6125936130a7565b60005b60058110156125e8578181600581106125b1576125b16158ed565b60200201516000036125d6576040516316334f8560e11b815260040160405180910390fd5b806125e081615919565b915050612596565b506110186019826005614e33565b612601600033612164565b61261d5760405162461bcd60e51b8152600401610d84906158c0565b61262561304e565b61262e81613c75565b1561264c5760405163e6c4247b60e01b815260040160405180910390fd5b601080546001600160a01b0319166001600160a01b038316179055600160085550565b61267a600033612164565b6126965760405162461bcd60e51b8152600401610d84906158c0565b61269e61304e565b6126a66130a7565b80518251146126c85760405163aa81c86160e01b815260040160405180910390fd5b6000805b825181101561274e578281815181106126e7576126e76158ed565b6020026020010151826126fa91906159d4565b915061271e848281518110612711576127116158ed565b6020026020010151613c75565b1561273c5760405163e6c4247b60e01b815260040160405180910390fd5b8061274681615919565b9150506126cc565b50612710811115612772576040516302ce67a560e31b815260040160405180910390fd5b825161278590600d906020860190614ee5565b50815161279990600e906020850190614e71565b50506112e86001600855565b6127b0600033612164565b6127cc5760405162461bcd60e51b8152600401610d84906158c0565b610f8360008261332f565b6127e2600033612164565b6127fe5760405162461bcd60e51b8152600401610d84906158c0565b61280960008261332f565b610f837f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab958261332f565b6001600160a01b0381166000908152601660205260408120541561286d57506001600160a01b031660009081526016602052604090205490565b6001600160a01b038216600090815260126020526040902060020154600a8110156128a057602360005b01549392505050565b600a81101580156128b15750601e81105b156128bf5760236001612897565b601e81101580156128d05750603c81105b156128de5760236002612897565b603c81101580156128ef5750606481105b156128fd5760236003612897565b6064811061290e5760236004612897565b604051630778611b60e51b815260040160405180910390fd5b6129313383613136565b61294d5760405162461bcd60e51b8152600401610d8490615932565b61295984848484613da2565b50505050565b61296a600033612164565b6129865760405162461bcd60e51b8152600401610d84906158c0565b61298e61304e565b6129966130a7565b80518251146129b85760405163aa81c86160e01b815260040160405180910390fd5b60005b8251811015612a39578181815181106129d6576129d66158ed565b602002602001015160158483815181106129f2576129f26158ed565b6020026020010151604051612a0791906159b8565b908152604051908190036020019020805491151560ff1990921691909117905580612a3181615919565b9150506129bb565b506112e86001600855565b612a4f600033612164565b612a6b5760405162461bcd60e51b8152600401610d84906158c0565b612a7361304e565b612a7b6130a7565b612710811115612a9e576040516302ce67a560e31b815260040160405180910390fd5b6001600160a01b03821660009081526016602052604090208190556112e86001600855565b6060612ace82612f81565b60008281526006602052604081208054612ae79061588c565b80601f0160208091040260200160405190810160405280929190818152602001828054612b139061588c565b8015612b605780601f10612b3557610100808354040283529160200191612b60565b820191906000526020600020905b815481529060010190602001808311612b4357829003601f168201915b505050505090506000612b7e60408051602081019091526000815290565b90508051600003612b90575092915050565b815115612bc2578082604051602001612baa929190615b18565b60405160208183030381529060405292505050919050565b612bcb84613dd5565b949350505050565b600082815260096020526040902060010154612bee81613325565b610e2583836133b5565b612c03600033612164565b6128095760405162461bcd60e51b8152600401610d84906158c0565b612c4a6040518060800160405280600081526020016060815260200160008152602001600081525090565b6001600160a01b03821660009081526012602090815260409182902082516080810184528154815260018201805485518186028101860190965280865291949293858101939290830182828015612cc057602002820191906000526020600020905b815481526020019060010190808311612cac575b50505050508152602001600282015481526020016003820154815250509050919050565b612d0e7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9533612164565b612d5a5760405162461bcd60e51b815260206004820152601860248201527f6d61696e7461696e657220726f6c6520726571756972656400000000000000006044820152606401610d84565b612d6261304e565b612d6a6130a7565b60005b8151811015611018576000828281518110612d8a57612d8a6158ed565b602002602001015190504260116000838152602001908152602001600020600301541115612dcb57604051632f77196360e21b815260040160405180910390fd5b6000818152601160205260409020600301544290612dec9062278d006159d4565b1115612e0b5760405163e2041e6160e01b815260040160405180910390fd5b612e1481613e48565b5080612e1f81615919565b915050612d6d565b612e32600033612164565b612e4e5760405162461bcd60e51b8152600401610d84906158c0565b612e5661304e565b60405133904780156108fc02916000818181858888f19350505050158015612e82573d6000803e3d6000fd5b506117f06001600855565b612e98600033612164565b612eb45760405162461bcd60e51b8152600401610d84906158c0565b612ebc61304e565b612ec46130a7565b60005b6005811015612f1b57612710828260058110612ee557612ee56158ed565b60200201511115612f09576040516302ce67a560e31b815260040160405180910390fd5b80612f1381615919565b915050612ec7565b506110186023826005614e33565b612f34600033612164565b612f505760405162461bcd60e51b8152600401610d84906158c0565b600b6112e88282615a59565b60006001600160e01b03198216637965db0b60e01b1480610c515750610c5182614148565b6000818152600260205260409020546001600160a01b0316610f835760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610d84565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061301582611f5b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6002600854036130a05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d84565b6002600855565b60075460ff16156117f05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d84565b606081600b6040516020016131029190615bba565b60408051601f19818403018152908290526131209291602001615b18565b6040516020818303038152906040529050919050565b60008061314283611f5b565b9050806001600160a01b0316846001600160a01b0316148061318957506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80612bcb5750836001600160a01b03166131a284610ce9565b6001600160a01b031614949350505050565b826001600160a01b03166131c782611f5b565b6001600160a01b0316146131ed5760405162461bcd60e51b8152600401610d8490615bd0565b6001600160a01b03821661324f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d84565b61325c838383600161416d565b826001600160a01b031661326f82611f5b565b6001600160a01b0316146132955760405162461bcd60e51b8152600401610d8490615bd0565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610f83813361458c565b6133398282612164565b6112e85760008281526009602090815260408083206001600160a01b03851684529091529020805460ff191660011790556133713390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6133bf8282612164565b156112e85760008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815b815181101561356657603060f81b828281518110613441576134416158ed565b01602001516001600160f81b031916108015906134825750603960f81b828281518110613470576134706158ed565b01602001516001600160f81b03191611155b1580156134e45750606160f81b8282815181106134a1576134a16158ed565b01602001516001600160f81b031916108015906134e25750607a60f81b8282815181106134d0576134d06158ed565b01602001516001600160f81b03191611155b155b801561351557508181815181106134fd576134fd6158ed565b6020910101516001600160f81b031916602d60f81b14155b80156135455750607f60f81b828281518110613533576135336158ed565b01602001516001600160f81b03191611155b15613554575060009392505050565b8061355e81615919565b915050613421565b5060019392505050565b8051600090819081905b8082101561366a576000858381518110613596576135966158ed565b01602001516001600160f81b0319169050600160ff1b8110156135c5576135be6001846159d4565b9250613657565b600760fd1b6001600160f81b0319821610156135e6576135be6002846159d4565b600f60fc1b6001600160f81b031982161015613607576135be6003846159d4565b601f60fb1b6001600160f81b031982161015613628576135be6004846159d4565b603f60fa1b6001600160f81b031982161015613649576135be6005846159d4565b6136546006846159d4565b92505b508261366281615919565b93505061357a565b50909392505050565b6000808261ffff16118015610c51575050601861ffff909116111590565b60008061369c612041565b9050806111c484670de0b6b3a764000061597f565b6136b96130a7565b835183511415806136cc57508051845114155b806136d957508351825114155b156136f75760405163aa81c86160e01b815260040160405180910390fd5b600083516001600160401b0381111561371257613712615044565b60405190808252806020026020018201604052801561373b578160200160208202803683370190505b50905060005b8451811015613afe57600086828151811061375e5761375e6158ed565b60200260200101519050600086838151811061377c5761377c6158ed565b60200260200101519050600085848151811061379a5761379a6158ed565b6020026020010151905060008785815181106137b8576137b86158ed565b602002602001015190506000600a549050808787815181106137dc576137dc6158ed565b6020026020010181815250506137fd8b8781518110612711576127116158ed565b1561381b5760405163e6c4247b60e01b815260040160405180910390fd5b6001613830601386604051611eb991906159b8565b6002811115613841576138416155a7565b0361385f57604051630ea075bf60e21b815260040160405180910390fd5b6002613874601386604051611eb991906159b8565b6002811115613885576138856155a7565b036138a357604051635f16d58360e01b815260040160405180910390fd5b600a80546001019055604080516080810182526001600160a01b03871681526020810186905261ffff841691810191909152606081016138e7856301e1338061597f565b6138f190426159d4565b90526000828152601160209081526040909120825181546001600160a01b0319166001600160a01b039091161781559082015160018201906139339082615a59565b5060408281015160028301805461ffff191661ffff9092169190911790556060909201516003909101556001600160a01b038616600090815260126020908152828220600190810180549182018155835291200182905551819060139061399b9087906159b8565b9081526040805160209281900383019020929092556001600160a01b03871660009081526012909152908120549003613a18576001600160a01b038516600081815260126020526040902082905581600080516020615db3833981519152613a02876130ed565b604051613a0f9190614fd2565b60405180910390a35b613a2285826145e5565b613a3481613a2f836145ff565b614648565b60188054600181019091557fb13d2d76d1f4b7be834882e410b3e3a8afaf69f83600ae24db354391d2378d2e018190556000818152601460205260409020613a7c8582615a59565b50600081815260176020908152604080832086905560119091529020600301546001600160a01b038616827f2d764d30e21994e86d9ea9925aa0095caac83736bb99f47ae5eeb3f2256239a7613ad1886130ed565b604051613ade9190614fd2565b60405180910390a450505050508080613af690615919565b915050613741565b505050505050565b613b0e614713565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b613b618161475c565b60008181526006602052604090208054613b7a9061588c565b159050610f83576000818152600660205260408120610f8391614eab565b6040805160208082018352600080835284815260149091529190912090613bbf9082615a59565b5060005b6018548110156112e8578160188281548110613be157613be16158ed565b906000526020600020015403613c635760188054613c01906001906159e7565b81548110613c1157613c116158ed565b906000526020600020015460188281548110613c2f57613c2f6158ed565b6000918252602090912001556018805480613c4c57613c4c615c15565b600190038181906000526020600020016000905590555b80613c6d81615919565b915050613bc3565b60006001600160a01b038216301480610c515750506001600160a01b03161590565b613c9f6130a7565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613b3b3390565b816001600160a01b0316836001600160a01b031603613d355760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d84565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613dad8484846131b4565b613db9848484846147ff565b6129595760405162461bcd60e51b8152600401610d8490615c2b565b6060613de082612f81565b6000613df760408051602081019091526000815290565b90506000815111613e1757604051806020016040528060008152506111ce565b80613e2184614900565b604051602001613e32929190615b18565b6040516020818303038152906040529392505050565b80600003613e695760405163aba4733960e01b815260040160405180910390fd5b6000818152601160209081526040808320546001600160a01b0316808452601283528184206001018054835181860281018601909452808452919493909190830182828015613ed757602002820191906000526020600020905b815481526020019060010190808311613ec3575b50505050509050600060018251613eee91906159e7565b6001600160401b03811115613f0557613f05615044565b604051908082528060200260200182016040528015613f2e578160200160208202803683370190505b5090506000805b8351811015613fb55785848281518110613f5157613f516158ed565b602002602001015114613fa357838181518110613f7057613f706158ed565b6020026020010151838381518110613f8a57613f8a6158ed565b602090810291909101015281613f9f81615919565b9250505b80613fad81615919565b915050613f35565b506001600160a01b03841660009081526012602090815260409091208351613fe592600190920191850190614e71565b506000825111801561400e57506001600160a01b03841660009081526012602052604090205485145b156140ab5781600081518110614026576140266158ed565b6020908102919091018101516001600160a01b038616600081815260129093526040832091909155835190918491614060576140606158ed565b6020026020010151600080516020615db38339815191526140916011600087600081518110611c3457611c346158ed565b60405161409e9190614fd2565b60405180910390a36140f6565b6001600160a01b03841660008181526012602052604080822082905551600080516020615db3833981519152906140ed90602080825260009082015260400190565b60405180910390a35b600085815260116020526040812080546001600160a01b0319168155906141206001830182614eab565b5060028101805461ffff19169055600060039091015561413f85613b58565b6117a885613b98565b60006001600160e01b03198216632483248360e11b1480610c515750610c5182614992565b6001600160a01b0384161580159061418d57506001600160a01b03831615155b1561451757600261419d836121b7565b60028111156141ae576141ae6155a7565b036141cc57604051632db0646360e01b815260040160405180910390fd5b6001600160a01b03841660009081526012602090815260408083206001018054825181850281018501909352808352919290919083018282801561422f57602002820191906000526020600020905b81548152602001906001019080831161421b575b50505050509050600082825161424591906159e7565b6001600160401b0381111561425c5761425c615044565b604051908082528060200260200182016040528015614285578160200160208202803683370190505b5090506000805b835181101561430c57858482815181106142a8576142a86158ed565b6020026020010151146142fa578381815181106142c7576142c76158ed565b60200260200101518383815181106142e1576142e16158ed565b6020908102919091010152816142f681615919565b9250505b8061430481615919565b91505061428c565b506001600160a01b0387166000908152601260209081526040909120835161433c92600190920191850190614e71565b506000825111801561436557506001600160a01b03871660009081526012602052604090205485145b15614402578160008151811061437d5761437d6158ed565b6020908102919091018101516001600160a01b0389166000818152601290935260408320919091558351909184916143b7576143b76158ed565b6020026020010151600080516020615db38339815191526143e86011600087600081518110611c3457611c346158ed565b6040516143f59190614fd2565b60405180910390a361444d565b6001600160a01b03871660008181526012602052604080822082905551600080516020615db38339815191529061444490602080825260009082015260400190565b60405180910390a35b6001600160a01b038616600081815260126020908152604082206001808201805491820181558452918320909101889055918152905490036144ec576001600160a01b03861660008181526012602090815260408083208990558883526011909152902060010180548791600080516020615db3833981519152916144d69190610ee09061588c565b6040516144e39190614fd2565b60405180910390a35b505050600082815260116020526040902080546001600160a01b0319166001600160a01b0385161790555b826001600160a01b0316846001600160a01b0316837feb4f1cd49fe2485e1a9331e0a0c4e38223edb71dbc7df86be6731d7b3054c506614571601160008881526020019081526020016000206001018054610ee09061588c565b60405161457e9190614fd2565b60405180910390a450505050565b6145968282612164565b6112e8576145a3816149e2565b6145ae8360206149f4565b6040516020016145bf929190615c7d565b60408051601f198184030181529082905262461bcd60e51b8252610d8491600401614fd2565b6112e8828260405180602001604052806000815250614b8f565b6060600061460c83614900565b9050466000600c61461c83614900565b8460405160200161462f93929190615cf2565b60408051601f1981840301815291905295945050505050565b6000828152600260205260409020546001600160a01b03166146c35760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610d84565b60008281526006602052604090206146db8282615a59565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60075460ff166117f05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610d84565b600061476782611f5b565b905061477781600084600161416d565b61478082611f5b565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b156148f557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614843903390899088908890600401615d41565b6020604051808303816000875af192505050801561487e575060408051601f3d908101601f1916820190925261487b91810190615d7e565b60015b6148db573d8080156148ac576040519150601f19603f3d011682016040523d82523d6000602084013e6148b1565b606091505b5080516000036148d35760405162461bcd60e51b8152600401610d8490615c2b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612bcb565b506001949350505050565b6060600061490d83614bc2565b60010190506000816001600160401b0381111561492c5761492c615044565b6040519080825280601f01601f191660200182016040528015614956576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461496057509392505050565b60006001600160e01b031982166380ac58cd60e01b14806149c357506001600160e01b03198216635b5e139f60e01b145b80610c5157506301ffc9a760e01b6001600160e01b0319831614610c51565b6060610c516001600160a01b03831660145b60606000614a0383600261597f565b614a0e9060026159d4565b6001600160401b03811115614a2557614a25615044565b6040519080825280601f01601f191660200182016040528015614a4f576020820181803683370190505b509050600360fc1b81600081518110614a6a57614a6a6158ed565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614a9957614a996158ed565b60200101906001600160f81b031916908160001a9053506000614abd84600261597f565b614ac89060016159d4565b90505b6001811115614b40576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614afc57614afc6158ed565b1a60f81b828281518110614b1257614b126158ed565b60200101906001600160f81b031916908160001a90535060049490941c93614b3981615d9b565b9050614acb565b5083156111ce5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d84565b614b998383614c9a565b614ba660008484846147ff565b610e255760405162461bcd60e51b8152600401610d8490615c2b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310614c015772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614c2d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310614c4b57662386f26fc10000830492506010015b6305f5e1008310614c63576305f5e100830492506008015b6127108310614c7757612710830492506004015b60648310614c89576064830492506002015b600a8310610c515760010192915050565b6001600160a01b038216614cf05760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d84565b6000818152600260205260409020546001600160a01b031615614d555760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d84565b614d6360008383600161416d565b6000818152600260205260409020546001600160a01b031615614dc85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d84565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8260058101928215614e61579160200282015b82811115614e61578251825591602001919060010190614e46565b50614e6d929150614f3a565b5090565b828054828255906000526020600020908101928215614e615791602002820182811115614e61578251825591602001919060010190614e46565b508054614eb79061588c565b6000825580601f10614ec7575050565b601f016020900490600052602060002090810190610f839190614f3a565b828054828255906000526020600020908101928215614e61579160200282015b82811115614e6157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614f05565b5b80821115614e6d5760008155600101614f3b565b6001600160e01b031981168114610f8357600080fd5b600060208284031215614f7757600080fd5b81356111ce81614f4f565b60005b83811015614f9d578181015183820152602001614f85565b50506000910152565b60008151808452614fbe816020860160208601614f82565b601f01601f19169290920160200192915050565b6020815260006111ce6020830184614fa6565b600060208284031215614ff757600080fd5b5035919050565b80356001600160a01b038116811461501557600080fd5b919050565b6000806040838503121561502d57600080fd5b61503683614ffe565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561508257615082615044565b604052919050565b600060a0828403121561509c57600080fd5b82601f8301126150ab57600080fd5b60405160a081018181106001600160401b03821117156150cd576150cd615044565b6040528060a08401858111156150e257600080fd5b845b818110156150fc5780358352602092830192016150e4565b509195945050505050565b60008060006060848603121561511c57600080fd5b61512584614ffe565b925061513360208501614ffe565b9150604084013590509250925092565b6020808252825182820181905260009190848201906040850190845b8181101561517b5783518352928401929184019160010161515f565b50909695505050505050565b6000806040838503121561519a57600080fd5b823591506151aa60208401614ffe565b90509250929050565b6000602082840312156151c557600080fd5b813561ffff811681146111ce57600080fd5b600080604083850312156151ea57600080fd5b50508035926020909101359150565b60006001600160401b0383111561521257615212615044565b615225601f8401601f191660200161505a565b905082815283838301111561523957600080fd5b828260208301376000602084830101529392505050565b600082601f83011261526157600080fd5b6111ce838335602085016151f9565b60006020828403121561528257600080fd5b81356001600160401b0381111561529857600080fd5b612bcb84828501615250565b60006001600160401b038211156152bd576152bd615044565b5060051b60200190565b600082601f8301126152d857600080fd5b813560206152ed6152e8836152a4565b61505a565b82815260059290921b8401810191818101908684111561530c57600080fd5b8286015b8481101561532e5761532181614ffe565b8352918301918301615310565b509695505050505050565b600082601f83011261534a57600080fd5b8135602061535a6152e8836152a4565b82815260059290921b8401810191818101908684111561537957600080fd5b8286015b8481101561532e5780356001600160401b0381111561539c5760008081fd5b6153aa8986838b0101615250565b84525091830191830161537d565b600082601f8301126153c957600080fd5b813560206153d96152e8836152a4565b82815260059290921b840181019181810190868411156153f857600080fd5b8286015b8481101561532e57803583529183019183016153fc565b600080600080600060a0868803121561542b57600080fd5b85356001600160401b038082111561544257600080fd5b61544e89838a016152c7565b9650602088013591508082111561546457600080fd5b61547089838a01615339565b9550604088013591508082111561548657600080fd5b50615493888289016153b8565b9350506154a260608701614ffe565b949793965091946080013592915050565b6000806000606084860312156154c857600080fd5b83356001600160401b03808211156154df57600080fd5b6154eb878388016152c7565b9450602086013591508082111561550157600080fd5b61550d87838801615339565b9350604086013591508082111561552357600080fd5b50615530868287016153b8565b9150509250925092565b602080825282516001600160a01b0316828201528201516080604083015260009061556860a0840182614fa6565b905061ffff6040850151166060840152606084015160808401528091505092915050565b60006020828403121561559e57600080fd5b6111ce82614ffe565b634e487b7160e01b600052602160045260246000fd5b60208101600383106155df57634e487b7160e01b600052602160045260246000fd5b91905290565b8035801515811461501557600080fd5b6000806040838503121561560857600080fd5b61561183614ffe565b91506151aa602084016155e5565b6000806040838503121561563257600080fd5b82356001600160401b038082111561564957600080fd5b615655868387016152c7565b9350602085013591508082111561566b57600080fd5b50615678858286016153b8565b9150509250929050565b6000806000806080858703121561569857600080fd5b6156a185614ffe565b93506156af60208601614ffe565b92506040850135915060608501356001600160401b038111156156d157600080fd5b8501601f810187136156e257600080fd5b6156f1878235602084016151f9565b91505092959194509250565b6000806040838503121561571057600080fd5b82356001600160401b038082111561572757600080fd5b61573386838701615339565b935060209150818501358181111561574a57600080fd5b85019050601f8101861361575d57600080fd5b803561576b6152e8826152a4565b81815260059190911b8201830190838101908883111561578a57600080fd5b928401925b828410156157af576157a0846155e5565b8252928401929084019061578f565b80955050505050509250929050565b60208082528251828201528281015160806040840152805160a0840181905260009291820190839060c08601905b8083101561580c57835182529284019260019290920191908401906157ec565b5060408701516060870152606087015160808701528094505050505092915050565b6000806040838503121561584157600080fd5b61584a83614ffe565b91506151aa60208401614ffe565b60006020828403121561586a57600080fd5b81356001600160401b0381111561588057600080fd5b612bcb848285016153b8565b600181811c908216806158a057607f821691505b60208210810361125957634e487b7160e01b600052602260045260246000fd5b60208082526013908201527218591b5a5b881c9bdb19481c995c5d5a5c9959606a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161592b5761592b615903565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b8082028115828204841417610c5157610c51615903565b6000826159b357634e487b7160e01b600052601260045260246000fd5b500490565b600082516159ca818460208701614f82565b9190910192915050565b80820180821115610c5157610c51615903565b81810381811115610c5157610c51615903565b600060208284031215615a0c57600080fd5b5051919050565b601f821115610e2557600081815260208120601f850160051c81016020861015615a3a5750805b601f850160051c820191505b81811015613afe57828155600101615a46565b81516001600160401b03811115615a7257615a72615044565b615a8681615a80845461588c565b84615a13565b602080601f831160018114615abb5760008415615aa35750858301515b600019600386901b1c1916600185901b178555613afe565b600085815260208120601f198616915b82811015615aea57888601518255948401946001909101908401615acb565b5085821015615b085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351615b2a818460208801614f82565b835190830190615b3e818360208801614f82565b01949350505050565b60008154615b548161588c565b60018281168015615b6c5760018114615b8157615bb0565b60ff1984168752821515830287019450615bb0565b8560005260208060002060005b85811015615ba75781548a820152908401908201615b8e565b50505082870194505b5050505092915050565b601760f91b815260006111ce6001830184615b47565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615cb5816017850160208801614f82565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615ce6816028840160208801614f82565b01602801949350505050565b6000615cfe8286615b47565b602f60f81b8082528551615d19816001850160208a01614f82565b60019201918201528351615d34816002840160208801614f82565b0160020195945050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615d7490830184614fa6565b9695505050505050565b600060208284031215615d9057600080fd5b81516111ce81614f4f565b600081615daa57615daa615903565b50600019019056fe53946bf984072f5888fcb2d7d2b0587c8efeb9187d958f21809711cf00b4b4a5a2646970667358221220f3b94c777502545d9d9e0bb493645230eea712a4daefd5d27dd77dedd5de023664736f6c63430008150033

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

000000000000000000000000c11ee6c94a86e18481d9206c29ecdd3b40c598980000000000000000000000000246d65ba41da3db6db55e489146eb25ca3634e5000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000062e7370656564000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057370656564000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _oracle (address): 0xc11eE6C94A86e18481d9206c29ECDd3B40C59898
Arg [1] : _giftCard (address): 0x0246D65bA41Da3DB6dB55e489146eB25ca3634E5
Arg [2] : _symbol (string): .speed
Arg [3] : _tld (string): speed

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000c11ee6c94a86e18481d9206c29ecdd3b40c59898
Arg [1] : 0000000000000000000000000246d65ba41da3db6db55e489146eb25ca3634e5
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [5] : 2e73706565640000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [7] : 7370656564000000000000000000000000000000000000000000000000000000


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