ETH Price: $2,455.13 (-1.31%)

Token

iZUMi DAO veNFT (veiZi)
 

Overview

Max Total Supply

485 veiZi

Holders

326

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Balance
1 veiZi
0xe3071f78fbc34c0043820229283cc3b5621b75dc
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:
veiZi

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 20 runs

Other Settings:
default evmVersion
File 1 of 19 : veiZi.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;

import "./libraries/multicall.sol";
import "./libraries/Math.sol";
import "./libraries/FixedPoints.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';

// import "hardhat/console.sol";

contract veiZi is Ownable, Multicall, ReentrancyGuard, ERC721Enumerable, IERC721Receiver {
    using SafeERC20 for IERC20;
    
    /// @dev Point of epochs
    /// for each epoch, y = bias - (t - timestamp) * slope
    struct Point {
        int256 bias;
        int256 slope;
        // start of segment
        uint256 timestamp;
    }

    /// @dev locked info of a nft
    struct LockedBalance {
        // amount of token locked
        int256 amount;
        // end block
        uint256 end;
    }

    int128 constant DEPOSIT_FOR_TYPE = 0;
    int128 constant CREATE_LOCK_TYPE = 1;
    int128 constant INCREASE_LOCK_AMOUNT = 2;
    int128 constant INCREASE_UNLOCK_TIME = 3;

    /// @notice emit if successfully deposit (calling increaseAmount, createLock, increaseUnlockTime)
    /// @param nftId id of nft, starts from 1
    /// @param value amount of token locked
    /// @param lockBlk end block
    /// @param depositType createLock / increaseAmount / increaseUnlockTime / depositFor
    /// @param timestamp start timestamp
    event Deposit(uint256 indexed nftId, uint256 value, uint256 indexed lockBlk, int128 depositType, uint256 timestamp);

    /// @notice emit if successfuly withdraw
    /// @param nftId id of nft, starts from 1
    /// @param value amount of token released
    /// @param timestamp block timestamp when calling withdraw(...)
    event Withdraw(uint256 indexed nftId, uint256 value, uint256 timestamp);

    /// @notice emit if an user successfully staked a nft
    /// @param nftId id of nft, starts from 1
    /// @param owner address of user
    event Stake(uint256 indexed nftId, address indexed owner);

    /// @notice emit if an user unstaked a staked nft
    /// @param nftId id of nft, starts from 1
    /// @param owner address of user
    event Unstake(uint256 indexed nftId, address indexed owner);

    /// @notice emit if the total amount of locked token changes
    /// @param preSupply total amount before change
    /// @param supply total amount after change
    event Supply(uint256 preSupply, uint256 supply);

    /// @notice number of block in a week (estimated)
    uint256 public WEEK;
    /// @notice number of block for 4 years
    uint256 public MAXTIME;
    /// @notice block delta 
    uint256 public secondsPerBlockX64;

    /// @notice erc-20 token to lock
    address public token;
    /// @notice total amount of locked token
    uint256 public supply;

    /// @notice num of nft generated
    uint256 public nftNum = 0;

    /// @notice locked info for each nft
    mapping(uint256 => LockedBalance) public nftLocked;

    uint256 public epoch;

    /// @notice weight-curve(veiZi amount) of total-weight for all nft
    mapping(uint256 => Point) public pointHistory;
    mapping(uint256 => int256) public slopeChanges;

    /// @notice weight-curve of each nft
    mapping(uint256 => mapping(uint256 => Point)) public nftPointHistory;
    mapping(uint256 => uint256) public nftPointEpoch;

    /// @notice total num of nft staked
    uint256 public stakeNum = 0; // +1 every time when calling stake(...)
    /// @notice total amount of staked iZi
    uint256 public stakeiZiAmount = 0;

    struct StakingStatus {
        uint256 stakingId;
        uint256 lockAmount;
        uint256 lastVeiZi;
        uint256 lastTouchBlock;
        uint256 lastTouchAccRewardPerShare;
    }
    
    /// @notice nftId to staking status
    mapping(uint256 => StakingStatus) public stakingStatus;
    /// @notice owner address of staked nft
    mapping(uint256 => address) public stakedNftOwners;
    /// @notice nftid the user staked, 0 for no staked. each user can stake at most 1 nft
    mapping(address => uint256) public stakedNft;

    string public baseTokenURI;

    mapping(uint256 => address) public delegateAddress;

    struct RewardInfo {
        /// @dev who provides reward
        address provider;
        /// @dev Accumulated Reward Tokens per share, times Q128.
        uint256 accRewardPerShare;
        /// @dev Reward amount for each block.
        uint256 rewardPerBlock;
        /// @dev Last block number that the accRewardRerShare is touched.
        uint256 lastTouchBlock;

        /// @dev The block number when NFT mining rewards starts/ends.
        uint256 startBlock;
        /// @dev The block number when NFT mining rewards starts/ends.
        uint256 endBlock;
    }

    /// @dev reward infos
    RewardInfo public rewardInfo;

    modifier checkAuth(uint256 nftId, bool allowStaked) {
        bool auth = _isApprovedOrOwner(msg.sender, nftId);
        if (allowStaked) {
            auth = auth || (stakedNft[msg.sender] == nftId);
        }
        require(auth, "Not Owner or Not exist!");
        _;
    }

    /// @notice constructor
    /// @param tokenAddr address of locked token
    /// @param _rewardInfo reward info
    constructor(address tokenAddr, RewardInfo memory _rewardInfo) ERC721("iZUMi DAO veNFT", "veiZi") {
        token = tokenAddr;
        pointHistory[0].timestamp = block.timestamp;

        WEEK = 7 * 24 * 3600;
        MAXTIME = (4 * 365 + 1) * 24 * 3600;

        rewardInfo = _rewardInfo;
        rewardInfo.accRewardPerShare = 0;
        rewardInfo.lastTouchBlock = Math.max(_rewardInfo.startBlock, block.number);

    }

    /// @notice Used for ERC721 safeTransferFrom
    function onERC721Received(address, address, uint256, bytes memory) 
        public 
        virtual 
        override 
        returns (bytes4) 
    {
        return this.onERC721Received.selector;
    }

    /// @notice get slope of last epoch of weight-curve of an nft
    /// @param nftId id of nft, starts from 1
    function getLastNftSlope(uint256 nftId) external view returns(int256) {
        uint256 uepoch = nftPointEpoch[nftId];
        return nftPointHistory[nftId][uepoch].slope;
    }

    struct CheckPointState {
        int256 oldDslope;
        int256 newDslope;
        uint256 _epoch;
    }

    function _checkPoint(uint256 nftId, LockedBalance memory oldLocked, LockedBalance memory newLocked) internal {

        Point memory uOld;
        Point memory uNew;
        CheckPointState memory cpState;
        cpState.oldDslope = 0;
        cpState.newDslope = 0;
        cpState._epoch = epoch;

        if (nftId != 0) {
            if (oldLocked.end > block.timestamp && oldLocked.amount > 0) {
                uOld.slope = oldLocked.amount / int256(MAXTIME);
                uOld.bias = uOld.slope * int256(oldLocked.end - block.timestamp);
            }
            if (newLocked.end > block.timestamp && newLocked.amount > 0) {
                uNew.slope = newLocked.amount / int256(MAXTIME);
                uNew.bias = uNew.slope * int256(newLocked.end - block.timestamp);
            }
            cpState.oldDslope = slopeChanges[oldLocked.end];
            if (newLocked.end != 0) {
                if (newLocked.end == oldLocked.end) {
                    cpState.newDslope = cpState.oldDslope;
                } else {
                    cpState.newDslope = slopeChanges[newLocked.end];
                }
            }
        }

        Point memory lastPoint = Point({bias: 0, slope: 0, timestamp: block.timestamp});
        if (cpState._epoch > 0) {
            lastPoint = pointHistory[cpState._epoch];
        }
        uint256 lastCheckPoint = lastPoint.timestamp;

        uint256 ti = (lastCheckPoint / WEEK) * WEEK;
        
        for (uint24 i = 0; i < 255; i ++) {
            ti += WEEK;
            int256 dSlope = 0;
            if (ti > block.timestamp) {
                ti = block.timestamp;
            } else {
                dSlope = slopeChanges[ti];
            }
            // ti >= lastCheckPoint
            
            lastPoint.bias -= lastPoint.slope * int256(ti - lastCheckPoint);
            lastPoint.slope += dSlope;
            if (lastPoint.bias < 0) {
                lastPoint.bias = 0;
            }
            if (lastPoint.slope < 0) {
                lastPoint.slope = 0;
            }
            lastCheckPoint = ti;
            lastPoint.timestamp = ti;
            if (ti == block.timestamp) {
                cpState._epoch += 1;
                break;
            } else {
                if (dSlope != 0) {
                    // slope changes
                    cpState._epoch += 1;
                    pointHistory[cpState._epoch] = lastPoint;
                }
            }
        }

        epoch = cpState._epoch;

        if (nftId != 0) {
            lastPoint.slope += (uNew.slope - uOld.slope);
            lastPoint.bias += (uNew.bias - uOld.bias);
            if (lastPoint.slope < 0) {
                lastPoint.slope = 0;
            }
            if (lastPoint.bias < 0) {
                lastPoint.bias = 0;
            }

        }

        pointHistory[cpState._epoch] = lastPoint;

        if (nftId != 0) {
            if (oldLocked.end > block.timestamp) {
                cpState.oldDslope += uOld.slope;
                if (newLocked.end == oldLocked.end) {
                    cpState.oldDslope -= uNew.slope;
                }
                slopeChanges[oldLocked.end] = cpState.oldDslope;
            }
            if (newLocked.end > block.timestamp) {
                if (newLocked.end > oldLocked.end) {
                    cpState.newDslope -= uNew.slope;
                    slopeChanges[newLocked.end] = cpState.newDslope;
                }
            }
            uint256 nftEpoch = nftPointEpoch[nftId] + 1;
            uNew.timestamp = block.timestamp;
            nftPointHistory[nftId][nftEpoch] = uNew;
            nftPointEpoch[nftId] = nftEpoch;
        }
        
    }

    function _depositFor(uint256 nftId, uint256 _value, uint256 unlockTime, LockedBalance memory lockedBalance, int128 depositType) internal {
        
        LockedBalance memory _locked = lockedBalance;
        uint256 supplyBefore = supply;

        supply = supplyBefore + _value;

        LockedBalance memory oldLocked = LockedBalance({amount: _locked.amount, end: _locked.end});

        _locked.amount += int256(_value);

        if (unlockTime != 0) {
            _locked.end = unlockTime;
        }
        _checkPoint(nftId, oldLocked, _locked);
        nftLocked[nftId] = _locked;
        if (_value != 0) {
            IERC20(token).safeTransferFrom(msg.sender, address(this), _value);
        }
        emit Deposit(nftId, _value, _locked.end, depositType, block.timestamp);
        emit Supply(supplyBefore, supplyBefore + _value);
    }

    /// @notice update global curve status to current block
    function checkPoint() external {
        _checkPoint(0, LockedBalance({amount: 0, end: 0}), LockedBalance({amount: 0, end: 0}));
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    function setBaseURI(string calldata baseURI) external onlyOwner {
        baseTokenURI = baseURI;
    }

    /// @notice create a new lock and generate a new nft
    /// @param _value amount of token to lock
    /// @param _unlockTime future timestamp to unlock
    /// @return nftId id of generated nft, starts from 1
    function createLock(uint256 _value, uint256 _unlockTime) external nonReentrant returns(uint256 nftId) {
        uint256 unlockTime = (_unlockTime / WEEK) * WEEK;
        nftNum ++;
        nftId = nftNum; // id starts from 1
        _mint(msg.sender, nftId);
        LockedBalance memory _locked = nftLocked[nftId];
        require(_value > 0, "Amount should >0");
        require(_locked.amount == 0, "Withdraw old tokens first");
        require(unlockTime > block.timestamp, "Can only lock until time in the future");
        require(unlockTime <= block.timestamp + MAXTIME, "Voting lock can be 4 years max");
        _depositFor(nftId, _value, unlockTime, _locked, CREATE_LOCK_TYPE);
    }

    /// @notice increase amount of locked token in an nft
    /// @param nftId id of nft, starts from 1
    /// @param _value increase amount
    function increaseAmount(uint256 nftId, uint256 _value) external nonReentrant {
        LockedBalance memory _locked = nftLocked[nftId];
        require(_value > 0, "Amount should >0");
        require(_locked.end > block.timestamp, "Can only lock until time in the future");
        _depositFor(nftId, _value, 0, _locked, (msg.sender == ownerOf(nftId) || stakedNft[msg.sender] == nftId) ? INCREASE_LOCK_AMOUNT : DEPOSIT_FOR_TYPE);
        if (stakingStatus[nftId].stakingId != 0) {
            _updateGlobalStatus();
            // this nft is staking
            // donot collect reward
            stakeiZiAmount += _value;
            stakingStatus[nftId].lockAmount += _value;
        }
    }

    /// @notice increase unlock time of an nft
    /// @param nftId id of nft
    /// @param _unlockTime future block number to unlock
    function increaseUnlockTime(uint256 nftId, uint256 _unlockTime) external checkAuth(nftId, true) nonReentrant {
        LockedBalance memory _locked = nftLocked[nftId];
        uint256 unlockTime = (_unlockTime / WEEK) * WEEK;

        require(unlockTime > _locked.end, "Can only increase unlock time");
        require(unlockTime > block.timestamp, "Can only lock until time in the future");
        require(unlockTime <= block.timestamp + MAXTIME, "Voting lock can be 4 years max");

        _depositFor(nftId, 0, unlockTime, _locked, INCREASE_UNLOCK_TIME);
        if (stakingStatus[nftId].stakingId != 0) {
            // this nft is staking
            address stakingOwner = stakedNftOwners[nftId];
            _collectReward(nftId, stakingOwner);
        }
    }

    /// @notice withdraw an unstaked-nft
    /// @param nftId id of nft
    function withdraw(uint256 nftId) external checkAuth(nftId, false) nonReentrant {
        LockedBalance memory _locked = nftLocked[nftId];
        require(block.timestamp >= _locked.end, "The lock didn't expire");
        uint256 value = uint256(_locked.amount);

        LockedBalance memory oldLocked = LockedBalance({amount: _locked.amount, end: _locked.end});
        _locked.end = 0;
        _locked.amount  = 0;
        nftLocked[nftId] = _locked;
        uint256 supplyBefore = supply;
        supply = supplyBefore - value;

        _checkPoint(nftId, oldLocked, _locked);
        IERC20(token).safeTransfer(msg.sender, value);

        emit Withdraw(nftId, value, block.timestamp);
        emit Supply(supplyBefore, supplyBefore - value);
    }

    /// @notice burn an unstaked-nft (dangerous!!!)
    /// @param nftId id of nft
    function burn(uint256 nftId) external checkAuth(nftId, false) nonReentrant {
        LockedBalance memory _locked = nftLocked[nftId];
        require(_locked.amount == 0, "Not Withdrawed!");
        _burn(nftId);
    }

    /// @notice merge nftFrom to nftTo
    /// @param nftFrom nft id of nftFrom, cannot be staked, owner must be msg.sender
    /// @param nftTo nft id of nftTo, cannot be staked, owner must be msg.sender
    function merge(uint256 nftFrom, uint256 nftTo) external nonReentrant {
        require(_isApprovedOrOwner(msg.sender, nftFrom), "Not Owner of nftFrom");
        require(_isApprovedOrOwner(msg.sender, nftTo), "Not Owner of nftTo");
        require(stakingStatus[nftFrom].stakingId == 0, "nftFrom is staked");
        require(stakingStatus[nftTo].stakingId == 0, "nftTo is staked");
        require(nftFrom != nftTo, 'Same nft!');

        LockedBalance memory lockedFrom = nftLocked[nftFrom];
        LockedBalance memory lockedTo = nftLocked[nftTo];
        require(lockedTo.end >= lockedFrom.end, "Endblock: nftFrom > nftTo");

        // cancel lockedFrom in the weight-curve
        _checkPoint(nftFrom, LockedBalance({amount: lockedFrom.amount, end: lockedFrom.end}), LockedBalance({amount: 0, end: lockedFrom.end}));

        // add locked iZi of nftFrom to nftTo
        _checkPoint(nftTo, LockedBalance({amount: lockedTo.amount, end: lockedTo.end}), LockedBalance({amount: lockedTo.amount + lockedFrom.amount, end: lockedTo.end}));
        nftLocked[nftFrom].amount = 0;
        nftLocked[nftTo].amount = lockedTo.amount + lockedFrom.amount;
    }

    function _findTimestampEpoch(uint256 _timestamp, uint256 maxEpoch) internal view returns(uint256) {
        uint256 _min = 0;
        uint256 _max = maxEpoch;
        for (uint24 i = 0; i < 128; i ++) {
            if (_min >= _max) {
                break;
            }
            uint256 _mid = (_min + _max + 1) / 2;
            if (pointHistory[_mid].timestamp <= _timestamp) {
                _min = _mid;
            } else {
                _max = _mid - 1;
            }
        }
        return _min;
    }

    function _findNftTimestampEpoch(uint256 nftId, uint256 _timestamp) internal view returns(uint256) {

        uint256 _min = 0;
        uint256 _max = nftPointEpoch[nftId];

        for (uint24 i = 0; i < 128; i ++) {
            if (_min >= _max) {
                break;
            }
            uint256 _mid = (_min + _max + 1) / 2;
            if (nftPointHistory[nftId][_mid].timestamp <= _timestamp) {
                _min = _mid;
            } else {
                _max = _mid - 1;
            }
        }
        return _min;
    }

    /// @notice weight of nft (veiZi amount) at certain time after latest update of that nft
    /// @param nftId id of nft
    /// @param timestamp specified timestamp after latest update of this nft (amount change or end change)
    /// @return weight
    function nftVeiZi(uint256 nftId, uint256 timestamp) public view returns(uint256) {
        uint256 _epoch = nftPointEpoch[nftId];
        if (_epoch == 0) {
            return 0;
        } else {
            Point memory lastPoint = nftPointHistory[nftId][_epoch];
            require(timestamp >= lastPoint.timestamp, "Too early");
            lastPoint.bias -= lastPoint.slope * int256(timestamp - lastPoint.timestamp);
            if (lastPoint.bias < 0) {
                lastPoint.bias = 0;
            }
            return uint256(lastPoint.bias);
        }
    }
    
    /// @notice weight of nft (veiZi amount) at certain time
    /// @param nftId id of nft
    /// @param timestamp specified timestamp after latest update of this nft (amount change or end change)
    /// @return weight
    function nftVeiZiAt(uint256 nftId, uint256 timestamp) public view returns(uint256) {

        uint256 targetEpoch = _findNftTimestampEpoch(nftId, timestamp);
        Point memory uPoint = nftPointHistory[nftId][targetEpoch];
        if (timestamp < uPoint.timestamp) {
            return 0;
        }
        uPoint.bias -= uPoint.slope * (int256(timestamp) - int256(uPoint.timestamp));
        if (uPoint.bias < 0) {
            uPoint.bias = 0;
        }
        return uint256(uPoint.bias);
    }

    function _totalVeiZiAt(Point memory point, uint256 timestamp) internal view returns(uint256) {
        Point memory lastPoint = point;
        uint256 ti = (lastPoint.timestamp / WEEK) * WEEK;
        for (uint24 i = 0; i < 255; i ++) {
            ti += WEEK;
            int256 dSlope = 0;
            if (ti > timestamp) {
                ti = timestamp;
            } else {
                dSlope = slopeChanges[ti];
            }
            lastPoint.bias -= lastPoint.slope * int256(ti - lastPoint.timestamp);
            if (lastPoint.bias <= 0) {
                lastPoint.bias = 0;
                break;
            }
            if (ti == timestamp) {
                break;
            }
            lastPoint.slope += dSlope;
            lastPoint.timestamp = ti;
        }
        return uint256(lastPoint.bias);
    }

    /// @notice total weight of all nft at a certain time after check-point of all-nft-collection's curve
    /// @param timestamp specified blockNumber, "certain time" in above line
    /// @return total weight
    function totalVeiZi(uint256 timestamp) external view returns(uint256) {
        uint256 _epoch = epoch;
        Point memory lastPoint = pointHistory[_epoch];
        require(timestamp >= lastPoint.timestamp, "Too Early");
        return _totalVeiZiAt(lastPoint, timestamp);
    }

    /// @notice total weight of all nft at a certain time
    /// @param timestamp specified blockNumber, "certain time" in above line
    /// @return total weight
    function totalVeiZiAt(uint256 timestamp) external view returns(uint256) {
        uint256 _epoch = epoch;
        uint256 targetEpoch = _findTimestampEpoch(timestamp, _epoch);

        Point memory point = pointHistory[targetEpoch];
        if (timestamp < point.timestamp) {
            return 0;
        }
        if (targetEpoch == _epoch) {
            return _totalVeiZiAt(point, timestamp);
        } else {
            point.bias = point.bias - point.slope * (int256(timestamp) - int256(point.timestamp));
            if (point.bias < 0) {
                point.bias = 0;
            }
            return uint256(point.bias);
        }
    }

    function _updateStakingStatus(uint256 nftId) internal {
        StakingStatus storage t = stakingStatus[nftId];
        t.lastTouchBlock = rewardInfo.lastTouchBlock;
        t.lastTouchAccRewardPerShare = rewardInfo.accRewardPerShare;
        t.lastVeiZi = t.lockAmount / MAXTIME * (Math.max(block.timestamp, nftLocked[nftId].end) - block.timestamp);
    }

    /// @notice Collect pending reward for a single veizi-nft. 
    /// @param nftId The related position id.
    /// @param recipient who acquires reward
    function _collectReward(uint256 nftId, address recipient) internal {
        StakingStatus memory t = stakingStatus[nftId];
        
        _updateGlobalStatus();
        uint256 reward = (t.lastVeiZi * (rewardInfo.accRewardPerShare - t.lastTouchAccRewardPerShare)) / FixedPoints.Q128;
        if (reward > 0) {
            IERC20(token).safeTransferFrom(
                rewardInfo.provider,
                recipient,
                reward
            );
        }
        _updateStakingStatus(nftId);
    }

    function setDelegateAddress(uint256 nftId, address addr) external checkAuth(nftId, true) nonReentrant {
        delegateAddress[nftId] = addr;
    }

    function _beforeTokenTransfer(address from, address to, uint256 nftId) internal virtual override {
        super._beforeTokenTransfer(from, to, nftId);
        // when calling stake() or unStake() (to is contract address, or from is contract address)
        // delegateAddress will not change
        if (from != address(this) && to != address(this)) {
            delegateAddress[nftId] = address(0);
        }
    }

    /// @notice stake an nft
    /// @param nftId id of nft
    function stake(uint256 nftId) external nonReentrant {
        require(nftLocked[nftId].end > block.timestamp, "Lock expired");
        // nftId starts from 1, zero or not owner(including staked) cannot be transfered
        safeTransferFrom(msg.sender, address(this), nftId);
        require(stakedNft[msg.sender] == 0, "Has Staked!");

        _updateGlobalStatus();

        stakedNft[msg.sender] = nftId;
        stakedNftOwners[nftId] = msg.sender;

        stakeNum += 1;
        uint256 lockAmount = uint256(nftLocked[nftId].amount);
        stakingStatus[nftId] = StakingStatus({
            stakingId: stakeNum,
            lockAmount: lockAmount,
            lastVeiZi: lockAmount / MAXTIME * (Math.max(block.timestamp, nftLocked[nftId].end) - block.timestamp),
            lastTouchBlock: rewardInfo.lastTouchBlock,
            lastTouchAccRewardPerShare: rewardInfo.accRewardPerShare
        });
        stakeiZiAmount += lockAmount;

        emit Stake(nftId, msg.sender);
    }

    /// @notice unstake an nft
    function unStake() external nonReentrant {
        uint256 nftId = stakedNft[msg.sender];
        require(nftId != 0, "No Staked Nft!");
        stakingStatus[nftId].stakingId = 0;
        stakedNft[msg.sender] = 0;
        stakedNftOwners[nftId] = address(0);
        _collectReward(nftId, msg.sender);
        // refund nft
        // note we can not use safeTransferFrom here because the
        // opterator is msg.sender who is not approved
        _safeTransfer(address(this), msg.sender, nftId, "");

        stakeiZiAmount -= uint256(nftLocked[nftId].amount);
        emit Unstake(nftId, msg.sender);
    }

    /// @notice get user's staking info
    /// @param user address of user
    /// @return nftId id of veizi-nft
    /// @return stakingId id of stake
    /// @return amount amount of locked iZi in nft
    function stakingInfo(address user) external view returns(uint256 nftId, uint256 stakingId, uint256 amount) {
        nftId = stakedNft[user];
        if (nftId != 0) {
            stakingId = stakingStatus[nftId].stakingId;
            amount = uint256(nftLocked[nftId].amount);
            uint256 remainBlock = Math.max(nftLocked[nftId].end, block.timestamp) - block.timestamp;
            amount = amount / MAXTIME * remainBlock;
        } else {
            stakingId = 0;
            amount = 0;
        }
    }
    
    /// @notice Update the global status.
    function _updateGlobalStatus() internal {
        if (block.number <= rewardInfo.lastTouchBlock) {
            return;
        }
        if (rewardInfo.lastTouchBlock >= rewardInfo.endBlock) {
            return;
        }
        uint256 currBlockNumber = Math.min(block.number, rewardInfo.endBlock);
        if (stakeiZiAmount == 0) {
            rewardInfo.lastTouchBlock = currBlockNumber;
            return;
        }

        // tokenReward < 2^25 * 2^64 * 2^10, 15 years, 1000 r/block
        uint256 tokenReward = (currBlockNumber - rewardInfo.lastTouchBlock) * rewardInfo.rewardPerBlock;
        // tokenReward * Q128 < 2^(25 + 64 + 10 + 128)
        rewardInfo.accRewardPerShare = rewardInfo.accRewardPerShare + ((tokenReward * FixedPoints.Q128) / stakeiZiAmount);
        
        rewardInfo.lastTouchBlock = currBlockNumber;
    }

    /// @notice Return reward multiplier over the given _from to _to block.
    /// @param _from The start block.
    /// @param _to The end block.
    function _getRewardBlockNum(uint256 _from, uint256 _to)
        internal
        view
        returns (uint256)
    {
        if (_from > _to) {
            return 0;
        }
        if (_to <= rewardInfo.endBlock) {
            return _to - _from;
        } else if (_from >= rewardInfo.endBlock) {
            return 0;
        } else {
            return rewardInfo.endBlock - _from;
        }
    }

    /// @notice View function to see pending Reward for a staked NFT.
    /// @param nftId The staked NFT id.
    /// @return reward iZi reward amount
    function pendingRewardOfToken(uint256 nftId)
        public
        view
        returns (uint256 reward)
    {
        reward = 0;
        StakingStatus memory t = stakingStatus[nftId];
        if (t.stakingId != 0) {
            // we are sure that stakeiZiAmount is not 0
            uint256 tokenReward = _getRewardBlockNum(
                rewardInfo.lastTouchBlock,
                block.number
            ) * rewardInfo.rewardPerBlock;
            // we are sure that stakeiZiAmount >= t.lockAmount > 0
            uint256 rewardPerShare = rewardInfo.accRewardPerShare + (tokenReward * FixedPoints.Q128) / stakeiZiAmount;
            // l * (currentAcc - lastAcc)
            reward = (t.lastVeiZi * (rewardPerShare - t.lastTouchAccRewardPerShare)) / FixedPoints.Q128;
        }
    }

    /// @notice View function to see pending Reward for a user.
    /// @param user The related user address.
    /// @return reward iZi reward amount
    function pendingRewardOfAddress(address user)
        public
        view
        returns (uint256 reward)
    {
        reward = 0;
        uint256 nftId = stakedNft[user];
        if (nftId != 0) {
            reward = pendingRewardOfToken(nftId);
        }
    }

    /// @notice collect pending reward if some user has a staked veizi-nft
    function collect() external nonReentrant {
        uint256 nftId = stakedNft[msg.sender];
        require(nftId != 0, 'No Staked veizi-nft!');
        _collectReward(nftId, msg.sender);
    }


    /// @notice Set new reward end block.
    /// @param endBlock New end block.
    function modifyEndBlock(uint256 endBlock) external onlyOwner {
        require(endBlock > block.number, "OUT OF DATE");
        _updateGlobalStatus();
        // jump if origin endBlock < block.number
        rewardInfo.lastTouchBlock = block.number;
        rewardInfo.endBlock = endBlock;
    }

    /// @notice Set new reward per block.
    /// @param _rewardPerBlock new reward per block
    function modifyRewardPerBlock(uint256 _rewardPerBlock)
        external
        onlyOwner
    {
        _updateGlobalStatus();
        rewardInfo.rewardPerBlock = _rewardPerBlock;
    }

    function modifyStartBlock(uint256 startBlock) external onlyOwner {
        require(rewardInfo.startBlock > block.number, 'has started!');
        require(startBlock > block.number, 'Too Early!');
        require(startBlock < rewardInfo.endBlock, 'Too Late!');
        rewardInfo.startBlock = startBlock;
        rewardInfo.lastTouchBlock = startBlock; // before start, lastTouchBlock = max(block.number, startBlock)
    }


    /// @notice Set new reward provider.
    /// @param provider New provider
    function modifyProvider(address provider)
        external
        onlyOwner
    {
        rewardInfo.provider = provider;
    }
}

File 2 of 19 : multicall.sol
//  SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

/// @title Multicall
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall {
    function multicall(bytes[] calldata data) external payable returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(data[i]);

            if (!success) {
                // Next 5 lines from https://ethereum.stackexchange.com/a/83577
                if (result.length < 68) revert();
                assembly {
                    result := add(result, 0x04)
                }
                revert(abi.decode(result, (string)));
            }

            results[i] = result;
        }
    }
}

File 3 of 19 : Math.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title Simple math library for Max and Min.
library Math {
    function max(int24 a, int24 b) internal pure returns (int24) {
        return a >= b ? a : b;
    }

    function min(int24 a, int24 b) internal pure returns (int24) {
        return a < b ? a : b;
    }

    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function tickFloor(int24 tick, int24 tickSpacing)
        internal
        pure
        returns (int24)
    {
        int24 c = tick / tickSpacing;
        if (tick < 0 && tick % tickSpacing != 0) {
            c = c - 1;
        }
        c = c * tickSpacing;
        return c;
    }

    function tickUpper(int24 tick, int24 tickSpacing)
        internal
        pure
        returns (int24)
    {
        int24 c = tick / tickSpacing;
        if (tick > 0 && tick % tickSpacing != 0) {
            c = c + 1;
        }
        c = c * tickSpacing;
        return c;
    }
}

File 4 of 19 : FixedPoints.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

library FixedPoints {
    uint256 constant Q32 = (1 << 32);
    uint256 constant Q64 = (1 << 64);
    uint256 constant Q96 = (1 << 96);
    uint256 constant Q128 = (1 << 128);
    uint256 constant Q160 = (1 << 160);
}

File 5 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

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

File 6 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 9 of 19 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 10 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 11 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

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

pragma solidity ^0.8.0;

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

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _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: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

    /**
     * @dev Safely mints `tokenId` 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);

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 15 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"tokenAddr","type":"address"},{"components":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"lastTouchBlock","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"}],"internalType":"struct veiZi.RewardInfo","name":"_rewardInfo","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"lockBlk","type":"uint256"},{"indexed":false,"internalType":"int128","name":"depositType","type":"int128"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"preSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"Supply","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":true,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAXTIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"createLock","outputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"delegateAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"getLastNftSlope","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"increaseAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"increaseUnlockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftFrom","type":"uint256"},{"internalType":"uint256","name":"nftTo","type":"uint256"}],"name":"merge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"modifyEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"modifyProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"modifyRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startBlock","type":"uint256"}],"name":"modifyStartBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftLocked","outputs":[{"internalType":"int256","name":"amount","type":"int256"},{"internalType":"uint256","name":"end","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftPointEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftPointHistory","outputs":[{"internalType":"int256","name":"bias","type":"int256"},{"internalType":"int256","name":"slope","type":"int256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"nftVeiZi","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"nftVeiZiAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","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":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingRewardOfAddress","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"pendingRewardOfToken","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pointHistory","outputs":[{"internalType":"int256","name":"bias","type":"int256"},{"internalType":"int256","name":"slope","type":"int256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardInfo","outputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"lastTouchBlock","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","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":"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":[],"name":"secondsPerBlockX64","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"addr","type":"address"}],"name":"setDelegateAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"slopeChanges","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakedNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedNftOwners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeiZiAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"stakingInfo","outputs":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"stakingId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakingStatus","outputs":[{"internalType":"uint256","name":"stakingId","type":"uint256"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"uint256","name":"lastVeiZi","type":"uint256"},{"internalType":"uint256","name":"lastTouchBlock","type":"uint256"},{"internalType":"uint256","name":"lastTouchAccRewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"totalVeiZi","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"totalVeiZiAt","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":"unStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000601155600060185560006019553480156200002057600080fd5b506040516200522e3803806200522e8339810160408190526200004391620002be565b6040518060400160405280600f81526020016e1a5695535a48111053c81d99539195608a1b815250604051806040016040528060058152602001647665695a6960d81b815250620000a36200009d6200018c60201b60201c565b62000190565b600180558151620000bc906002906020850190620001fb565b508051620000d2906003906020840190620001fb565b5050600f80546001600160a01b038086166001600160a01b031992831617909255600080805260146020908152427f4f26c3876aa9f4b92579780beea1161a61f87ebf1ec6ee865b299e447ecba99e5562093a80600c556307861f80600d558551601f805491909516931692909217909255604084015160215560608401516022556080840151602381905560a0850151602455918155620001809250439062002af9620001e0821b17901c565b60225550620003ae9050565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081831015620001f25781620001f4565b825b9392505050565b828054620002099062000371565b90600052602060002090601f0160209004810192826200022d576000855562000278565b82601f106200024857805160ff191683800117855562000278565b8280016001018555821562000278579182015b82811115620002785782518255916020019190600101906200025b565b50620002869291506200028a565b5090565b5b808211156200028657600081556001016200028b565b80516001600160a01b0381168114620002b957600080fd5b919050565b60008082840360e0811215620002d2578283fd5b620002dd84620002a1565b925060c0601f1982011215620002f1578182fd5b5060405160c081016001600160401b03811182821017156200032157634e487b7160e01b83526041600452602483fd5b6040526200033260208501620002a1565b815260408401516020820152606084015160408201526080840151606082015260a0840151608082015260c084015160a0820152809150509250929050565b600181811c908216806200038657607f821691505b60208210811415620003a857634e487b7160e01b600052602260045260246000fd5b50919050565b614e7080620003be6000396000f3fe6080604052600436106102fe5760003560e01c80638da5cb5b1161019d578063d1c2babb116100e8578063d1c2babb146109ed578063d547cfb714610a0d578063d62dd3a614610a22578063d8b6676414610a42578063e278751d14610a78578063e522538114610a98578063e5743bc814610aad578063e985e9c514610ac3578063ee00ef3a14610ae3578063ee274e5514610af9578063f105a1df14610b0f578063f185976d14610b2f578063f2fde38b14610ba1578063f4359ce514610bc1578063f52a36f714610bd7578063f7f0b4d614610c04578063fc0c546a14610c4d57600080fd5b80638da5cb5b146107cd578063900cf0cf146107e257806394eecb50146107f857806395d89b41146108185780639d507b8b1461082d578063a22cb4651461084d578063a694fc3a1461086d578063ac9650d81461088d578063b2383e55146108ad578063b396dabc146108cd578063b52c05fe146108ed578063b88d4fde1461090d578063c87b56dd1461092d578063c9f670721461094d578063cd79b9aa146109b8578063cff805ab146109d857600080fd5b806301ffc9a714610303578063047fc9aa1461033857806306fdde031461035c578063081812fc1461037e578063095ea7b3146103b6578063099139f6146103d8578063150b7a021461043a57806318160ddd1461047357806323b872dd1461048857806329a07636146104a85780632bdd4efb146104de5780632e1a7d4d146104f45780632f745c59146105145780633ce043e1146105345780633d2ebc36146105545780634181a17b1461057457806342842e0e1461058a57806342966c68146105aa57806349162641146105ca5780634f6ccce7146105ea57806355a4010e1461060a57806355f804b3146106375780635d429637146106575780635f1e119d146106845780636352211e146106a457806370a08231146106c4578063715018a6146106e457806373cf575a146106f95780637d65588c1461070e5780638042bea51461072e5780638ad4c447146107715780638d6e8325146107ad575b600080fd5b34801561030f57600080fd5b5061032361031e36600461464e565b610c6d565b60405190151581526020015b60405180910390f35b34801561034457600080fd5b5061034e60105481565b60405190815260200161032f565b34801561036857600080fd5b50610371610c98565b60405161032f91906148d2565b34801561038a57600080fd5b5061039e610399366004614752565b610d2a565b6040516001600160a01b03909116815260200161032f565b3480156103c257600080fd5b506103d66103d136600461459a565b610db7565b005b3480156103e457600080fd5b5061041f6103f336600461478c565b601660209081526000928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161032f565b34801561044657600080fd5b5061045a6104553660046144c2565b610ec8565b6040516001600160e01b0319909116815260200161032f565b34801561047f57600080fd5b50600a5461034e565b34801561049457600080fd5b506103d66104a3366004614487565b610ed9565b3480156104b457600080fd5b5061039e6104c3366004614752565b601e602052600090815260409020546001600160a01b031681565b3480156104ea57600080fd5b5061034e60115481565b34801561050057600080fd5b506103d661050f366004614752565b610f0a565b34801561052057600080fd5b5061034e61052f36600461459a565b6110ef565b34801561054057600080fd5b5061034e61054f366004614752565b611185565b34801561056057600080fd5b506103d661056f366004614752565b61125b565b34801561058057600080fd5b5061034e600e5481565b34801561059657600080fd5b506103d66105a5366004614487565b61134d565b3480156105b657600080fd5b506103d66105c5366004614752565b611368565b3480156105d657600080fd5b5061034e6105e536600461478c565b61145c565b3480156105f657600080fd5b5061034e610605366004614752565b611502565b34801561061657600080fd5b5061034e610625366004614752565b60176020526000908152604090205481565b34801561064357600080fd5b506103d6610652366004614686565b6115a3565b34801561066357600080fd5b5061034e61067236600461443b565b601c6020526000908152604090205481565b34801561069057600080fd5b506103d661069f36600461476a565b6115de565b3480156106b057600080fd5b5061039e6106bf366004614752565b61168e565b3480156106d057600080fd5b5061034e6106df36600461443b565b611705565b3480156106f057600080fd5b506103d661178c565b34801561070557600080fd5b506103d66117c7565b34801561071a57600080fd5b506103d6610729366004614752565b6118f9565b34801561073a57600080fd5b5061034e610749366004614752565b6000908152601760209081526040808320546016835281842090845290915290206001015490565b34801561077d57600080fd5b5061041f61078c366004614752565b60146020526000908152604090208054600182015460029092015490919083565b3480156107b957600080fd5b506103d66107c836600461443b565b611935565b3480156107d957600080fd5b5061039e611986565b3480156107ee57600080fd5b5061034e60135481565b34801561080457600080fd5b5061041f61081336600461443b565b611995565b34801561082457600080fd5b50610371611a24565b34801561083957600080fd5b506103d661084836600461478c565b611a33565b34801561085957600080fd5b506103d6610868366004614564565b611bde565b34801561087957600080fd5b506103d6610888366004614752565b611bed565b6108a061089b3660046145c3565b611e11565b60405161032f9190614871565b3480156108b957600080fd5b506103d66108c836600461478c565b611f92565b3480156108d957600080fd5b5061034e6108e836600461443b565b6120d8565b3480156108f957600080fd5b5061034e61090836600461478c565b612107565b34801561091957600080fd5b506103d66109283660046144c2565b612264565b34801561093957600080fd5b50610371610948366004614752565b61229c565b34801561095957600080fd5b50601f54602054602154602254602354602454610981956001600160a01b0316949392919086565b604080516001600160a01b0390971687526020870195909552938501929092526060840152608083015260a082015260c00161032f565b3480156109c457600080fd5b5061034e6109d3366004614752565b612366565b3480156109e457600080fd5b506103d6612414565b3480156109f957600080fd5b506103d6610a0836600461478c565b61244c565b348015610a1957600080fd5b50610371612736565b348015610a2e57600080fd5b506103d6610a3d366004614752565b6127c4565b348015610a4e57600080fd5b5061039e610a5d366004614752565b601b602052600090815260409020546001600160a01b031681565b348015610a8457600080fd5b5061034e610a9336600461478c565b612841565b348015610aa457600080fd5b506103d6612920565b348015610ab957600080fd5b5061034e60185481565b348015610acf57600080fd5b50610323610ade366004614455565b6129ad565b348015610aef57600080fd5b5061034e600d5481565b348015610b0557600080fd5b5061034e60195481565b348015610b1b57600080fd5b5061034e610b2a366004614752565b6129db565b348015610b3b57600080fd5b50610b79610b4a366004614752565b601a60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a00161032f565b348015610bad57600080fd5b506103d6610bbc36600461443b565b612a59565b348015610bcd57600080fd5b5061034e600c5481565b348015610be357600080fd5b5061034e610bf2366004614752565b60156020526000908152604090205481565b348015610c1057600080fd5b50610c38610c1f366004614752565b6012602052600090815260409020805460019091015482565b6040805192835260208301919091520161032f565b348015610c5957600080fd5b50600f5461039e906001600160a01b031681565b60006001600160e01b0319821663780e9d6360e01b1480610c925750610c9282612b10565b92915050565b606060028054610ca790614d2d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd390614d2d565b8015610d205780601f10610cf557610100808354040283529160200191610d20565b820191906000526020600020905b815481529060010190602001808311610d0357829003601f168201915b5050505050905090565b6000610d3582612b60565b610d9b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610dc28261168e565b9050806001600160a01b0316836001600160a01b03161415610e305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610d92565b336001600160a01b0382161480610e4c5750610e4c81336129ad565b610eb95760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610d92565b610ec38383612b7d565b505050565b630a85bd0160e11b5b949350505050565b610ee33382612beb565b610eff5760405162461bcd60e51b8152600401610d9290614a44565b610ec3838383612cad565b80600080610f183384612beb565b90508115610f3d578080610f3a5750336000908152601c602052604090205483145b90505b80610f5a5760405162461bcd60e51b8152600401610d9290614961565b60026001541415610f7d5760405162461bcd60e51b8152600401610d9290614a95565b600260019081556000858152601260209081526040918290208251808401909352805483529092015491810182905290421015610ff55760405162461bcd60e51b8152602060048201526016602482015275546865206c6f636b206469646e27742065787069726560501b6044820152606401610d92565b805160408051808201825283518152602080850180518284015260008082528087528a8152601290925292902084518155915160019092019190915560105461103e8382614cea565b60105561104c888386612e42565b600f54611063906001600160a01b03163385613303565b6040805184815242602082015289917fa01a72713bf837059e3a668d28f0de277fb7f24f2a4e95bf926703c95b5f12b2910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c816110c98582614cea565b6040805192835260208301919091520160405180910390a1505060018055505050505050565b60006110fa83611705565b821061115c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610d92565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b6000818152601a60209081526040808320815160a081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600401546080820152901561125557602154602254600091906111e89043613366565b6111f29190614c8c565b90506000601954600160801b836112099190614c8c565b6112139190614bf5565b6020546112209190614baf565b9050600160801b8360800151826112379190614cea565b84604001516112469190614c8c565b6112509190614bf5565b935050505b50919050565b33611264611986565b6001600160a01b03161461128a5760405162461bcd60e51b8152600401610d92906149c9565b60235443106112ca5760405162461bcd60e51b815260206004820152600c60248201526b68617320737461727465642160a01b6044820152606401610d92565b4381116113065760405162461bcd60e51b815260206004820152600a602482015269546f6f204561726c792160b01b6044820152606401610d92565b60245481106113435760405162461bcd60e51b8152602060048201526009602482015268546f6f204c6174652160b81b6044820152606401610d92565b6023819055602255565b610ec383838360405180602001604052806000815250612264565b806000806113763384612beb565b9050811561139b5780806113985750336000908152601c602052604090205483145b90505b806113b85760405162461bcd60e51b8152600401610d9290614961565b600260015414156113db5760405162461bcd60e51b8152600401610d9290614a95565b60026001908155600085815260126020908152604091829020825180840190935280548084529301549082015290156114485760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420576974686472617765642160881b6044820152606401610d92565b611451856133b1565b505060018055505050565b6000806114698484613446565b6000858152601660209081526040808320848452825291829020825160608101845281548152600182015492810192909252600201549181018290529192508410156114ba57600092505050610c92565b60408101516114c99085614cab565b81602001516114d89190614c09565b815182906114e7908390614cab565b9052508051600013156114f957600081525b51949350505050565b600061150d600a5490565b82106115705760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610d92565b600a828154811061159157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b336115ac611986565b6001600160a01b0316146115d25760405162461bcd60e51b8152600401610d92906149c9565b610ec3601d8383614365565b81600160006115ed3384612beb565b9050811561161257808061160f5750336000908152601c602052604090205483145b90505b8061162f5760405162461bcd60e51b8152600401610d9290614961565b600260015414156116525760405162461bcd60e51b8152600401610d9290614a95565b5050600260019081556000938452601e602052604090932080546001600160a01b0319166001600160a01b039390931692909217909155508055565b6000818152600460205260408120546001600160a01b031680610c925760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610d92565b60006001600160a01b0382166117705760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610d92565b506001600160a01b031660009081526005602052604090205490565b33611795611986565b6001600160a01b0316146117bb5760405162461bcd60e51b8152600401610d92906149c9565b6117c560006134ef565b565b600260015414156117ea5760405162461bcd60e51b8152600401610d9290614a95565b6002600155336000908152601c60205260409020548061183d5760405162461bcd60e51b815260206004820152600e60248201526d4e6f205374616b6564204e66742160901b6044820152606401610d92565b6000818152601a6020908152604080832083905533808452601c8352818420849055848452601b90925290912080546001600160a01b031916905561188390829061353f565b61189e303383604051806020016040528060008152506135f6565b60008181526012602052604081205460198054919290916118c0908490614cea565b9091555050604051339082907f4ac743692c9ced0a3f0052fb9917c0856b6b12671016afe41b649643a89b1ad590600090a35060018055565b33611902611986565b6001600160a01b0316146119285760405162461bcd60e51b8152600401610d92906149c9565b611930613629565b602155565b3361193e611986565b6001600160a01b0316146119645760405162461bcd60e51b8152600401610d92906149c9565b601f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b6001600160a01b0381166000908152601c602052604081205490808215611a165750506000818152601a60209081526040808320546012909252822080546001909101549192909142906119e99082612af9565b6119f39190614cea565b905080600d5483611a049190614bf5565b611a0e9190614c8c565b915050611a1d565b5060009050805b9193909250565b606060038054610ca790614d2d565b8160016000611a423384612beb565b90508115611a67578080611a645750336000908152601c602052604090205483145b90505b80611a845760405162461bcd60e51b8152600401610d9290614961565b60026001541415611aa75760405162461bcd60e51b8152600401610d9290614a95565b6002600190815560008681526012602090815260408083208151808301909252805482529093015490830152600c54611ae08188614bf5565b611aea9190614c8c565b905081602001518111611b3f5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c7920696e63726561736520756e6c6f636b2074696d650000006044820152606401610d92565b428111611b5e5760405162461bcd60e51b8152600401610d92906149fe565b600d54611b6b9042614baf565b811115611b8a5760405162461bcd60e51b8152600401610d9290614992565b611b99876000838560036136b6565b6000878152601a602052604090205415611bd1576000878152601b60205260409020546001600160a01b0316611bcf888261353f565b505b5050600180555050505050565b611be93383836137ed565b5050565b60026001541415611c105760405162461bcd60e51b8152600401610d9290614a95565b60026001908155600082815260126020526040902001544210611c645760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b6044820152606401610d92565b611c6f33308361134d565b336000908152601c602052604090205415611cba5760405162461bcd60e51b815260206004820152600b60248201526a486173205374616b65642160a81b6044820152606401610d92565b611cc2613629565b336000818152601c60209081526040808320859055848352601b909152812080546001600160a01b0319169092179091556018805460019290611d06908490614baf565b909155505060008181526012602081815260408084208054825160a08101845260185481528085018290529587905293909252600190910154919291908201904290611d53908290612af9565b611d5d9190614cea565b600d54611d6a9085614bf5565b611d749190614c8c565b815260225460208083019190915280546040928301526000858152601a8252828120845181559184015160018301559183015160028201556060830151600382015560809092015160049092019190915560198054839290611dd7908490614baf565b9091555050604051339083907f2bccdce62e5aec7ee273161a374088a6da4311d0e688784bde3c1cec8a3c003a90600090a3505060018055565b6060816001600160401b03811115611e3957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611e6c57816020015b6060815260200190600190039081611e575790505b50905060005b82811015611f8b5760008030868685818110611e9e57634e487b7160e01b600052603260045260246000fd5b9050602002810190611eb09190614acc565b604051611ebe9291906147d9565b600060405180830381855af49150503d8060008114611ef9576040519150601f19603f3d011682016040523d82523d6000602084013e611efe565b606091505b509150915081611f4a57604481511015611f1757600080fd5b60048101905080806020019051810190611f3191906146e0565b60405162461bcd60e51b8152600401610d9291906148d2565b80848481518110611f6b57634e487b7160e01b600052603260045260246000fd5b602002602001018190525050508080611f8390614d85565b915050611e72565b5092915050565b60026001541415611fb55760405162461bcd60e51b8152600401610d9290614a95565b600260019081556000838152601260209081526040918290208251808401909352805483529092015491810191909152816120025760405162461bcd60e51b8152600401610d9290614937565b428160200151116120255760405162461bcd60e51b8152600401610d92906149fe565b61207583836000846120368861168e565b6001600160a01b0316336001600160a01b031614806120635750336000908152601c602052604090205488145b61206e5760006136b6565b60026136b6565b6000838152601a6020526040902054156120cf57612091613629565b81601960008282546120a39190614baf565b90915550506000838152601a6020526040812060010180548492906120c9908490614baf565b90915550505b50506001805550565b6001600160a01b0381166000908152601c602052604081205480156112555761210081611185565b9392505050565b60006002600154141561212c5760405162461bcd60e51b8152600401610d9290614a95565b6002600155600c546000906121418185614bf5565b61214b9190614c8c565b60118054919250600061215d83614d85565b9190505550601154915061217133836138b8565b6000828152601260209081526040918290208251808401909352805483526001015490820152846121b45760405162461bcd60e51b8152600401610d9290614937565b8051156121ff5760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b6044820152606401610d92565b42821161221e5760405162461bcd60e51b8152600401610d92906149fe565b600d5461222b9042614baf565b82111561224a5760405162461bcd60e51b8152600401610d9290614992565b6122588386848460016136b6565b50506001805592915050565b61226e3383612beb565b61228a5760405162461bcd60e51b8152600401610d9290614a44565b612296848484846135f6565b50505050565b60606122a782612b60565b61230b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610d92565b60006123156139e4565b905060008151116123355760405180602001604052806000815250612100565b8061233f846139f3565b604051602001612350929190614805565b6040516020818303038152906040529392505050565b601354600090816123778483613b0c565b600081815260146020908152604091829020825160608101845281548152600182015492810192909252600201549181018290529192508510156123c057506000949350505050565b828214156123d2576112508186613b93565b60408101516123e19086614cab565b81602001516123f09190614c09565b81516123fc9190614cab565b808252600013156114f9576000815251949350505050565b6117c5600060405180604001604052806000815260200160008152506040518060400160405280600081526020016000815250612e42565b6002600154141561246f5760405162461bcd60e51b8152600401610d9290614a95565b600260015561247e3383612beb565b6124c15760405162461bcd60e51b81526020600482015260146024820152734e6f74204f776e6572206f66206e667446726f6d60601b6044820152606401610d92565b6124cb3382612beb565b61250c5760405162461bcd60e51b81526020600482015260126024820152714e6f74204f776e6572206f66206e6674546f60701b6044820152606401610d92565b6000828152601a60205260409020541561255c5760405162461bcd60e51b81526020600482015260116024820152701b999d119c9bdb481a5cc81cdd185ad959607a1b6044820152606401610d92565b6000818152601a6020526040902054156125aa5760405162461bcd60e51b815260206004820152600f60248201526e1b999d151bc81a5cc81cdd185ad959608a1b6044820152606401610d92565b808214156125e65760405162461bcd60e51b815260206004820152600960248201526853616d65206e66742160b81b6044820152606401610d92565b60008281526012602081815260408084208151808301835281548152600191820154818501908152878752948452948290208251808401909352805483520154918101829052915111156126785760405162461bcd60e51b8152602060048201526019602482015278456e64626c6f636b3a206e667446726f6d203e206e6674546f60381b6044820152606401610d92565b60408051808201825283518152602080850180518284015283518085019094526000845251908301526126ad91869190612e42565b6126fd8360405180604001604052808460000151815260200184602001518152506040518060400160405280866000015186600001516126ed9190614b6e565b8152602086810151910152612e42565b6000848152601260205260408120558151815161271a9190614b6e565b6000938452601260205260409093209290925550506001805550565b601d805461274390614d2d565b80601f016020809104026020016040519081016040528092919081815260200182805461276f90614d2d565b80156127bc5780601f10612791576101008083540402835291602001916127bc565b820191906000526020600020905b81548152906001019060200180831161279f57829003601f168201915b505050505081565b336127cd611986565b6001600160a01b0316146127f35760405162461bcd60e51b8152600401610d92906149c9565b4381116128305760405162461bcd60e51b815260206004820152600b60248201526a4f5554204f46204441544560a81b6044820152606401610d92565b612838613629565b43602255602455565b6000828152601760205260408120548061285f576000915050610c92565b600084815260166020908152604080832084845282529182902082516060810184528154815260018201549281019290925260020154918101829052908410156128d75760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b6044820152606401610d92565b60408101516128e69085614cea565b81602001516128f59190614c09565b81518290612904908390614cab565b90525080516000131561291657600081525b519150610c929050565b600260015414156129435760405162461bcd60e51b8152600401610d9290614a95565b6002600155336000908152601c60205260409020548061299c5760405162461bcd60e51b81526020600482015260146024820152734e6f205374616b6564207665697a692d6e66742160601b6044820152606401610d92565b6129a6813361353f565b5060018055565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b601354600081815260146020908152604080832081516060810183528154815260018201549381019390935260020154908201819052919291841015612a4f5760405162461bcd60e51b8152602060048201526009602482015268546f6f204561726c7960b81b6044820152606401610d92565b610ed18185613b93565b33612a62611986565b6001600160a01b031614612a885760405162461bcd60e51b8152600401610d92906149c9565b6001600160a01b038116612aed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d92565b612af6816134ef565b50565b600081831015612b095781612100565b5090919050565b60006001600160e01b031982166380ac58cd60e01b1480612b4157506001600160e01b03198216635b5e139f60e01b145b80610c9257506301ffc9a760e01b6001600160e01b0319831614610c92565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612bb28261168e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612bf682612b60565b612c575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d92565b6000612c628361168e565b9050806001600160a01b0316846001600160a01b03161480612c9d5750836001600160a01b0316612c9284610d2a565b6001600160a01b0316145b80610ed15750610ed181856129ad565b826001600160a01b0316612cc08261168e565b6001600160a01b031614612d245760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610d92565b6001600160a01b038216612d865760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d92565b612d91838383613c89565b612d9c600082612b7d565b6001600160a01b0383166000908152600560205260408120805460019290612dc5908490614cea565b90915550506001600160a01b0382166000908152600560205260408120805460019290612df3908490614baf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020614e1b83398151915291a4505050565b612e4a6143e9565b612e526143e9565b612e7660405180606001604052806000815260200160008152602001600081525090565b6000808252602082015260135460408201528515612f8357428560200151118015612ea2575084516000125b15612edf57600d548551612eb69190614bc7565b602080850191909152850151612ecd904290614cea565b8360200151612edc9190614c09565b83525b428460200151118015612ef3575083516000125b15612f3057600d548451612f079190614bc7565b602080840191909152840151612f1e904290614cea565b8260200151612f2d9190614c09565b82525b6020808601516000908152601582526040902054825284015115612f8357846020015184602001511415612f6a5780516020820152612f83565b6020808501516000908152601582526040902054908201525b604080516060810182526000808252602082015242818301529082015115612fe057506040808201516000908152601460209081529082902082516060810184528154815260018201549281019290925260020154918101919091525b6040810151600c54600090612ff58184614bf5565b612fff9190614c8c565b905060005b60ff8162ffffff16101561313857600c5461301f9083614baf565b915060004283111561303357429250613044565b506000828152601560205260409020545b61304e8484614cea565b856020015161305d9190614c09565b8551869061306c908390614cab565b905250602085018051829190613083908390614b6e565b90525084516000131561309557600085525b6000856020015112156130aa57600060208601525b604085018390529192508291428314156130db576001866040018181516130d19190614baf565b9052506131389050565b8015613125576001866040018181516130f49190614baf565b9052506040808701516000908152601460209081529082902087518155908701516001820155908601516002909101555b508061313081614d62565b915050613004565b50604084015160135588156131b3578560200151856020015161315b9190614cab565b8360200181815161316c9190614b6e565b9052508551855161317d9190614cab565b8351849061318c908390614b6e565b9052506020830151600013156131a457600060208401525b8251600013156131b357600083525b60408085015160009081526014602090815290829020855181559085015160018201559084015160029091015588156132f857428860200151111561324957602086015184518590613206908390614b6e565b9052506020808901519088015114156132315760208501518451859061322d908390614cab565b9052505b83516020808a01516000908152601590915260409020555b4287602001511115613299578760200151876020015111156132995784602001518460200181815161327b9190614cab565b90525060208085015188820151600090815260159092526040909120555b6000898152601760205260408120546132b3906001614baf565b42604080890191825260008d81526016602090815282822085835281528282208b518155818c0151600182015593516002909401939093558d81526017909252902055505b505050505050505050565b6040516001600160a01b038316602482015260448101829052610ec390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613cdb565b60008183111561337857506000610c92565b60245482116133925761338b8383614cea565b9050610c92565b60245483106133a357506000610c92565b60245461338b908490614cea565b60006133bc8261168e565b90506133ca81600084613c89565b6133d5600083612b7d565b6001600160a01b03811660009081526005602052604081208054600192906133fe908490614cea565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020614e1b833981519152908390a45050565b6000828152601760205260408120548190815b60808162ffffff1610156134e557818310613473576134e5565b600060026134818486614baf565b61348c906001614baf565b6134969190614bf5565b600088815260166020908152604080832084845290915290206002015490915086106134c4578093506134d2565b6134cf600182614cea565b92505b50806134dd81614d62565b915050613459565b5090949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152601a6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101546080820152613592613629565b6000600160801b8260800151601f600101546135ae9190614cea565b83604001516135bd9190614c8c565b6135c79190614bf5565b905080156135ed57601f54600f546135ed916001600160a01b0391821691168584613dad565b61229684613de5565b613601848484612cad565b61360d84848484613e4d565b6122965760405162461bcd60e51b8152600401610d92906148e5565b602254431161363457565b6024546022541061364157565b600061365243601f60050154613f5e565b90506019546000141561366457602255565b602154602254600091906136789084614cea565b6136829190614c8c565b601954909150613696600160801b83614c8c565b6136a09190614bf5565b6020546136ad9190614baf565b60205550602255565b60105482906136c58682614baf565b6010556040805180820190915282518152602080840151908201528251879084906136f1908390614b6e565b905250851561370257602083018690525b61370d888285612e42565b60008881526012602090815260409091208451815590840151600190910155861561374a57600f5461374a906001600160a01b031633308a613dad565b8260200151887f621b671f614e8ed2023af3e491b3d2d895533d7d964005535af4c018d208967489874260405161379793929190928352600f9190910b6020830152604082015260600190565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c826137cb8982614baf565b6040805192835260208301919091520160405180910390a15050505050505050565b816001600160a01b0316836001600160a01b0316141561384b5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610d92565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03821661390e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d92565b61391781612b60565b156139635760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610d92565b61396f60008383613c89565b6001600160a01b0382166000908152600560205260408120805460019290613998908490614baf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020614e1b833981519152908290a45050565b6060601d8054610ca790614d2d565b606081613a175750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a415780613a2b81614d85565b9150613a3a9050600a83614bf5565b9150613a1b565b6000816001600160401b03811115613a6957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613a93576020820181803683370190505b5090505b8415610ed157613aa8600183614cea565b9150613ab5600a86614da0565b613ac0906030614baf565b60f81b818381518110613ae357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613b05600a86614bf5565b9450613a97565b60008082815b60808162ffffff1610156134e557818310613b2c576134e5565b60006002613b3a8486614baf565b613b45906001614baf565b613b4f9190614bf5565b6000818152601460205260409020600201549091508710613b7257809350613b80565b613b7d600182614cea565b92505b5080613b8b81614d62565b915050613b12565b6000808390506000600c54600c548360400151613bb09190614bf5565b613bba9190614c8c565b905060005b60ff8162ffffff161015613c7f57600c54613bda9083614baf565b9150600085831115613bee57859250613bff565b506000828152601560205260409020545b6040840151613c0e9084614cea565b8460200151613c1d9190614c09565b84518590613c2c908390614cab565b9052508351600012613c42575060008352613c7f565b85831415613c505750613c7f565b8084602001818151613c629190614b6e565b905250506040830182905280613c7781614d62565b915050613bbf565b5050519392505050565b613c94838383613f6d565b6001600160a01b0383163014801590613cb657506001600160a01b0382163014155b15610ec3576000908152601e6020526040902080546001600160a01b03191690555050565b6000613d30826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166140259092919063ffffffff16565b805190915015610ec35780806020019051810190613d4e9190614632565b610ec35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d92565b6040516001600160a01b03808516602483015283166044820152606481018290526122969085906323b872dd60e01b9060840161332f565b6000818152601a602090815260408083206022546003820155825460048201556012909252909120600101544290613e1e908290612af9565b613e289190614cea565b600d548260010154613e3a9190614bf5565b613e449190614c8c565b60029091015550565b6000613e61846001600160a01b0316614034565b15613f5657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613e98903390899088908890600401614834565b602060405180830381600087803b158015613eb257600080fd5b505af1925050508015613ee2575060408051601f3d908101601f19168201909252613edf9181019061466a565b60015b613f3c573d808015613f10576040519150601f19603f3d011682016040523d82523d6000602084013e613f15565b606091505b508051613f345760405162461bcd60e51b8152600401610d92906148e5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610ed1565b506001610ed1565b6000818310612b095781612100565b6001600160a01b038316613fc857613fc381600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b613feb565b816001600160a01b0316836001600160a01b031614613feb57613feb8382614043565b6001600160a01b03821661400257610ec3816140e0565b826001600160a01b0316826001600160a01b031614610ec357610ec382826141b9565b6060610ed184846000856141fd565b6001600160a01b03163b151590565b6000600161405084611705565b61405a9190614cea565b6000838152600960205260409020549091508082146140ad576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a546000906140f290600190614cea565b6000838152600b6020526040812054600a805493945090928490811061412857634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a838154811061415757634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061419d57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006141c483611705565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b60608247101561425e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610d92565b61426785614034565b6142b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d92565b600080866001600160a01b031685876040516142cf91906147e9565b60006040518083038185875af1925050503d806000811461430c576040519150601f19603f3d011682016040523d82523d6000602084013e614311565b606091505b509150915061432182828661432c565b979650505050505050565b6060831561433b575081612100565b82511561434b5782518084602001fd5b8160405162461bcd60e51b8152600401610d9291906148d2565b82805461437190614d2d565b90600052602060002090601f01602090048101928261439357600085556143d9565b82601f106143ac5782800160ff198235161785556143d9565b828001600101855582156143d9579182015b828111156143d95782358255916020019190600101906143be565b506143e592915061440a565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156143e5576000815560010161440b565b80356001600160a01b038116811461443657600080fd5b919050565b60006020828403121561444c578081fd5b6121008261441f565b60008060408385031215614467578081fd5b6144708361441f565b915061447e6020840161441f565b90509250929050565b60008060006060848603121561449b578081fd5b6144a48461441f565b92506144b26020850161441f565b9150604084013590509250925092565b600080600080608085870312156144d7578081fd5b6144e08561441f565b93506144ee6020860161441f565b92506040850135915060608501356001600160401b0381111561450f578182fd5b8501601f8101871361451f578182fd5b803561453261452d82614b47565b614b17565b818152886020838501011115614546578384fd5b81602084016020830137908101602001929092525092959194509250565b60008060408385031215614576578182fd5b61457f8361441f565b9150602083013561458f81614df6565b809150509250929050565b600080604083850312156145ac578182fd5b6145b58361441f565b946020939093013593505050565b600080602083850312156145d5578182fd5b82356001600160401b03808211156145eb578384fd5b818501915085601f8301126145fe578384fd5b81358181111561460c578485fd5b8660208260051b8501011115614620578485fd5b60209290920196919550909350505050565b600060208284031215614643578081fd5b815161210081614df6565b60006020828403121561465f578081fd5b813561210081614e04565b60006020828403121561467b578081fd5b815161210081614e04565b60008060208385031215614698578182fd5b82356001600160401b03808211156146ae578384fd5b818501915085601f8301126146c1578384fd5b8135818111156146cf578485fd5b866020828501011115614620578485fd5b6000602082840312156146f1578081fd5b81516001600160401b03811115614706578182fd5b8201601f81018413614716578182fd5b805161472461452d82614b47565b818152856020838501011115614738578384fd5b614749826020830160208601614d01565b95945050505050565b600060208284031215614763578081fd5b5035919050565b6000806040838503121561477c578182fd5b8235915061447e6020840161441f565b6000806040838503121561479e578182fd5b50508035926020909101359150565b600081518084526147c5816020860160208601614d01565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b600082516147fb818460208701614d01565b9190910192915050565b60008351614817818460208801614d01565b83519083019061482b818360208801614d01565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614867908301846147ad565b9695505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156148c557603f198886030184526148b38583516147ad565b94509285019290850190600101614897565b5092979650505050505050565b60208152600061210060208301846147ad565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526010908201526f0416d6f756e742073686f756c64203e360841b604082015260600190565b6020808252601790820152764e6f74204f776e6572206f72204e6f742065786973742160481b604082015260600190565b6020808252601e908201527f566f74696e67206c6f636b2063616e2062652034207965617273206d61780000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f43616e206f6e6c79206c6f636b20756e74696c2074696d6520696e207468652060408201526566757475726560d01b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000808335601e19843603018112614ae2578283fd5b8301803591506001600160401b03821115614afb578283fd5b602001915036819003821315614b1057600080fd5b9250929050565b604051601f8201601f191681016001600160401b0381118282101715614b3f57614b3f614de0565b604052919050565b60006001600160401b03821115614b6057614b60614de0565b50601f01601f191660200190565b600080821280156001600160ff1b0384900385131615614b9057614b90614db4565b600160ff1b8390038412811615614ba957614ba9614db4565b50500190565b60008219821115614bc257614bc2614db4565b500190565b600082614bd657614bd6614dca565b600160ff1b821460001984141615614bf057614bf0614db4565b500590565b600082614c0457614c04614dca565b500490565b60006001600160ff1b0381841382841380821686840486111615614c2f57614c2f614db4565b600160ff1b84871282811687830589121615614c4d57614c4d614db4565b858712925087820587128484161615614c6857614c68614db4565b87850587128184161615614c7e57614c7e614db4565b505050929093029392505050565b6000816000190483118215151615614ca657614ca6614db4565b500290565b60008083128015600160ff1b850184121615614cc957614cc9614db4565b6001600160ff1b0384018313811615614ce457614ce4614db4565b50500390565b600082821015614cfc57614cfc614db4565b500390565b60005b83811015614d1c578181015183820152602001614d04565b838111156122965750506000910152565b600181811c90821680614d4157607f821691505b6020821081141561125557634e487b7160e01b600052602260045260246000fd5b600062ffffff80831681811415614d7b57614d7b614db4565b6001019392505050565b6000600019821415614d9957614d99614db4565b5060010190565b600082614daf57614daf614dca565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114612af657600080fd5b6001600160e01b031981168114612af657600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220701eb1ab96dcb560a7c5b37324bef0e3c0e0f407b074f71dc56ecf15fa3d5b2364736f6c634300080400330000000000000000000000009ad37205d608b8b219e6a2573f922094cec5c200000000000000000000000000fa0ad5f78d1fc96def92ef7252b8a548edf6d1310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f51c291b9262a9b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000db8350000000000000000000000000000000000000000000000000000000000892fa10

Deployed Bytecode

0x6080604052600436106102fe5760003560e01c80638da5cb5b1161019d578063d1c2babb116100e8578063d1c2babb146109ed578063d547cfb714610a0d578063d62dd3a614610a22578063d8b6676414610a42578063e278751d14610a78578063e522538114610a98578063e5743bc814610aad578063e985e9c514610ac3578063ee00ef3a14610ae3578063ee274e5514610af9578063f105a1df14610b0f578063f185976d14610b2f578063f2fde38b14610ba1578063f4359ce514610bc1578063f52a36f714610bd7578063f7f0b4d614610c04578063fc0c546a14610c4d57600080fd5b80638da5cb5b146107cd578063900cf0cf146107e257806394eecb50146107f857806395d89b41146108185780639d507b8b1461082d578063a22cb4651461084d578063a694fc3a1461086d578063ac9650d81461088d578063b2383e55146108ad578063b396dabc146108cd578063b52c05fe146108ed578063b88d4fde1461090d578063c87b56dd1461092d578063c9f670721461094d578063cd79b9aa146109b8578063cff805ab146109d857600080fd5b806301ffc9a714610303578063047fc9aa1461033857806306fdde031461035c578063081812fc1461037e578063095ea7b3146103b6578063099139f6146103d8578063150b7a021461043a57806318160ddd1461047357806323b872dd1461048857806329a07636146104a85780632bdd4efb146104de5780632e1a7d4d146104f45780632f745c59146105145780633ce043e1146105345780633d2ebc36146105545780634181a17b1461057457806342842e0e1461058a57806342966c68146105aa57806349162641146105ca5780634f6ccce7146105ea57806355a4010e1461060a57806355f804b3146106375780635d429637146106575780635f1e119d146106845780636352211e146106a457806370a08231146106c4578063715018a6146106e457806373cf575a146106f95780637d65588c1461070e5780638042bea51461072e5780638ad4c447146107715780638d6e8325146107ad575b600080fd5b34801561030f57600080fd5b5061032361031e36600461464e565b610c6d565b60405190151581526020015b60405180910390f35b34801561034457600080fd5b5061034e60105481565b60405190815260200161032f565b34801561036857600080fd5b50610371610c98565b60405161032f91906148d2565b34801561038a57600080fd5b5061039e610399366004614752565b610d2a565b6040516001600160a01b03909116815260200161032f565b3480156103c257600080fd5b506103d66103d136600461459a565b610db7565b005b3480156103e457600080fd5b5061041f6103f336600461478c565b601660209081526000928352604080842090915290825290208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161032f565b34801561044657600080fd5b5061045a6104553660046144c2565b610ec8565b6040516001600160e01b0319909116815260200161032f565b34801561047f57600080fd5b50600a5461034e565b34801561049457600080fd5b506103d66104a3366004614487565b610ed9565b3480156104b457600080fd5b5061039e6104c3366004614752565b601e602052600090815260409020546001600160a01b031681565b3480156104ea57600080fd5b5061034e60115481565b34801561050057600080fd5b506103d661050f366004614752565b610f0a565b34801561052057600080fd5b5061034e61052f36600461459a565b6110ef565b34801561054057600080fd5b5061034e61054f366004614752565b611185565b34801561056057600080fd5b506103d661056f366004614752565b61125b565b34801561058057600080fd5b5061034e600e5481565b34801561059657600080fd5b506103d66105a5366004614487565b61134d565b3480156105b657600080fd5b506103d66105c5366004614752565b611368565b3480156105d657600080fd5b5061034e6105e536600461478c565b61145c565b3480156105f657600080fd5b5061034e610605366004614752565b611502565b34801561061657600080fd5b5061034e610625366004614752565b60176020526000908152604090205481565b34801561064357600080fd5b506103d6610652366004614686565b6115a3565b34801561066357600080fd5b5061034e61067236600461443b565b601c6020526000908152604090205481565b34801561069057600080fd5b506103d661069f36600461476a565b6115de565b3480156106b057600080fd5b5061039e6106bf366004614752565b61168e565b3480156106d057600080fd5b5061034e6106df36600461443b565b611705565b3480156106f057600080fd5b506103d661178c565b34801561070557600080fd5b506103d66117c7565b34801561071a57600080fd5b506103d6610729366004614752565b6118f9565b34801561073a57600080fd5b5061034e610749366004614752565b6000908152601760209081526040808320546016835281842090845290915290206001015490565b34801561077d57600080fd5b5061041f61078c366004614752565b60146020526000908152604090208054600182015460029092015490919083565b3480156107b957600080fd5b506103d66107c836600461443b565b611935565b3480156107d957600080fd5b5061039e611986565b3480156107ee57600080fd5b5061034e60135481565b34801561080457600080fd5b5061041f61081336600461443b565b611995565b34801561082457600080fd5b50610371611a24565b34801561083957600080fd5b506103d661084836600461478c565b611a33565b34801561085957600080fd5b506103d6610868366004614564565b611bde565b34801561087957600080fd5b506103d6610888366004614752565b611bed565b6108a061089b3660046145c3565b611e11565b60405161032f9190614871565b3480156108b957600080fd5b506103d66108c836600461478c565b611f92565b3480156108d957600080fd5b5061034e6108e836600461443b565b6120d8565b3480156108f957600080fd5b5061034e61090836600461478c565b612107565b34801561091957600080fd5b506103d66109283660046144c2565b612264565b34801561093957600080fd5b50610371610948366004614752565b61229c565b34801561095957600080fd5b50601f54602054602154602254602354602454610981956001600160a01b0316949392919086565b604080516001600160a01b0390971687526020870195909552938501929092526060840152608083015260a082015260c00161032f565b3480156109c457600080fd5b5061034e6109d3366004614752565b612366565b3480156109e457600080fd5b506103d6612414565b3480156109f957600080fd5b506103d6610a0836600461478c565b61244c565b348015610a1957600080fd5b50610371612736565b348015610a2e57600080fd5b506103d6610a3d366004614752565b6127c4565b348015610a4e57600080fd5b5061039e610a5d366004614752565b601b602052600090815260409020546001600160a01b031681565b348015610a8457600080fd5b5061034e610a9336600461478c565b612841565b348015610aa457600080fd5b506103d6612920565b348015610ab957600080fd5b5061034e60185481565b348015610acf57600080fd5b50610323610ade366004614455565b6129ad565b348015610aef57600080fd5b5061034e600d5481565b348015610b0557600080fd5b5061034e60195481565b348015610b1b57600080fd5b5061034e610b2a366004614752565b6129db565b348015610b3b57600080fd5b50610b79610b4a366004614752565b601a60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a00161032f565b348015610bad57600080fd5b506103d6610bbc36600461443b565b612a59565b348015610bcd57600080fd5b5061034e600c5481565b348015610be357600080fd5b5061034e610bf2366004614752565b60156020526000908152604090205481565b348015610c1057600080fd5b50610c38610c1f366004614752565b6012602052600090815260409020805460019091015482565b6040805192835260208301919091520161032f565b348015610c5957600080fd5b50600f5461039e906001600160a01b031681565b60006001600160e01b0319821663780e9d6360e01b1480610c925750610c9282612b10565b92915050565b606060028054610ca790614d2d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd390614d2d565b8015610d205780601f10610cf557610100808354040283529160200191610d20565b820191906000526020600020905b815481529060010190602001808311610d0357829003601f168201915b5050505050905090565b6000610d3582612b60565b610d9b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610dc28261168e565b9050806001600160a01b0316836001600160a01b03161415610e305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610d92565b336001600160a01b0382161480610e4c5750610e4c81336129ad565b610eb95760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776044820152771b995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b60421b6064820152608401610d92565b610ec38383612b7d565b505050565b630a85bd0160e11b5b949350505050565b610ee33382612beb565b610eff5760405162461bcd60e51b8152600401610d9290614a44565b610ec3838383612cad565b80600080610f183384612beb565b90508115610f3d578080610f3a5750336000908152601c602052604090205483145b90505b80610f5a5760405162461bcd60e51b8152600401610d9290614961565b60026001541415610f7d5760405162461bcd60e51b8152600401610d9290614a95565b600260019081556000858152601260209081526040918290208251808401909352805483529092015491810182905290421015610ff55760405162461bcd60e51b8152602060048201526016602482015275546865206c6f636b206469646e27742065787069726560501b6044820152606401610d92565b805160408051808201825283518152602080850180518284015260008082528087528a8152601290925292902084518155915160019092019190915560105461103e8382614cea565b60105561104c888386612e42565b600f54611063906001600160a01b03163385613303565b6040805184815242602082015289917fa01a72713bf837059e3a668d28f0de277fb7f24f2a4e95bf926703c95b5f12b2910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c816110c98582614cea565b6040805192835260208301919091520160405180910390a1505060018055505050505050565b60006110fa83611705565b821061115c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610d92565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b6000818152601a60209081526040808320815160a081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600401546080820152901561125557602154602254600091906111e89043613366565b6111f29190614c8c565b90506000601954600160801b836112099190614c8c565b6112139190614bf5565b6020546112209190614baf565b9050600160801b8360800151826112379190614cea565b84604001516112469190614c8c565b6112509190614bf5565b935050505b50919050565b33611264611986565b6001600160a01b03161461128a5760405162461bcd60e51b8152600401610d92906149c9565b60235443106112ca5760405162461bcd60e51b815260206004820152600c60248201526b68617320737461727465642160a01b6044820152606401610d92565b4381116113065760405162461bcd60e51b815260206004820152600a602482015269546f6f204561726c792160b01b6044820152606401610d92565b60245481106113435760405162461bcd60e51b8152602060048201526009602482015268546f6f204c6174652160b81b6044820152606401610d92565b6023819055602255565b610ec383838360405180602001604052806000815250612264565b806000806113763384612beb565b9050811561139b5780806113985750336000908152601c602052604090205483145b90505b806113b85760405162461bcd60e51b8152600401610d9290614961565b600260015414156113db5760405162461bcd60e51b8152600401610d9290614a95565b60026001908155600085815260126020908152604091829020825180840190935280548084529301549082015290156114485760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420576974686472617765642160881b6044820152606401610d92565b611451856133b1565b505060018055505050565b6000806114698484613446565b6000858152601660209081526040808320848452825291829020825160608101845281548152600182015492810192909252600201549181018290529192508410156114ba57600092505050610c92565b60408101516114c99085614cab565b81602001516114d89190614c09565b815182906114e7908390614cab565b9052508051600013156114f957600081525b51949350505050565b600061150d600a5490565b82106115705760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610d92565b600a828154811061159157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b336115ac611986565b6001600160a01b0316146115d25760405162461bcd60e51b8152600401610d92906149c9565b610ec3601d8383614365565b81600160006115ed3384612beb565b9050811561161257808061160f5750336000908152601c602052604090205483145b90505b8061162f5760405162461bcd60e51b8152600401610d9290614961565b600260015414156116525760405162461bcd60e51b8152600401610d9290614a95565b5050600260019081556000938452601e602052604090932080546001600160a01b0319166001600160a01b039390931692909217909155508055565b6000818152600460205260408120546001600160a01b031680610c925760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610d92565b60006001600160a01b0382166117705760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610d92565b506001600160a01b031660009081526005602052604090205490565b33611795611986565b6001600160a01b0316146117bb5760405162461bcd60e51b8152600401610d92906149c9565b6117c560006134ef565b565b600260015414156117ea5760405162461bcd60e51b8152600401610d9290614a95565b6002600155336000908152601c60205260409020548061183d5760405162461bcd60e51b815260206004820152600e60248201526d4e6f205374616b6564204e66742160901b6044820152606401610d92565b6000818152601a6020908152604080832083905533808452601c8352818420849055848452601b90925290912080546001600160a01b031916905561188390829061353f565b61189e303383604051806020016040528060008152506135f6565b60008181526012602052604081205460198054919290916118c0908490614cea565b9091555050604051339082907f4ac743692c9ced0a3f0052fb9917c0856b6b12671016afe41b649643a89b1ad590600090a35060018055565b33611902611986565b6001600160a01b0316146119285760405162461bcd60e51b8152600401610d92906149c9565b611930613629565b602155565b3361193e611986565b6001600160a01b0316146119645760405162461bcd60e51b8152600401610d92906149c9565b601f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b6001600160a01b0381166000908152601c602052604081205490808215611a165750506000818152601a60209081526040808320546012909252822080546001909101549192909142906119e99082612af9565b6119f39190614cea565b905080600d5483611a049190614bf5565b611a0e9190614c8c565b915050611a1d565b5060009050805b9193909250565b606060038054610ca790614d2d565b8160016000611a423384612beb565b90508115611a67578080611a645750336000908152601c602052604090205483145b90505b80611a845760405162461bcd60e51b8152600401610d9290614961565b60026001541415611aa75760405162461bcd60e51b8152600401610d9290614a95565b6002600190815560008681526012602090815260408083208151808301909252805482529093015490830152600c54611ae08188614bf5565b611aea9190614c8c565b905081602001518111611b3f5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c7920696e63726561736520756e6c6f636b2074696d650000006044820152606401610d92565b428111611b5e5760405162461bcd60e51b8152600401610d92906149fe565b600d54611b6b9042614baf565b811115611b8a5760405162461bcd60e51b8152600401610d9290614992565b611b99876000838560036136b6565b6000878152601a602052604090205415611bd1576000878152601b60205260409020546001600160a01b0316611bcf888261353f565b505b5050600180555050505050565b611be93383836137ed565b5050565b60026001541415611c105760405162461bcd60e51b8152600401610d9290614a95565b60026001908155600082815260126020526040902001544210611c645760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b6044820152606401610d92565b611c6f33308361134d565b336000908152601c602052604090205415611cba5760405162461bcd60e51b815260206004820152600b60248201526a486173205374616b65642160a81b6044820152606401610d92565b611cc2613629565b336000818152601c60209081526040808320859055848352601b909152812080546001600160a01b0319169092179091556018805460019290611d06908490614baf565b909155505060008181526012602081815260408084208054825160a08101845260185481528085018290529587905293909252600190910154919291908201904290611d53908290612af9565b611d5d9190614cea565b600d54611d6a9085614bf5565b611d749190614c8c565b815260225460208083019190915280546040928301526000858152601a8252828120845181559184015160018301559183015160028201556060830151600382015560809092015160049092019190915560198054839290611dd7908490614baf565b9091555050604051339083907f2bccdce62e5aec7ee273161a374088a6da4311d0e688784bde3c1cec8a3c003a90600090a3505060018055565b6060816001600160401b03811115611e3957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611e6c57816020015b6060815260200190600190039081611e575790505b50905060005b82811015611f8b5760008030868685818110611e9e57634e487b7160e01b600052603260045260246000fd5b9050602002810190611eb09190614acc565b604051611ebe9291906147d9565b600060405180830381855af49150503d8060008114611ef9576040519150601f19603f3d011682016040523d82523d6000602084013e611efe565b606091505b509150915081611f4a57604481511015611f1757600080fd5b60048101905080806020019051810190611f3191906146e0565b60405162461bcd60e51b8152600401610d9291906148d2565b80848481518110611f6b57634e487b7160e01b600052603260045260246000fd5b602002602001018190525050508080611f8390614d85565b915050611e72565b5092915050565b60026001541415611fb55760405162461bcd60e51b8152600401610d9290614a95565b600260019081556000838152601260209081526040918290208251808401909352805483529092015491810191909152816120025760405162461bcd60e51b8152600401610d9290614937565b428160200151116120255760405162461bcd60e51b8152600401610d92906149fe565b61207583836000846120368861168e565b6001600160a01b0316336001600160a01b031614806120635750336000908152601c602052604090205488145b61206e5760006136b6565b60026136b6565b6000838152601a6020526040902054156120cf57612091613629565b81601960008282546120a39190614baf565b90915550506000838152601a6020526040812060010180548492906120c9908490614baf565b90915550505b50506001805550565b6001600160a01b0381166000908152601c602052604081205480156112555761210081611185565b9392505050565b60006002600154141561212c5760405162461bcd60e51b8152600401610d9290614a95565b6002600155600c546000906121418185614bf5565b61214b9190614c8c565b60118054919250600061215d83614d85565b9190505550601154915061217133836138b8565b6000828152601260209081526040918290208251808401909352805483526001015490820152846121b45760405162461bcd60e51b8152600401610d9290614937565b8051156121ff5760405162461bcd60e51b815260206004820152601960248201527815da5d1a191c985dc81bdb19081d1bdad95b9cc8199a5c9cdd603a1b6044820152606401610d92565b42821161221e5760405162461bcd60e51b8152600401610d92906149fe565b600d5461222b9042614baf565b82111561224a5760405162461bcd60e51b8152600401610d9290614992565b6122588386848460016136b6565b50506001805592915050565b61226e3383612beb565b61228a5760405162461bcd60e51b8152600401610d9290614a44565b612296848484846135f6565b50505050565b60606122a782612b60565b61230b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610d92565b60006123156139e4565b905060008151116123355760405180602001604052806000815250612100565b8061233f846139f3565b604051602001612350929190614805565b6040516020818303038152906040529392505050565b601354600090816123778483613b0c565b600081815260146020908152604091829020825160608101845281548152600182015492810192909252600201549181018290529192508510156123c057506000949350505050565b828214156123d2576112508186613b93565b60408101516123e19086614cab565b81602001516123f09190614c09565b81516123fc9190614cab565b808252600013156114f9576000815251949350505050565b6117c5600060405180604001604052806000815260200160008152506040518060400160405280600081526020016000815250612e42565b6002600154141561246f5760405162461bcd60e51b8152600401610d9290614a95565b600260015561247e3383612beb565b6124c15760405162461bcd60e51b81526020600482015260146024820152734e6f74204f776e6572206f66206e667446726f6d60601b6044820152606401610d92565b6124cb3382612beb565b61250c5760405162461bcd60e51b81526020600482015260126024820152714e6f74204f776e6572206f66206e6674546f60701b6044820152606401610d92565b6000828152601a60205260409020541561255c5760405162461bcd60e51b81526020600482015260116024820152701b999d119c9bdb481a5cc81cdd185ad959607a1b6044820152606401610d92565b6000818152601a6020526040902054156125aa5760405162461bcd60e51b815260206004820152600f60248201526e1b999d151bc81a5cc81cdd185ad959608a1b6044820152606401610d92565b808214156125e65760405162461bcd60e51b815260206004820152600960248201526853616d65206e66742160b81b6044820152606401610d92565b60008281526012602081815260408084208151808301835281548152600191820154818501908152878752948452948290208251808401909352805483520154918101829052915111156126785760405162461bcd60e51b8152602060048201526019602482015278456e64626c6f636b3a206e667446726f6d203e206e6674546f60381b6044820152606401610d92565b60408051808201825283518152602080850180518284015283518085019094526000845251908301526126ad91869190612e42565b6126fd8360405180604001604052808460000151815260200184602001518152506040518060400160405280866000015186600001516126ed9190614b6e565b8152602086810151910152612e42565b6000848152601260205260408120558151815161271a9190614b6e565b6000938452601260205260409093209290925550506001805550565b601d805461274390614d2d565b80601f016020809104026020016040519081016040528092919081815260200182805461276f90614d2d565b80156127bc5780601f10612791576101008083540402835291602001916127bc565b820191906000526020600020905b81548152906001019060200180831161279f57829003601f168201915b505050505081565b336127cd611986565b6001600160a01b0316146127f35760405162461bcd60e51b8152600401610d92906149c9565b4381116128305760405162461bcd60e51b815260206004820152600b60248201526a4f5554204f46204441544560a81b6044820152606401610d92565b612838613629565b43602255602455565b6000828152601760205260408120548061285f576000915050610c92565b600084815260166020908152604080832084845282529182902082516060810184528154815260018201549281019290925260020154918101829052908410156128d75760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b6044820152606401610d92565b60408101516128e69085614cea565b81602001516128f59190614c09565b81518290612904908390614cab565b90525080516000131561291657600081525b519150610c929050565b600260015414156129435760405162461bcd60e51b8152600401610d9290614a95565b6002600155336000908152601c60205260409020548061299c5760405162461bcd60e51b81526020600482015260146024820152734e6f205374616b6564207665697a692d6e66742160601b6044820152606401610d92565b6129a6813361353f565b5060018055565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b601354600081815260146020908152604080832081516060810183528154815260018201549381019390935260020154908201819052919291841015612a4f5760405162461bcd60e51b8152602060048201526009602482015268546f6f204561726c7960b81b6044820152606401610d92565b610ed18185613b93565b33612a62611986565b6001600160a01b031614612a885760405162461bcd60e51b8152600401610d92906149c9565b6001600160a01b038116612aed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d92565b612af6816134ef565b50565b600081831015612b095781612100565b5090919050565b60006001600160e01b031982166380ac58cd60e01b1480612b4157506001600160e01b03198216635b5e139f60e01b145b80610c9257506301ffc9a760e01b6001600160e01b0319831614610c92565b6000908152600460205260409020546001600160a01b0316151590565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612bb28261168e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612bf682612b60565b612c575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d92565b6000612c628361168e565b9050806001600160a01b0316846001600160a01b03161480612c9d5750836001600160a01b0316612c9284610d2a565b6001600160a01b0316145b80610ed15750610ed181856129ad565b826001600160a01b0316612cc08261168e565b6001600160a01b031614612d245760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610d92565b6001600160a01b038216612d865760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d92565b612d91838383613c89565b612d9c600082612b7d565b6001600160a01b0383166000908152600560205260408120805460019290612dc5908490614cea565b90915550506001600160a01b0382166000908152600560205260408120805460019290612df3908490614baf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b038681169182179092559151849391871691600080516020614e1b83398151915291a4505050565b612e4a6143e9565b612e526143e9565b612e7660405180606001604052806000815260200160008152602001600081525090565b6000808252602082015260135460408201528515612f8357428560200151118015612ea2575084516000125b15612edf57600d548551612eb69190614bc7565b602080850191909152850151612ecd904290614cea565b8360200151612edc9190614c09565b83525b428460200151118015612ef3575083516000125b15612f3057600d548451612f079190614bc7565b602080840191909152840151612f1e904290614cea565b8260200151612f2d9190614c09565b82525b6020808601516000908152601582526040902054825284015115612f8357846020015184602001511415612f6a5780516020820152612f83565b6020808501516000908152601582526040902054908201525b604080516060810182526000808252602082015242818301529082015115612fe057506040808201516000908152601460209081529082902082516060810184528154815260018201549281019290925260020154918101919091525b6040810151600c54600090612ff58184614bf5565b612fff9190614c8c565b905060005b60ff8162ffffff16101561313857600c5461301f9083614baf565b915060004283111561303357429250613044565b506000828152601560205260409020545b61304e8484614cea565b856020015161305d9190614c09565b8551869061306c908390614cab565b905250602085018051829190613083908390614b6e565b90525084516000131561309557600085525b6000856020015112156130aa57600060208601525b604085018390529192508291428314156130db576001866040018181516130d19190614baf565b9052506131389050565b8015613125576001866040018181516130f49190614baf565b9052506040808701516000908152601460209081529082902087518155908701516001820155908601516002909101555b508061313081614d62565b915050613004565b50604084015160135588156131b3578560200151856020015161315b9190614cab565b8360200181815161316c9190614b6e565b9052508551855161317d9190614cab565b8351849061318c908390614b6e565b9052506020830151600013156131a457600060208401525b8251600013156131b357600083525b60408085015160009081526014602090815290829020855181559085015160018201559084015160029091015588156132f857428860200151111561324957602086015184518590613206908390614b6e565b9052506020808901519088015114156132315760208501518451859061322d908390614cab565b9052505b83516020808a01516000908152601590915260409020555b4287602001511115613299578760200151876020015111156132995784602001518460200181815161327b9190614cab565b90525060208085015188820151600090815260159092526040909120555b6000898152601760205260408120546132b3906001614baf565b42604080890191825260008d81526016602090815282822085835281528282208b518155818c0151600182015593516002909401939093558d81526017909252902055505b505050505050505050565b6040516001600160a01b038316602482015260448101829052610ec390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613cdb565b60008183111561337857506000610c92565b60245482116133925761338b8383614cea565b9050610c92565b60245483106133a357506000610c92565b60245461338b908490614cea565b60006133bc8261168e565b90506133ca81600084613c89565b6133d5600083612b7d565b6001600160a01b03811660009081526005602052604081208054600192906133fe908490614cea565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b03841690600080516020614e1b833981519152908390a45050565b6000828152601760205260408120548190815b60808162ffffff1610156134e557818310613473576134e5565b600060026134818486614baf565b61348c906001614baf565b6134969190614bf5565b600088815260166020908152604080832084845290915290206002015490915086106134c4578093506134d2565b6134cf600182614cea565b92505b50806134dd81614d62565b915050613459565b5090949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152601a6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101546080820152613592613629565b6000600160801b8260800151601f600101546135ae9190614cea565b83604001516135bd9190614c8c565b6135c79190614bf5565b905080156135ed57601f54600f546135ed916001600160a01b0391821691168584613dad565b61229684613de5565b613601848484612cad565b61360d84848484613e4d565b6122965760405162461bcd60e51b8152600401610d92906148e5565b602254431161363457565b6024546022541061364157565b600061365243601f60050154613f5e565b90506019546000141561366457602255565b602154602254600091906136789084614cea565b6136829190614c8c565b601954909150613696600160801b83614c8c565b6136a09190614bf5565b6020546136ad9190614baf565b60205550602255565b60105482906136c58682614baf565b6010556040805180820190915282518152602080840151908201528251879084906136f1908390614b6e565b905250851561370257602083018690525b61370d888285612e42565b60008881526012602090815260409091208451815590840151600190910155861561374a57600f5461374a906001600160a01b031633308a613dad565b8260200151887f621b671f614e8ed2023af3e491b3d2d895533d7d964005535af4c018d208967489874260405161379793929190928352600f9190910b6020830152604082015260600190565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c826137cb8982614baf565b6040805192835260208301919091520160405180910390a15050505050505050565b816001600160a01b0316836001600160a01b0316141561384b5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610d92565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03821661390e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d92565b61391781612b60565b156139635760405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606401610d92565b61396f60008383613c89565b6001600160a01b0382166000908152600560205260408120805460019290613998908490614baf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386169081179091559051839290600080516020614e1b833981519152908290a45050565b6060601d8054610ca790614d2d565b606081613a175750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613a415780613a2b81614d85565b9150613a3a9050600a83614bf5565b9150613a1b565b6000816001600160401b03811115613a6957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613a93576020820181803683370190505b5090505b8415610ed157613aa8600183614cea565b9150613ab5600a86614da0565b613ac0906030614baf565b60f81b818381518110613ae357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350613b05600a86614bf5565b9450613a97565b60008082815b60808162ffffff1610156134e557818310613b2c576134e5565b60006002613b3a8486614baf565b613b45906001614baf565b613b4f9190614bf5565b6000818152601460205260409020600201549091508710613b7257809350613b80565b613b7d600182614cea565b92505b5080613b8b81614d62565b915050613b12565b6000808390506000600c54600c548360400151613bb09190614bf5565b613bba9190614c8c565b905060005b60ff8162ffffff161015613c7f57600c54613bda9083614baf565b9150600085831115613bee57859250613bff565b506000828152601560205260409020545b6040840151613c0e9084614cea565b8460200151613c1d9190614c09565b84518590613c2c908390614cab565b9052508351600012613c42575060008352613c7f565b85831415613c505750613c7f565b8084602001818151613c629190614b6e565b905250506040830182905280613c7781614d62565b915050613bbf565b5050519392505050565b613c94838383613f6d565b6001600160a01b0383163014801590613cb657506001600160a01b0382163014155b15610ec3576000908152601e6020526040902080546001600160a01b03191690555050565b6000613d30826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166140259092919063ffffffff16565b805190915015610ec35780806020019051810190613d4e9190614632565b610ec35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d92565b6040516001600160a01b03808516602483015283166044820152606481018290526122969085906323b872dd60e01b9060840161332f565b6000818152601a602090815260408083206022546003820155825460048201556012909252909120600101544290613e1e908290612af9565b613e289190614cea565b600d548260010154613e3a9190614bf5565b613e449190614c8c565b60029091015550565b6000613e61846001600160a01b0316614034565b15613f5657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613e98903390899088908890600401614834565b602060405180830381600087803b158015613eb257600080fd5b505af1925050508015613ee2575060408051601f3d908101601f19168201909252613edf9181019061466a565b60015b613f3c573d808015613f10576040519150601f19603f3d011682016040523d82523d6000602084013e613f15565b606091505b508051613f345760405162461bcd60e51b8152600401610d92906148e5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610ed1565b506001610ed1565b6000818310612b095781612100565b6001600160a01b038316613fc857613fc381600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b613feb565b816001600160a01b0316836001600160a01b031614613feb57613feb8382614043565b6001600160a01b03821661400257610ec3816140e0565b826001600160a01b0316826001600160a01b031614610ec357610ec382826141b9565b6060610ed184846000856141fd565b6001600160a01b03163b151590565b6000600161405084611705565b61405a9190614cea565b6000838152600960205260409020549091508082146140ad576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a546000906140f290600190614cea565b6000838152600b6020526040812054600a805493945090928490811061412857634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600a838154811061415757634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061419d57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006141c483611705565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b60608247101561425e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610d92565b61426785614034565b6142b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d92565b600080866001600160a01b031685876040516142cf91906147e9565b60006040518083038185875af1925050503d806000811461430c576040519150601f19603f3d011682016040523d82523d6000602084013e614311565b606091505b509150915061432182828661432c565b979650505050505050565b6060831561433b575081612100565b82511561434b5782518084602001fd5b8160405162461bcd60e51b8152600401610d9291906148d2565b82805461437190614d2d565b90600052602060002090601f01602090048101928261439357600085556143d9565b82601f106143ac5782800160ff198235161785556143d9565b828001600101855582156143d9579182015b828111156143d95782358255916020019190600101906143be565b506143e592915061440a565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156143e5576000815560010161440b565b80356001600160a01b038116811461443657600080fd5b919050565b60006020828403121561444c578081fd5b6121008261441f565b60008060408385031215614467578081fd5b6144708361441f565b915061447e6020840161441f565b90509250929050565b60008060006060848603121561449b578081fd5b6144a48461441f565b92506144b26020850161441f565b9150604084013590509250925092565b600080600080608085870312156144d7578081fd5b6144e08561441f565b93506144ee6020860161441f565b92506040850135915060608501356001600160401b0381111561450f578182fd5b8501601f8101871361451f578182fd5b803561453261452d82614b47565b614b17565b818152886020838501011115614546578384fd5b81602084016020830137908101602001929092525092959194509250565b60008060408385031215614576578182fd5b61457f8361441f565b9150602083013561458f81614df6565b809150509250929050565b600080604083850312156145ac578182fd5b6145b58361441f565b946020939093013593505050565b600080602083850312156145d5578182fd5b82356001600160401b03808211156145eb578384fd5b818501915085601f8301126145fe578384fd5b81358181111561460c578485fd5b8660208260051b8501011115614620578485fd5b60209290920196919550909350505050565b600060208284031215614643578081fd5b815161210081614df6565b60006020828403121561465f578081fd5b813561210081614e04565b60006020828403121561467b578081fd5b815161210081614e04565b60008060208385031215614698578182fd5b82356001600160401b03808211156146ae578384fd5b818501915085601f8301126146c1578384fd5b8135818111156146cf578485fd5b866020828501011115614620578485fd5b6000602082840312156146f1578081fd5b81516001600160401b03811115614706578182fd5b8201601f81018413614716578182fd5b805161472461452d82614b47565b818152856020838501011115614738578384fd5b614749826020830160208601614d01565b95945050505050565b600060208284031215614763578081fd5b5035919050565b6000806040838503121561477c578182fd5b8235915061447e6020840161441f565b6000806040838503121561479e578182fd5b50508035926020909101359150565b600081518084526147c5816020860160208601614d01565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b600082516147fb818460208701614d01565b9190910192915050565b60008351614817818460208801614d01565b83519083019061482b818360208801614d01565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614867908301846147ad565b9695505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156148c557603f198886030184526148b38583516147ad565b94509285019290850190600101614897565b5092979650505050505050565b60208152600061210060208301846147ad565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526010908201526f0416d6f756e742073686f756c64203e360841b604082015260600190565b6020808252601790820152764e6f74204f776e6572206f72204e6f742065786973742160481b604082015260600190565b6020808252601e908201527f566f74696e67206c6f636b2063616e2062652034207965617273206d61780000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f43616e206f6e6c79206c6f636b20756e74696c2074696d6520696e207468652060408201526566757475726560d01b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000808335601e19843603018112614ae2578283fd5b8301803591506001600160401b03821115614afb578283fd5b602001915036819003821315614b1057600080fd5b9250929050565b604051601f8201601f191681016001600160401b0381118282101715614b3f57614b3f614de0565b604052919050565b60006001600160401b03821115614b6057614b60614de0565b50601f01601f191660200190565b600080821280156001600160ff1b0384900385131615614b9057614b90614db4565b600160ff1b8390038412811615614ba957614ba9614db4565b50500190565b60008219821115614bc257614bc2614db4565b500190565b600082614bd657614bd6614dca565b600160ff1b821460001984141615614bf057614bf0614db4565b500590565b600082614c0457614c04614dca565b500490565b60006001600160ff1b0381841382841380821686840486111615614c2f57614c2f614db4565b600160ff1b84871282811687830589121615614c4d57614c4d614db4565b858712925087820587128484161615614c6857614c68614db4565b87850587128184161615614c7e57614c7e614db4565b505050929093029392505050565b6000816000190483118215151615614ca657614ca6614db4565b500290565b60008083128015600160ff1b850184121615614cc957614cc9614db4565b6001600160ff1b0384018313811615614ce457614ce4614db4565b50500390565b600082821015614cfc57614cfc614db4565b500390565b60005b83811015614d1c578181015183820152602001614d04565b838111156122965750506000910152565b600181811c90821680614d4157607f821691505b6020821081141561125557634e487b7160e01b600052602260045260246000fd5b600062ffffff80831681811415614d7b57614d7b614db4565b6001019392505050565b6000600019821415614d9957614d99614db4565b5060010190565b600082614daf57614daf614dca565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114612af657600080fd5b6001600160e01b031981168114612af657600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220701eb1ab96dcb560a7c5b37324bef0e3c0e0f407b074f71dc56ecf15fa3d5b2364736f6c63430008040033

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

0000000000000000000000009ad37205d608b8b219e6a2573f922094cec5c200000000000000000000000000fa0ad5f78d1fc96def92ef7252b8a548edf6d1310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f51c291b9262a9b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000db8350000000000000000000000000000000000000000000000000000000000892fa10

-----Decoded View---------------
Arg [0] : tokenAddr (address): 0x9ad37205d608B8b219e6a2573f922094CEc5c200
Arg [1] : _rewardInfo (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000009ad37205d608b8b219e6a2573f922094cec5c200
Arg [1] : 000000000000000000000000fa0ad5f78d1fc96def92ef7252b8a548edf6d131
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 000000000000000000000000000000000000000000000000f51c291b9262a9b0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000db8350
Arg [6] : 000000000000000000000000000000000000000000000000000000000892fa10


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.