Address Details
contract

0x5D92147cF4b2CEB01212E4f1D16C35fcc9B97aEA

Contract Name
MasterChef
Creator
0x7d6740–c9cfce at 0xfec943–a42a31
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
8889097
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
MasterChef




Optimization enabled
true
Compiler version
v0.8.10+commit.fc410830




Optimization runs
200
EVM Version
london




Verified at
2023-02-01T12:24:05.294418Z

contracts/StarFarm.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";

interface IStarNode {
    function nodeGain(address _user) external view returns (uint256, uint256);
    function settleNode(address _user, uint256 _amount) external;
}

interface INFTLogic {
    function starMeta(uint256 _tokenId) view external returns (uint8, uint256, uint256, uint256);
}

// import "@nomiclabs/buidler/console.sol";
interface IMigratorChef {
    function migrate(IERC20Upgradeable token) external returns (IERC20Upgradeable);
}

// MasterChef is the master of Star. He can make Star and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once STAR is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract MasterChef is Initializable, OwnableUpgradeable {
    using SafeMathUpgradeable for uint256;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    // Info of each user.
    struct UserInfo {
        uint256 amount;     // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        uint256 reward;
        uint256 userRewardDebt;
        uint256 lastDeposit;
        uint256 nftAmount;
        uint256 nftRewardDebt;
        uint256 nftReward;
        uint256 nftUserRewardDebt;
        uint256 nftLastDeposit;
        // 
        // We do some fancy math here. Basically, any point in time, the amount of STARs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accStarPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accStarPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }
	
    // Info of each pool.
    struct PoolInfo {
        IERC20Upgradeable lpToken;  // Address of LP token contract.
        uint256 lpSupply;
        uint256 allocPoint;         // How many allocation points assigned to this pool. STARs to distribute per block.
        uint256 lastRewardBlock;    // Last block number that STARs distribution occurs.
        uint256 accStarPerShare;    // Accumulated STARs per share, times 1e12. See below.
        uint256 extraAmount;        // Extra amount of token. users from node or NFT.
        uint256 fee;
        uint256 size;
    }

    struct SlotInfo {
        PoolInfo pool;
        uint256 _self_parentGain;
        uint256 _selfGain;
        uint256 _parentGain;
        uint256 _nftAmountGain; 
        uint256 accStarPerShare;
        uint256 lpSupply;
        uint256 multiplier;
        uint256 starReward;
        uint256 i;
        uint256 _amount;
        uint256 _amountpendingStar;
        uint256 fee;
    }

    // The STAR TOKEN!
    IERC20Upgradeable public starToken;
    // Star node.
    IStarNode public starNode;
    // Dev address.
    address public bonusAddr;
    // Star NFT.
    IERC721Upgradeable public starNFT;
    // NFT logic
    INFTLogic public nftLogic;
    // STAR tokens created per block.
    uint256 public starPerBlock;
    // Bonus muliplier for early star makers.
    uint256 public BONUS_MULTIPLIER;
    // The migrator contract. It has a lot of power. Can only be set through governance (owner).
    IMigratorChef public migrator;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping (uint256 => mapping (address => UserInfo)) public userInfo;
    mapping (uint256 => mapping (uint256 => address)) public userIndex;
    mapping (uint256 => mapping (address => bool)) public isPoolUser;
    // Total allocation poitns. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;
    // The block number when STAR mining starts.
    uint256 public startBlock;
    address public lockAddr;
    address public teamAddr;
    address public rewardAddr;
    uint256 public lockRatio;
    uint256 public teamRatio;
    uint256 public rewardRatio;

    // Node user
    mapping (address => bool) public isNodeUser;
    mapping (address => uint256[]) public userNFTs;

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount, bool isNodeUser);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount, bool isNodeUser);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount, bool isNodeUser);

    function initialize(address _starToken, address _bonus, address _node, uint256 _starPerBlock, uint256 _startBlock) public initializer {
        __farm_init(_starToken, _bonus, _node, _starPerBlock, _startBlock);
    }

    function __farm_init(address _starToken, address _bonus, address _node, uint256 _starPerBlock, uint256 _startBlock) internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
        __farm_init_unchained(_starToken, _bonus, _node, _starPerBlock, _startBlock);
    }

    function __farm_init_unchained(address _starToken, address _bonus, address _node, uint256 _starPerBlock, uint256 _startBlock) internal initializer {
        starToken = IERC20Upgradeable(_starToken);
        bonusAddr = _bonus;
        starNode = IStarNode(_node);
        starPerBlock = _starPerBlock;
        startBlock = _startBlock;

        // staking pool
        poolInfo.push(PoolInfo({
            lpToken: IERC20Upgradeable(_starToken),
            lpSupply: 0,
            allocPoint: 1000,
            lastRewardBlock: startBlock,
            accStarPerShare: 0,
            extraAmount: 0,
            fee: 0,
            size: 0
        }));
		
        totalAllocPoint = 1000;
    }

    function updateMultiplier(uint256 multiplierNumber) public onlyOwner {
        BONUS_MULTIPLIER = multiplierNumber;
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
    function add(uint256 _allocPoint, IERC20Upgradeable _lpToken, uint256 _fee, bool _withUpdate) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolInfo.push(PoolInfo({
            lpToken: _lpToken,
            lpSupply: 0,
            allocPoint: _allocPoint,
            lastRewardBlock: lastRewardBlock,
            accStarPerShare: 0,
            extraAmount: 0,
            fee: _fee,
            size: 0
        }));
        updateStakingPool();
    }

    // Update the given pool's STAR allocation point. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint, uint256 _fee, bool _withUpdate) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
        uint256 prevAllocPoint = poolInfo[_pid].allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].fee = _fee;

        if (prevAllocPoint != _allocPoint) {
            updateStakingPool();
        }
    }

    function updateStakingPool() internal {
        uint256 length = poolInfo.length;
        uint256 points = 0;
        for (uint256 pid = 1; pid < length; ++pid) {
            points = points.add(poolInfo[pid].allocPoint);
        }
        if (points != 0) {
            points = points.div(3);
            totalAllocPoint = totalAllocPoint.sub(poolInfo[0].allocPoint).add(points);
            poolInfo[0].allocPoint = points;
        }
    }

    // Set the migrator contract. Can only be called by the owner.
    function setMigrator(IMigratorChef _migrator) public onlyOwner {
        migrator = _migrator;
    }

    // Migrate lp token to another lp contract. We trust that migrator contract is good.
    function migrate(uint256 _pid) public onlyOwner {
        require(address(migrator) != address(0), "migrate: no migrator");
        PoolInfo storage pool = poolInfo[_pid];
        IERC20Upgradeable lpToken = pool.lpToken;
        uint256 bal = lpToken.balanceOf(address(this));
        lpToken.safeApprove(address(migrator), bal);
        IERC20Upgradeable newLpToken = migrator.migrate(lpToken);
        require(bal == newLpToken.balanceOf(address(this)), "migrate: bad");
        pool.lpToken = newLpToken;
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
        return _to.sub(_from).mul(BONUS_MULTIPLIER);
    }

    // View function to see pending STARs on frontend.
    function pendingStar(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accStarPerShare = pool.accStarPerShare;
        if (block.number > pool.lastRewardBlock && pool.lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(pool.lpSupply.add(pool.extraAmount));
        }
        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        uint256 _amountGain = user.amount.add(user.amount.mul(_selfGain.add(_parentGain)).div(100));
		uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
        _amountpendingStar = user.reward.add(_amountpendingStar);
        if(_amountpendingStar > 0) {
            _amountpendingStar = _amountpendingStar.sub(_amountpendingStar.mul(lockRatio.add(teamRatio)).div(100));
            _amountpendingStar = _amountpendingStar.sub(_amountpendingStar.mul(rewardRatio).div(100));
            _amountpendingStar = _amountpendingStar.mul(100).div(_selfGain.add(_parentGain).add(100));
            _amountpendingStar = _amountpendingStar.mul(_selfGain.add(100)).div(100);
        }

		return _amountpendingStar;
    }
    
    //View function to see pending STARs on frontend of nft.
    function nftPendingStar(address _user,uint256 _tokenId) external view returns (uint256,uint256) {
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][_user];
        uint256 accStarPerShare = pool.accStarPerShare;
        uint256 lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(lpSupply);
        }
        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        (, , uint256 _price, uint256 _multi) = nftLogic.starMeta(_tokenId);
        uint256 _amount = _price.mul(_multi).div(100);
        uint256 _amountGain = _amount.add(_amount.mul(_selfGain.add(_parentGain)).div(100));
		uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
        if(_amountpendingStar > 0) {
            _amountpendingStar = _amountpendingStar.sub(_amountpendingStar.mul(lockRatio.add(teamRatio)).div(100));
            _amountpendingStar = _amountpendingStar.sub(_amountpendingStar.mul(rewardRatio).div(100));
            _amountpendingStar = _amountpendingStar.mul(100).div(_selfGain.add(_parentGain).add(100));
            _amountpendingStar = _amountpendingStar.mul(_selfGain.add(100)).div(100);
        }
        return (user.nftReward,_amountpendingStar);
    }
	
    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid,0);
        }
    }

    function testImint(uint256 _pid,uint256 _amount) public {
        PoolInfo storage pool = poolInfo[_pid];
        pool.lpToken.safeTransferFrom(address(0), address(this), _amount);
	}
    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid,uint256 _type) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        if (pool.lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
        uint256 lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 accStarPerShare = starReward.mul(1e12).div(lpSupply);
            for(uint256 unumber = 0; unumber < pool.size; ++unumber){
            	address userAddr = userIndex[_pid][unumber];
                if(userIndex[_pid][unumber] == address(0)){
            	    continue;
            	}
                UserInfo storage user = userInfo[_pid][userAddr];
                if(user.amount >0){
                    (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(userAddr);
                    uint256 _amountGain = user.amount.add(user.amount.mul(_selfGain.add(_parentGain)).div(100));
                    uint256 _nftAmountGain = user.nftAmount.add(user.nftAmount.mul(_selfGain.add(_parentGain)).div(100));
                    uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
                    uint256 _nftAmountpendingStar = _nftAmountGain.mul(accStarPerShare).div(1e12);
                    if(userAddr == _msgSender()){
                        if(_type == 1){
                            user.nftReward = user.nftReward.add(_nftAmountpendingStar);
                        }else if(_type == 2){
                            user.reward = user.reward.add(_amountpendingStar);
                        }else{
                            user.reward = user.reward.add(_amountpendingStar);
                            user.nftReward = user.nftReward.add(_nftAmountpendingStar);
                        }
                    }else{
                        user.reward = user.reward.add(_amountpendingStar);
                        user.nftReward = user.nftReward.add(_nftAmountpendingStar);
                    }
                }
            }
			pool.accStarPerShare = accStarPerShare;
            pool.lastRewardBlock = block.number;
        }
    }
    function testpendingStar(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accStarPerShare = pool.accStarPerShare;
        //uint256 lpSupply = pool.lpToken.balanceOf(address(this)).add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && pool.lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(pool.lpSupply);
        }
        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        uint256 _amountGain = user.amount.add(user.amount.mul(_selfGain.add(_parentGain)).div(100));
		uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
        _amountpendingStar = user.reward.add(_amountpendingStar);

		return _amountpendingStar;
    }

    function testdeposit(uint256 _pid, uint256 _amount) view public returns(uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_msgSender()];
        //updatePool(_pid);

        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        uint256 _amountGain = user.amount.add(user.amount.mul(_selfGain.add(_parentGain)).div(100));
        uint256 accStarPerShare = pool.accStarPerShare;
        //uint256 lpSupply = pool.lpToken.balanceOf(address(this)).add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && pool.lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(pool.lpSupply);
        }
            uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
        if(user.amount >0){
            _amountpendingStar = user.reward.add(_amountpendingStar);
        }
		return _amountpendingStar;
    }
    // Deposit LP tokens to MasterChef for STAR allocation.
    function deposit(uint256 _pid, uint256 _amount) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_msgSender()];
        updatePool(_pid,1);

        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        uint256 _amountGain = user.amount.add(user.amount.mul(_selfGain.add(_parentGain)).div(100));
        uint256 accStarPerShare = pool.accStarPerShare;
        uint256 lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(lpSupply);
        }
        if(_amountGain >0){
            uint256 _amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
            user.reward = user.reward.add(_amountpendingStar);
        }
        uint256 pending = user.reward;
        if(pending > 0) {
            starToken.safeTransfer(lockAddr,pending.mul(lockRatio).div(100));
            starToken.safeTransfer(teamAddr,pending.mul(teamRatio).div(100));
            pending = pending.sub(pending.mul(lockRatio.add(teamRatio)).div(100));
            starToken.safeTransfer(rewardAddr,pending.mul(rewardRatio).div(100));
            pending = pending.sub(pending.mul(rewardRatio).div(100));

            pending = pending.mul(100).div(_selfGain.add(_parentGain).add(100));
            starToken.safeTransfer(_msgSender(), pending.mul(_selfGain.add(100)).div(100));
            user.rewardDebt = user.rewardDebt.add(pending.mul(_selfGain.add(100)).div(100));
            starNode.settleNode(_msgSender(), pending.mul(_parentGain).div(100));
            user.reward = 0;
            pool.accStarPerShare = accStarPerShare;
        }

        if (_amount > 0) {
            pool.lpToken.safeTransferFrom(_msgSender(), address(this), _amount);
            user.amount = user.amount.add(_amount);
            user.lastDeposit = block.timestamp;
            uint256 _extraAmount = _amount.mul(_selfGain.add(_parentGain)).div(100);
            pool.extraAmount = pool.extraAmount.add(_extraAmount);
            pool.lpSupply = pool.lpSupply.add(_amount);
            if(isPoolUser[_pid][_msgSender()] == false){
                userIndex[_pid][pool.size] = _msgSender();
                pool.size += 1;
                isPoolUser[_pid][_msgSender()] = true;
            }
        }

        emit Deposit(_msgSender(), _pid, _amount, isNodeUser[_msgSender()]);
    }
    event WithdrawTL(uint256 reward,uint256 pendingStar);
    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_msgSender()];
		SlotInfo memory slot;
        require(user.amount >= _amount, "withdraw: amount error");
        updatePool(_pid,1);

        (slot._selfGain, slot._parentGain) = starNode.nodeGain(_msgSender());
        uint256 _amountGain = user.amount.add(user.amount.mul(slot._selfGain.add(slot._parentGain)).div(100));
        uint256 accStarPerShare = pool.accStarPerShare;
        uint256 lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            slot.multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            slot.starReward = slot.multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = slot.starReward.mul(1e12).div(lpSupply);
        }
        if(_amountGain >0){
            slot._amountpendingStar = _amountGain.mul(accStarPerShare).div(1e12);
			emit WithdrawTL(user.reward, slot._amountpendingStar);
            user.reward = user.reward.add(slot._amountpendingStar);
        }
        uint256 pending = user.reward;
        if(pending > 0) {
            starToken.safeTransfer(lockAddr,pending.mul(lockRatio).div(100));
            starToken.safeTransfer(teamAddr,pending.mul(teamRatio).div(100));
            pending = pending.sub(pending.mul(lockRatio.add(teamRatio)).div(100));
            starToken.safeTransfer(rewardAddr,pending.mul(rewardRatio).div(100));
            pending = pending.sub(pending.mul(rewardRatio).div(100));
            pending = pending.div(slot._selfGain.add(slot._parentGain).add(100)).mul(100);
            if (user.lastDeposit > block.timestamp.sub(604800)) {
                slot.fee = pending.mul(pool.fee).div(10000);
                starToken.safeTransfer(_msgSender(), (pending.sub(slot.fee)).mul(slot._selfGain.add(100)).div(100));
                starNode.settleNode(_msgSender(), (pending.sub(slot.fee)).mul(slot._parentGain).div(100));
                user.rewardDebt = user.rewardDebt.add((pending.sub(slot.fee)).mul(slot._selfGain.add(100)).div(100));
                if(pool.fee > 0){
                    starToken.safeTransfer(bonusAddr, slot.fee.mul(70).div(100));
                    starToken.safeTransfer(lockAddr, slot.fee.mul(30).div(100));
                }
            }else{
                starToken.safeTransfer(_msgSender(), pending);
                starNode.settleNode(_msgSender(), pending.mul(slot._parentGain).div(100));
                user.rewardDebt = user.rewardDebt.add(pending);
            }
            user.reward = 0;
            pool.accStarPerShare = accStarPerShare;
        }

        if(_amount > 0) {
            user.amount = user.amount.sub(_amount);
            uint256 _extraAmount = _amount.mul(slot._selfGain.add(slot._parentGain)).div(100);
            pool.extraAmount = pool.extraAmount.sub(_extraAmount);
            pool.lpSupply = pool.lpSupply.sub(_amount);
            pool.lpToken.safeTransfer(_msgSender(), _amount);
        }

        emit Withdraw(_msgSender(), _pid, _amount, isNodeUser[_msgSender()]);
    }

    // Stake Star NFT to MasterChef
    function enterStakingNFT(uint256 _tokenId) public {
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][_msgSender()];
		require(starNFT.ownerOf(_tokenId) == _msgSender(), "error NFT user");
        //require(userNFTs[_msgSender()].length > 0, "star token user");
        updatePool(0,2);

        (uint256 _selfGain, uint256 _parentGain) = starNode.nodeGain(_msgSender());
        uint256 _nftAmountGain = user.nftAmount.add(user.nftAmount.mul(_selfGain.add(_parentGain)).div(100));
        uint256 accStarPerShare = pool.accStarPerShare;
        uint256 lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 starReward = multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accStarPerShare = starReward.mul(1e12).div(lpSupply);
        }
        if(user.nftAmount >0){
            uint256 _nftAmountpendingStar = _nftAmountGain.mul(accStarPerShare).div(1e12);
            user.nftReward = user.nftReward.add(_nftAmountpendingStar);
        }
        uint256 pending = user.nftReward;
        if(pending > 0) {
            starToken.safeTransfer(lockAddr,pending.mul(lockRatio).div(100));
            starToken.safeTransfer(teamAddr,pending.mul(teamRatio).div(100));
            pending = pending.sub(pending.mul(lockRatio.add(teamRatio)).div(100));
            starToken.safeTransfer(rewardAddr,pending.mul(rewardRatio).div(100));
            pending = pending.sub(pending.mul(rewardRatio).div(100));
            pending = pending.mul(100).div(_selfGain.add(_parentGain).add(100));
            starToken.safeTransfer(_msgSender(), pending.mul(_selfGain.add(100)).div(100));
            user.nftRewardDebt = user.nftRewardDebt.add(pending.mul(_selfGain.add(100)).div(100));
            starNode.settleNode(_msgSender(), pending.mul(_parentGain).div(100));
            user.nftReward = 0;
            pool.accStarPerShare = accStarPerShare;
        }

        if (_tokenId > 0) {
            starNFT.transferFrom(_msgSender(), address(this), _tokenId);
            userNFTs[_msgSender()].push(_tokenId);

            (, , uint256 _price, uint256 _multi) = nftLogic.starMeta(_tokenId);
            uint256 _amount = _price.mul(_multi).div(100);
            uint256 _extraAmount = _amount.add(_amount.mul(_selfGain.add(_parentGain)).div(100));
            pool.extraAmount = pool.extraAmount.add(_extraAmount);
			pool.lpSupply = pool.lpSupply.add(_amount);
            user.nftAmount = user.nftAmount.add(_amount);
            user.nftLastDeposit = block.timestamp;
            if(isPoolUser[0][_msgSender()] == false){
                userIndex[0][pool.size] = _msgSender();
                pool.size += 1;
                isPoolUser[0][_msgSender()] = true;
            }
        }
        emit Deposit(_msgSender(), 0, _tokenId, isNodeUser[_msgSender()]);
    }
	
    function testleaveStakingNFT(uint256 _tokenId) view public returns(uint256) {
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][_msgSender()];
		SlotInfo memory slot;
        //require(userNFTs[_msgSender()].length > 0, "no NFT");
        //updatePool(0);

        (slot._selfGain, slot._parentGain) = starNode.nodeGain(_msgSender());
        slot._self_parentGain = slot._selfGain.add(slot._parentGain);
        slot._nftAmountGain = user.nftAmount.add(user.nftAmount.mul(slot._self_parentGain).div(100));
        slot.accStarPerShare = pool.accStarPerShare;
        //slot.lpSupply = pool.lpToken.balanceOf(address(this)).add(pool.extraAmount);
        slot.lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && slot.lpSupply != 0) {
            slot.multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            slot.starReward = slot.multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            slot.accStarPerShare = slot.starReward.mul(1e12).div(slot.lpSupply);
        }
        //uint256 pending = slot._nftAmountGain.mul(slot.accStarPerShare).div(1e12);
            uint256 _nftAmountpendingStar = slot._nftAmountGain.mul(slot.accStarPerShare).div(1e12);
        if(user.amount >0){
            _nftAmountpendingStar = user.nftReward.add(_nftAmountpendingStar);
        }
		return _nftAmountpendingStar;
	}
   // Withdraw Star NFT from STAKING.
    function leaveStakingNFT(uint256 _tokenId) public {
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][_msgSender()];
		SlotInfo memory slot;
        require(userNFTs[_msgSender()].length > 0, "no NFT");
        updatePool(0,2);

        (slot._selfGain, slot._parentGain) = starNode.nodeGain(_msgSender());
        slot._self_parentGain = slot._selfGain.add(slot._parentGain);
        slot._nftAmountGain = user.nftAmount.add(user.nftAmount.mul(slot._self_parentGain).div(100));
        slot.accStarPerShare = pool.accStarPerShare;
        slot.lpSupply = pool.lpSupply.add(pool.extraAmount);
        if (block.number > pool.lastRewardBlock && slot.lpSupply != 0) {
            slot.multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            slot.starReward = slot.multiplier.mul(starPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            slot.accStarPerShare = slot.starReward.mul(1e12).div(slot.lpSupply);
        }
        if(user.nftAmount > 0){
            uint256 _nftAmountpendingStar = slot._nftAmountGain.mul(slot.accStarPerShare).div(1e12);
            user.nftReward = user.nftReward.add(_nftAmountpendingStar);
        }
        uint256 pending = user.nftReward;
        if(pending > 0) {
            starToken.safeTransfer(lockAddr,pending.mul(lockRatio).div(100));
            starToken.safeTransfer(teamAddr,pending.mul(teamRatio).div(100));
            pending = pending.sub(pending.mul(lockRatio.add(teamRatio)).div(100));
            starToken.safeTransfer(rewardAddr,pending.mul(rewardRatio).div(100));
            pending = pending.sub(pending.mul(rewardRatio).div(100));
            pending = pending.mul(100).div(slot._self_parentGain.add(100));
            if (user.lastDeposit > block.timestamp.sub(604800)) {
                slot.fee = pending.mul(pool.fee).div(10000);
                starToken.safeTransfer(_msgSender(), (pending.sub(slot.fee)).mul(slot._selfGain.add(100)).div(100));
                starNode.settleNode(_msgSender(), (pending.sub(slot.fee)).mul(slot._parentGain).div(100));
                user.nftRewardDebt = user.nftRewardDebt.add((pending.sub(slot.fee)).mul(slot._selfGain.add(100)).div(100));
                starToken.safeTransfer(bonusAddr, slot.fee.mul(70).div(100));
                starToken.safeTransfer(lockAddr, slot.fee.mul(30).div(100));
            }else{
                starToken.safeTransfer(_msgSender(), pending);
                starNode.settleNode(_msgSender(), pending.mul(slot._parentGain).div(100));
                user.nftRewardDebt = user.nftRewardDebt.add(pending);
            }
            user.nftReward = 0;
            pool.accStarPerShare = slot.accStarPerShare;
        }

        if (_tokenId > 0) {
            uint256[] storage _userNFTs = userNFTs[_msgSender()];
            for (slot.i = 0; slot.i < _userNFTs.length; slot.i ++) {
                if(_userNFTs[slot.i] == _tokenId) {
                    (, , uint256 _price, uint256 _multi) = nftLogic.starMeta(_tokenId);
					slot._amount = _price.mul(_multi).div(100);

                    if(slot._amount > 0) {
                        uint256 _extraAmount = slot._amount.add(slot._amount.mul(slot._self_parentGain).div(100));
                        pool.extraAmount = pool.extraAmount.sub(_extraAmount);
                        pool.lpSupply = pool.lpSupply.sub(slot._amount);
                        user.nftAmount = user.nftAmount.sub(slot._amount);
                        _userNFTs[slot.i] = _userNFTs[_userNFTs.length - 1];
                        _userNFTs.pop();
                    }
                    starNFT.transferFrom(address(this), _msgSender(), _tokenId);

                    slot._nftAmountGain = user.nftAmount.add(user.nftAmount.mul(slot._selfGain).div(100));
                    user.nftRewardDebt = slot._nftAmountGain.mul(pool.accStarPerShare).div(1e12);
                    emit Withdraw(_msgSender(), 0, _price.mul(_multi).div(100), isNodeUser[_msgSender()]);
                    break;
                }
            }
        }
    }
	
    function getStakingNFTAmount(address _user) view public returns (uint256) {
        return userNFTs[_user].length;
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_msgSender()];
        pool.lpToken.safeTransfer(_msgSender(), user.amount);
        emit EmergencyWithdraw(_msgSender(), _pid, user.amount, isNodeUser[_msgSender()]);
        user.amount = 0;
        user.rewardDebt = 0;
    }

    function setBonus(address _addr) external onlyOwner {
        require(address(0) != _addr, "bonus address can not be address 0");
        bonusAddr = _addr;
    }

    function getAllocationInfo() view public returns(address ,address ,address ,uint256 ,uint256 ,uint256 ) {
        return (lockAddr,teamAddr,rewardAddr,lockRatio,teamRatio,rewardRatio);
    }
	
    function setAllocationInfo(address _lockAddr,address _teamAddr,address _rewardAddr,uint256 _lockRatio,uint256 _teamRatio,uint256 _rewardRatio) public onlyOwner {
        lockAddr = _lockAddr;
        teamAddr = _teamAddr;
        rewardAddr = _rewardAddr;
        lockRatio = _lockRatio;
        teamRatio = _teamRatio;
        rewardRatio = _rewardRatio;
    }

    function setStarNFT(address _addr) external onlyOwner {
        require(address(0) != _addr, "NFT address can not be address 0");
        starNFT = IERC721Upgradeable(_addr);
    }

    function setNFTLogic(address _addr) external onlyOwner {
        require(address(0) != _addr, "logic address can not be address 0");
        nftLogic = INFTLogic(_addr);
    }
    
    function regNodeUser(address _user) external onlyNode {
        require(address(0) != _user, '');
        isNodeUser[_user] = true;
    }

    function setNode(address _node) public onlyOwner {
        require(address(0) != _node, 'node can not be address 0');
        starNode = IStarNode(_node);
    }

    modifier onlyNode() {
        require(_msgSender() == address(starNode), "not node");
        _;
    }
}
        

/_openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    function __Ownable_init_unchained() internal initializer {
        _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);
    }
    uint256[49] private __gap;
}
          

/_openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}
          

/_openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        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);
}
          

/_openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(IERC20Upgradeable 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");
        }
    }
}
          

/_openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

/_openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 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);
            }
        }
    }
}
          

/_openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

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

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

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}
          

/_openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

/_openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
          

Contract ABI

[{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"bool","name":"isNodeUser","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"bool","name":"isNodeUser","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"bool","name":"isNodeUser","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"WithdrawTL","inputs":[{"type":"uint256","name":"reward","internalType":"uint256","indexed":false},{"type":"uint256","name":"pendingStar","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"BONUS_MULTIPLIER","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"address","name":"_lpToken","internalType":"contract IERC20Upgradeable"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"bool","name":"_withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"bonusAddr","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enterStakingNFT","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAllocationInfo","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMultiplier","inputs":[{"type":"uint256","name":"_from","internalType":"uint256"},{"type":"uint256","name":"_to","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getStakingNFTAmount","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_starToken","internalType":"address"},{"type":"address","name":"_bonus","internalType":"address"},{"type":"address","name":"_node","internalType":"address"},{"type":"uint256","name":"_starPerBlock","internalType":"uint256"},{"type":"uint256","name":"_startBlock","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isNodeUser","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPoolUser","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"leaveStakingNFT","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lockAddr","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockRatio","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"massUpdatePools","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrate","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMigratorChef"}],"name":"migrator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract INFTLogic"}],"name":"nftLogic","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"nftPendingStar","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingStar","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"lpToken","internalType":"contract IERC20Upgradeable"},{"type":"uint256","name":"lpSupply","internalType":"uint256"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardBlock","internalType":"uint256"},{"type":"uint256","name":"accStarPerShare","internalType":"uint256"},{"type":"uint256","name":"extraAmount","internalType":"uint256"},{"type":"uint256","name":"fee","internalType":"uint256"},{"type":"uint256","name":"size","internalType":"uint256"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"regNodeUser","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rewardAddr","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardRatio","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"bool","name":"_withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAllocationInfo","inputs":[{"type":"address","name":"_lockAddr","internalType":"address"},{"type":"address","name":"_teamAddr","internalType":"address"},{"type":"address","name":"_rewardAddr","internalType":"address"},{"type":"uint256","name":"_lockRatio","internalType":"uint256"},{"type":"uint256","name":"_teamRatio","internalType":"uint256"},{"type":"uint256","name":"_rewardRatio","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBonus","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMigrator","inputs":[{"type":"address","name":"_migrator","internalType":"contract IMigratorChef"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNFTLogic","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNode","inputs":[{"type":"address","name":"_node","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStarNFT","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC721Upgradeable"}],"name":"starNFT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IStarNode"}],"name":"starNode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"starPerBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Upgradeable"}],"name":"starToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"teamAddr","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"teamRatio","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"testImint","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"testdeposit","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"testleaveStakingNFT","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"testpendingStar","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMultiplier","inputs":[{"type":"uint256","name":"multiplierNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updatePool","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_type","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"userIndex","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"rewardDebt","internalType":"uint256"},{"type":"uint256","name":"reward","internalType":"uint256"},{"type":"uint256","name":"userRewardDebt","internalType":"uint256"},{"type":"uint256","name":"lastDeposit","internalType":"uint256"},{"type":"uint256","name":"nftAmount","internalType":"uint256"},{"type":"uint256","name":"nftRewardDebt","internalType":"uint256"},{"type":"uint256","name":"nftReward","internalType":"uint256"},{"type":"uint256","name":"nftUserRewardDebt","internalType":"uint256"},{"type":"uint256","name":"nftLastDeposit","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userNFTs","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b50614ca0806100206000396000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c8063646033bc116101b8578063988d7a6011610104578063b7ca51e8116100a2578063c62ba3701161007c578063c62ba3701461085d578063e231d96414610870578063e2bbb15814610898578063f2fde38b146108ab57600080fd5b8063b7ca51e814610809578063bf0645511461081c578063c21d5ab71461084a57600080fd5b8063a0b4f431116100de578063a0b4f4311461075d578063a6b63eb8146107b0578063b0bf74e3146107c3578063b3bcb633146107d657600080fd5b8063988d7a60146107385780639c3709ea1461074b5780639fc3ab031461075457600080fd5b80637fdab94e116101715780638da5cb5b1161014b5780638da5cb5b146106485780638dbb1e3a1461065957806393f1a40b1461066c57806396ed7f891461072557600080fd5b80637fdab94e146106195780638862445a1461062c5780638aa285501461063f57600080fd5b8063646033bc146105bc5780636aef2866146105c55780637015e95e146105d857806370dca974146105eb578063715018a6146105fe5780637cd07e471461060657600080fd5b8063291c73c31161029257806348cd4cb1116102305780635312ea8e1161020a5780635312ea8e1461057b57806355ab356e1461058e5780635ffe6146146105a1578063630b5ba1146105b457600080fd5b806348cd4cb11461054c5780634a5ff7491461055557806351c0e71d1461056857600080fd5b806337ef75c81161026c57806337ef75c8146104ea5780633a4bc9c2146104fd578063441a3e7014610526578063454b06081461053957600080fd5b8063291c73c31461049057806329a111b2146104a35780632d5ad7a9146104d757600080fd5b806312dcff7a116102ff57806315bd0212116102d957806315bd02121461044e57806317caf6f11461046157806323cf31181461046a57806325136f1f1461047d57600080fd5b806312dcff7a146103b657806313eaabb8146103cb5780631526fe27146103f657600080fd5b8062ed820614610346578063081e3eda14610362578063082abd0c1461036a5780630b32fcea1461037d5780630ce9666a1461039057806312bdc1ca146103a3575b600080fd5b61034f606a5481565b6040519081526020015b60405180910390f35b606d5461034f565b61034f6103783660046147ac565b6108be565b61034f61038b3660046147e3565b610a80565b61034f61039e366004614813565b610c14565b61034f6103b13660046147e3565b610e29565b6103c96103c436600461482c565b611058565b005b6067546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610359565b610409610404366004614813565b61110e565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e082015261010001610359565b6103c961045c366004614813565b61116e565b61034f60715481565b6103c961047836600461482c565b611a5f565b6069546103de906001600160a01b031681565b61034f61049e366004614849565b611aab565b6103de6104b13660046147ac565b606f6020908152600092835260408084209091529082529020546001600160a01b031681565b6066546103de906001600160a01b031681565b6103c96104f836600461482c565b611adc565b61034f61050b36600461482c565b6001600160a01b03166000908152607a602052604090205490565b6103c96105343660046147ac565b611b89565b6103c9610547366004614813565b612249565b61034f60725481565b6074546103de906001600160a01b031681565b6103c96105763660046147ac565b6124ad565b6103c9610589366004614813565b6124f2565b6103c961059c36600461482c565b6125c0565b6103c96105af366004614813565b612662565b6103c9612691565b61034f60785481565b6103c96105d3366004614875565b6126be565b6075546103de906001600160a01b031681565b6068546103de906001600160a01b031681565b6103c9612737565b606c546103de906001600160a01b031681565b6073546103de906001600160a01b031681565b6103c961063a3660046148e8565b61276d565b61034f606b5481565b6033546001600160a01b03166103de565b61034f6106673660046147ac565b612872565b6106db61067a3660046147e3565b606e60205281600052604060002060205280600052604060002060009150915050806000015490806001015490806002015490806003015490806004015490806005015490806006015490806007015490806008015490806009015490508a565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a086015260c085015260e084015261010083015261012082015261014001610359565b6103c96107333660046147ac565b61288d565b6103c9610746366004614929565b612b7d565b61034f60765481565b61034f60775481565b607354607454607554607654607754607854604080516001600160a01b039788168152958716602087015295909316948401949094526060830152608082019290925260a081019190915260c001610359565b6103c96107be366004614968565b612d81565b6103c96107d136600461482c565b612dfe565b6107f96107e436600461482c565b60796020526000908152604090205460ff1681565b6040519015158152602001610359565b6065546103de906001600160a01b031681565b6107f961082a3660046147e3565b607060209081526000928352604080842090915290825290205460ff1681565b6103c961085836600461482c565b612ea0565b6103c961086b366004614813565b612f42565b61088361087e366004614849565b613630565b60408051928352602083019190915201610359565b6103c96108a63660046147ac565b6138da565b6103c96108b936600461482c565b613d97565b600080606d84815481106108d4576108d46149c3565b60009182526020808320878452606e909152604083206008909202019250816108fa3390565b6001600160a01b039081168252602082019290925260400160009081206066549093509091829116633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561096b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098f91906149d9565b909250905060006109c16109b960646109b36109ab8787613e32565b885490613e3e565b90613e4a565b855490613e32565b6004860154600387015491925090431180156109e05750600186015415155b15610a425760006109f5876003015443612872565b90506000610a226071546109b38a60020154610a1c606a5487613e3e90919063ffffffff16565b90613e3e565b6001890154909150610a3d906109b38364e8d4a51000613e3e565b925050505b6000610a5764e8d4a510006109b38585613e3e565b865490915015610a73576002860154610a709082613e32565b90505b9998505050505050505050565b600080606d8481548110610a9657610a966149c3565b60009182526020808320878452606e825260408085206001600160a01b03891686529092529220600460089092029092019081015460038201549193509043118015610ae55750600183015415155b15610b41576000610afa846003015443612872565b90506000610b216071546109b38760020154610a1c606a5487613e3e90919063ffffffff16565b6001860154909150610b3c906109b38364e8d4a51000613e3e565b925050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf91906149d9565b90925090506000610beb610be360646109b3610bdb8787613e32565b895490613e3e565b865490613e32565b90506000610c0264e8d4a510006109b38488613e3e565b6002870154909150610a709082613e32565b600080606d600081548110610c2b57610c2b6149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b83398151915281610c5c3390565b6001600160a01b03166001600160a01b031681526020019081526020016000209050610c866146f5565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cff91906149d9565b6060830181905260408301829052610d179190613e32565b602082018190526005830154610d4391610d38916064916109b39190613e3e565b600584015490613e32565b6080820152600483015460a082015260058301546001840154610d6591613e32565b60c0820152600383015443118015610d80575060c081015115155b15610dde57610d93836003015443612872565b60e082018190526071546002850154606a54610db8936109b39291610a1c9190613e3e565b610100820181905260c0820151610dd8916109b39064e8d4a51000613e3e565b60a08201525b6000610e0464e8d4a510006109b38460a001518560800151613e3e90919063ffffffff16565b835490915015610e20576007830154610e1d9082613e32565b90505b95945050505050565b600080606d8481548110610e3f57610e3f6149c3565b60009182526020808320878452606e825260408085206001600160a01b03891686529092529220600460089092029092019081015460038201549193509043118015610e8e5750600183015415155b15610efe576000610ea3846003015443612872565b90506000610eca6071546109b38760020154610a1c606a5487613e3e90919063ffffffff16565b9050610ef9610eea86600501548760010154613e3290919063ffffffff16565b6109b38364e8d4a51000613e3e565b925050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c91906149d9565b90925090506000610f98610be360646109b3610bdb8787613e32565b90506000610faf64e8d4a510006109b38488613e3e565b6002870154909150610fc19082613e32565b90508015610a7357610ff9610ff260646109b3610feb607754607654613e3290919063ffffffff16565b8590613e3e565b8290613e56565b9050611018610ff260646109b360785485613e3e90919063ffffffff16565b905061103d611032606461102c8787613e32565b90613e32565b6109b3836064613e3e565b9050610a7060646109b36110518783613e32565b8490613e3e565b6033546001600160a01b0316331461108b5760405162461bcd60e51b8152600401611082906149fd565b60405180910390fd5b6001600160a01b0381166110ec5760405162461bcd60e51b815260206004820152602260248201527f626f6e757320616464726573732063616e206e6f742062652061646472657373604482015261020360f41b6064820152608401611082565b606780546001600160a01b0319166001600160a01b0392909216919091179055565b606d818154811061111e57600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b0390961697509395929491939092909188565b6000606d600081548110611184576111846149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b833981519152816111b53390565b6001600160a01b03166001600160a01b0316815260200190815260200160002090506111df6146f5565b336000908152607a60205260409020546112245760405162461bcd60e51b81526020600482015260066024820152651b9bc813919560d21b6044820152606401611082565b6112306000600261288d565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906149d9565b60608301819052604083018290526112c19190613e32565b6020820181905260058301546112e291610d38916064916109b39190613e3e565b6080820152600483015460a08201526005830154600184015461130491613e32565b60c082015260038301544311801561131f575060c081015115155b1561137d57611332836003015443612872565b60e082018190526071546002850154606a54611357936109b39291610a1c9190613e3e565b610100820181905260c0820151611377916109b39064e8d4a51000613e3e565b60a08201525b6005820154156113c65760006113ad64e8d4a510006109b38460a001518560800151613e3e90919063ffffffff16565b60078401549091506113bf9082613e32565b6007840155505b600782015480156117245760735460765461140a916001600160a01b0316906113f7906064906109b3908690613e3e565b6065546001600160a01b03169190613e62565b607454607754611430916001600160a01b0316906113f7906064906109b3908690613e3e565b611452610ff260646109b3610feb607754607654613e3290919063ffffffff16565b60755460785491925061147d916001600160a01b03909116906113f7906064906109b3908690613e3e565b61149a610ff260646109b360785485613e3e90919063ffffffff16565b90506114b761103260648460200151613e3290919063ffffffff16565b90506114c64262093a80613e56565b83600401541115611659576114ee6127106109b3866006015484613e3e90919063ffffffff16565b610180830152611529336113f760646109b361151860648860400151613e3290919063ffffffff16565b610180880151610a1c908890613e56565b6066546001600160a01b031663986f33e03361156060646109b38760600151610a1c89610180015189613e5690919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156115a657600080fd5b505af11580156115ba573d6000803e3d6000fd5b505050506115fd6115f260646109b36115e160648760400151613e3290919063ffffffff16565b610180870151610a1c908790613e56565b600685015490613e32565b600684015560675461018083015161162b916001600160a01b0316906113f7906064906109b3906046613e3e565b607354610180830151611654916001600160a01b0316906113f7906064906109b390601e613e3e565b611712565b611671335b6065546001600160a01b03169083613e62565b6066546001600160a01b031663986f33e03361169f60646109b3876060015187613e3e90919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050600684015461170c915082613e32565b60068401555b6000600784015560a082015160048501555b8415611a5857336000908152607a602052604081206101208401919091525b80546101208401511015611a5657858184610120015181548110611769576117696149c3565b90600052602060002001541415611a3d57606954604051634b893b5760e11b81526004810188905260009182916001600160a01b039091169063971276ae90602401608060405180830381865afa1580156117c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ec9190614a32565b93509350505061180a60646109b38385613e3e90919063ffffffff16565b61014086018190521561190a57600061184961183d60646109b389602001518a6101400151613e3e90919063ffffffff16565b61014088015190613e32565b600589015490915061185b9082613e56565b6005890155610140860151600189015461187491613e56565b6001890155610140860151600588015461188d91613e56565b6005880155835484906118a290600190614a8d565b815481106118b2576118b26149c3565b906000526020600020015484876101200151815481106118d4576118d46149c3565b9060005260206000200181905550838054806118f2576118f2614aa4565b60019003818190600052602060002001600090559055505b6068546001600160a01b03166323b872dd30336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018b9052606401600060405180830381600087803b15801561196c57600080fd5b505af1158015611980573d6000803e3d6000fd5b505050506119b26119a760646109b388604001518a60050154613e3e90919063ffffffff16565b600588015490613e32565b6080860181905260048801546119d39164e8d4a51000916109b39190613e3e565b60068701556000337fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d272611a0b60646109b38787613e3e565b3360009081526079602090815260409182902054825193845260ff161515908301528051918290030190a35050611a56565b6101208301805190611a4e82614aba565b905250611743565b505b5050505050565b6033546001600160a01b03163314611a895760405162461bcd60e51b8152600401611082906149fd565b606c80546001600160a01b0319166001600160a01b0392909216919091179055565b607a6020528160005260406000208181548110611ac757600080fd5b90600052602060002001600091509150505481565b6033546001600160a01b03163314611b065760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116611b675760405162461bcd60e51b815260206004820152602260248201527f6c6f67696320616464726573732063616e206e6f742062652061646472657373604482015261020360f41b6064820152608401611082565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6000606d8381548110611b9e57611b9e6149c3565b60009182526020808320868452606e90915260408320600890920201925081611bc43390565b6001600160a01b03166001600160a01b031681526020019081526020016000209050611bee6146f5565b8154841115611c385760405162461bcd60e51b81526020600482015260166024820152753bb4ba34323930bb9d1030b6b7bab73a1032b93937b960511b6044820152606401611082565b611c4385600161288d565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cbc91906149d9565b6060830181905260408301829052600091611cf591611ced916064916109b391611ce591613e32565b875490613e3e565b845490613e32565b90506000846004015490506000611d1d86600501548760010154613e3290919063ffffffff16565b9050856003015443118015611d3157508015155b15611d8957611d44866003015443612872565b60e085018190526071546002880154606a54611d69936109b39291610a1c9190613e3e565b6101008501819052611d869082906109b39064e8d4a51000613e3e565b91505b8215611e0757611da264e8d4a510006109b38585613e3e565b610160850181905260028601546040517f069cf917f05d714ae2887907c063ffb6734872d599071579f317e9b5a48cacf192611de5928252602082015260400190565b60405180910390a16101608401516002860154611e0191613e32565b60028601555b6002850154801561215e57607354607654611e38916001600160a01b0316906113f7906064906109b3908690613e3e565b607454607754611e5e916001600160a01b0316906113f7906064906109b3908690613e3e565b611e80610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250611eab916001600160a01b03909116906113f7906064906109b3908690613e3e565b611ec8610ff260646109b360785485613e3e90919063ffffffff16565b9050611ef96064610a1c611ef2606461102c8a606001518b60400151613e3290919063ffffffff16565b8490613e4a565b9050611f084262093a80613e56565b866004015411156120a557611f306127106109b3896006015484613e3e90919063ffffffff16565b610180860152611f6b336113f760646109b3611f5a60648b60400151613e3290919063ffffffff16565b6101808b0151610a1c908890613e56565b6066546001600160a01b031663986f33e033611fa260646109b38a60600151610a1c8c610180015189613e5690919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015611fe857600080fd5b505af1158015611ffc573d6000803e3d6000fd5b5050505061203f61203460646109b361202360648a60400151613e3290919063ffffffff16565b6101808a0151610a1c908790613e56565b600188015490613e32565b60018701556006870154156120a057606754610180860151612077916001600160a01b0316906113f7906064906109b3906046613e3e565b6073546101808601516120a0916001600160a01b0316906113f7906064906109b390601e613e3e565b61214f565b6120ae3361165e565b6066546001600160a01b031663986f33e0336120dc60646109b38a6060015187613e3e90919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561212257600080fd5b505af1158015612136573d6000803e3d6000fd5b5050506001870154612149915082613e32565b60018701555b60006002870155600487018390555b87156121dd5785546121709089613e56565b86556060850151604086015160009161219a916064916109b39161219391613e32565b8c90613e3e565b60058901549091506121ac9082613e56565b600589015560018801546121c0908a613e56565b60018901556121db3389546001600160a01b0316908b613e62565b505b88337fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d2728a60796000845b6001600160a01b03168152602080820192909252604090810160002054815193845260ff161515918301919091520160405180910390a3505050505050505050565b6033546001600160a01b031633146122735760405162461bcd60e51b8152600401611082906149fd565b606c546001600160a01b03166122c25760405162461bcd60e51b815260206004820152601460248201527336b4b3b930ba329d1037379036b4b3b930ba37b960611b6044820152606401611082565b6000606d82815481106122d7576122d76149c3565b6000918252602082206008919091020180546040516370a0823160e01b81523060048201529193506001600160a01b0316919082906370a0823190602401602060405180830381865afa158015612332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123569190614ad5565b606c54909150612373906001600160a01b03848116911683613ec5565b606c5460405163ce5494bb60e01b81526001600160a01b038481166004830152600092169063ce5494bb906024016020604051808303816000875af11580156123c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e49190614aee565b6040516370a0823160e01b81523060048201529091506001600160a01b038216906370a0823190602401602060405180830381865afa15801561242b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244f9190614ad5565b821461248c5760405162461bcd60e51b815260206004820152600c60248201526b1b5a59dc985d194e8818985960a21b6044820152606401611082565b83546001600160a01b0319166001600160a01b039190911617909255505050565b6000606d83815481106124c2576124c26149c3565b60009182526020822060089091020180549092506124ed916001600160a01b03909116903085613fda565b505050565b6000606d8281548110612507576125076149c3565b60009182526020808320858452606e9091526040832060089092020192508161252d3390565b6001600160a01b031681526020810191909152604001600020905061256033825484546001600160a01b03169190613e62565b80543360008181526079602090815260409182902054825194855260ff16151590840152805186937f9fef67ca40344e5550d748f62064f1b3d31f46191945782c3c408c8aa26f3a2692908290030190a360008082556001909101555050565b6066546001600160a01b0316336001600160a01b03161461260e5760405162461bcd60e51b81526020600482015260086024820152676e6f74206e6f646560c01b6044820152606401611082565b6001600160a01b03811661263e5760405162461bcd60e51b81526020600482015260006024820152604401611082565b6001600160a01b03166000908152607960205260409020805460ff19166001179055565b6033546001600160a01b0316331461268c5760405162461bcd60e51b8152600401611082906149fd565b606b55565b606d5460005b818110156126ba576126aa81600061288d565b6126b381614aba565b9050612697565b5050565b6033546001600160a01b031633146126e85760405162461bcd60e51b8152600401611082906149fd565b607380546001600160a01b03199081166001600160a01b039889161790915560748054821696881696909617909555607580549095169390951692909217909255607691909155607755607855565b6033546001600160a01b031633146127615760405162461bcd60e51b8152600401611082906149fd565b61276b6000614018565b565b6033546001600160a01b031633146127975760405162461bcd60e51b8152600401611082906149fd565b80156127a5576127a5612691565b6127e28361102c606d87815481106127bf576127bf6149c3565b906000526020600020906008020160020154607154613e5690919063ffffffff16565b6071819055506000606d85815481106127fd576127fd6149c3565b906000526020600020906008020160020154905083606d8681548110612825576128256149c3565b90600052602060002090600802016002018190555082606d868154811061284e5761284e6149c3565b906000526020600020906008020160060181905550838114611a5857611a5861406a565b606b5460009061288690610a1c8486613e56565b9392505050565b6000606d83815481106128a2576128a26149c3565b90600052602060002090600802019050806003015443116128c257505050565b60018101546128d657436003909101555050565b60006128e6826003015443612872565b9050600061290d6071546109b38560020154610a1c606a5487613e3e90919063ffffffff16565b9050600061292c84600501548560010154613e3290919063ffffffff16565b905083600301544311801561294057508015155b15611a5657600061295a826109b38564e8d4a51000613e3e565b905060005b8560070154811015612b69576000888152606f602090815260408083208484529091529020546001600160a01b0316806129995750612b59565b6000898152606e602090815260408083206001600160a01b03851684529091529020805415612b5657606654604051630fe7f46160e21b81526001600160a01b0384811660048301526000928392911690633f9fd184906024016040805180830381865afa158015612a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3391906149d9565b90925090506000612a4f6109b960646109b36109ab8787613e32565b90506000612a7e612a7360646109b3612a688888613e32565b60058a015490613e3e565b600587015490613e32565b90506000612a9564e8d4a510006109b3858c613e3e565b90506000612aac64e8d4a510006109b3858d613e3e565b90506001600160a01b038816331415612b26578e60011415612ae1576007870154612ad79082613e32565b6007880155612b4f565b8e60021415612b03576002870154612af99083613e32565b6002880155612b4f565b6002870154612b129083613e32565b60028801556007870154612ad79082613e32565b6002870154612b359083613e32565b60028801556007870154612b499082613e32565b60078801555b5050505050505b50505b612b6281614aba565b905061295f565b506004850155436003850155505050505050565b6033546001600160a01b03163314612ba75760405162461bcd60e51b8152600401611082906149fd565b8015612bb557612bb5612691565b60006072544311612bc857607254612bca565b435b607154909150612bda9086613e32565b60715560408051610100810182526001600160a01b038681168252600060208301818152938301898152606084018681526080850183815260a0860184815260c087018b815260e08801868152606d8054600181018255975297517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d8600890970296870180546001600160a01b031916919098161790965596517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d985015591517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18da840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18db830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dc82015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dd840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18de830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18df90910155611a5861406a565b600054610100900460ff1680612d9a575060005460ff16155b612db65760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff16158015612dd8576000805461ffff19166101011790555b612de58686868686614126565b8015611a56576000805461ff0019169055505050505050565b6033546001600160a01b03163314612e285760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116612e7e5760405162461bcd60e51b815260206004820181905260248201527f4e465420616464726573732063616e206e6f74206265206164647265737320306044820152606401611082565b606880546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314612eca5760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116612f205760405162461bcd60e51b815260206004820152601960248201527f6e6f64652063616e206e6f7420626520616464726573732030000000000000006044820152606401611082565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6000606d600081548110612f5857612f586149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b83398151915281612f893390565b6001600160a01b0316815260208101919091526040016000209050336068546040516331a9108f60e11b8152600481018690526001600160a01b039283169290911690636352211e90602401602060405180830381865afa158015612ff2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130169190614aee565b6001600160a01b03161461305d5760405162461bcd60e51b815260206004820152600e60248201526d32b93937b91027232a103ab9b2b960911b6044820152606401611082565b6130696000600261288d565b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa1580156130c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e791906149d9565b9092509050600061311961310e60646109b36131038787613e32565b600589015490613e3e565b600586015490613e32565b9050600085600401549050600061314187600501548860010154613e3290919063ffffffff16565b905086600301544311801561315557508015155b156131ab57600061316a886003015443612872565b905060006131916071546109b38b60020154610a1c606a5487613e3e90919063ffffffff16565b90506131a6836109b38364e8d4a51000613e3e565b935050505b6005860154156131e35760006131ca64e8d4a510006109b38686613e3e565b60078801549091506131dc9082613e32565b6007880155505b6007860154801561338b57607354607654613214916001600160a01b0316906113f7906064906109b3908690613e3e565b60745460775461323a916001600160a01b0316906113f7906064906109b3908690613e3e565b61325c610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250613287916001600160a01b03909116906113f7906064906109b3908690613e3e565b6132a4610ff260646109b360785485613e3e90919063ffffffff16565b90506132b8611032606461102c8989613e32565b90506132d8335b6113f760646109b36132d18b83613e32565b8690613e3e565b6132f86132ed60646109b3610feb8a83613e32565b600689015490613e32565b60068801556066546001600160a01b031663986f33e03361331e60646109b3868b613e3e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561336457600080fd5b505af1158015613378573d6000803e3d6000fd5b5050600060078a01555050600488018390555b8815613602576068546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018c9052606401600060405180830381600087803b1580156133f157600080fd5b505af1158015613405573d6000803e3d6000fd5b50505050607a60006134143390565b6001600160a01b0390811682526020808301939093526040918201600090812080546001810182559082529381209093018c90556069549151634b893b5760e11b8152600481018d905283929091169063971276ae90602401608060405180830381865afa15801561348a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134ae9190614a32565b93509350505060006134ce60646109b38486613e3e90919063ffffffff16565b905060006134ee6134e760646109b36132d18e8e613e32565b8390613e32565b60058d01549091506135009082613e32565b60058d015560018c01546135149083613e32565b60018d015560058b01546135289083613e32565b60058c01554260098c01553360009081527f29272c5198ac4c1c7fb0303943f851de04a43367f02c26a44994c42c27db24b5602052604090205460ff166135fd5760078c01805460009081527fd0170a6220fef73a7dd2c1e9984b0b3831956884ac33b7728dde627780a65be56020526040812080546001600160a01b03191633179055815460019291906135be908490614b59565b90915550503360009081527f29272c5198ac4c1c7fb0303943f851de04a43367f02c26a44994c42c27db24b560205260409020805460ff191660011790555b505050505b6000337f6dbb6056a2fff319358e6dd7d0d72cb3baa992cdcc7e120fb0a32cd1601840e58b60798484612207565b6000806000606d600081548110613649576136496149c3565b600091825260208083206001600160a01b0389168452600080516020614c4b833981519152909152604083206008929092020160048101546005820154600183015492955092939092909161369d91613e32565b90508360030154431180156136b157508015155b156137075760006136c6856003015443612872565b905060006136ed6071546109b38860020154610a1c606a5487613e3e90919063ffffffff16565b9050613702836109b38364e8d4a51000613e3e565b935050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015613761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061378591906149d9565b606954604051634b893b5760e11b8152600481018d905292945090925060009182916001600160a01b03169063971276ae90602401608060405180830381865afa1580156137d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137fb9190614a32565b935093505050600061381b60646109b38486613e3e90919063ffffffff16565b905060006138346134e760646109b36132d18a8a613e32565b9050600061384b64e8d4a510006109b3848c613e3e565b905080156138bf57613875610ff260646109b3610feb607754607654613e3290919063ffffffff16565b9050613894610ff260646109b360785485613e3e90919063ffffffff16565b90506138a8611032606461102c8a8a613e32565b90506138bc60646109b36110518a83613e32565b90505b6007909901549b509799505050505050505050509250929050565b6000606d83815481106138ef576138ef6149c3565b60009182526020808320868452606e909152604083206008909202019250816139153390565b6001600160a01b03166001600160a01b03168152602001908152602001600020905061394284600161288d565b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561399c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c091906149d9565b909250905060006139dc6109b960646109b36109ab8787613e32565b90506000856004015490506000613a0487600501548860010154613e3290919063ffffffff16565b9050866003015443118015613a1857508015155b15613a6e576000613a2d886003015443612872565b90506000613a546071546109b38b60020154610a1c606a5487613e3e90919063ffffffff16565b9050613a69836109b38364e8d4a51000613e3e565b935050505b8215613aa2576000613a8964e8d4a510006109b38686613e3e565b6002880154909150613a9b9082613e32565b6002880155505b60028601548015613c3557607354607654613ad3916001600160a01b0316906113f7906064906109b3908690613e3e565b607454607754613af9916001600160a01b0316906113f7906064906109b3908690613e3e565b613b1b610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250613b46916001600160a01b03909116906113f7906064906109b3908690613e3e565b613b63610ff260646109b360785485613e3e90919063ffffffff16565b9050613b77611032606461102c8989613e32565b9050613b82336132bf565b613ba2613b9760646109b3610feb8a83613e32565b600189015490613e32565b60018801556066546001600160a01b031663986f33e033613bc860646109b3868b613e3e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015613c0e57600080fd5b505af1158015613c22573d6000803e3d6000fd5b5050600060028a01555050600488018390555b8815613d3757613c523389546001600160a01b031690308c613fda565b8654613c5e908a613e32565b87554260048801556000613c8160646109b3613c7a8a8a613e32565b8d90613e3e565b60058a0154909150613c939082613e32565b60058a01556001890154613ca7908b613e32565b60018a015560008b815260706020908152604080832033845290915290205460ff16613d355760008b8152606f6020908152604080832060078d01805485529252822080546001600160a01b03191633179055805460019290613d0b908490614b59565b909155505060008b81526070602090815260408083203384529091529020805460ff191660011790555b505b336000818152607960209081526040918290205482518d815260ff90911615159181019190915281518d93927f6dbb6056a2fff319358e6dd7d0d72cb3baa992cdcc7e120fb0a32cd1601840e5928290030190a350505050505050505050565b6033546001600160a01b03163314613dc15760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116613e265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611082565b613e2f81614018565b50565b60006128868284614b59565b60006128868284614b71565b60006128868284614b90565b60006128868284614a8d565b6040516001600160a01b0383166024820152604481018290526124ed90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261419a565b801580613f3f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190614ad5565b155b613faa5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401611082565b6040516001600160a01b0383166024820152604481018290526124ed90849063095ea7b360e01b90606401613e8e565b6040516001600160a01b03808516602483015283166044820152606481018290526140129085906323b872dd60e01b90608401613e8e565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606d54600060015b828110156140c3576140b1606d8281548110614090576140906149c3565b90600052602060002090600802016002015483613e3290919063ffffffff16565b91506140bc81614aba565b9050614072565b5080156126ba576140d5816003613e4a565b90506140f28161102c606d6000815481106127bf576127bf6149c3565b60718190555080606d60008154811061410d5761410d6149c3565b9060005260206000209060080201600201819055505050565b600054610100900460ff168061413f575060005460ff16155b61415b5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561417d576000805461ffff19166101011790555b61418561426c565b61418d6142d7565b612de58686868686614337565b60006141ef826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661457d9092919063ffffffff16565b8051909150156124ed578080602001905181019061420d9190614bb2565b6124ed5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611082565b600054610100900460ff1680614285575060005460ff16155b6142a15760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff161580156142c3576000805461ffff19166101011790555b8015613e2f576000805461ff001916905550565b600054610100900460ff16806142f0575060005460ff16155b61430c5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561432e576000805461ffff19166101011790555b6142c333614018565b600054610100900460ff1680614350575060005460ff16155b61436c5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561438e576000805461ffff19166101011790555b606580546001600160a01b03199081166001600160a01b03898116918217909355606780548316898516179055606680548316888516179055606a869055607285905560408051610100810182529182526000602083018181526103e8928401838152606085018981526080860184815260a0870185815260c0880186815260e08901878152606d8054600181018255985298517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d860089098029788018054909b169b169a909a1790985592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d985015590517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18da840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18db830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dc82015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dd84015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18de830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18df909101556071558015611a56576000805461ff0019169055505050505050565b606061458c8484600085614594565b949350505050565b6060824710156145f55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611082565b843b6146435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611082565b600080866001600160a01b0316858760405161465f9190614bfb565b60006040518083038185875af1925050503d806000811461469c576040519150601f19603f3d011682016040523d82523d6000602084013e6146a1565b606091505b50915091506146b18282866146bc565b979650505050505050565b606083156146cb575081612886565b8251156146db5782518084602001fd5b8160405162461bcd60e51b81526004016110829190614c17565b604051806101a0016040528061475260405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600080604083850312156147bf57600080fd5b50508035926020909101359150565b6001600160a01b0381168114613e2f57600080fd5b600080604083850312156147f657600080fd5b823591506020830135614808816147ce565b809150509250929050565b60006020828403121561482557600080fd5b5035919050565b60006020828403121561483e57600080fd5b8135612886816147ce565b6000806040838503121561485c57600080fd5b8235614867816147ce565b946020939093013593505050565b60008060008060008060c0878903121561488e57600080fd5b8635614899816147ce565b955060208701356148a9816147ce565b945060408701356148b9816147ce565b959894975094956060810135955060808101359460a0909101359350915050565b8015158114613e2f57600080fd5b600080600080608085870312156148fe57600080fd5b843593506020850135925060408501359150606085013561491e816148da565b939692955090935050565b6000806000806080858703121561493f57600080fd5b843593506020850135614951816147ce565b925060408501359150606085013561491e816148da565b600080600080600060a0868803121561498057600080fd5b853561498b816147ce565b9450602086013561499b816147ce565b935060408601356149ab816147ce565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052603260045260246000fd5b600080604083850312156149ec57600080fd5b505080516020909101519092909150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008060008060808587031215614a4857600080fd5b845160ff81168114614a5957600080fd5b60208601516040870151606090970151919890975090945092505050565b634e487b7160e01b600052601160045260246000fd5b600082821015614a9f57614a9f614a77565b500390565b634e487b7160e01b600052603160045260246000fd5b6000600019821415614ace57614ace614a77565b5060010190565b600060208284031215614ae757600080fd5b5051919050565b600060208284031215614b0057600080fd5b8151612886816147ce565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008219821115614b6c57614b6c614a77565b500190565b6000816000190483118215151615614b8b57614b8b614a77565b500290565b600082614bad57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215614bc457600080fd5b8151612886816148da565b60005b83811015614bea578181015183820152602001614bd2565b838111156140125750506000910152565b60008251614c0d818460208701614bcf565b9190910192915050565b6020815260008251806020840152614c36816040850160208701614bcf565b601f01601f1916919091016040019291505056fe136eb4aae73f7618d8559a84c5ff3678edc6b16994db052447ebc43c429b7d6fa2646970667358221220b7e1dbf881511b22f46dbe0236df158024c3b12929dee853bc7d7d4f730f392764736f6c634300080a0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106103415760003560e01c8063646033bc116101b8578063988d7a6011610104578063b7ca51e8116100a2578063c62ba3701161007c578063c62ba3701461085d578063e231d96414610870578063e2bbb15814610898578063f2fde38b146108ab57600080fd5b8063b7ca51e814610809578063bf0645511461081c578063c21d5ab71461084a57600080fd5b8063a0b4f431116100de578063a0b4f4311461075d578063a6b63eb8146107b0578063b0bf74e3146107c3578063b3bcb633146107d657600080fd5b8063988d7a60146107385780639c3709ea1461074b5780639fc3ab031461075457600080fd5b80637fdab94e116101715780638da5cb5b1161014b5780638da5cb5b146106485780638dbb1e3a1461065957806393f1a40b1461066c57806396ed7f891461072557600080fd5b80637fdab94e146106195780638862445a1461062c5780638aa285501461063f57600080fd5b8063646033bc146105bc5780636aef2866146105c55780637015e95e146105d857806370dca974146105eb578063715018a6146105fe5780637cd07e471461060657600080fd5b8063291c73c31161029257806348cd4cb1116102305780635312ea8e1161020a5780635312ea8e1461057b57806355ab356e1461058e5780635ffe6146146105a1578063630b5ba1146105b457600080fd5b806348cd4cb11461054c5780634a5ff7491461055557806351c0e71d1461056857600080fd5b806337ef75c81161026c57806337ef75c8146104ea5780633a4bc9c2146104fd578063441a3e7014610526578063454b06081461053957600080fd5b8063291c73c31461049057806329a111b2146104a35780632d5ad7a9146104d757600080fd5b806312dcff7a116102ff57806315bd0212116102d957806315bd02121461044e57806317caf6f11461046157806323cf31181461046a57806325136f1f1461047d57600080fd5b806312dcff7a146103b657806313eaabb8146103cb5780631526fe27146103f657600080fd5b8062ed820614610346578063081e3eda14610362578063082abd0c1461036a5780630b32fcea1461037d5780630ce9666a1461039057806312bdc1ca146103a3575b600080fd5b61034f606a5481565b6040519081526020015b60405180910390f35b606d5461034f565b61034f6103783660046147ac565b6108be565b61034f61038b3660046147e3565b610a80565b61034f61039e366004614813565b610c14565b61034f6103b13660046147e3565b610e29565b6103c96103c436600461482c565b611058565b005b6067546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610359565b610409610404366004614813565b61110e565b604080516001600160a01b0390991689526020890197909752958701949094526060860192909252608085015260a084015260c083015260e082015261010001610359565b6103c961045c366004614813565b61116e565b61034f60715481565b6103c961047836600461482c565b611a5f565b6069546103de906001600160a01b031681565b61034f61049e366004614849565b611aab565b6103de6104b13660046147ac565b606f6020908152600092835260408084209091529082529020546001600160a01b031681565b6066546103de906001600160a01b031681565b6103c96104f836600461482c565b611adc565b61034f61050b36600461482c565b6001600160a01b03166000908152607a602052604090205490565b6103c96105343660046147ac565b611b89565b6103c9610547366004614813565b612249565b61034f60725481565b6074546103de906001600160a01b031681565b6103c96105763660046147ac565b6124ad565b6103c9610589366004614813565b6124f2565b6103c961059c36600461482c565b6125c0565b6103c96105af366004614813565b612662565b6103c9612691565b61034f60785481565b6103c96105d3366004614875565b6126be565b6075546103de906001600160a01b031681565b6068546103de906001600160a01b031681565b6103c9612737565b606c546103de906001600160a01b031681565b6073546103de906001600160a01b031681565b6103c961063a3660046148e8565b61276d565b61034f606b5481565b6033546001600160a01b03166103de565b61034f6106673660046147ac565b612872565b6106db61067a3660046147e3565b606e60205281600052604060002060205280600052604060002060009150915050806000015490806001015490806002015490806003015490806004015490806005015490806006015490806007015490806008015490806009015490508a565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a086015260c085015260e084015261010083015261012082015261014001610359565b6103c96107333660046147ac565b61288d565b6103c9610746366004614929565b612b7d565b61034f60765481565b61034f60775481565b607354607454607554607654607754607854604080516001600160a01b039788168152958716602087015295909316948401949094526060830152608082019290925260a081019190915260c001610359565b6103c96107be366004614968565b612d81565b6103c96107d136600461482c565b612dfe565b6107f96107e436600461482c565b60796020526000908152604090205460ff1681565b6040519015158152602001610359565b6065546103de906001600160a01b031681565b6107f961082a3660046147e3565b607060209081526000928352604080842090915290825290205460ff1681565b6103c961085836600461482c565b612ea0565b6103c961086b366004614813565b612f42565b61088361087e366004614849565b613630565b60408051928352602083019190915201610359565b6103c96108a63660046147ac565b6138da565b6103c96108b936600461482c565b613d97565b600080606d84815481106108d4576108d46149c3565b60009182526020808320878452606e909152604083206008909202019250816108fa3390565b6001600160a01b039081168252602082019290925260400160009081206066549093509091829116633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561096b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098f91906149d9565b909250905060006109c16109b960646109b36109ab8787613e32565b885490613e3e565b90613e4a565b855490613e32565b6004860154600387015491925090431180156109e05750600186015415155b15610a425760006109f5876003015443612872565b90506000610a226071546109b38a60020154610a1c606a5487613e3e90919063ffffffff16565b90613e3e565b6001890154909150610a3d906109b38364e8d4a51000613e3e565b925050505b6000610a5764e8d4a510006109b38585613e3e565b865490915015610a73576002860154610a709082613e32565b90505b9998505050505050505050565b600080606d8481548110610a9657610a966149c3565b60009182526020808320878452606e825260408085206001600160a01b03891686529092529220600460089092029092019081015460038201549193509043118015610ae55750600183015415155b15610b41576000610afa846003015443612872565b90506000610b216071546109b38760020154610a1c606a5487613e3e90919063ffffffff16565b6001860154909150610b3c906109b38364e8d4a51000613e3e565b925050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf91906149d9565b90925090506000610beb610be360646109b3610bdb8787613e32565b895490613e3e565b865490613e32565b90506000610c0264e8d4a510006109b38488613e3e565b6002870154909150610a709082613e32565b600080606d600081548110610c2b57610c2b6149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b83398151915281610c5c3390565b6001600160a01b03166001600160a01b031681526020019081526020016000209050610c866146f5565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cff91906149d9565b6060830181905260408301829052610d179190613e32565b602082018190526005830154610d4391610d38916064916109b39190613e3e565b600584015490613e32565b6080820152600483015460a082015260058301546001840154610d6591613e32565b60c0820152600383015443118015610d80575060c081015115155b15610dde57610d93836003015443612872565b60e082018190526071546002850154606a54610db8936109b39291610a1c9190613e3e565b610100820181905260c0820151610dd8916109b39064e8d4a51000613e3e565b60a08201525b6000610e0464e8d4a510006109b38460a001518560800151613e3e90919063ffffffff16565b835490915015610e20576007830154610e1d9082613e32565b90505b95945050505050565b600080606d8481548110610e3f57610e3f6149c3565b60009182526020808320878452606e825260408085206001600160a01b03891686529092529220600460089092029092019081015460038201549193509043118015610e8e5750600183015415155b15610efe576000610ea3846003015443612872565b90506000610eca6071546109b38760020154610a1c606a5487613e3e90919063ffffffff16565b9050610ef9610eea86600501548760010154613e3290919063ffffffff16565b6109b38364e8d4a51000613e3e565b925050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7c91906149d9565b90925090506000610f98610be360646109b3610bdb8787613e32565b90506000610faf64e8d4a510006109b38488613e3e565b6002870154909150610fc19082613e32565b90508015610a7357610ff9610ff260646109b3610feb607754607654613e3290919063ffffffff16565b8590613e3e565b8290613e56565b9050611018610ff260646109b360785485613e3e90919063ffffffff16565b905061103d611032606461102c8787613e32565b90613e32565b6109b3836064613e3e565b9050610a7060646109b36110518783613e32565b8490613e3e565b6033546001600160a01b0316331461108b5760405162461bcd60e51b8152600401611082906149fd565b60405180910390fd5b6001600160a01b0381166110ec5760405162461bcd60e51b815260206004820152602260248201527f626f6e757320616464726573732063616e206e6f742062652061646472657373604482015261020360f41b6064820152608401611082565b606780546001600160a01b0319166001600160a01b0392909216919091179055565b606d818154811061111e57600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b0390961697509395929491939092909188565b6000606d600081548110611184576111846149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b833981519152816111b53390565b6001600160a01b03166001600160a01b0316815260200190815260200160002090506111df6146f5565b336000908152607a60205260409020546112245760405162461bcd60e51b81526020600482015260066024820152651b9bc813919560d21b6044820152606401611082565b6112306000600261288d565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611285573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a991906149d9565b60608301819052604083018290526112c19190613e32565b6020820181905260058301546112e291610d38916064916109b39190613e3e565b6080820152600483015460a08201526005830154600184015461130491613e32565b60c082015260038301544311801561131f575060c081015115155b1561137d57611332836003015443612872565b60e082018190526071546002850154606a54611357936109b39291610a1c9190613e3e565b610100820181905260c0820151611377916109b39064e8d4a51000613e3e565b60a08201525b6005820154156113c65760006113ad64e8d4a510006109b38460a001518560800151613e3e90919063ffffffff16565b60078401549091506113bf9082613e32565b6007840155505b600782015480156117245760735460765461140a916001600160a01b0316906113f7906064906109b3908690613e3e565b6065546001600160a01b03169190613e62565b607454607754611430916001600160a01b0316906113f7906064906109b3908690613e3e565b611452610ff260646109b3610feb607754607654613e3290919063ffffffff16565b60755460785491925061147d916001600160a01b03909116906113f7906064906109b3908690613e3e565b61149a610ff260646109b360785485613e3e90919063ffffffff16565b90506114b761103260648460200151613e3290919063ffffffff16565b90506114c64262093a80613e56565b83600401541115611659576114ee6127106109b3866006015484613e3e90919063ffffffff16565b610180830152611529336113f760646109b361151860648860400151613e3290919063ffffffff16565b610180880151610a1c908890613e56565b6066546001600160a01b031663986f33e03361156060646109b38760600151610a1c89610180015189613e5690919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156115a657600080fd5b505af11580156115ba573d6000803e3d6000fd5b505050506115fd6115f260646109b36115e160648760400151613e3290919063ffffffff16565b610180870151610a1c908790613e56565b600685015490613e32565b600684015560675461018083015161162b916001600160a01b0316906113f7906064906109b3906046613e3e565b607354610180830151611654916001600160a01b0316906113f7906064906109b390601e613e3e565b611712565b611671335b6065546001600160a01b03169083613e62565b6066546001600160a01b031663986f33e03361169f60646109b3876060015187613e3e90919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050600684015461170c915082613e32565b60068401555b6000600784015560a082015160048501555b8415611a5857336000908152607a602052604081206101208401919091525b80546101208401511015611a5657858184610120015181548110611769576117696149c3565b90600052602060002001541415611a3d57606954604051634b893b5760e11b81526004810188905260009182916001600160a01b039091169063971276ae90602401608060405180830381865afa1580156117c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ec9190614a32565b93509350505061180a60646109b38385613e3e90919063ffffffff16565b61014086018190521561190a57600061184961183d60646109b389602001518a6101400151613e3e90919063ffffffff16565b61014088015190613e32565b600589015490915061185b9082613e56565b6005890155610140860151600189015461187491613e56565b6001890155610140860151600588015461188d91613e56565b6005880155835484906118a290600190614a8d565b815481106118b2576118b26149c3565b906000526020600020015484876101200151815481106118d4576118d46149c3565b9060005260206000200181905550838054806118f2576118f2614aa4565b60019003818190600052602060002001600090559055505b6068546001600160a01b03166323b872dd30336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604481018b9052606401600060405180830381600087803b15801561196c57600080fd5b505af1158015611980573d6000803e3d6000fd5b505050506119b26119a760646109b388604001518a60050154613e3e90919063ffffffff16565b600588015490613e32565b6080860181905260048801546119d39164e8d4a51000916109b39190613e3e565b60068701556000337fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d272611a0b60646109b38787613e3e565b3360009081526079602090815260409182902054825193845260ff161515908301528051918290030190a35050611a56565b6101208301805190611a4e82614aba565b905250611743565b505b5050505050565b6033546001600160a01b03163314611a895760405162461bcd60e51b8152600401611082906149fd565b606c80546001600160a01b0319166001600160a01b0392909216919091179055565b607a6020528160005260406000208181548110611ac757600080fd5b90600052602060002001600091509150505481565b6033546001600160a01b03163314611b065760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116611b675760405162461bcd60e51b815260206004820152602260248201527f6c6f67696320616464726573732063616e206e6f742062652061646472657373604482015261020360f41b6064820152608401611082565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6000606d8381548110611b9e57611b9e6149c3565b60009182526020808320868452606e90915260408320600890920201925081611bc43390565b6001600160a01b03166001600160a01b031681526020019081526020016000209050611bee6146f5565b8154841115611c385760405162461bcd60e51b81526020600482015260166024820152753bb4ba34323930bb9d1030b6b7bab73a1032b93937b960511b6044820152606401611082565b611c4385600161288d565b6066546001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cbc91906149d9565b6060830181905260408301829052600091611cf591611ced916064916109b391611ce591613e32565b875490613e3e565b845490613e32565b90506000846004015490506000611d1d86600501548760010154613e3290919063ffffffff16565b9050856003015443118015611d3157508015155b15611d8957611d44866003015443612872565b60e085018190526071546002880154606a54611d69936109b39291610a1c9190613e3e565b6101008501819052611d869082906109b39064e8d4a51000613e3e565b91505b8215611e0757611da264e8d4a510006109b38585613e3e565b610160850181905260028601546040517f069cf917f05d714ae2887907c063ffb6734872d599071579f317e9b5a48cacf192611de5928252602082015260400190565b60405180910390a16101608401516002860154611e0191613e32565b60028601555b6002850154801561215e57607354607654611e38916001600160a01b0316906113f7906064906109b3908690613e3e565b607454607754611e5e916001600160a01b0316906113f7906064906109b3908690613e3e565b611e80610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250611eab916001600160a01b03909116906113f7906064906109b3908690613e3e565b611ec8610ff260646109b360785485613e3e90919063ffffffff16565b9050611ef96064610a1c611ef2606461102c8a606001518b60400151613e3290919063ffffffff16565b8490613e4a565b9050611f084262093a80613e56565b866004015411156120a557611f306127106109b3896006015484613e3e90919063ffffffff16565b610180860152611f6b336113f760646109b3611f5a60648b60400151613e3290919063ffffffff16565b6101808b0151610a1c908890613e56565b6066546001600160a01b031663986f33e033611fa260646109b38a60600151610a1c8c610180015189613e5690919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015611fe857600080fd5b505af1158015611ffc573d6000803e3d6000fd5b5050505061203f61203460646109b361202360648a60400151613e3290919063ffffffff16565b6101808a0151610a1c908790613e56565b600188015490613e32565b60018701556006870154156120a057606754610180860151612077916001600160a01b0316906113f7906064906109b3906046613e3e565b6073546101808601516120a0916001600160a01b0316906113f7906064906109b390601e613e3e565b61214f565b6120ae3361165e565b6066546001600160a01b031663986f33e0336120dc60646109b38a6060015187613e3e90919063ffffffff16565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561212257600080fd5b505af1158015612136573d6000803e3d6000fd5b5050506001870154612149915082613e32565b60018701555b60006002870155600487018390555b87156121dd5785546121709089613e56565b86556060850151604086015160009161219a916064916109b39161219391613e32565b8c90613e3e565b60058901549091506121ac9082613e56565b600589015560018801546121c0908a613e56565b60018901556121db3389546001600160a01b0316908b613e62565b505b88337fb97e775637eca8401af330efee0810af7079bafae27761741e09caa14db8d2728a60796000845b6001600160a01b03168152602080820192909252604090810160002054815193845260ff161515918301919091520160405180910390a3505050505050505050565b6033546001600160a01b031633146122735760405162461bcd60e51b8152600401611082906149fd565b606c546001600160a01b03166122c25760405162461bcd60e51b815260206004820152601460248201527336b4b3b930ba329d1037379036b4b3b930ba37b960611b6044820152606401611082565b6000606d82815481106122d7576122d76149c3565b6000918252602082206008919091020180546040516370a0823160e01b81523060048201529193506001600160a01b0316919082906370a0823190602401602060405180830381865afa158015612332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123569190614ad5565b606c54909150612373906001600160a01b03848116911683613ec5565b606c5460405163ce5494bb60e01b81526001600160a01b038481166004830152600092169063ce5494bb906024016020604051808303816000875af11580156123c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e49190614aee565b6040516370a0823160e01b81523060048201529091506001600160a01b038216906370a0823190602401602060405180830381865afa15801561242b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244f9190614ad5565b821461248c5760405162461bcd60e51b815260206004820152600c60248201526b1b5a59dc985d194e8818985960a21b6044820152606401611082565b83546001600160a01b0319166001600160a01b039190911617909255505050565b6000606d83815481106124c2576124c26149c3565b60009182526020822060089091020180549092506124ed916001600160a01b03909116903085613fda565b505050565b6000606d8281548110612507576125076149c3565b60009182526020808320858452606e9091526040832060089092020192508161252d3390565b6001600160a01b031681526020810191909152604001600020905061256033825484546001600160a01b03169190613e62565b80543360008181526079602090815260409182902054825194855260ff16151590840152805186937f9fef67ca40344e5550d748f62064f1b3d31f46191945782c3c408c8aa26f3a2692908290030190a360008082556001909101555050565b6066546001600160a01b0316336001600160a01b03161461260e5760405162461bcd60e51b81526020600482015260086024820152676e6f74206e6f646560c01b6044820152606401611082565b6001600160a01b03811661263e5760405162461bcd60e51b81526020600482015260006024820152604401611082565b6001600160a01b03166000908152607960205260409020805460ff19166001179055565b6033546001600160a01b0316331461268c5760405162461bcd60e51b8152600401611082906149fd565b606b55565b606d5460005b818110156126ba576126aa81600061288d565b6126b381614aba565b9050612697565b5050565b6033546001600160a01b031633146126e85760405162461bcd60e51b8152600401611082906149fd565b607380546001600160a01b03199081166001600160a01b039889161790915560748054821696881696909617909555607580549095169390951692909217909255607691909155607755607855565b6033546001600160a01b031633146127615760405162461bcd60e51b8152600401611082906149fd565b61276b6000614018565b565b6033546001600160a01b031633146127975760405162461bcd60e51b8152600401611082906149fd565b80156127a5576127a5612691565b6127e28361102c606d87815481106127bf576127bf6149c3565b906000526020600020906008020160020154607154613e5690919063ffffffff16565b6071819055506000606d85815481106127fd576127fd6149c3565b906000526020600020906008020160020154905083606d8681548110612825576128256149c3565b90600052602060002090600802016002018190555082606d868154811061284e5761284e6149c3565b906000526020600020906008020160060181905550838114611a5857611a5861406a565b606b5460009061288690610a1c8486613e56565b9392505050565b6000606d83815481106128a2576128a26149c3565b90600052602060002090600802019050806003015443116128c257505050565b60018101546128d657436003909101555050565b60006128e6826003015443612872565b9050600061290d6071546109b38560020154610a1c606a5487613e3e90919063ffffffff16565b9050600061292c84600501548560010154613e3290919063ffffffff16565b905083600301544311801561294057508015155b15611a5657600061295a826109b38564e8d4a51000613e3e565b905060005b8560070154811015612b69576000888152606f602090815260408083208484529091529020546001600160a01b0316806129995750612b59565b6000898152606e602090815260408083206001600160a01b03851684529091529020805415612b5657606654604051630fe7f46160e21b81526001600160a01b0384811660048301526000928392911690633f9fd184906024016040805180830381865afa158015612a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3391906149d9565b90925090506000612a4f6109b960646109b36109ab8787613e32565b90506000612a7e612a7360646109b3612a688888613e32565b60058a015490613e3e565b600587015490613e32565b90506000612a9564e8d4a510006109b3858c613e3e565b90506000612aac64e8d4a510006109b3858d613e3e565b90506001600160a01b038816331415612b26578e60011415612ae1576007870154612ad79082613e32565b6007880155612b4f565b8e60021415612b03576002870154612af99083613e32565b6002880155612b4f565b6002870154612b129083613e32565b60028801556007870154612ad79082613e32565b6002870154612b359083613e32565b60028801556007870154612b499082613e32565b60078801555b5050505050505b50505b612b6281614aba565b905061295f565b506004850155436003850155505050505050565b6033546001600160a01b03163314612ba75760405162461bcd60e51b8152600401611082906149fd565b8015612bb557612bb5612691565b60006072544311612bc857607254612bca565b435b607154909150612bda9086613e32565b60715560408051610100810182526001600160a01b038681168252600060208301818152938301898152606084018681526080850183815260a0860184815260c087018b815260e08801868152606d8054600181018255975297517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d8600890970296870180546001600160a01b031916919098161790965596517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d985015591517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18da840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18db830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dc82015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dd840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18de830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18df90910155611a5861406a565b600054610100900460ff1680612d9a575060005460ff16155b612db65760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff16158015612dd8576000805461ffff19166101011790555b612de58686868686614126565b8015611a56576000805461ff0019169055505050505050565b6033546001600160a01b03163314612e285760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116612e7e5760405162461bcd60e51b815260206004820181905260248201527f4e465420616464726573732063616e206e6f74206265206164647265737320306044820152606401611082565b606880546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314612eca5760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116612f205760405162461bcd60e51b815260206004820152601960248201527f6e6f64652063616e206e6f7420626520616464726573732030000000000000006044820152606401611082565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6000606d600081548110612f5857612f586149c3565b60009182526020808320838052606e9091526008909102019150600080516020614c4b83398151915281612f893390565b6001600160a01b0316815260208101919091526040016000209050336068546040516331a9108f60e11b8152600481018690526001600160a01b039283169290911690636352211e90602401602060405180830381865afa158015612ff2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130169190614aee565b6001600160a01b03161461305d5760405162461bcd60e51b815260206004820152600e60248201526d32b93937b91027232a103ab9b2b960911b6044820152606401611082565b6130696000600261288d565b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa1580156130c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e791906149d9565b9092509050600061311961310e60646109b36131038787613e32565b600589015490613e3e565b600586015490613e32565b9050600085600401549050600061314187600501548860010154613e3290919063ffffffff16565b905086600301544311801561315557508015155b156131ab57600061316a886003015443612872565b905060006131916071546109b38b60020154610a1c606a5487613e3e90919063ffffffff16565b90506131a6836109b38364e8d4a51000613e3e565b935050505b6005860154156131e35760006131ca64e8d4a510006109b38686613e3e565b60078801549091506131dc9082613e32565b6007880155505b6007860154801561338b57607354607654613214916001600160a01b0316906113f7906064906109b3908690613e3e565b60745460775461323a916001600160a01b0316906113f7906064906109b3908690613e3e565b61325c610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250613287916001600160a01b03909116906113f7906064906109b3908690613e3e565b6132a4610ff260646109b360785485613e3e90919063ffffffff16565b90506132b8611032606461102c8989613e32565b90506132d8335b6113f760646109b36132d18b83613e32565b8690613e3e565b6132f86132ed60646109b3610feb8a83613e32565b600689015490613e32565b60068801556066546001600160a01b031663986f33e03361331e60646109b3868b613e3e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561336457600080fd5b505af1158015613378573d6000803e3d6000fd5b5050600060078a01555050600488018390555b8815613602576068546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018c9052606401600060405180830381600087803b1580156133f157600080fd5b505af1158015613405573d6000803e3d6000fd5b50505050607a60006134143390565b6001600160a01b0390811682526020808301939093526040918201600090812080546001810182559082529381209093018c90556069549151634b893b5760e11b8152600481018d905283929091169063971276ae90602401608060405180830381865afa15801561348a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134ae9190614a32565b93509350505060006134ce60646109b38486613e3e90919063ffffffff16565b905060006134ee6134e760646109b36132d18e8e613e32565b8390613e32565b60058d01549091506135009082613e32565b60058d015560018c01546135149083613e32565b60018d015560058b01546135289083613e32565b60058c01554260098c01553360009081527f29272c5198ac4c1c7fb0303943f851de04a43367f02c26a44994c42c27db24b5602052604090205460ff166135fd5760078c01805460009081527fd0170a6220fef73a7dd2c1e9984b0b3831956884ac33b7728dde627780a65be56020526040812080546001600160a01b03191633179055815460019291906135be908490614b59565b90915550503360009081527f29272c5198ac4c1c7fb0303943f851de04a43367f02c26a44994c42c27db24b560205260409020805460ff191660011790555b505050505b6000337f6dbb6056a2fff319358e6dd7d0d72cb3baa992cdcc7e120fb0a32cd1601840e58b60798484612207565b6000806000606d600081548110613649576136496149c3565b600091825260208083206001600160a01b0389168452600080516020614c4b833981519152909152604083206008929092020160048101546005820154600183015492955092939092909161369d91613e32565b90508360030154431180156136b157508015155b156137075760006136c6856003015443612872565b905060006136ed6071546109b38860020154610a1c606a5487613e3e90919063ffffffff16565b9050613702836109b38364e8d4a51000613e3e565b935050505b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015613761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061378591906149d9565b606954604051634b893b5760e11b8152600481018d905292945090925060009182916001600160a01b03169063971276ae90602401608060405180830381865afa1580156137d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137fb9190614a32565b935093505050600061381b60646109b38486613e3e90919063ffffffff16565b905060006138346134e760646109b36132d18a8a613e32565b9050600061384b64e8d4a510006109b3848c613e3e565b905080156138bf57613875610ff260646109b3610feb607754607654613e3290919063ffffffff16565b9050613894610ff260646109b360785485613e3e90919063ffffffff16565b90506138a8611032606461102c8a8a613e32565b90506138bc60646109b36110518a83613e32565b90505b6007909901549b509799505050505050505050509250929050565b6000606d83815481106138ef576138ef6149c3565b60009182526020808320868452606e909152604083206008909202019250816139153390565b6001600160a01b03166001600160a01b03168152602001908152602001600020905061394284600161288d565b60665460009081906001600160a01b0316633f9fd184336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa15801561399c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c091906149d9565b909250905060006139dc6109b960646109b36109ab8787613e32565b90506000856004015490506000613a0487600501548860010154613e3290919063ffffffff16565b9050866003015443118015613a1857508015155b15613a6e576000613a2d886003015443612872565b90506000613a546071546109b38b60020154610a1c606a5487613e3e90919063ffffffff16565b9050613a69836109b38364e8d4a51000613e3e565b935050505b8215613aa2576000613a8964e8d4a510006109b38686613e3e565b6002880154909150613a9b9082613e32565b6002880155505b60028601548015613c3557607354607654613ad3916001600160a01b0316906113f7906064906109b3908690613e3e565b607454607754613af9916001600160a01b0316906113f7906064906109b3908690613e3e565b613b1b610ff260646109b3610feb607754607654613e3290919063ffffffff16565b607554607854919250613b46916001600160a01b03909116906113f7906064906109b3908690613e3e565b613b63610ff260646109b360785485613e3e90919063ffffffff16565b9050613b77611032606461102c8989613e32565b9050613b82336132bf565b613ba2613b9760646109b3610feb8a83613e32565b600189015490613e32565b60018801556066546001600160a01b031663986f33e033613bc860646109b3868b613e3e565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015613c0e57600080fd5b505af1158015613c22573d6000803e3d6000fd5b5050600060028a01555050600488018390555b8815613d3757613c523389546001600160a01b031690308c613fda565b8654613c5e908a613e32565b87554260048801556000613c8160646109b3613c7a8a8a613e32565b8d90613e3e565b60058a0154909150613c939082613e32565b60058a01556001890154613ca7908b613e32565b60018a015560008b815260706020908152604080832033845290915290205460ff16613d355760008b8152606f6020908152604080832060078d01805485529252822080546001600160a01b03191633179055805460019290613d0b908490614b59565b909155505060008b81526070602090815260408083203384529091529020805460ff191660011790555b505b336000818152607960209081526040918290205482518d815260ff90911615159181019190915281518d93927f6dbb6056a2fff319358e6dd7d0d72cb3baa992cdcc7e120fb0a32cd1601840e5928290030190a350505050505050505050565b6033546001600160a01b03163314613dc15760405162461bcd60e51b8152600401611082906149fd565b6001600160a01b038116613e265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611082565b613e2f81614018565b50565b60006128868284614b59565b60006128868284614b71565b60006128868284614b90565b60006128868284614a8d565b6040516001600160a01b0383166024820152604481018290526124ed90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261419a565b801580613f3f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d9190614ad5565b155b613faa5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401611082565b6040516001600160a01b0383166024820152604481018290526124ed90849063095ea7b360e01b90606401613e8e565b6040516001600160a01b03808516602483015283166044820152606481018290526140129085906323b872dd60e01b90608401613e8e565b50505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606d54600060015b828110156140c3576140b1606d8281548110614090576140906149c3565b90600052602060002090600802016002015483613e3290919063ffffffff16565b91506140bc81614aba565b9050614072565b5080156126ba576140d5816003613e4a565b90506140f28161102c606d6000815481106127bf576127bf6149c3565b60718190555080606d60008154811061410d5761410d6149c3565b9060005260206000209060080201600201819055505050565b600054610100900460ff168061413f575060005460ff16155b61415b5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561417d576000805461ffff19166101011790555b61418561426c565b61418d6142d7565b612de58686868686614337565b60006141ef826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661457d9092919063ffffffff16565b8051909150156124ed578080602001905181019061420d9190614bb2565b6124ed5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611082565b600054610100900460ff1680614285575060005460ff16155b6142a15760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff161580156142c3576000805461ffff19166101011790555b8015613e2f576000805461ff001916905550565b600054610100900460ff16806142f0575060005460ff16155b61430c5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561432e576000805461ffff19166101011790555b6142c333614018565b600054610100900460ff1680614350575060005460ff16155b61436c5760405162461bcd60e51b815260040161108290614b0b565b600054610100900460ff1615801561438e576000805461ffff19166101011790555b606580546001600160a01b03199081166001600160a01b03898116918217909355606780548316898516179055606680548316888516179055606a869055607285905560408051610100810182529182526000602083018181526103e8928401838152606085018981526080860184815260a0870185815260c0880186815260e08901878152606d8054600181018255985298517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d860089098029788018054909b169b169a909a1790985592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18d985015590517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18da840155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18db830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dc82015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18dd84015592517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18de830155517f5006b838207c6a9ae9b84d68f467dd4bb5c305fbfb6b04eab8faaabeec1e18df909101556071558015611a56576000805461ff0019169055505050505050565b606061458c8484600085614594565b949350505050565b6060824710156145f55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611082565b843b6146435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611082565b600080866001600160a01b0316858760405161465f9190614bfb565b60006040518083038185875af1925050503d806000811461469c576040519150601f19603f3d011682016040523d82523d6000602084013e6146a1565b606091505b50915091506146b18282866146bc565b979650505050505050565b606083156146cb575081612886565b8251156146db5782518084602001fd5b8160405162461bcd60e51b81526004016110829190614c17565b604051806101a0016040528061475260405180610100016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600080604083850312156147bf57600080fd5b50508035926020909101359150565b6001600160a01b0381168114613e2f57600080fd5b600080604083850312156147f657600080fd5b823591506020830135614808816147ce565b809150509250929050565b60006020828403121561482557600080fd5b5035919050565b60006020828403121561483e57600080fd5b8135612886816147ce565b6000806040838503121561485c57600080fd5b8235614867816147ce565b946020939093013593505050565b60008060008060008060c0878903121561488e57600080fd5b8635614899816147ce565b955060208701356148a9816147ce565b945060408701356148b9816147ce565b959894975094956060810135955060808101359460a0909101359350915050565b8015158114613e2f57600080fd5b600080600080608085870312156148fe57600080fd5b843593506020850135925060408501359150606085013561491e816148da565b939692955090935050565b6000806000806080858703121561493f57600080fd5b843593506020850135614951816147ce565b925060408501359150606085013561491e816148da565b600080600080600060a0868803121561498057600080fd5b853561498b816147ce565b9450602086013561499b816147ce565b935060408601356149ab816147ce565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052603260045260246000fd5b600080604083850312156149ec57600080fd5b505080516020909101519092909150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008060008060808587031215614a4857600080fd5b845160ff81168114614a5957600080fd5b60208601516040870151606090970151919890975090945092505050565b634e487b7160e01b600052601160045260246000fd5b600082821015614a9f57614a9f614a77565b500390565b634e487b7160e01b600052603160045260246000fd5b6000600019821415614ace57614ace614a77565b5060010190565b600060208284031215614ae757600080fd5b5051919050565b600060208284031215614b0057600080fd5b8151612886816147ce565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008219821115614b6c57614b6c614a77565b500190565b6000816000190483118215151615614b8b57614b8b614a77565b500290565b600082614bad57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215614bc457600080fd5b8151612886816148da565b60005b83811015614bea578181015183820152602001614bd2565b838111156140125750506000910152565b60008251614c0d818460208701614bcf565b9190910192915050565b6020815260008251806020840152614c36816040850160208701614bcf565b601f01601f1916919091016040019291505056fe136eb4aae73f7618d8559a84c5ff3678edc6b16994db052447ebc43c429b7d6fa2646970667358221220b7e1dbf881511b22f46dbe0236df158024c3b12929dee853bc7d7d4f730f392764736f6c634300080a0033