Address Details
contract

0xEBC48B41b33D966583c68724E3260f02675EE373

Contract Name
Bonus
Creator
0x7d6740–c9cfce at 0x7b4423–3420b6
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
9060484
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
Bonus




Optimization enabled
true
Compiler version
v0.8.11+commit.d7f03943




Optimization runs
200
EVM Version
london




Verified at
2022-08-19T06:16:29.016613Z

contracts/Bonus.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.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 "./IStarNFT.sol";

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

contract Bonus is ContextUpgradeable, OwnableUpgradeable {

    using SafeMathUpgradeable for uint256;
    IERC20Upgradeable public starToken;
    IERC721Upgradeable public starNFT;
    INFTLogic public NFTLogic;

    IStarNFT public StarNFT1;

    address public lockAddr;
    uint256 public lockRatio;
    uint256 public bonusWithdrawn;
    uint256 public lockWithdrawn;

    mapping(uint256 => uint256) public tokenWithdraw;

    function initialize(address _starToken, address _lock, uint256 _lockRatio) public initializer {
        __bonus_init(_starToken, _lock, _lockRatio);
    }

    function __bonus_init(address _starToken, address _lock, uint256 _lockRatio) internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
        __bonus_init_unchained(_starToken, _lock, _lockRatio);
    }

    function __bonus_init_unchained(address _starToken, address _lock, uint256 _lockRatio) internal initializer {
        require(_lockRatio < 10000, 'ratio error');
        starToken = IERC20Upgradeable(_starToken);
        lockAddr = _lock;
        lockRatio = _lockRatio;
    }

    function setLockRatio(uint256 _newRatio) onlyOwner public {
        require(_newRatio < 10000, 'ratio error');
        lockRatio = _newRatio;
    }

    function setStarNFTAddress(address _StarNFT) public {
        StarNFT1 = IStarNFT(_StarNFT);
    }

    function lockWithdraw(uint256 _amount) onlyLockUser public {
        require(_amount > 0, "amount error");
        uint256 _balance = starToken.balanceOf(address(this));
        uint256 _availLock = _balance.add(lockWithdrawn).add(bonusWithdrawn).mul(lockRatio).div(10000).sub(lockWithdrawn);
        require(_amount <= _availLock, 'amount error');
        lockWithdrawn = lockWithdrawn.add(_amount);
        starToken.transfer(_msgSender(), _amount);
    }

    function _getBonus(uint256 _tokenId) view internal returns (uint256) {
        uint256 _totalPrice = NFTLogic.totalPrice();
        (, , uint256 _price, uint256 _multi) = NFTLogic.starMeta(_tokenId);
        uint256 _ratio = _price.mul(_multi).div(100).mul(1e12).div(_totalPrice);
        uint256 _balance = starToken.balanceOf(address(this));   // Returns the amount of tokens owned by `account`.
        uint256 _availBonus = _balance.add(lockWithdrawn).add(bonusWithdrawn).mul(10000 - lockRatio).div(10000).mul(_ratio).div(1e12);
        return _availBonus > tokenWithdraw[_tokenId] ? _availBonus - tokenWithdraw[_tokenId] : 0;
    }

    function allWithdrawal(address owner) public{
        uint256 _amount = 0;
        for (uint256 i = 0 ; i < StarNFT1.balanceOf(owner); i ++){
             uint256 _tokenId = StarNFT1.tokenOfOwnerByIndex(owner,i);
             uint256 _number = _getBonus(_tokenId);
             bonusWithdrawn = bonusWithdrawn.add(_amount);
             tokenWithdraw[_tokenId] = tokenWithdraw[_tokenId].add(_amount);
             _amount += _number;
        }
        starToken.transfer(_msgSender(), _amount);
    }

    function getAllWithdrawal(address owner) public view returns(uint256){
        uint256 _amount = 0;
        for (uint256 i = 0 ; i < StarNFT1.balanceOf(owner); i ++) {
            uint256 _tokenId = StarNFT1.tokenOfOwnerByIndex(owner,i);
            _amount += _getBonus(_tokenId);
        }
        return _amount;
    }

    function bonusWithdraw(uint256 _tokenId) public{
        require(_msgSender() == starNFT.ownerOf(_tokenId), "not your token");
        uint256 _amount =  _getBonus(_tokenId);
        require(_amount > 0, "no bonus");
        bonusWithdrawn = bonusWithdrawn.add(_amount);
        tokenWithdraw[_tokenId] = tokenWithdraw[_tokenId].add(_amount);
        starToken.transfer(_msgSender(), _amount);
    }

    function setTokenWithdraw(uint256 _tokenId,uint256 _amount) external{
        tokenWithdraw[_tokenId] = tokenWithdraw[_tokenId].add(_amount);
    }

    function setBonusWithdrawn(uint256 _amount) external{
        bonusWithdrawn = bonusWithdrawn.add(_amount);
    }

    function getBonus(uint256 _tokenId) view external returns (uint256) {
        return _getBonus(_tokenId);
    }

    function setLock(address _addr) onlyOwner public {
        require(address(0) != _addr, 'lock address error');
        lockAddr = _addr;
    }

    function setNFT(address _addr) onlyOwner public {
        require(address(0) != _addr, 'NFT address error');
        starNFT = IERC721Upgradeable(_addr);
    }

    function setNFTLogic(address _addr) onlyOwner public {
        require(address(0) != _addr, 'NFT address error');
        NFTLogic = INFTLogic(_addr);
    }

    modifier onlyLockUser() {
        require(_msgSender() == lockAddr, 'no permission');
        _;
    }
}
        

/_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/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/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;
        }
    }
}
          

/contracts/IStarNFT.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IStarNFT {
    function mint(address _owner, uint256 _cateId) external returns (uint256);
    function setCateURI(uint256 _cateId, string memory _cateUri) external;
    function massVerifyOwner(address owner, uint256[] memory _tokenIds) view external returns (bool);
    function massBurn(uint256[] memory _tokenIds) external;
    function setSale(bool _sale) external;
    function balanceOf(address owner) view external returns (uint256);
    function tokenOfOwnerByIndex(address owner,uint256 tokenid) view external returns (uint256);
}
          

Contract ABI

[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract INFTLogic"}],"name":"NFTLogic","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IStarNFT"}],"name":"StarNFT1","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"allWithdrawal","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bonusWithdraw","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bonusWithdrawn","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAllWithdrawal","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBonus","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_starToken","internalType":"address"},{"type":"address","name":"_lock","internalType":"address"},{"type":"uint256","name":"_lockRatio","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":"lockWithdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockWithdrawn","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBonusWithdrawn","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLock","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLockRatio","inputs":[{"type":"uint256","name":"_newRatio","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNFT","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setNFTLogic","inputs":[{"type":"address","name":"_addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStarNFTAddress","inputs":[{"type":"address","name":"_StarNFT","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenWithdraw","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC721Upgradeable"}],"name":"starNFT","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":"tokenWithdraw","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061152f806100206000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c9fd982311610097578063da117df811610071578063da117df814610333578063e7bd719114610346578063f2fde38b14610359578063f56e9c661461036c57600080fd5b8063c9fd9823146102f7578063d7e751ff1461030a578063d9fc0e7f1461032a57600080fd5b80638da5cb5b1461029157806395a0af47146102a25780639c3709ea146102b5578063a32088d4146102be578063b7ca51e8146102d1578063bcb47005146102e457600080fd5b806357fe507a1161013057806357fe507a1461021257806370dca97414610225578063715018a6146102505780637666fc88146102585780637de613821461026b5780637fdab94e1461027e57600080fd5b8063085a4f15146101785780630f8a8a541461018d5780631794bb3c146101a95780631f6f7be5146101bc57806337ef75c8146101ec5780634aa66b28146101ff575b600080fd5b61018b61018636600461128a565b61037f565b005b610196606c5481565b6040519081526020015b60405180910390f35b61018b6101b73660046112b8565b6105a6565b61018b6101ca3660046112f9565b606880546001600160a01b0319166001600160a01b0392909216919091179055565b61018b6101fa3660046112f9565b61061f565b61019661020d36600461128a565b6106b5565b61018b610220366004611316565b6106c6565b606654610238906001600160a01b031681565b6040516001600160a01b0390911681526020016101a0565b61018b6106f5565b606854610238906001600160a01b031681565b6101966102793660046112f9565b61072b565b606954610238906001600160a01b031681565b6033546001600160a01b0316610238565b61018b6102b036600461128a565b61084d565b610196606a5481565b61018b6102cc3660046112f9565b610860565b606554610238906001600160a01b031681565b606754610238906001600160a01b031681565b61018b61030536600461128a565b6108f7565b61019661031836600461128a565b606d6020526000908152604090205481565b610196606b5481565b61018b6103413660046112f9565b610abe565b61018b61035436600461128a565b610c2e565b61018b6103673660046112f9565b610c9c565b61018b61037a3660046112f9565b610d37565b6069546001600160a01b0316336001600160a01b0316146103d75760405162461bcd60e51b815260206004820152600d60248201526c3737903832b936b4b9b9b4b7b760991b60448201526064015b60405180910390fd5b600081116104165760405162461bcd60e51b815260206004820152600c60248201526b30b6b7bab73a1032b93937b960a11b60448201526064016103ce565b6065546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561045f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104839190611338565b905060006104cc606c546104c66127106104c0606a546104ba606b546104b4606c548b610dcd90919063ffffffff16565b90610dcd565b90610de0565b90610dec565b90610df8565b90508083111561050d5760405162461bcd60e51b815260206004820152600c60248201526b30b6b7bab73a1032b93937b960a11b60448201526064016103ce565b606c5461051a9084610dcd565b606c556065546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526044016020604051808303816000875af115801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190611351565b50505050565b600054610100900460ff16806105bf575060005460ff16155b6105db5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff161580156105fd576000805461ffff19166101011790555b610608848484610e04565b80156105a0576000805461ff001916905550505050565b6033546001600160a01b031633146106495760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b0381166106935760405162461bcd60e51b815260206004820152601160248201527027232a1030b2323932b9b99032b93937b960791b60448201526064016103ce565b606780546001600160a01b0319166001600160a01b0392909216919091179055565b60006106c082610e76565b92915050565b6000828152606d60205260409020546106df9082610dcd565b6000928352606d60205260409092209190915550565b6033546001600160a01b0316331461071f5760405162461bcd60e51b81526004016103ce906113c1565b610729600061108b565b565b600080805b6068546040516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611338565b81101561084657606854604051632f745c5960e01b81526001600160a01b038681166004830152602482018490526000921690632f745c5990604401602060405180830381865afa1580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190611338565b905061082681610e76565b610830908461140c565b925050808061083e90611424565b915050610730565b5092915050565b606b5461085a9082610dcd565b606b5550565b6033546001600160a01b0316331461088a5760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b0381166108d55760405162461bcd60e51b81526020600482015260126024820152713637b1b59030b2323932b9b99032b93937b960711b60448201526064016103ce565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6066546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610964919061143f565b6001600160a01b0316336001600160a01b0316146109b55760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b60448201526064016103ce565b60006109c082610e76565b9050600081116109fd5760405162461bcd60e51b81526020600482015260086024820152676e6f20626f6e757360c01b60448201526064016103ce565b606b54610a0a9082610dcd565b606b556000828152606d6020526040902054610a269082610dcd565b6000838152606d60205260409020556065546001600160a01b031663a9059cbb335b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab99190611351565b505050565b6000805b6068546040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190611338565b811015610c1657606854604051632f745c5960e01b81526001600160a01b038581166004830152602482018490526000921690632f745c5990604401602060405180830381865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190611338565b90506000610bba82610e76565b606b54909150610bca9085610dcd565b606b556000828152606d6020526040902054610be69085610dcd565b6000838152606d6020526040902055610bff818561140c565b935050508080610c0e90611424565b915050610ac2565b506065546001600160a01b031663a9059cbb33610a48565b6033546001600160a01b03163314610c585760405162461bcd60e51b81526004016103ce906113c1565b6127108110610c975760405162461bcd60e51b815260206004820152600b60248201526a3930ba34b79032b93937b960a91b60448201526064016103ce565b606a55565b6033546001600160a01b03163314610cc65760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b038116610d2b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ce565b610d348161108b565b50565b6033546001600160a01b03163314610d615760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b038116610dab5760405162461bcd60e51b815260206004820152601160248201527027232a1030b2323932b9b99032b93937b960791b60448201526064016103ce565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dd9828461140c565b9392505050565b6000610dd9828461145c565b6000610dd9828461147b565b6000610dd9828461149d565b600054610100900460ff1680610e1d575060005460ff16155b610e395760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff16158015610e5b576000805461ffff19166101011790555b610e636110dd565b610e6b611148565b6106088484846111a8565b600080606760009054906101000a90046001600160a01b03166001600160a01b031663ab0d92dd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef09190611338565b606754604051634b893b5760e11b81526004810186905291925060009182916001600160a01b03169063971276ae90602401608060405180830381865afa158015610f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6391906114b4565b9350935050506000610f90846104c064e8d4a510006104ba60646104c0888a610de090919063ffffffff16565b6065546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110029190611338565b9050600061104764e8d4a510006104c0856104ba6127106104c0606a5461271061102c919061149d565b6104ba606b546104b4606c548d610dcd90919063ffffffff16565b6000898152606d6020526040902054909150811161106657600061107f565b6000888152606d602052604090205461107f908261149d565b98975050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16806110f6575060005460ff16155b6111125760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff16158015611134576000805461ffff19166101011790555b8015610d34576000805461ff001916905550565b600054610100900460ff1680611161575060005460ff16155b61117d5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff1615801561119f576000805461ffff19166101011790555b6111343361108b565b600054610100900460ff16806111c1575060005460ff16155b6111dd5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff161580156111ff576000805461ffff19166101011790555b612710821061123e5760405162461bcd60e51b815260206004820152600b60248201526a3930ba34b79032b93937b960a91b60448201526064016103ce565b606580546001600160a01b038087166001600160a01b0319928316179092556069805492861692909116919091179055606a82905580156105a0576000805461ff001916905550505050565b60006020828403121561129c57600080fd5b5035919050565b6001600160a01b0381168114610d3457600080fd5b6000806000606084860312156112cd57600080fd5b83356112d8816112a3565b925060208401356112e8816112a3565b929592945050506040919091013590565b60006020828403121561130b57600080fd5b8135610dd9816112a3565b6000806040838503121561132957600080fd5b50508035926020909101359150565b60006020828403121561134a57600080fd5b5051919050565b60006020828403121561136357600080fd5b81518015158114610dd957600080fd5b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561141f5761141f6113f6565b500190565b6000600019821415611438576114386113f6565b5060010190565b60006020828403121561145157600080fd5b8151610dd9816112a3565b6000816000190483118215151615611476576114766113f6565b500290565b60008261149857634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156114af576114af6113f6565b500390565b600080600080608085870312156114ca57600080fd5b845160ff811681146114db57600080fd5b6020860151604087015160609097015191989097509094509250505056fea26469706673582212209fb3eb2f1f907ea6151a72491c846fc014e11fcd396e622084c144d9380c154a64736f6c634300080b0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c9fd982311610097578063da117df811610071578063da117df814610333578063e7bd719114610346578063f2fde38b14610359578063f56e9c661461036c57600080fd5b8063c9fd9823146102f7578063d7e751ff1461030a578063d9fc0e7f1461032a57600080fd5b80638da5cb5b1461029157806395a0af47146102a25780639c3709ea146102b5578063a32088d4146102be578063b7ca51e8146102d1578063bcb47005146102e457600080fd5b806357fe507a1161013057806357fe507a1461021257806370dca97414610225578063715018a6146102505780637666fc88146102585780637de613821461026b5780637fdab94e1461027e57600080fd5b8063085a4f15146101785780630f8a8a541461018d5780631794bb3c146101a95780631f6f7be5146101bc57806337ef75c8146101ec5780634aa66b28146101ff575b600080fd5b61018b61018636600461128a565b61037f565b005b610196606c5481565b6040519081526020015b60405180910390f35b61018b6101b73660046112b8565b6105a6565b61018b6101ca3660046112f9565b606880546001600160a01b0319166001600160a01b0392909216919091179055565b61018b6101fa3660046112f9565b61061f565b61019661020d36600461128a565b6106b5565b61018b610220366004611316565b6106c6565b606654610238906001600160a01b031681565b6040516001600160a01b0390911681526020016101a0565b61018b6106f5565b606854610238906001600160a01b031681565b6101966102793660046112f9565b61072b565b606954610238906001600160a01b031681565b6033546001600160a01b0316610238565b61018b6102b036600461128a565b61084d565b610196606a5481565b61018b6102cc3660046112f9565b610860565b606554610238906001600160a01b031681565b606754610238906001600160a01b031681565b61018b61030536600461128a565b6108f7565b61019661031836600461128a565b606d6020526000908152604090205481565b610196606b5481565b61018b6103413660046112f9565b610abe565b61018b61035436600461128a565b610c2e565b61018b6103673660046112f9565b610c9c565b61018b61037a3660046112f9565b610d37565b6069546001600160a01b0316336001600160a01b0316146103d75760405162461bcd60e51b815260206004820152600d60248201526c3737903832b936b4b9b9b4b7b760991b60448201526064015b60405180910390fd5b600081116104165760405162461bcd60e51b815260206004820152600c60248201526b30b6b7bab73a1032b93937b960a11b60448201526064016103ce565b6065546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561045f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104839190611338565b905060006104cc606c546104c66127106104c0606a546104ba606b546104b4606c548b610dcd90919063ffffffff16565b90610dcd565b90610de0565b90610dec565b90610df8565b90508083111561050d5760405162461bcd60e51b815260206004820152600c60248201526b30b6b7bab73a1032b93937b960a11b60448201526064016103ce565b606c5461051a9084610dcd565b606c556065546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018690526044016020604051808303816000875af115801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190611351565b50505050565b600054610100900460ff16806105bf575060005460ff16155b6105db5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff161580156105fd576000805461ffff19166101011790555b610608848484610e04565b80156105a0576000805461ff001916905550505050565b6033546001600160a01b031633146106495760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b0381166106935760405162461bcd60e51b815260206004820152601160248201527027232a1030b2323932b9b99032b93937b960791b60448201526064016103ce565b606780546001600160a01b0319166001600160a01b0392909216919091179055565b60006106c082610e76565b92915050565b6000828152606d60205260409020546106df9082610dcd565b6000928352606d60205260409092209190915550565b6033546001600160a01b0316331461071f5760405162461bcd60e51b81526004016103ce906113c1565b610729600061108b565b565b600080805b6068546040516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611338565b81101561084657606854604051632f745c5960e01b81526001600160a01b038681166004830152602482018490526000921690632f745c5990604401602060405180830381865afa1580156107f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081b9190611338565b905061082681610e76565b610830908461140c565b925050808061083e90611424565b915050610730565b5092915050565b606b5461085a9082610dcd565b606b5550565b6033546001600160a01b0316331461088a5760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b0381166108d55760405162461bcd60e51b81526020600482015260126024820152713637b1b59030b2323932b9b99032b93937b960711b60448201526064016103ce565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b6066546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610964919061143f565b6001600160a01b0316336001600160a01b0316146109b55760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b60448201526064016103ce565b60006109c082610e76565b9050600081116109fd5760405162461bcd60e51b81526020600482015260086024820152676e6f20626f6e757360c01b60448201526064016103ce565b606b54610a0a9082610dcd565b606b556000828152606d6020526040902054610a269082610dcd565b6000838152606d60205260409020556065546001600160a01b031663a9059cbb335b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab99190611351565b505050565b6000805b6068546040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190611338565b811015610c1657606854604051632f745c5960e01b81526001600160a01b038581166004830152602482018490526000921690632f745c5990604401602060405180830381865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad9190611338565b90506000610bba82610e76565b606b54909150610bca9085610dcd565b606b556000828152606d6020526040902054610be69085610dcd565b6000838152606d6020526040902055610bff818561140c565b935050508080610c0e90611424565b915050610ac2565b506065546001600160a01b031663a9059cbb33610a48565b6033546001600160a01b03163314610c585760405162461bcd60e51b81526004016103ce906113c1565b6127108110610c975760405162461bcd60e51b815260206004820152600b60248201526a3930ba34b79032b93937b960a91b60448201526064016103ce565b606a55565b6033546001600160a01b03163314610cc65760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b038116610d2b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ce565b610d348161108b565b50565b6033546001600160a01b03163314610d615760405162461bcd60e51b81526004016103ce906113c1565b6001600160a01b038116610dab5760405162461bcd60e51b815260206004820152601160248201527027232a1030b2323932b9b99032b93937b960791b60448201526064016103ce565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dd9828461140c565b9392505050565b6000610dd9828461145c565b6000610dd9828461147b565b6000610dd9828461149d565b600054610100900460ff1680610e1d575060005460ff16155b610e395760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff16158015610e5b576000805461ffff19166101011790555b610e636110dd565b610e6b611148565b6106088484846111a8565b600080606760009054906101000a90046001600160a01b03166001600160a01b031663ab0d92dd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef09190611338565b606754604051634b893b5760e11b81526004810186905291925060009182916001600160a01b03169063971276ae90602401608060405180830381865afa158015610f3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6391906114b4565b9350935050506000610f90846104c064e8d4a510006104ba60646104c0888a610de090919063ffffffff16565b6065546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110029190611338565b9050600061104764e8d4a510006104c0856104ba6127106104c0606a5461271061102c919061149d565b6104ba606b546104b4606c548d610dcd90919063ffffffff16565b6000898152606d6020526040902054909150811161106657600061107f565b6000888152606d602052604090205461107f908261149d565b98975050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16806110f6575060005460ff16155b6111125760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff16158015611134576000805461ffff19166101011790555b8015610d34576000805461ff001916905550565b600054610100900460ff1680611161575060005460ff16155b61117d5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff1615801561119f576000805461ffff19166101011790555b6111343361108b565b600054610100900460ff16806111c1575060005460ff16155b6111dd5760405162461bcd60e51b81526004016103ce90611373565b600054610100900460ff161580156111ff576000805461ffff19166101011790555b612710821061123e5760405162461bcd60e51b815260206004820152600b60248201526a3930ba34b79032b93937b960a91b60448201526064016103ce565b606580546001600160a01b038087166001600160a01b0319928316179092556069805492861692909116919091179055606a82905580156105a0576000805461ff001916905550505050565b60006020828403121561129c57600080fd5b5035919050565b6001600160a01b0381168114610d3457600080fd5b6000806000606084860312156112cd57600080fd5b83356112d8816112a3565b925060208401356112e8816112a3565b929592945050506040919091013590565b60006020828403121561130b57600080fd5b8135610dd9816112a3565b6000806040838503121561132957600080fd5b50508035926020909101359150565b60006020828403121561134a57600080fd5b5051919050565b60006020828403121561136357600080fd5b81518015158114610dd957600080fd5b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561141f5761141f6113f6565b500190565b6000600019821415611438576114386113f6565b5060010190565b60006020828403121561145157600080fd5b8151610dd9816112a3565b6000816000190483118215151615611476576114766113f6565b500290565b60008261149857634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156114af576114af6113f6565b500390565b600080600080608085870312156114ca57600080fd5b845160ff811681146114db57600080fd5b6020860151604087015160609097015191989097509094509250505056fea26469706673582212209fb3eb2f1f907ea6151a72491c846fc014e11fcd396e622084c144d9380c154a64736f6c634300080b0033