ETH Price: $3,085.90 (-7.52%)
 

Overview

Max Total Supply

20 RING

Holders

9

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
4 RING
0x36110cac84b56eaaa83ab31d571b2af61afa9907
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
RINGManager

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 10 runs

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


pragma solidity ^0.8.19;



// ░░██╗██╗██╗░░░██╗████████╗░░███╗░░░██████╗████████╗░░███╗░░░█████╗░
// ░██╔╝██║██║░░░██║╚══██╔══╝░████║░░██╔════╝╚══██╔══╝░████║░░██╔══██╗
// ██╔╝░██║██║░░░██║░░░██║░░░██╔██║░░╚█████╗░░░░██║░░░██╔██║░░██║░░╚═╝
// ███████║██║░░░██║░░░██║░░░╚═╝██║░░░╚═══██╗░░░██║░░░╚═╝██║░░██║░░██╗
// ╚════██║╚██████╔╝░░░██║░░░███████╗██████╔╝░░░██║░░░███████╗╚█████╔╝
// ░░░░░╚═╝░╚═════╝░░░░╚═╝░░░╚══════╝╚═════╝░░░░╚═╝░░░╚══════╝░╚════╝░

// ██████╗░██████╗░░██╗░░░░░░░██╗░░██╗██╗██████╗░██████╗░░██████╗
// ██╔══██╗╚════██╗░██║░░██╗░░██║░██╔╝██║██╔══██╗██╔══██╗██╔════╝
// ██████╔╝░█████╔╝░╚██╗████╗██╔╝██╔╝░██║██████╔╝██║░░██║╚█████╗░
// ██╔══██╗░╚═══██╗░░████╔═████║░███████║██╔══██╗██║░░██║░╚═══██╗
// ██║░░██║██████╔╝░░╚██╔╝░╚██╔╝░╚════██║██║░░██║██████╔╝██████╔╝
// ╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚═╝░░░░░░░╚═╝╚═╝░░╚═╝╚═════╝░╚═════╝░

// Docs: https://docs.shpos9999iqrun.com/
// Website: https://shpos9999iqrun.com/
// Twitter: https://twitter.com/Shpos9999IQRun
// Telegram: http://t.me/Shpos9999IQRun



import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/Base64Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./OwnerRecoveryUpgradeable.sol";
import "./SonicImplementationPointerUpgradeable.sol";
import "./LiquidityPoolManagerImplementationPointerUpgradeable.sol";

contract RINGManager is
    Initializable,
    ERC721Upgradeable,
    ERC721EnumerableUpgradeable,
    ERC721URIStorageUpgradeable,
    PausableUpgradeable,
    OwnableUpgradeable,
    OwnerRecoveryUpgradeable,
    ReentrancyGuardUpgradeable,
    SonicImplementationPointerUpgradeable,
    LiquidityPoolManagerImplementationPointerUpgradeable
{
    using CountersUpgradeable for CountersUpgradeable.Counter;

    struct ringInfoEntity {
        RingEntity ring;
        uint256 id;
        uint256 pendingRewards;
        uint256 rewardPerDay;
        uint256 compoundDelay;
        uint256 pendingRewardsGross;
        uint256 rewardPerDayGross;
    }

    struct RingEntity {
        uint256 id;
        uint256 name;
        uint256 creationTime;
        uint256 lastProcessingTimestamp;
        uint256 rewardMult;
        uint256 ringValue;
        uint256 totalClaimed;
        bool exists;
        bool isMerged;
    }
    

    struct TierStorage {
        uint256 rewardMult;
        uint256 amountLockedInTier;
        bool exists;
    }

  struct Tier {
    uint32 level;
    uint32 slope;
    uint32 dailyAPR;
    uint32 claimFee;
    uint32 claimBurnFee;
    uint32 compoundFee;
    string name;
    string imageURI;
  }



    CountersUpgradeable.Counter private _ringCounter;
    mapping(uint256 => RingEntity) private _rings;
    mapping(uint256 => ringInfoEntity) private _ringInfo;
    mapping(uint256 => TierStorage) private _tierTracking;
    uint256[] _tiersTracked;

    bool public feesLive;
    uint256 public rewardPerDay;

    uint256 public creationPriceYellow = 3000 * 1e18;
    uint256 public creationPriceGreen = 7500 * 1e18;
    uint256 public creationPriceRed =  18000 * 1e18;



    uint256 public compoundDelay;
    uint256 public processingFee;
    

    Tier[3] public rings;

    string public ipfsBaseURI;
   
    uint256 private constant ONE_DAY = 86400;
    uint256 public totalValueLocked;



    function _onlyRingOwner() public view {
        address sender = _msgSender();
        require(
            sender != address(0),
            "Can not be the zero address"
        );
        require(
            isOwnerRing(sender), "only Ring owner"
         
        );
    }

    modifier onlyRingOwner() {
         _onlyRingOwner();
        _;
    }


    function _checkPermissions(uint256 _ringId) public view  {
         address sender = _msgSender();
        require(ringExists(_ringId), ": This ring doesn't exist");
        require(
            isApprovedOrOwnerOfRing(sender, _ringId),
            ": You do not have control over this ring"
        );
    }



    modifier checkPermissions(uint256 _ringId) {
        _checkPermissions(_ringId);
        _;
    }


    function _checkPermissionsMultiple(uint256[] memory _ringId) public view  {
            address sender = _msgSender();
        for (uint256 i = 0; i < _ringId.length; i++) {
            require(
                ringExists(_ringId[i]),
                ": This ring doesn't exist"
            );
            require(
                isApprovedOrOwnerOfRing(sender, _ringId[i]),
                ": You do not control this ring"
            );
        }
    }


    modifier checkPermissionsMultiple(uint256[] memory _ringId) {
       _checkPermissionsMultiple(_ringId);
        _;
    }



    event Compound(
        address indexed account,
        uint256 indexed ringId,
        uint256 amountToCompound
    );
    event Cashout(
        address indexed account,
        uint256 indexed ringId,
        uint256 rewardAmount
    );

    event Create(
        address indexed account,
        uint256 indexed newringId,
        uint256 amount
    );


    function initialize() external initializer {
        __ERC721_init("RING Farm", "RING");
        __Ownable_init();
        __ERC721Enumerable_init();
        __ERC721URIStorage_init();
        __ReentrancyGuard_init();
        __Pausable_init();
        feesLive = true;

        ipfsBaseURI = "ipfs://Qmev88mBuPK2xRGaU8QATSfvLkyoZrjqUZEcovgbMzKZ9v/";
    

        Tier[3] memory _sonic = [
        Tier({
            level: 1000,
            slope: 1000,
            dailyAPR: 150,
            claimFee: 80,
            claimBurnFee: 0,
            compoundFee: 0,
            name: "YellowRING",
            imageURI: string(abi.encodePacked(ipfsBaseURI, "yellowring.png"))
        }),
         Tier({
            level: 2000,
            slope: 1000,
            dailyAPR: 250,
            claimFee: 80,
            claimBurnFee: 0,
            compoundFee: 0,
            name: "GreenRING",
            imageURI: string(abi.encodePacked(ipfsBaseURI, "greenring.png"))
        }),
         Tier({
            level: 3000,
            slope: 1000,
            dailyAPR: 420,
            claimFee: 80,
            claimBurnFee: 0,
            compoundFee: 0,
            name: "RedRING",
            imageURI: string(abi.encodePacked(ipfsBaseURI, "redring.png"))
        })];
     
    changeTiers(_sonic);
        
    }

    function changeFeesLive(bool _feesLive) onlyOwner external{
        feesLive = _feesLive;
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override(ERC721URIStorageUpgradeable, ERC721Upgradeable)
        returns (string memory)
    {

        // ringInfoEntity memory tokenInfo = _ringInfo[tokenId]; 

        RingEntity memory _ring = _rings[tokenId];
        (, string memory _type, string memory image) = getTierMetadata(
        _ring.rewardMult
        );

       bytes memory dataURI = abi.encodePacked(
      '{ "image": "',
      image,
      '", "attributes": [',
      '{"trait_type": "type", "value": "',
      _type,
      '"}, {"trait_type": "tokens", "value": "',
      StringsUpgradeable.toString(_ring.ringValue / (10**18)),
      '"}]}'
    );


   return
      string(
        abi.encodePacked(
          "data:application/json;base64,",
          Base64Upgradeable.encode(dataURI)
        )
      );

    }


      function getTierMetadata(uint256 prevMult)
    private
    view
    returns (
      uint256,
      string memory,
      string memory
    )
  {
    (Tier memory tier, uint256 tierIndex) = getTier(prevMult);
    return (tierIndex + 1, tier.name, tier.imageURI);
  }


function updateDailyAPR(uint8 tierIndex, uint32 newAPR) public {
    require(tierIndex <= rings.length, "Invalid tier index");
    rings[tierIndex].dailyAPR = newAPR;
}


   function getTier(uint256 mult) public view returns (Tier memory, uint256) {
    Tier memory _ring;
    for (int256 i = int256(rings.length - 1); i >= 0; i--) {
      _ring = rings[uint256(i)];
      if (mult >= _ring.level) {
        return (_ring, uint256(i));
      }
    }
    return (_ring, 0);
  }

  

    function buyYellowRing(
    ) public whenNotPaused  returns (uint256) {
        address sender = _msgSender();
        uint256 ringValue = 3000 * 1e18;

        require(
            sonic.balanceOf(sender) >= ringValue,
            ": Balance too low for creation"
        );

        // Burn the tokens used to mint the NFT
        sonic.accountBurn(sender, ringValue);

        // Increment the total number of tokens
        _ringCounter.increment();

        uint256 newringId = _ringCounter.current();
        uint256 currentTime = block.timestamp;

        // Add this to the TVL
        totalValueLocked += ringValue;
        logTier(rings[0].level, int256(ringValue));

        // Add RING
            _rings[newringId] = RingEntity({
            id: newringId,
            name: newringId,
            creationTime: currentTime,
            lastProcessingTimestamp: currentTime,
            rewardMult: rings[0].level,
            ringValue: ringValue,
            totalClaimed: 0,
            exists: true,
            isMerged: false
        });

        // Assign the Ring to this account
        _mint(sender, newringId);

        emit Create(sender, newringId, ringValue);

        return newringId;
    }


    function buyGreenRing(
    ) public whenNotPaused  returns (uint256) {
        address sender = _msgSender();
        uint256 ringValue = 7500 * 1e18;

        require(
            sonic.balanceOf(sender) >= ringValue,
            ": Balance too low for creation"
        );

        // Burn the tokens used to mint the NFT
        sonic.accountBurn(sender, ringValue);

        // Increment the total number of tokens
        _ringCounter.increment();

        uint256 newringId = _ringCounter.current();
        uint256 currentTime = block.timestamp;

        // Add this to the TVL
        totalValueLocked += ringValue;
        logTier(rings[1].level, int256(ringValue));

        // Add RING
            _rings[newringId] = RingEntity({
            id: newringId,
            name: newringId,
            creationTime: currentTime,
            lastProcessingTimestamp: currentTime,
            rewardMult: rings[1].level,
            ringValue: ringValue,
            totalClaimed: 0,
            exists: true,
            isMerged: false
        });

        // Assign the Ring to this account
        _mint(sender, newringId);

        emit Create(sender, newringId, ringValue);

        return newringId;
    }



    function buyRedRing(
    ) public whenNotPaused  returns (uint256) {
        address sender = _msgSender();
        uint256 ringValue = 18000 * 1e18;

        require(
            sonic.balanceOf(sender) >= ringValue,
            ": Balance too low for creation"
        );

        // Burn the tokens used to mint the NFT
        sonic.accountBurn(sender, ringValue);

        // Increment the total number of tokens
        _ringCounter.increment();

        uint256 newringId = _ringCounter.current();
        uint256 currentTime = block.timestamp;

        // Add this to the TVL
        totalValueLocked += ringValue;
        logTier(rings[2].level, int256(ringValue));

        // Add RING
            _rings[newringId] = RingEntity({
            id: newringId,
            name: newringId,
            creationTime: currentTime,
            lastProcessingTimestamp: currentTime,
            rewardMult: rings[2].level,
            ringValue: ringValue,
            totalClaimed: 0,
            exists: true,
            isMerged: false
        });

        // Assign the Ring to this account
        _mint(sender, newringId);

        emit Create(sender, newringId, ringValue);

        return newringId;
    }

   

    function claimAll() external nonReentrant onlyRingOwner whenNotPaused {
        address account = _msgSender();
        uint256 rewardsTotal = 0;
        uint256[] memory ringsOwned = getRingIdsOf(account);
        for (uint256 i = 0; i < ringsOwned.length; i++) {
            uint256 amountToReward = _getringCashoutRewards(ringsOwned[i]);
            rewardsTotal += amountToReward;
        }
        _cashoutReward(rewardsTotal);
    }


   function getRingIdsOf(address account)
        public
        view
        returns (uint256[] memory)
    {
        uint256 numberOfRings = balanceOf(account);
        uint256[] memory ringIds = new uint256[](numberOfRings);
        for (uint256 i = 0; i < numberOfRings; i++) {
            uint256 _ringId = tokenOfOwnerByIndex(account, i);
            require(
                ringExists(_ringId),
                "ring: This ring doesn't exist"
            );
            ringIds[i] = _ringId;
        }
        return ringIds;
    }

    // Private reward functions

    function _getringCashoutRewards(uint256 _ringId)
        private
        returns (uint256)
    {
        RingEntity storage ring = _rings[_ringId];

        if (!isProcessable(ring)) {
            return 0;
        }

        uint256 reward = calculateReward(ring);
        ring.totalClaimed += reward;

        ring.lastProcessingTimestamp = block.timestamp;

        return reward;
    }




    function _cashoutReward(uint256 amountToReward) private {
        require(
            amountToReward > 0,
            "rings: You don't have enough reward to cash out"
        );
        address to = _msgSender();

        sonic.accountReward(to, amountToReward);
    }
    

     function getringByIds(uint256[] memory _ringIds)
        external
        view
        returns (ringInfoEntity[] memory)
    {
        ringInfoEntity[] memory ringsInfo = new ringInfoEntity[](
            _ringIds.length
        );

        for (uint256 i = 0; i < _ringIds.length; i++) {
            uint256 ringId = _ringIds[i];
            RingEntity memory ring = _rings[ringId];

            // need to create function if dynamics fees 
          

            uint256 pendingRewardsGross = calculateReward(ring);
            uint256 rewardsPerDayGross = rewardPerDayFor(ring);

            uint256 amountToReward = pendingRewardsGross;
            uint256 amountToRewardDaily = rewardsPerDayGross;  

            ringsInfo[i] = ringInfoEntity(
                ring,
                ringId,
                amountToReward,
                amountToRewardDaily,
                compoundDelay,
                pendingRewardsGross,
                rewardsPerDayGross
            );

        }

        return ringsInfo;
    }


    function logTier(uint256 mult, int256 amount) private {
        TierStorage storage tierStorage = _tierTracking[mult];
        if (tierStorage.exists) {
            require(
                tierStorage.rewardMult == mult,
                "rings: rewardMult does not match in TierStorage"
            );
            uint256 amountLockedInTier = uint256(
                int256(tierStorage.amountLockedInTier) + amount
            );
            require(
                amountLockedInTier >= 0,
                "rings: amountLockedInTier cannot underflow"
            );
            tierStorage.amountLockedInTier = amountLockedInTier;
        } else {
            // Tier isn't registered exist, register it
            require(
                amount > 0,
                "rings: Fatal error while creating new TierStorage. Amount cannot be below zero."
            );
            _tierTracking[mult] = TierStorage({
                rewardMult: mult,
                amountLockedInTier: uint256(amount),
                exists: true
            });
            _tiersTracked.push(mult);
        }
    }

    // Private view functions
    function getPercentageOf(uint256 rewardAmount, uint256 _feeAmount)
        private
        pure
        returns (uint256, uint256)
    {
        uint256 feeAmount = 0;
        if (_feeAmount > 0) {
            feeAmount = (rewardAmount * _feeAmount) / 100;
        }
        return (rewardAmount - feeAmount, feeAmount);
    }



      function increaseMultiplier(uint256 prevMult) private view returns (uint256) {
    (Tier memory tier, ) = getTier(prevMult);
    return tier.slope;
  }



    function getTieredRevenues(uint256 mult) private view returns (uint256) {
    (Tier memory tier, ) = getTier(mult);
    return tier.dailyAPR;
  }


    function isProcessable(RingEntity memory ring)
        private
        view
        returns (bool)
    {
        return
            block.timestamp >= ring.lastProcessingTimestamp + compoundDelay;
    }

    function calculateReward(RingEntity memory ring)
        private
        view
        returns (uint256)
    {
        return
            _calculateRewardsFromValue(
                ring.ringValue,
                ring.rewardMult,
                block.timestamp - ring.lastProcessingTimestamp
            );
    }

    function rewardPerDayFor(RingEntity memory ring)
        private
        view
        returns (uint256)
    {
        return
            _calculateRewardsFromValue(
                ring.ringValue,
                ring.rewardMult,
                ONE_DAY
            );
    }

    function _calculateRewardsFromValue(
        uint256 _ringValue,
        uint256 _rewardMult,
        uint256 _timeRewards
    ) private view returns (uint256) {
        uint256 numOfDays = ((_timeRewards * 1e10) / 1 days);
        uint256 yieldPerDay = getTieredRevenues(_rewardMult);
        return (numOfDays * yieldPerDay * _ringValue) / (1000 * 1e10);

    }



    function ringExists(uint256 _ringId) private view returns (bool) {
        require(_ringId > 0, "rings: Id must be higher than zero");
        RingEntity memory ring = _rings[_ringId];
        if (ring.exists) {
            return true;
        }
        return false;
    }



    // Public view functions

    function calculateTotalDailyEmission() external view returns (uint256) {
        uint256 dailyEmission = 0;
        for (uint256 i = 0; i < _tiersTracked.length; i++) {
            TierStorage memory tierStorage = _tierTracking[_tiersTracked[i]];
            dailyEmission += _calculateRewardsFromValue(
                tierStorage.amountLockedInTier,
                tierStorage.rewardMult,
                ONE_DAY
            );
        }
        return dailyEmission;
    }




    function isOwnerRing(address account) public view returns (bool) {
        return balanceOf(account) > 0;
    }

    function isApprovedOrOwnerOfRing(address account, uint256 _ringId)
        public
        view
        returns (bool)
    {
        return _isApprovedOrOwner(account, _ringId);
    }

    function getRingsOf(address account)
        public
        view
        returns (uint256[] memory)
    {
        uint256 numberOfrings = balanceOf(account);
        uint256[] memory ringsIds = new uint256[](numberOfrings);
        for (uint256 i = 0; i < numberOfrings; i++) {
            uint256 ringId = tokenOfOwnerByIndex(account, i);
            require(
                ringExists(ringId),
                "rings: This ring doesn't exist"
            );
            ringsIds[i] = ringId;
        }
        return ringsIds;
    }


  function changeTiers(Tier[3] memory _newRings) public onlyOwner {
     for (uint256 i = 0; i < _newRings.length; i++) {
      rings[i] = _newRings[i];
    }
  }
    
  
  


    function pause() public onlyOwner {
        _pause();
    }

    function unpause() public onlyOwner {
        _unpause();
    }

    function burn(uint256 _ringId)
        external
        virtual
        nonReentrant
        onlyRingOwner
        whenNotPaused
        checkPermissions(_ringId)
    {
        _burn(_ringId);
    }




    function liquidityReward(uint256 amountToReward) private {
        (, uint256 liquidityFee) = getPercentageOf(
            amountToReward,
            5 // Mint the 5% Treasury fee
        );
        sonic.liquidityReward(liquidityFee);
    }

    // Mandatory overrides
    function _burn(uint256 tokenId)
        internal
        override(ERC721URIStorageUpgradeable, ERC721Upgradeable)
    {
        RingEntity storage ring = _rings[tokenId];
        ring.exists = false;
        logTier(ring.rewardMult, -int256(ring.ringValue));
        ERC721Upgradeable._burn(tokenId);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount,
        uint256 batchSize
    )
        internal
        virtual
        override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
        whenNotPaused
    {
        super._beforeTokenTransfer(from, to, amount, batchSize);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }


}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "./IERC721Upgradeable.sol";

/// @title EIP-721 Metadata Update Extension
interface IERC4906Upgradeable is IERC165Upgradeable, IERC721Upgradeable {
    /// @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 5 of 31 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

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

File 6 of 31 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 7 of 31 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @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.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _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());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 8 of 31 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 9 of 31 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

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

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable 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.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return
            interfaceId == type(IERC721Upgradeable).interfaceId ||
            interfaceId == type(IERC721MetadataUpgradeable).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 = ERC721Upgradeable.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 = ERC721Upgradeable.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 = ERC721Upgradeable.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721Upgradeable.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(ERC721Upgradeable.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(ERC721Upgradeable.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(ERC721Upgradeable.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 IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[44] private __gap;
}

File 11 of 31 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal onlyInitializing {
    }

    function __ERC721Enumerable_init_unchained() internal onlyInitializing {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

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

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

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

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

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

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

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

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[46] private __gap;
}

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

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "../../../interfaces/IERC4906Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906Upgradeable, ERC721Upgradeable {
    function __ERC721URIStorage_init() internal onlyInitializing {
    }

    function __ERC721URIStorage_init_unchained() internal onlyInitializing {
    }
    using StringsUpgradeable for uint256;

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

    /**
     * @dev See {IERC165-supportsInterface}
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) 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];
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 13 of 31 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @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 15 of 31 : IERC721ReceiverUpgradeable.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 IERC721ReceiverUpgradeable {
    /**
     * @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 16 of 31 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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 17 of 31 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @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 18 of 31 : Base64Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64Upgradeable {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

            // Prepare result pointer, jump over length
            let resultPtr := add(result, 32)

            // Run over the input, 3 bytes at a time
            for {
                let dataPtr := data
                let endPtr := add(data, mload(data))
            } lt(dataPtr, endPtr) {

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

File 19 of 31 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 20 of 31 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

File 23 of 31 : MathUpgradeable.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 MathUpgradeable {
    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 24 of 31 : SignedMathUpgradeable.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 SignedMathUpgradeable {
    /**
     * @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 25 of 31 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 = MathUpgradeable.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(SignedMathUpgradeable.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, MathUpgradeable.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 26 of 31 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 27 of 31 : ILiquidityPoolManager.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;

interface ILiquidityPoolManager {
    function owner() external view returns (address);

    function getRouter() external view returns (address);

    function getPair() external view returns (address);

    function getLeftSide() external view returns (address);

    function getRightSide() external view returns (address);

    function isPair(address _pair) external view returns (bool);

    function isRouter(address _router) external view returns (bool);

    function isFeeReceiver(address _receiver) external view returns (bool);

    function isLiquidityIntact() external view returns (bool);

    function isLiquidityAdded() external view returns (bool);

    function afterTokenTransfer(address sender) external returns (bool);
}

File 28 of 31 : ISonic.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISonic is IERC20 {
    function owner() external view returns (address);

    function accountBurn(address account, uint256 amount) external;

    function accountReward(address account, uint256 amount) external;

    function liquidityReward(uint256 amount) external;

    function mint(address account, uint256 amount) external;
}

File 29 of 31 : LiquidityPoolManagerImplementationPointerUpgradeable.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "./interfaces/ILiquidityPoolManager.sol";

abstract contract LiquidityPoolManagerImplementationPointerUpgradeable is OwnableUpgradeable {
    ILiquidityPoolManager internal liquidityPoolManager;

    event UpdateLiquidityPoolManager(
        address indexed oldImplementation,
        address indexed newImplementation
    );

    modifier onlyLiquidityPoolManager() {
        require(
            address(liquidityPoolManager) != address(0),
            "Implementations: LiquidityPoolManager is not set"
        );
        address sender = _msgSender();
        require(
            sender == address(liquidityPoolManager),
            "Implementations: Not LiquidityPoolManager"
        );
        _;
    }

    function getLiquidityPoolManagerImplementation() public view returns (address) {
        return address(liquidityPoolManager);
    }

    function changeLiquidityPoolManagerImplementation(address newImplementation)
        public
        virtual
        onlyOwner
    {
        address oldImplementation = address(liquidityPoolManager);
        liquidityPoolManager = ILiquidityPoolManager(newImplementation);
        emit UpdateLiquidityPoolManager(oldImplementation, newImplementation);
    }

    uint256[49] private __gap;
}

File 30 of 31 : OwnerRecoveryUpgradeable.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

abstract contract OwnerRecoveryUpgradeable is OwnableUpgradeable {
    function recoverLostETH() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    function recoverLostTokens(
        address _token,
        address _to,
        uint256 _amount
    ) external onlyOwner {
        IERC20Upgradeable(_token).transfer(_to, _amount);
    }

    uint256[50] private __gap;
}

File 31 of 31 : SonicImplementationPointerUpgradeable.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

import "./interfaces/ISonic.sol";




abstract contract SonicImplementationPointerUpgradeable is OwnableUpgradeable {
    ISonic internal sonic;

    event Updatesonic(
        address indexed oldImplementation,
        address indexed newImplementation
    );

    modifier onlysonic() {
        require(
            address(sonic) != address(0),
            "Implementations: sonic is not set"
        );
        address sender = _msgSender();
        require(
            sender == address(sonic),
            "Implementations: Not sonic"
        );
        _;
    }

    function getsonicImplementation() public view returns (address) {
        return address(sonic);
    }

    function changesonicImplementation(address newImplementation)
        public
        virtual
        onlyOwner
    {
        address oldImplementation = address(sonic);
        require(
            AddressUpgradeable.isContract(newImplementation) ||
                newImplementation == address(0),
            "sonic: You can only set 0x0 or a contract address as a new implementation"
        );
        sonic = ISonic(newImplementation);
        emit Updatesonic(oldImplementation, newImplementation);
    }

    uint256[49] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"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":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"ringId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"Cashout","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"ringId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountToCompound","type":"uint256"}],"name":"Compound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"newringId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"UpdateLiquidityPoolManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"Updatesonic","type":"event"},{"inputs":[{"internalType":"uint256","name":"_ringId","type":"uint256"}],"name":"_checkPermissions","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ringId","type":"uint256[]"}],"name":"_checkPermissionsMultiple","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_onlyRingOwner","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ringId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyGreenRing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyRedRing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyYellowRing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"calculateTotalDailyEmission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_feesLive","type":"bool"}],"name":"changeFeesLive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"changeLiquidityPoolManagerImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"level","type":"uint32"},{"internalType":"uint32","name":"slope","type":"uint32"},{"internalType":"uint32","name":"dailyAPR","type":"uint32"},{"internalType":"uint32","name":"claimFee","type":"uint32"},{"internalType":"uint32","name":"claimBurnFee","type":"uint32"},{"internalType":"uint32","name":"compoundFee","type":"uint32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"imageURI","type":"string"}],"internalType":"struct RINGManager.Tier[3]","name":"_newRings","type":"tuple[3]"}],"name":"changeTiers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"changesonicImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"compoundDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creationPriceGreen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creationPriceRed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creationPriceYellow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityPoolManagerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRingIdsOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRingsOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mult","type":"uint256"}],"name":"getTier","outputs":[{"components":[{"internalType":"uint32","name":"level","type":"uint32"},{"internalType":"uint32","name":"slope","type":"uint32"},{"internalType":"uint32","name":"dailyAPR","type":"uint32"},{"internalType":"uint32","name":"claimFee","type":"uint32"},{"internalType":"uint32","name":"claimBurnFee","type":"uint32"},{"internalType":"uint32","name":"compoundFee","type":"uint32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"imageURI","type":"string"}],"internalType":"struct RINGManager.Tier","name":"","type":"tuple"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ringIds","type":"uint256[]"}],"name":"getringByIds","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"name","type":"uint256"},{"internalType":"uint256","name":"creationTime","type":"uint256"},{"internalType":"uint256","name":"lastProcessingTimestamp","type":"uint256"},{"internalType":"uint256","name":"rewardMult","type":"uint256"},{"internalType":"uint256","name":"ringValue","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"bool","name":"isMerged","type":"bool"}],"internalType":"struct RINGManager.RingEntity","name":"ring","type":"tuple"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"pendingRewards","type":"uint256"},{"internalType":"uint256","name":"rewardPerDay","type":"uint256"},{"internalType":"uint256","name":"compoundDelay","type":"uint256"},{"internalType":"uint256","name":"pendingRewardsGross","type":"uint256"},{"internalType":"uint256","name":"rewardPerDayGross","type":"uint256"}],"internalType":"struct RINGManager.ringInfoEntity[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getsonicImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ipfsBaseURI","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":"address","name":"account","type":"address"},{"internalType":"uint256","name":"_ringId","type":"uint256"}],"name":"isApprovedOrOwnerOfRing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isOwnerRing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"processingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"recoverLostETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverLostTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rings","outputs":[{"internalType":"uint32","name":"level","type":"uint32"},{"internalType":"uint32","name":"slope","type":"uint32"},{"internalType":"uint32","name":"dailyAPR","type":"uint32"},{"internalType":"uint32","name":"claimFee","type":"uint32"},{"internalType":"uint32","name":"claimBurnFee","type":"uint32"},{"internalType":"uint32","name":"compoundFee","type":"uint32"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"imageURI","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalValueLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tierIndex","type":"uint8"},{"internalType":"uint32","name":"newAPR","type":"uint32"}],"name":"updateDailyAPR","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405268a2a15d09519be0000061022e556901969368974c05b0000061022f556903cfc82e37e9a74000006102305534801561003c57600080fd5b50614be68061004c6000396000f3fe608060405234801561001057600080fd5b50600436106102935760003560e01c806301ffc9a71461029857806302fcd12c146102c057806306fdde03146102e0578063073dd690146102f5578063081812fc1461030b578063095ea7b31461032b578063151f6fbb1461034057806318160ddd146103535780632278e3e61461035b57806323b872dd1461036557806326da18751461037857806328c08a6b146103825780632d9ecafb146103955780632f745c59146103a8578063302f627d146103bb5780633f4ba83a146103c357806342842e0e146103cb57806342966c68146103de5780634f062c5a146103f15780634f6ccce7146104125780635c975abb1461042557806361dec354146104305780636352211e1461044357806370a0823114610456578063715018a61461046957806377ca75e1146104715780637e4d4bd5146104835780638129fc1c146104915780638456cb59146104995780638504565b146104a15780638da5cb5b146104a957806393399b7e146104b157806395d89b41146104bb578063a22cb465146104c3578063a8ada541146104d6578063af8f42b8146104e9578063b88d4fde146104f3578063c1ba9feb14610506578063c6b3222514610519578063c87b56dd14610521578063c97dcf4614610534578063cc45d4531461053c578063cce222c51461054f578063d1058e5914610561578063d523520214610569578063da0489e41461057c578063dd49042d1461058f578063de1881a814610599578063e985e9c5146105a3578063ec18154e146105b6578063f0fb21b0146105c0578063f2fde38b146105c8578063f5207733146105db578063f5f0ff0f146105e3578063faba069d146105f6578063fb29885d14610609578063fe3c3a8314610630575b600080fd5b6102ab6102a6366004613c15565b610650565b60405190151581526020015b60405180910390f35b6102d36102ce366004613c4e565b610661565b6040516102b79190613c69565b6102e8610762565b6040516102b79190613cfd565b6102fd6107f4565b6040519081526020016102b7565b61031e610319366004613d10565b610a91565b6040516102b79190613d29565b61033e610339366004613d3d565b610ab8565b005b61033e61034e366004613c4e565b610bcd565b6099546102fd565b6102fd61022e5481565b61033e610373366004613d67565b610cd3565b6102fd61022f5481565b61033e610390366004613ebf565b610d04565b61033e6103a3366004613c4e565b610e3e565b6102fd6103b6366004613d3d565b610e99565b61033e610f2f565b61033e610f7a565b61033e6103d9366004613d67565b610f8c565b61033e6103ec366004613d10565b610fa7565b6104046103ff366004613d10565b610fde565b6040516102b7929190614015565b6102fd610420366004613d10565b6111ed565b60fb5460ff166102ab565b61033e61043e366004613d67565b611280565b61031e610451366004613d10565b6112ff565b6102fd610464366004613c4e565b611333565b61033e6113b9565b6101c3546001600160a01b031661031e565b61022c546102ab9060ff1681565b61033e6113cb565b61033e61172b565b6102fd61173b565b61031e6117e5565b6102fd6102315481565b6102e86117f5565b61033e6104d13660046140df565b611804565b61033e6104e4366004614116565b61180f565b6102fd61022d5481565b61033e610501366004614133565b61182b565b6102ab610514366004613c4e565b61185d565b61033e611870565b6102e861052f366004613d10565b611903565b6102fd611a14565b61033e61054a3660046141ae565b611ba2565b6101f5546001600160a01b031661031e565b61033e611c2e565b6102d3610577366004613c4e565b611cbf565b61033e61058a366004613d10565b611db3565b6102fd6102305481565b6102fd6102325481565b6102ab6105b13660046141e9565b611e40565b6102fd61023d5481565b6102e8611e6e565b61033e6105d6366004613c4e565b611efd565b6102fd611f73565b6102ab6105f1366004613d3d565b612100565b61033e610604366004614213565b612113565b61061c610617366004613d10565b6121df565b6040516102b79897969594939291906142b8565b61064361063e366004614213565b612355565b6040516102b79190614325565b600061065b826124ec565b92915050565b6060600061066e83611333565b90506000816001600160401b0381111561068a5761068a613da3565b6040519080825280602002602001820160405280156106b3578160200160208202803683370190505b50905060005b8281101561075a5760006106cd8683610e99565b90506106d881612511565b6107295760405162461bcd60e51b815260206004820152601d60248201527f72696e673a20546869732072696e6720646f65736e277420657869737400000060448201526064015b60405180910390fd5b8083838151811061073c5761073c6143fe565b602090810291909101015250806107528161442a565b9150506106b9565b509392505050565b60606065805461077190614443565b80601f016020809104026020016040519081016040528092919081815260200182805461079d90614443565b80156107ea5780601f106107bf576101008083540402835291602001916107ea565b820191906000526020600020905b8154815290600101906020018083116107cd57829003601f168201915b5050505050905090565b60006107fe612609565b6101c3546040516370a0823160e01b815233916903cfc82e37e9a74000009182916001600160a01b0316906370a082319061083d908690600401613d29565b602060405180830381865afa15801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e9190614477565b101561089c5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b906108cf90859085906004016144c7565b600060405180830381600087803b1580156108e957600080fd5b505af11580156108fd573d6000803e3d6000fd5b5050505061091061022780546001019055565b600061091c6102275490565b905060004290508261023d600082825461093691906144e0565b90915550610956905061023360025b600302015463ffffffff168461264f565b60405180610120016040528083815260200183815260200182815260200182815260200161023360026003811061098f5761098f6143fe565b6003908102919091015463ffffffff16825260208083018790526000604080850182905260016060808701829052608096870184905289845261022885529282902087518155938701519084015585015160028301558401519181019190915590820151600482015560a0820151600582015560c0820151600682015560e0820151600790910180546101009384015161ffff1990911692151561ff00191692909217911515909202179055610a4584836127fc565b81846001600160a01b03167f278b0fd0170e87df8d6e9c94b47d3ff7382de693c547e6089b53f9972c53238985604051610a8191815260200190565b60405180910390a3509250505090565b6000610a9c82612905565b506000908152606960205260409020546001600160a01b031690565b6000610ac3826112ff565b9050806001600160a01b0316836001600160a01b031603610b305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610720565b336001600160a01b0382161480610b4c5750610b4c8133611e40565b610bbe5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610720565b610bc8838361292a565b505050565b610bd5612998565b6101c3546001600160a01b0316610beb826129f7565b80610bfd57506001600160a01b038216155b610c815760405162461bcd60e51b815260206004820152604960248201527f736f6e69633a20596f752063616e206f6e6c792073657420307830206f72206160448201527f20636f6e747261637420616464726573732061732061206e657720696d706c6560648201526836b2b73a30ba34b7b760b91b608482015260a401610720565b6101c380546001600160a01b0319166001600160a01b0384811691821790925560405190918316907f233d73528bc30032c202e2b2ba9a77cfcfac62e181eed102a457256ff39dcdd490600090a35050565b610cdd3382612a06565b610cf95760405162461bcd60e51b8152600401610720906144f3565b610bc8838383612a65565b610d0c612998565b60005b6003811015610e3a57818160038110610d2a57610d2a6143fe565b60200201516102338260038110610d4357610d436143fe565b8251600391909102919091018054602084015160408501516060860151608087015160a088015163ffffffff908116600160a01b0263ffffffff60a01b19928216600160801b0292909216600160801b600160c01b0319938216600160601b0263ffffffff60601b19958316600160401b0295909516600160401b600160801b0319968316600160201b026001600160401b0319909816929099169190911795909517939093169590951717939093161791909117815560c08201516001820190610e0e9082614586565b5060e08201516002820190610e239082614586565b509050508080610e329061442a565b915050610d0f565b5050565b610e46612998565b6101f580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fdcde9a93392ce8f6a02392dc08f42df39d1fb10ce386c7e9c6c1faba80b2a42490600090a35050565b6000610ea483611333565b8210610f065760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610720565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b610f37612998565b610f3f6117e5565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610f77573d6000803e3d6000fd5b50565b610f82612998565b610f8a612bc4565b565b610bc88383836040518060200160405280600081525061182b565b610faf612c10565b610fb7611870565b610fbf612609565b80610fc981611db3565b610fd282612c6b565b50610f77600161019155565b610fe6613b2b565b6000610ff0613b2b565b6000610ffe60016003614645565b90505b600081126111e257610233816003811061101d5761101d6143fe565b604080516101008101825260039290920292909201805463ffffffff8082168452600160201b820481166020850152600160401b8204811694840194909452600160601b810484166060840152600160801b810484166080840152600160a01b900490921660a082015260018201805491929160c08401919061109f90614443565b80601f01602080910402602001604051908101604052809291908181526020018280546110cb90614443565b80156111185780601f106110ed57610100808354040283529160200191611118565b820191906000526020600020905b8154815290600101906020018083116110fb57829003601f168201915b5050505050815260200160028201805461113190614443565b80601f016020809104026020016040519081016040528092919081815260200182805461115d90614443565b80156111aa5780601f1061117f576101008083540402835291602001916111aa565b820191906000526020600020905b81548152906001019060200180831161118d57829003601f168201915b5050505050815250509150816000015163ffffffff1685106111d0579094909350915050565b806111da81614658565b915050611001565b509360009350915050565b60006111f860995490565b821061125b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610720565b6099828154811061126e5761126e6143fe565b90600052602060002001549050919050565b611288612998565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906112b690859085906004016144c7565b6020604051808303816000875af11580156112d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f99190614675565b50505050565b60008061130b83612cb4565b90506001600160a01b03811661065b5760405162461bcd60e51b815260040161072090614692565b60006001600160a01b03821661139d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610720565b506001600160a01b031660009081526068602052604090205490565b6113c1612998565b610f8a6000612ccf565b600054610100900460ff16158080156113eb5750600054600160ff909116105b8061140c57506113fa306129f7565b15801561140c575060005460ff166001145b61146f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610720565b6000805460ff191660011790558015611492576000805461ff0019166101001790555b6114d96040518060400160405280600981526020016852494e47204661726d60b81b8152506040518060400160405280600481526020016352494e4760e01b815250612d22565b6114e1612d53565b6114e9612d82565b6114f1612d82565b6114f9612da9565b611501612dd8565b61022c805460ff1916600117905560408051606081019091526036808252614b1b602083013961023c906115359082614586565b5060408051610160810182526103e8606082018181526080830191909152609660a0830152605060c0830152600060e08301819052610100830181905283518085018552600a81526959656c6c6f7752494e4760b01b602082810191909152610120850191909152935190938392916101408401916115b89161023c9101614737565b60408051601f1981840301815291815291529082528051610100810182526107d081526103e860208281019190915260fa828401526050606083015260006080830181905260a0830152825180840184526009815268477265656e52494e4760b81b8183015260c0830152915192820192909160e083019161163e9161023c9101614761565b60408051601f198184030181529181529152908252805161010081018252610bb881526103e86020828101919091526101a4828401526050606083015260006080830181905260a083015282518084018452600781526652656452494e4760c81b8183015260c0830152915192820192909160e08301916116c39161023c910161478a565b60408051601f198184030181529190529052905290506116e281610d04565b508015610f77576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b611733612998565b610f8a612e07565b600080805b61022b548110156117df57600061022a600061022b8481548110611766576117666143fe565b60009182526020808320909101548352828101939093526040918201902081516060810183528154808252600183015494820185905260029092015460ff161515928101929092529092506117bf919062015180612e44565b6117c990846144e0565b92505080806117d79061442a565b915050611740565b50919050565b61012d546001600160a01b031690565b60606066805461077190614443565b610e3a338383612ea3565b611817612998565b61022c805460ff1916911515919091179055565b6118353383612a06565b6118515760405162461bcd60e51b8152600401610720906144f3565b6112f984848484612f6d565b60008061186983611333565b1192915050565b33806118bc5760405162461bcd60e51b815260206004820152601b60248201527a43616e206e6f7420626520746865207a65726f206164647265737360281b6044820152606401610720565b6118c58161185d565b610f775760405162461bcd60e51b815260206004820152600f60248201526e37b7363c902934b7339037bbb732b960891b6044820152606401610720565b600081815261022860209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083810191909152600482015460808401819052600583015460a0850152600683015460c085015260079092015460ff808216151560e086015261010091829004161515908401529290819061199590612fa0565b9250925050600081836119be670de0b6b3a76400008760a001516119b991906147b1565b612fda565b6040516020016119d0939291906147d3565b60405160208183030381529060405290506119ea8161306c565b6040516020016119fa91906148c9565b604051602081830303815290604052945050505050919050565b6000611a1e612609565b6101c3546040516370a0823160e01b815233916901969368974c05b000009182916001600160a01b0316906370a0823190611a5d908690600401613d29565b602060405180830381865afa158015611a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9e9190614477565b1015611abc5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b90611aef90859085906004016144c7565b600060405180830381600087803b158015611b0957600080fd5b505af1158015611b1d573d6000803e3d6000fd5b50505050611b3061022780546001019055565b6000611b3c6102275490565b905060004290508261023d6000828254611b5691906144e0565b90915550611b6990506102336001610945565b60405180610120016040528083815260200183815260200182815260200182815260200161023360016003811061098f5761098f6143fe565b60038260ff161115611beb5760405162461bcd60e51b8152602060048201526012602482015271092dcecc2d8d2c840e8d2cae440d2dcc8caf60731b6044820152606401610720565b806102338360ff1660038110611c0357611c036143fe565b60030201805463ffffffff92909216600160401b0263ffffffff60401b199092169190911790555050565b611c36612c10565b611c3e611870565b611c46612609565b33600080611c5383610661565b905060005b8151811015611ca7576000611c85838381518110611c7857611c786143fe565b60200260200101516131be565b9050611c9181856144e0565b9350508080611c9f9061442a565b915050611c58565b50611cb1826132f6565b505050610f8a600161019155565b60606000611ccc83611333565b90506000816001600160401b03811115611ce857611ce8613da3565b604051908082528060200260200182016040528015611d11578160200160208202803683370190505b50905060005b8281101561075a576000611d2b8683610e99565b9050611d3681612511565b611d825760405162461bcd60e51b815260206004820152601e60248201527f72696e67733a20546869732072696e6720646f65736e277420657869737400006044820152606401610720565b80838381518110611d9557611d956143fe565b60209081029190910101525080611dab8161442a565b915050611d17565b33611dbd82612511565b611dd95760405162461bcd60e51b81526004016107209061490e565b611de38183612100565b610e3a5760405162461bcd60e51b815260206004820152602860248201527f3a20596f7520646f206e6f74206861766520636f6e74726f6c206f76657220746044820152676869732072696e6760c01b6064820152608401610720565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b61023c8054611e7c90614443565b80601f0160208091040260200160405190810160405280929190818152602001828054611ea890614443565b8015611ef55780601f10611eca57610100808354040283529160200191611ef5565b820191906000526020600020905b815481529060010190602001808311611ed857829003601f168201915b505050505081565b611f05612998565b6001600160a01b038116611f6a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610720565b610f7781612ccf565b6000611f7d612609565b6101c3546040516370a0823160e01b8152339168a2a15d09519be000009182916001600160a01b0316906370a0823190611fbb908690600401613d29565b602060405180830381865afa158015611fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffc9190614477565b101561201a5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b9061204d90859085906004016144c7565b600060405180830381600087803b15801561206757600080fd5b505af115801561207b573d6000803e3d6000fd5b5050505061208e61022780546001019055565b600061209a6102275490565b905060004290508261023d60008282546120b491906144e0565b909155506120c790506102336000610945565b60405180610120016040528083815260200183815260200182815260200182815260200161023360006003811061098f5761098f6143fe565b600061210c8383612a06565b9392505050565b3360005b8251811015610bc857612142838281518110612135576121356143fe565b6020026020010151612511565b61215e5760405162461bcd60e51b81526004016107209061490e565b61218182848381518110612174576121746143fe565b6020026020010151612100565b6121cd5760405162461bcd60e51b815260206004820152601e60248201527f3a20596f7520646f206e6f7420636f6e74726f6c20746869732072696e6700006044820152606401610720565b806121d78161442a565b915050612117565b61023381600381106121f057600080fd5b60030201805460018201805463ffffffff8084169550600160201b8404811694600160401b8504821694600160601b8104831694600160801b8204841694600160a01b909204909316929061224490614443565b80601f016020809104026020016040519081016040528092919081815260200182805461227090614443565b80156122bd5780601f10612292576101008083540402835291602001916122bd565b820191906000526020600020905b8154815290600101906020018083116122a057829003601f168201915b5050505050908060020180546122d290614443565b80601f01602080910402602001604051908101604052809291908181526020018280546122fe90614443565b801561234b5780601f106123205761010080835404028352916020019161234b565b820191906000526020600020905b81548152906001019060200180831161232e57829003601f168201915b5050505050905088565b6060600082516001600160401b0381111561237257612372613da3565b6040519080825280602002602001820160405280156123ab57816020015b612398613b71565b8152602001906001900390816123905790505b50905060005b83518110156124e55760008482815181106123ce576123ce6143fe565b602090810291909101810151600081815261022883526040808220815161012081018352815481526001820154958101959095526002810154918501919091526003810154606085015260048101546080850152600581015460a0850152600681015460c08501526007015460ff808216151560e08601526101009182900416151590840152909250612460826133c7565b9050600061246d836133eb565b9050600082905060008290506040518060e00160405280868152602001878152602001838152602001828152602001610231548152602001858152602001848152508888815181106124c1576124c16143fe565b602002602001018190525050505050505080806124dd9061442a565b9150506123b1565b5092915050565b60006001600160e01b03198216632483248360e11b148061065b575061065b82613403565b600080821161256d5760405162461bcd60e51b815260206004820152602260248201527f72696e67733a204964206d75737420626520686967686572207468616e207a65604482015261726f60f01b6064820152608401610720565b60008281526102286020908152604091829020825161012081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460ff80821615801560e0850152610100928390049091161515918301919091526126005750600192915050565b50600092915050565b60fb5460ff1615610f8a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610720565b600082815261022a60205260409020600281015460ff16156126f157805483146126d35760405162461bcd60e51b815260206004820152602f60248201527f72696e67733a207265776172644d756c7420646f6573206e6f74206d6174636860448201526e20696e205469657253746f7261676560881b6064820152608401610720565b60008282600101546126e59190614941565b90506001820155505050565b6000821361277f5760405162461bcd60e51b815260206004820152604f60248201527f72696e67733a20466174616c206572726f72207768696c65206372656174696e60448201527f67206e6577205469657253746f726167652e20416d6f756e742063616e6e6f7460648201526e103132903132b637bb903d32b9379760891b608482015260a401610720565b506040805160608101825283815260208082019384526001828401818152600087815261022a9093529382209251835593518285015591516002909101805460ff191691151591909117905561022b8054928301815590527f1569264fd58a8773a958c52b23cf9b03ee9eb78e82215439e5244253c4b74d840155565b6001600160a01b0382166128525760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610720565b61285b81613428565b156128785760405162461bcd60e51b815260040161072090614969565b612886600083836001613445565b61288f81613428565b156128ac5760405162461bcd60e51b815260040161072090614969565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b031916841790555183929190600080516020614b91833981519152908290a45050565b61290e81613428565b610f775760405162461bcd60e51b815260040161072090614692565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061295f826112ff565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b336129a16117e5565b6001600160a01b031614610f8a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610720565b6001600160a01b03163b151590565b600080612a12836112ff565b9050806001600160a01b0316846001600160a01b03161480612a395750612a398185611e40565b80612a5d5750836001600160a01b0316612a5284610a91565b6001600160a01b0316145b949350505050565b826001600160a01b0316612a78826112ff565b6001600160a01b031614612a9e5760405162461bcd60e51b81526004016107209061499f565b6001600160a01b038216612b005760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610720565b612b0d8383836001613445565b826001600160a01b0316612b20826112ff565b6001600160a01b031614612b465760405162461bcd60e51b81526004016107209061499f565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038781168086526068855283862080546000190190559087168086528386208054600101905586865260679094528285208054909216841790915590518493600080516020614b9183398151915291a4505050565b612bcc613459565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612c069190613d29565b60405180910390a1565b60026101915403612c635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610720565b600261019155565b60008181526102286020526040902060078101805460ff1916905560048101546005820154612ca39190612c9e906149e4565b61264f565b610e3a826134a2565b600161019155565b6000908152606760205260409020546001600160a01b031690565b61012d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16612d495760405162461bcd60e51b815260040161072090614a00565b610e3a8282613533565b600054610100900460ff16612d7a5760405162461bcd60e51b815260040161072090614a00565b610f8a613573565b600054610100900460ff16610f8a5760405162461bcd60e51b815260040161072090614a00565b600054610100900460ff16612dd05760405162461bcd60e51b815260040161072090614a00565b610f8a6135a3565b600054610100900460ff16612dff5760405162461bcd60e51b815260040161072090614a00565b610f8a6135ca565b612e0f612609565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612bf93390565b60008062015180612e5a846402540be400614a4b565b612e6491906147b1565b90506000612e71856135fd565b90506509184e72a00086612e858385614a4b565b612e8f9190614a4b565b612e9991906147b1565b9695505050505050565b816001600160a01b0316836001600160a01b031603612f005760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610720565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612f78848484612a65565b612f848484848461361b565b6112f95760405162461bcd60e51b815260040161072090614a62565b6000606080600080612fb186610fde565b9092509050612fc18160016144e0565b8260c001518360e0015194509450945050509193909250565b60606000612fe783613723565b60010190506000816001600160401b0381111561300657613006613da3565b6040519080825280601f01601f191660200182016040528015613030576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461303a57509392505050565b6060815160000361308b57505060408051602081019091526000815290565b6000604051806060016040528060408152602001614b5160409139905060006003845160026130ba91906144e0565b6130c491906147b1565b6130cf906004614a4b565b6001600160401b038111156130e6576130e6613da3565b6040519080825280601f01601f191660200182016040528015613110576020820181803683370190505b509050600182016020820185865187015b8082101561317c576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250613121565b505060038651066001811461319857600281146131ab576131b3565b603d6001830353603d60028303536131b3565b603d60018303535b509195945050505050565b600081815261022860209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460ff808216151560e0850152610100918290041615159083015290613246906137f9565b6132535750600092915050565b604080516101208101825282548152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460ff808216151560e084015261010091829004161515908201526000906132cb906133c7565b9050808260060160008282546132e191906144e0565b90915550504260039092019190915592915050565b6000811161335e5760405162461bcd60e51b815260206004820152602f60248201527f72696e67733a20596f7520646f6e2774206861766520656e6f7567682072657760448201526e185c99081d1bc818d85cda081bdd5d608a1b6064820152608401610720565b6101c354604051639b5f7c6560e01b815233916001600160a01b031690639b5f7c659061339190849086906004016144c7565b600060405180830381600087803b1580156133ab57600080fd5b505af11580156133bf573d6000803e3d6000fd5b505050505050565b600061065b8260a0015183608001518460600151426133e69190614645565b612e44565b600061065b8260a00151836080015162015180612e44565b60006001600160e01b0319821663780e9d6360e01b148061065b575061065b82613817565b60008061343483612cb4565b6001600160a01b0316141592915050565b61344d612609565b6112f984848484613867565b60fb5460ff16610f8a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610720565b60006134ad826112ff565b90506134bd816000846001613445565b6134c6826112ff565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606884528285208054600019019055878552606790935281842080549091169055519293508492600080516020614b91833981519152908390a45050565b600054610100900460ff1661355a5760405162461bcd60e51b815260040161072090614a00565b60656135668382614586565b506066610bc88282614586565b600054610100900460ff1661359a5760405162461bcd60e51b815260040161072090614a00565b610f8a33612ccf565b600054610100900460ff16612cac5760405162461bcd60e51b815260040161072090614a00565b600054610100900460ff166135f15760405162461bcd60e51b815260040161072090614a00565b60fb805460ff19169055565b60008061360983610fde565b506040015163ffffffff169392505050565b600061362f846001600160a01b03166129f7565b1561371857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613666903390899088908890600401614ab4565b6020604051808303816000875af19250505080156136a1575060408051601f3d908101601f1916820190925261369e91810190614ae7565b60015b6136fe573d8080156136cf576040519150601f19603f3d011682016040523d82523d6000602084013e6136d4565b606091505b5080516000036136f65760405162461bcd60e51b815260040161072090614a62565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a5d565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137625772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b831061378c576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106137aa57662386f26fc10000830492506010015b6305f5e10083106137c2576305f5e100830492506008015b61271083106137d657612710830492506004015b606483106137e8576064830492506002015b600a831061065b5760010192915050565b600061023154826060015161380e91906144e0565b42101592915050565b60006001600160e01b031982166380ac58cd60e01b148061384857506001600160e01b03198216635b5e139f60e01b145b8061065b57506301ffc9a760e01b6001600160e01b031983161461065b565b60018111156138d65760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610720565b816001600160a01b0385166139325761392d81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613955565b836001600160a01b0316856001600160a01b03161461395557613955858261399b565b6001600160a01b0384166139715761396c81613a38565b613994565b846001600160a01b0316846001600160a01b031614613994576139948482613ae7565b5050505050565b600060016139a884611333565b6139b29190614645565b600083815260986020526040902054909150808214613a05576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613a4a90600190614645565b6000838152609a602052604081205460998054939450909284908110613a7257613a726143fe565b906000526020600020015490508060998381548110613a9357613a936143fe565b6000918252602080832090910192909255828152609a90915260408082208490558582528120556099805480613acb57613acb614b04565b6001900381819060005260206000200160009055905550505050565b6000613af283611333565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082019290925260c0810182905260e081019190915290565b6040518060e00160405280613bcf604051806101200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160e01b031981168114610f7757600080fd5b600060208284031215613c2757600080fd5b813561210c81613bff565b80356001600160a01b0381168114613c4957600080fd5b919050565b600060208284031215613c6057600080fd5b61210c82613c32565b6020808252825182820181905260009190848201906040850190845b81811015613ca157835183529284019291840191600101613c85565b50909695505050505050565b60005b83811015613cc8578181015183820152602001613cb0565b50506000910152565b60008151808452613ce9816020860160208601613cad565b601f01601f19169290920160200192915050565b60208152600061210c6020830184613cd1565b600060208284031215613d2257600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060408385031215613d5057600080fd5b613d5983613c32565b946020939093013593505050565b600080600060608486031215613d7c57600080fd5b613d8584613c32565b9250613d9360208501613c32565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715613ddb57613ddb613da3565b60405290565b60405161010081016001600160401b0381118282101715613ddb57613ddb613da3565b604051601f8201601f191681016001600160401b0381118282101715613e2c57613e2c613da3565b604052919050565b803563ffffffff81168114613c4957600080fd5b60006001600160401b03831115613e6157613e61613da3565b613e74601f8401601f1916602001613e04565b9050828152838383011115613e8857600080fd5b828260208301376000602084830101529392505050565b600082601f830112613eb057600080fd5b61210c83833560208501613e48565b60006020808385031215613ed257600080fd5b82356001600160401b0380821115613ee957600080fd5b818501915085601f830112613efd57600080fd5b613f05613db9565b80606080850189811115613f1857600080fd5b855b8181101561400657803586811115613f325760008081fd5b8701610100818d031215613f465760008081fd5b613f4e613de1565b613f5782613e34565b8152613f648a8301613e34565b8a8201526040613f75818401613e34565b90820152613f84828601613e34565b858201526080613f95818401613e34565b9082015260a0613fa6838201613e34565b9082015260c08281013589811115613fbe5760008081fd5b613fca8f828601613e9f565b82840152505060e08083013589811115613fe45760008081fd5b613ff08f828601613e9f565b9183019190915250865250938701938701613f1a565b50919998505050505050505050565b6040815263ffffffff83511660408201526000602084015161403f606084018263ffffffff169052565b50604084015163ffffffff8116608084015250606084015163ffffffff811660a084015250608084015163ffffffff811660c08401525060a084015163ffffffff811660e08401525060c0840151610100838101526140a2610140840182613cd1565b905060e0850151603f19848303016101208501526140c08282613cd1565b925050508260208301529392505050565b8015158114610f7757600080fd5b600080604083850312156140f257600080fd5b6140fb83613c32565b9150602083013561410b816140d1565b809150509250929050565b60006020828403121561412857600080fd5b813561210c816140d1565b6000806000806080858703121561414957600080fd5b61415285613c32565b935061416060208601613c32565b92506040850135915060608501356001600160401b0381111561418257600080fd5b8501601f8101871361419357600080fd5b6141a287823560208401613e48565b91505092959194509250565b600080604083850312156141c157600080fd5b823560ff811681146141d257600080fd5b91506141e060208401613e34565b90509250929050565b600080604083850312156141fc57600080fd5b61420583613c32565b91506141e060208401613c32565b6000602080838503121561422657600080fd5b82356001600160401b038082111561423d57600080fd5b818501915085601f83011261425157600080fd5b81358181111561426357614263613da3565b8060051b9150614274848301613e04565b818152918301840191848101908884111561428e57600080fd5b938501935b838510156142ac57843582529385019390850190614293565b98975050505050505050565b600061010063ffffffff808c168452808b166020850152808a1660408501528089166060850152808816608085015280871660a0850152508060c084015261430281840186613cd1565b905082810360e08401526143168185613cd1565b9b9a5050505050505050505050565b602080825282518282018190526000919060409081850190868401855b828110156143f157815180518051865287810151888701528681015187870152606080820151818801526080808301518189015260a080840151818a015260c080850151818b015260e0808601511515908b0152610100948501511515948a01949094528a8501516101208a0152898501516101408a0152918401516101608901528301516101808801528201516101a087015201516101c08501526101e09093019290850190600101614342565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161443c5761443c614414565b5060010190565b600181811c9082168061445757607f821691505b6020821081036117df57634e487b7160e01b600052602260045260246000fd5b60006020828403121561448957600080fd5b5051919050565b6020808252601e908201527f3a2042616c616e636520746f6f206c6f7720666f72206372656174696f6e0000604082015260600190565b6001600160a01b03929092168252602082015260400190565b8082018082111561065b5761065b614414565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f821115610bc857600081815260208120601f850160051c810160208610156145675750805b601f850160051c820191505b818110156133bf57828155600101614573565b81516001600160401b0381111561459f5761459f613da3565b6145b3816145ad8454614443565b84614540565b602080601f8311600181146145e857600084156145d05750858301515b600019600386901b1c1916600185901b1785556133bf565b600085815260208120601f198616915b82811015614617578886015182559484019460019091019084016145f8565b50858210156146355787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8181038181111561065b5761065b614414565b6000600160ff1b820161466d5761466d614414565b506000190190565b60006020828403121561468757600080fd5b815161210c816140d1565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b600081546146d181614443565b600182811680156146e957600181146146fe5761472d565b60ff198416875282151583028701945061472d565b8560005260208060002060005b858110156147245781548a82015290840190820161470b565b50505082870194505b5050505092915050565b600061474382846146c4565b6d79656c6c6f7772696e672e706e6760901b8152600e019392505050565b600061476d82846146c4565b6c677265656e72696e672e706e6760981b8152600d019392505050565b600061479682846146c4565b6a72656472696e672e706e6760a81b8152600b019392505050565b6000826147ce57634e487b7160e01b600052601260045260246000fd5b500490565b6b3d901134b6b0b3b2911d101160a11b815283516000906147fb81600c850160208901613cad565b71222c202261747472696275746573223a205b60701b600c918401918201527f7b2274726169745f74797065223a202274797065222c202276616c7565223a20601e820152601160f91b603e820152845161485d81603f840160208901613cad565b7f227d2c207b2274726169745f74797065223a2022746f6b656e73222c20227661603f929091019182015266363ab2911d101160c91b605f82015283516148ab816066840160208801613cad565b63227d5d7d60e01b60669290910191820152606a0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161490181601d850160208701613cad565b91909101601d0192915050565b6020808252601990820152780e88151a1a5cc81c9a5b99c8191bd95cdb89dd08195e1a5cdd603a1b604082015260600190565b808201828112600083128015821682158216171561496157614961614414565b505092915050565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6000600160ff1b82016149f9576149f9614414565b5060000390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b808202811582820484141761065b5761065b614414565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e9990830184613cd1565b600060208284031215614af957600080fd5b815161210c81613bff565b634e487b7160e01b600052603160045260246000fdfe697066733a2f2f516d657638386d4275504b327852476155385141545366764c6b796f5a726a71555a45636f7667624d7a4b5a39762f4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220668aba688a70993d0552bc4ffc0c3f9a460e48da828e030fa6a83c59aa9a742764736f6c63430008130033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102935760003560e01c806301ffc9a71461029857806302fcd12c146102c057806306fdde03146102e0578063073dd690146102f5578063081812fc1461030b578063095ea7b31461032b578063151f6fbb1461034057806318160ddd146103535780632278e3e61461035b57806323b872dd1461036557806326da18751461037857806328c08a6b146103825780632d9ecafb146103955780632f745c59146103a8578063302f627d146103bb5780633f4ba83a146103c357806342842e0e146103cb57806342966c68146103de5780634f062c5a146103f15780634f6ccce7146104125780635c975abb1461042557806361dec354146104305780636352211e1461044357806370a0823114610456578063715018a61461046957806377ca75e1146104715780637e4d4bd5146104835780638129fc1c146104915780638456cb59146104995780638504565b146104a15780638da5cb5b146104a957806393399b7e146104b157806395d89b41146104bb578063a22cb465146104c3578063a8ada541146104d6578063af8f42b8146104e9578063b88d4fde146104f3578063c1ba9feb14610506578063c6b3222514610519578063c87b56dd14610521578063c97dcf4614610534578063cc45d4531461053c578063cce222c51461054f578063d1058e5914610561578063d523520214610569578063da0489e41461057c578063dd49042d1461058f578063de1881a814610599578063e985e9c5146105a3578063ec18154e146105b6578063f0fb21b0146105c0578063f2fde38b146105c8578063f5207733146105db578063f5f0ff0f146105e3578063faba069d146105f6578063fb29885d14610609578063fe3c3a8314610630575b600080fd5b6102ab6102a6366004613c15565b610650565b60405190151581526020015b60405180910390f35b6102d36102ce366004613c4e565b610661565b6040516102b79190613c69565b6102e8610762565b6040516102b79190613cfd565b6102fd6107f4565b6040519081526020016102b7565b61031e610319366004613d10565b610a91565b6040516102b79190613d29565b61033e610339366004613d3d565b610ab8565b005b61033e61034e366004613c4e565b610bcd565b6099546102fd565b6102fd61022e5481565b61033e610373366004613d67565b610cd3565b6102fd61022f5481565b61033e610390366004613ebf565b610d04565b61033e6103a3366004613c4e565b610e3e565b6102fd6103b6366004613d3d565b610e99565b61033e610f2f565b61033e610f7a565b61033e6103d9366004613d67565b610f8c565b61033e6103ec366004613d10565b610fa7565b6104046103ff366004613d10565b610fde565b6040516102b7929190614015565b6102fd610420366004613d10565b6111ed565b60fb5460ff166102ab565b61033e61043e366004613d67565b611280565b61031e610451366004613d10565b6112ff565b6102fd610464366004613c4e565b611333565b61033e6113b9565b6101c3546001600160a01b031661031e565b61022c546102ab9060ff1681565b61033e6113cb565b61033e61172b565b6102fd61173b565b61031e6117e5565b6102fd6102315481565b6102e86117f5565b61033e6104d13660046140df565b611804565b61033e6104e4366004614116565b61180f565b6102fd61022d5481565b61033e610501366004614133565b61182b565b6102ab610514366004613c4e565b61185d565b61033e611870565b6102e861052f366004613d10565b611903565b6102fd611a14565b61033e61054a3660046141ae565b611ba2565b6101f5546001600160a01b031661031e565b61033e611c2e565b6102d3610577366004613c4e565b611cbf565b61033e61058a366004613d10565b611db3565b6102fd6102305481565b6102fd6102325481565b6102ab6105b13660046141e9565b611e40565b6102fd61023d5481565b6102e8611e6e565b61033e6105d6366004613c4e565b611efd565b6102fd611f73565b6102ab6105f1366004613d3d565b612100565b61033e610604366004614213565b612113565b61061c610617366004613d10565b6121df565b6040516102b79897969594939291906142b8565b61064361063e366004614213565b612355565b6040516102b79190614325565b600061065b826124ec565b92915050565b6060600061066e83611333565b90506000816001600160401b0381111561068a5761068a613da3565b6040519080825280602002602001820160405280156106b3578160200160208202803683370190505b50905060005b8281101561075a5760006106cd8683610e99565b90506106d881612511565b6107295760405162461bcd60e51b815260206004820152601d60248201527f72696e673a20546869732072696e6720646f65736e277420657869737400000060448201526064015b60405180910390fd5b8083838151811061073c5761073c6143fe565b602090810291909101015250806107528161442a565b9150506106b9565b509392505050565b60606065805461077190614443565b80601f016020809104026020016040519081016040528092919081815260200182805461079d90614443565b80156107ea5780601f106107bf576101008083540402835291602001916107ea565b820191906000526020600020905b8154815290600101906020018083116107cd57829003601f168201915b5050505050905090565b60006107fe612609565b6101c3546040516370a0823160e01b815233916903cfc82e37e9a74000009182916001600160a01b0316906370a082319061083d908690600401613d29565b602060405180830381865afa15801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e9190614477565b101561089c5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b906108cf90859085906004016144c7565b600060405180830381600087803b1580156108e957600080fd5b505af11580156108fd573d6000803e3d6000fd5b5050505061091061022780546001019055565b600061091c6102275490565b905060004290508261023d600082825461093691906144e0565b90915550610956905061023360025b600302015463ffffffff168461264f565b60405180610120016040528083815260200183815260200182815260200182815260200161023360026003811061098f5761098f6143fe565b6003908102919091015463ffffffff16825260208083018790526000604080850182905260016060808701829052608096870184905289845261022885529282902087518155938701519084015585015160028301558401519181019190915590820151600482015560a0820151600582015560c0820151600682015560e0820151600790910180546101009384015161ffff1990911692151561ff00191692909217911515909202179055610a4584836127fc565b81846001600160a01b03167f278b0fd0170e87df8d6e9c94b47d3ff7382de693c547e6089b53f9972c53238985604051610a8191815260200190565b60405180910390a3509250505090565b6000610a9c82612905565b506000908152606960205260409020546001600160a01b031690565b6000610ac3826112ff565b9050806001600160a01b0316836001600160a01b031603610b305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610720565b336001600160a01b0382161480610b4c5750610b4c8133611e40565b610bbe5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610720565b610bc8838361292a565b505050565b610bd5612998565b6101c3546001600160a01b0316610beb826129f7565b80610bfd57506001600160a01b038216155b610c815760405162461bcd60e51b815260206004820152604960248201527f736f6e69633a20596f752063616e206f6e6c792073657420307830206f72206160448201527f20636f6e747261637420616464726573732061732061206e657720696d706c6560648201526836b2b73a30ba34b7b760b91b608482015260a401610720565b6101c380546001600160a01b0319166001600160a01b0384811691821790925560405190918316907f233d73528bc30032c202e2b2ba9a77cfcfac62e181eed102a457256ff39dcdd490600090a35050565b610cdd3382612a06565b610cf95760405162461bcd60e51b8152600401610720906144f3565b610bc8838383612a65565b610d0c612998565b60005b6003811015610e3a57818160038110610d2a57610d2a6143fe565b60200201516102338260038110610d4357610d436143fe565b8251600391909102919091018054602084015160408501516060860151608087015160a088015163ffffffff908116600160a01b0263ffffffff60a01b19928216600160801b0292909216600160801b600160c01b0319938216600160601b0263ffffffff60601b19958316600160401b0295909516600160401b600160801b0319968316600160201b026001600160401b0319909816929099169190911795909517939093169590951717939093161791909117815560c08201516001820190610e0e9082614586565b5060e08201516002820190610e239082614586565b509050508080610e329061442a565b915050610d0f565b5050565b610e46612998565b6101f580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fdcde9a93392ce8f6a02392dc08f42df39d1fb10ce386c7e9c6c1faba80b2a42490600090a35050565b6000610ea483611333565b8210610f065760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610720565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b610f37612998565b610f3f6117e5565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610f77573d6000803e3d6000fd5b50565b610f82612998565b610f8a612bc4565b565b610bc88383836040518060200160405280600081525061182b565b610faf612c10565b610fb7611870565b610fbf612609565b80610fc981611db3565b610fd282612c6b565b50610f77600161019155565b610fe6613b2b565b6000610ff0613b2b565b6000610ffe60016003614645565b90505b600081126111e257610233816003811061101d5761101d6143fe565b604080516101008101825260039290920292909201805463ffffffff8082168452600160201b820481166020850152600160401b8204811694840194909452600160601b810484166060840152600160801b810484166080840152600160a01b900490921660a082015260018201805491929160c08401919061109f90614443565b80601f01602080910402602001604051908101604052809291908181526020018280546110cb90614443565b80156111185780601f106110ed57610100808354040283529160200191611118565b820191906000526020600020905b8154815290600101906020018083116110fb57829003601f168201915b5050505050815260200160028201805461113190614443565b80601f016020809104026020016040519081016040528092919081815260200182805461115d90614443565b80156111aa5780601f1061117f576101008083540402835291602001916111aa565b820191906000526020600020905b81548152906001019060200180831161118d57829003601f168201915b5050505050815250509150816000015163ffffffff1685106111d0579094909350915050565b806111da81614658565b915050611001565b509360009350915050565b60006111f860995490565b821061125b5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610720565b6099828154811061126e5761126e6143fe565b90600052602060002001549050919050565b611288612998565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906112b690859085906004016144c7565b6020604051808303816000875af11580156112d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f99190614675565b50505050565b60008061130b83612cb4565b90506001600160a01b03811661065b5760405162461bcd60e51b815260040161072090614692565b60006001600160a01b03821661139d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610720565b506001600160a01b031660009081526068602052604090205490565b6113c1612998565b610f8a6000612ccf565b600054610100900460ff16158080156113eb5750600054600160ff909116105b8061140c57506113fa306129f7565b15801561140c575060005460ff166001145b61146f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610720565b6000805460ff191660011790558015611492576000805461ff0019166101001790555b6114d96040518060400160405280600981526020016852494e47204661726d60b81b8152506040518060400160405280600481526020016352494e4760e01b815250612d22565b6114e1612d53565b6114e9612d82565b6114f1612d82565b6114f9612da9565b611501612dd8565b61022c805460ff1916600117905560408051606081019091526036808252614b1b602083013961023c906115359082614586565b5060408051610160810182526103e8606082018181526080830191909152609660a0830152605060c0830152600060e08301819052610100830181905283518085018552600a81526959656c6c6f7752494e4760b01b602082810191909152610120850191909152935190938392916101408401916115b89161023c9101614737565b60408051601f1981840301815291815291529082528051610100810182526107d081526103e860208281019190915260fa828401526050606083015260006080830181905260a0830152825180840184526009815268477265656e52494e4760b81b8183015260c0830152915192820192909160e083019161163e9161023c9101614761565b60408051601f198184030181529181529152908252805161010081018252610bb881526103e86020828101919091526101a4828401526050606083015260006080830181905260a083015282518084018452600781526652656452494e4760c81b8183015260c0830152915192820192909160e08301916116c39161023c910161478a565b60408051601f198184030181529190529052905290506116e281610d04565b508015610f77576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b611733612998565b610f8a612e07565b600080805b61022b548110156117df57600061022a600061022b8481548110611766576117666143fe565b60009182526020808320909101548352828101939093526040918201902081516060810183528154808252600183015494820185905260029092015460ff161515928101929092529092506117bf919062015180612e44565b6117c990846144e0565b92505080806117d79061442a565b915050611740565b50919050565b61012d546001600160a01b031690565b60606066805461077190614443565b610e3a338383612ea3565b611817612998565b61022c805460ff1916911515919091179055565b6118353383612a06565b6118515760405162461bcd60e51b8152600401610720906144f3565b6112f984848484612f6d565b60008061186983611333565b1192915050565b33806118bc5760405162461bcd60e51b815260206004820152601b60248201527a43616e206e6f7420626520746865207a65726f206164647265737360281b6044820152606401610720565b6118c58161185d565b610f775760405162461bcd60e51b815260206004820152600f60248201526e37b7363c902934b7339037bbb732b960891b6044820152606401610720565b600081815261022860209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083810191909152600482015460808401819052600583015460a0850152600683015460c085015260079092015460ff808216151560e086015261010091829004161515908401529290819061199590612fa0565b9250925050600081836119be670de0b6b3a76400008760a001516119b991906147b1565b612fda565b6040516020016119d0939291906147d3565b60405160208183030381529060405290506119ea8161306c565b6040516020016119fa91906148c9565b604051602081830303815290604052945050505050919050565b6000611a1e612609565b6101c3546040516370a0823160e01b815233916901969368974c05b000009182916001600160a01b0316906370a0823190611a5d908690600401613d29565b602060405180830381865afa158015611a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9e9190614477565b1015611abc5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b90611aef90859085906004016144c7565b600060405180830381600087803b158015611b0957600080fd5b505af1158015611b1d573d6000803e3d6000fd5b50505050611b3061022780546001019055565b6000611b3c6102275490565b905060004290508261023d6000828254611b5691906144e0565b90915550611b6990506102336001610945565b60405180610120016040528083815260200183815260200182815260200182815260200161023360016003811061098f5761098f6143fe565b60038260ff161115611beb5760405162461bcd60e51b8152602060048201526012602482015271092dcecc2d8d2c840e8d2cae440d2dcc8caf60731b6044820152606401610720565b806102338360ff1660038110611c0357611c036143fe565b60030201805463ffffffff92909216600160401b0263ffffffff60401b199092169190911790555050565b611c36612c10565b611c3e611870565b611c46612609565b33600080611c5383610661565b905060005b8151811015611ca7576000611c85838381518110611c7857611c786143fe565b60200260200101516131be565b9050611c9181856144e0565b9350508080611c9f9061442a565b915050611c58565b50611cb1826132f6565b505050610f8a600161019155565b60606000611ccc83611333565b90506000816001600160401b03811115611ce857611ce8613da3565b604051908082528060200260200182016040528015611d11578160200160208202803683370190505b50905060005b8281101561075a576000611d2b8683610e99565b9050611d3681612511565b611d825760405162461bcd60e51b815260206004820152601e60248201527f72696e67733a20546869732072696e6720646f65736e277420657869737400006044820152606401610720565b80838381518110611d9557611d956143fe565b60209081029190910101525080611dab8161442a565b915050611d17565b33611dbd82612511565b611dd95760405162461bcd60e51b81526004016107209061490e565b611de38183612100565b610e3a5760405162461bcd60e51b815260206004820152602860248201527f3a20596f7520646f206e6f74206861766520636f6e74726f6c206f76657220746044820152676869732072696e6760c01b6064820152608401610720565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b61023c8054611e7c90614443565b80601f0160208091040260200160405190810160405280929190818152602001828054611ea890614443565b8015611ef55780601f10611eca57610100808354040283529160200191611ef5565b820191906000526020600020905b815481529060010190602001808311611ed857829003601f168201915b505050505081565b611f05612998565b6001600160a01b038116611f6a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610720565b610f7781612ccf565b6000611f7d612609565b6101c3546040516370a0823160e01b8152339168a2a15d09519be000009182916001600160a01b0316906370a0823190611fbb908690600401613d29565b602060405180830381865afa158015611fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ffc9190614477565b101561201a5760405162461bcd60e51b815260040161072090614490565b6101c35460405163db0e185b60e01b81526001600160a01b039091169063db0e185b9061204d90859085906004016144c7565b600060405180830381600087803b15801561206757600080fd5b505af115801561207b573d6000803e3d6000fd5b5050505061208e61022780546001019055565b600061209a6102275490565b905060004290508261023d60008282546120b491906144e0565b909155506120c790506102336000610945565b60405180610120016040528083815260200183815260200182815260200182815260200161023360006003811061098f5761098f6143fe565b600061210c8383612a06565b9392505050565b3360005b8251811015610bc857612142838281518110612135576121356143fe565b6020026020010151612511565b61215e5760405162461bcd60e51b81526004016107209061490e565b61218182848381518110612174576121746143fe565b6020026020010151612100565b6121cd5760405162461bcd60e51b815260206004820152601e60248201527f3a20596f7520646f206e6f7420636f6e74726f6c20746869732072696e6700006044820152606401610720565b806121d78161442a565b915050612117565b61023381600381106121f057600080fd5b60030201805460018201805463ffffffff8084169550600160201b8404811694600160401b8504821694600160601b8104831694600160801b8204841694600160a01b909204909316929061224490614443565b80601f016020809104026020016040519081016040528092919081815260200182805461227090614443565b80156122bd5780601f10612292576101008083540402835291602001916122bd565b820191906000526020600020905b8154815290600101906020018083116122a057829003601f168201915b5050505050908060020180546122d290614443565b80601f01602080910402602001604051908101604052809291908181526020018280546122fe90614443565b801561234b5780601f106123205761010080835404028352916020019161234b565b820191906000526020600020905b81548152906001019060200180831161232e57829003601f168201915b5050505050905088565b6060600082516001600160401b0381111561237257612372613da3565b6040519080825280602002602001820160405280156123ab57816020015b612398613b71565b8152602001906001900390816123905790505b50905060005b83518110156124e55760008482815181106123ce576123ce6143fe565b602090810291909101810151600081815261022883526040808220815161012081018352815481526001820154958101959095526002810154918501919091526003810154606085015260048101546080850152600581015460a0850152600681015460c08501526007015460ff808216151560e08601526101009182900416151590840152909250612460826133c7565b9050600061246d836133eb565b9050600082905060008290506040518060e00160405280868152602001878152602001838152602001828152602001610231548152602001858152602001848152508888815181106124c1576124c16143fe565b602002602001018190525050505050505080806124dd9061442a565b9150506123b1565b5092915050565b60006001600160e01b03198216632483248360e11b148061065b575061065b82613403565b600080821161256d5760405162461bcd60e51b815260206004820152602260248201527f72696e67733a204964206d75737420626520686967686572207468616e207a65604482015261726f60f01b6064820152608401610720565b60008281526102286020908152604091829020825161012081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460ff80821615801560e0850152610100928390049091161515918301919091526126005750600192915050565b50600092915050565b60fb5460ff1615610f8a5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610720565b600082815261022a60205260409020600281015460ff16156126f157805483146126d35760405162461bcd60e51b815260206004820152602f60248201527f72696e67733a207265776172644d756c7420646f6573206e6f74206d6174636860448201526e20696e205469657253746f7261676560881b6064820152608401610720565b60008282600101546126e59190614941565b90506001820155505050565b6000821361277f5760405162461bcd60e51b815260206004820152604f60248201527f72696e67733a20466174616c206572726f72207768696c65206372656174696e60448201527f67206e6577205469657253746f726167652e20416d6f756e742063616e6e6f7460648201526e103132903132b637bb903d32b9379760891b608482015260a401610720565b506040805160608101825283815260208082019384526001828401818152600087815261022a9093529382209251835593518285015591516002909101805460ff191691151591909117905561022b8054928301815590527f1569264fd58a8773a958c52b23cf9b03ee9eb78e82215439e5244253c4b74d840155565b6001600160a01b0382166128525760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610720565b61285b81613428565b156128785760405162461bcd60e51b815260040161072090614969565b612886600083836001613445565b61288f81613428565b156128ac5760405162461bcd60e51b815260040161072090614969565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b031916841790555183929190600080516020614b91833981519152908290a45050565b61290e81613428565b610f775760405162461bcd60e51b815260040161072090614692565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061295f826112ff565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b336129a16117e5565b6001600160a01b031614610f8a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610720565b6001600160a01b03163b151590565b600080612a12836112ff565b9050806001600160a01b0316846001600160a01b03161480612a395750612a398185611e40565b80612a5d5750836001600160a01b0316612a5284610a91565b6001600160a01b0316145b949350505050565b826001600160a01b0316612a78826112ff565b6001600160a01b031614612a9e5760405162461bcd60e51b81526004016107209061499f565b6001600160a01b038216612b005760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610720565b612b0d8383836001613445565b826001600160a01b0316612b20826112ff565b6001600160a01b031614612b465760405162461bcd60e51b81526004016107209061499f565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038781168086526068855283862080546000190190559087168086528386208054600101905586865260679094528285208054909216841790915590518493600080516020614b9183398151915291a4505050565b612bcc613459565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051612c069190613d29565b60405180910390a1565b60026101915403612c635760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610720565b600261019155565b60008181526102286020526040902060078101805460ff1916905560048101546005820154612ca39190612c9e906149e4565b61264f565b610e3a826134a2565b600161019155565b6000908152606760205260409020546001600160a01b031690565b61012d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16612d495760405162461bcd60e51b815260040161072090614a00565b610e3a8282613533565b600054610100900460ff16612d7a5760405162461bcd60e51b815260040161072090614a00565b610f8a613573565b600054610100900460ff16610f8a5760405162461bcd60e51b815260040161072090614a00565b600054610100900460ff16612dd05760405162461bcd60e51b815260040161072090614a00565b610f8a6135a3565b600054610100900460ff16612dff5760405162461bcd60e51b815260040161072090614a00565b610f8a6135ca565b612e0f612609565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612bf93390565b60008062015180612e5a846402540be400614a4b565b612e6491906147b1565b90506000612e71856135fd565b90506509184e72a00086612e858385614a4b565b612e8f9190614a4b565b612e9991906147b1565b9695505050505050565b816001600160a01b0316836001600160a01b031603612f005760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610720565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612f78848484612a65565b612f848484848461361b565b6112f95760405162461bcd60e51b815260040161072090614a62565b6000606080600080612fb186610fde565b9092509050612fc18160016144e0565b8260c001518360e0015194509450945050509193909250565b60606000612fe783613723565b60010190506000816001600160401b0381111561300657613006613da3565b6040519080825280601f01601f191660200182016040528015613030576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461303a57509392505050565b6060815160000361308b57505060408051602081019091526000815290565b6000604051806060016040528060408152602001614b5160409139905060006003845160026130ba91906144e0565b6130c491906147b1565b6130cf906004614a4b565b6001600160401b038111156130e6576130e6613da3565b6040519080825280601f01601f191660200182016040528015613110576020820181803683370190505b509050600182016020820185865187015b8082101561317c576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250613121565b505060038651066001811461319857600281146131ab576131b3565b603d6001830353603d60028303536131b3565b603d60018303535b509195945050505050565b600081815261022860209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460ff808216151560e0850152610100918290041615159083015290613246906137f9565b6132535750600092915050565b604080516101208101825282548152600183015460208201526002830154918101919091526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460ff808216151560e084015261010091829004161515908201526000906132cb906133c7565b9050808260060160008282546132e191906144e0565b90915550504260039092019190915592915050565b6000811161335e5760405162461bcd60e51b815260206004820152602f60248201527f72696e67733a20596f7520646f6e2774206861766520656e6f7567682072657760448201526e185c99081d1bc818d85cda081bdd5d608a1b6064820152608401610720565b6101c354604051639b5f7c6560e01b815233916001600160a01b031690639b5f7c659061339190849086906004016144c7565b600060405180830381600087803b1580156133ab57600080fd5b505af11580156133bf573d6000803e3d6000fd5b505050505050565b600061065b8260a0015183608001518460600151426133e69190614645565b612e44565b600061065b8260a00151836080015162015180612e44565b60006001600160e01b0319821663780e9d6360e01b148061065b575061065b82613817565b60008061343483612cb4565b6001600160a01b0316141592915050565b61344d612609565b6112f984848484613867565b60fb5460ff16610f8a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610720565b60006134ad826112ff565b90506134bd816000846001613445565b6134c6826112ff565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606884528285208054600019019055878552606790935281842080549091169055519293508492600080516020614b91833981519152908390a45050565b600054610100900460ff1661355a5760405162461bcd60e51b815260040161072090614a00565b60656135668382614586565b506066610bc88282614586565b600054610100900460ff1661359a5760405162461bcd60e51b815260040161072090614a00565b610f8a33612ccf565b600054610100900460ff16612cac5760405162461bcd60e51b815260040161072090614a00565b600054610100900460ff166135f15760405162461bcd60e51b815260040161072090614a00565b60fb805460ff19169055565b60008061360983610fde565b506040015163ffffffff169392505050565b600061362f846001600160a01b03166129f7565b1561371857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613666903390899088908890600401614ab4565b6020604051808303816000875af19250505080156136a1575060408051601f3d908101601f1916820190925261369e91810190614ae7565b60015b6136fe573d8080156136cf576040519150601f19603f3d011682016040523d82523d6000602084013e6136d4565b606091505b5080516000036136f65760405162461bcd60e51b815260040161072090614a62565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a5d565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137625772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b831061378c576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106137aa57662386f26fc10000830492506010015b6305f5e10083106137c2576305f5e100830492506008015b61271083106137d657612710830492506004015b606483106137e8576064830492506002015b600a831061065b5760010192915050565b600061023154826060015161380e91906144e0565b42101592915050565b60006001600160e01b031982166380ac58cd60e01b148061384857506001600160e01b03198216635b5e139f60e01b145b8061065b57506301ffc9a760e01b6001600160e01b031983161461065b565b60018111156138d65760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610720565b816001600160a01b0385166139325761392d81609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b613955565b836001600160a01b0316856001600160a01b03161461395557613955858261399b565b6001600160a01b0384166139715761396c81613a38565b613994565b846001600160a01b0316846001600160a01b031614613994576139948482613ae7565b5050505050565b600060016139a884611333565b6139b29190614645565b600083815260986020526040902054909150808214613a05576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b609954600090613a4a90600190614645565b6000838152609a602052604081205460998054939450909284908110613a7257613a726143fe565b906000526020600020015490508060998381548110613a9357613a936143fe565b6000918252602080832090910192909255828152609a90915260408082208490558582528120556099805480613acb57613acb614b04565b6001900381819060005260206000200160009055905550505050565b6000613af283611333565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a082019290925260c0810182905260e081019190915290565b6040518060e00160405280613bcf604051806101200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160e01b031981168114610f7757600080fd5b600060208284031215613c2757600080fd5b813561210c81613bff565b80356001600160a01b0381168114613c4957600080fd5b919050565b600060208284031215613c6057600080fd5b61210c82613c32565b6020808252825182820181905260009190848201906040850190845b81811015613ca157835183529284019291840191600101613c85565b50909695505050505050565b60005b83811015613cc8578181015183820152602001613cb0565b50506000910152565b60008151808452613ce9816020860160208601613cad565b601f01601f19169290920160200192915050565b60208152600061210c6020830184613cd1565b600060208284031215613d2257600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060408385031215613d5057600080fd5b613d5983613c32565b946020939093013593505050565b600080600060608486031215613d7c57600080fd5b613d8584613c32565b9250613d9360208501613c32565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715613ddb57613ddb613da3565b60405290565b60405161010081016001600160401b0381118282101715613ddb57613ddb613da3565b604051601f8201601f191681016001600160401b0381118282101715613e2c57613e2c613da3565b604052919050565b803563ffffffff81168114613c4957600080fd5b60006001600160401b03831115613e6157613e61613da3565b613e74601f8401601f1916602001613e04565b9050828152838383011115613e8857600080fd5b828260208301376000602084830101529392505050565b600082601f830112613eb057600080fd5b61210c83833560208501613e48565b60006020808385031215613ed257600080fd5b82356001600160401b0380821115613ee957600080fd5b818501915085601f830112613efd57600080fd5b613f05613db9565b80606080850189811115613f1857600080fd5b855b8181101561400657803586811115613f325760008081fd5b8701610100818d031215613f465760008081fd5b613f4e613de1565b613f5782613e34565b8152613f648a8301613e34565b8a8201526040613f75818401613e34565b90820152613f84828601613e34565b858201526080613f95818401613e34565b9082015260a0613fa6838201613e34565b9082015260c08281013589811115613fbe5760008081fd5b613fca8f828601613e9f565b82840152505060e08083013589811115613fe45760008081fd5b613ff08f828601613e9f565b9183019190915250865250938701938701613f1a565b50919998505050505050505050565b6040815263ffffffff83511660408201526000602084015161403f606084018263ffffffff169052565b50604084015163ffffffff8116608084015250606084015163ffffffff811660a084015250608084015163ffffffff811660c08401525060a084015163ffffffff811660e08401525060c0840151610100838101526140a2610140840182613cd1565b905060e0850151603f19848303016101208501526140c08282613cd1565b925050508260208301529392505050565b8015158114610f7757600080fd5b600080604083850312156140f257600080fd5b6140fb83613c32565b9150602083013561410b816140d1565b809150509250929050565b60006020828403121561412857600080fd5b813561210c816140d1565b6000806000806080858703121561414957600080fd5b61415285613c32565b935061416060208601613c32565b92506040850135915060608501356001600160401b0381111561418257600080fd5b8501601f8101871361419357600080fd5b6141a287823560208401613e48565b91505092959194509250565b600080604083850312156141c157600080fd5b823560ff811681146141d257600080fd5b91506141e060208401613e34565b90509250929050565b600080604083850312156141fc57600080fd5b61420583613c32565b91506141e060208401613c32565b6000602080838503121561422657600080fd5b82356001600160401b038082111561423d57600080fd5b818501915085601f83011261425157600080fd5b81358181111561426357614263613da3565b8060051b9150614274848301613e04565b818152918301840191848101908884111561428e57600080fd5b938501935b838510156142ac57843582529385019390850190614293565b98975050505050505050565b600061010063ffffffff808c168452808b166020850152808a1660408501528089166060850152808816608085015280871660a0850152508060c084015261430281840186613cd1565b905082810360e08401526143168185613cd1565b9b9a5050505050505050505050565b602080825282518282018190526000919060409081850190868401855b828110156143f157815180518051865287810151888701528681015187870152606080820151818801526080808301518189015260a080840151818a015260c080850151818b015260e0808601511515908b0152610100948501511515948a01949094528a8501516101208a0152898501516101408a0152918401516101608901528301516101808801528201516101a087015201516101c08501526101e09093019290850190600101614342565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161443c5761443c614414565b5060010190565b600181811c9082168061445757607f821691505b6020821081036117df57634e487b7160e01b600052602260045260246000fd5b60006020828403121561448957600080fd5b5051919050565b6020808252601e908201527f3a2042616c616e636520746f6f206c6f7720666f72206372656174696f6e0000604082015260600190565b6001600160a01b03929092168252602082015260400190565b8082018082111561065b5761065b614414565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f821115610bc857600081815260208120601f850160051c810160208610156145675750805b601f850160051c820191505b818110156133bf57828155600101614573565b81516001600160401b0381111561459f5761459f613da3565b6145b3816145ad8454614443565b84614540565b602080601f8311600181146145e857600084156145d05750858301515b600019600386901b1c1916600185901b1785556133bf565b600085815260208120601f198616915b82811015614617578886015182559484019460019091019084016145f8565b50858210156146355787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8181038181111561065b5761065b614414565b6000600160ff1b820161466d5761466d614414565b506000190190565b60006020828403121561468757600080fd5b815161210c816140d1565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b600081546146d181614443565b600182811680156146e957600181146146fe5761472d565b60ff198416875282151583028701945061472d565b8560005260208060002060005b858110156147245781548a82015290840190820161470b565b50505082870194505b5050505092915050565b600061474382846146c4565b6d79656c6c6f7772696e672e706e6760901b8152600e019392505050565b600061476d82846146c4565b6c677265656e72696e672e706e6760981b8152600d019392505050565b600061479682846146c4565b6a72656472696e672e706e6760a81b8152600b019392505050565b6000826147ce57634e487b7160e01b600052601260045260246000fd5b500490565b6b3d901134b6b0b3b2911d101160a11b815283516000906147fb81600c850160208901613cad565b71222c202261747472696275746573223a205b60701b600c918401918201527f7b2274726169745f74797065223a202274797065222c202276616c7565223a20601e820152601160f91b603e820152845161485d81603f840160208901613cad565b7f227d2c207b2274726169745f74797065223a2022746f6b656e73222c20227661603f929091019182015266363ab2911d101160c91b605f82015283516148ab816066840160208801613cad565b63227d5d7d60e01b60669290910191820152606a0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161490181601d850160208701613cad565b91909101601d0192915050565b6020808252601990820152780e88151a1a5cc81c9a5b99c8191bd95cdb89dd08195e1a5cdd603a1b604082015260600190565b808201828112600083128015821682158216171561496157614961614414565b505092915050565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6000600160ff1b82016149f9576149f9614414565b5060000390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b808202811582820484141761065b5761065b614414565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612e9990830184613cd1565b600060208284031215614af957600080fd5b815161210c81613bff565b634e487b7160e01b600052603160045260246000fdfe697066733a2f2f516d657638386d4275504b327852476155385141545366764c6b796f5a726a71555a45636f7667624d7a4b5a39762f4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220668aba688a70993d0552bc4ffc0c3f9a460e48da828e030fa6a83c59aa9a742764736f6c63430008130033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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