Address Details
contract

0xfE0A2E6923B0aD6b76405B24BB4676b4539EC0b6

Contract Name
NFTMarket
Creator
0x7d6740–c9cfce at 0x8c464a–c6e72d
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
9010704
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
NFTMarket




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




Optimization runs
200
EVM Version
london




Verified at
2023-02-06T18:15:17.652175Z

contracts/StarNFTMarket.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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/security/ReentrancyGuardUpgradeable.sol";

contract NFTMarket is OwnableUpgradeable, ReentrancyGuardUpgradeable {
    using SafeMathUpgradeable for uint256;

    IERC20Upgradeable public starToken;
    IERC721Upgradeable public starNFT;

    address public bonusAddr;
    uint256 public fee;

    struct TokenInfo {
        address owner;
        uint256 price;
    }

    // tokenId => price
    mapping (uint256 => TokenInfo) public tokenInfo;

    uint256[] public marketTokens;
    // tokenid => marketToken Index
    mapping(uint256 => uint256) public tokensIndex;

    mapping(address => uint256[]) public userTokens;
    mapping(address => mapping(uint256 => uint256)) public userTokensIndex;

    mapping(address => uint256) public userStar;
    
    function initialize(address _starToken, address _bonus, address _starNFT, uint256 _fee) public initializer {
        __starMarket_init(_starToken, _bonus, _starNFT, _fee);
    }

    function __starMarket_init(address _starToken, address _bonus, address _starNFT, uint256 _fee) internal initializer {
        __Ownable_init();
        __ReentrancyGuard_init();
        __starMarket_init_unchained(_starToken, _bonus, _starNFT, _fee);
    }

    function __starMarket_init_unchained(address _starToken,  address _bonus, address _starNFT, uint256 _fee) internal initializer {
        starToken = IERC20Upgradeable(_starToken);
        starNFT = IERC721Upgradeable(_starNFT);
        bonusAddr = _bonus;
        fee = _fee;
    }

    function _addToken(address _user, uint256 _tokenId) private {
        marketTokens.push(_tokenId);
        tokensIndex[_tokenId] = marketTokens.length - 1;
        userTokens[_user].push(_tokenId);
        userTokensIndex[_user][_tokenId] = userTokens[_msgSender()].length - 1;
    }

    function _removeToken(address _user, uint256 _tokenId) private {
        uint256 tokenIndex = tokensIndex[_tokenId];
        uint256 lastTokenId = marketTokens[marketTokens.length - 1];

        marketTokens[tokenIndex] = lastTokenId;
        tokensIndex[lastTokenId] = tokenIndex;
        delete tokensIndex[_tokenId];
        marketTokens.pop();

        uint256 userTokenIndex = userTokensIndex[_user][_tokenId];
        uint256 userLastTokenId = userTokens[_user][userTokens[_user].length - 1];

        userTokens[_user][userTokenIndex] = userLastTokenId;
        userTokensIndex[_user][userLastTokenId] = userTokenIndex;
        delete userTokensIndex[_user][_tokenId];
        userTokens[_user].pop();
    }

    function getMarketTokensLength() view public returns (uint256) {
        return marketTokens.length;
    }

    function getUserTokensLength(address _user) view public returns (uint256) {
        return userTokens[_user].length;
    }
   
    function setTokenSale(uint256 _tokenId, bool _sale, uint256 _price) public {
        if (_sale) {
            require(starNFT.ownerOf(_tokenId) == _msgSender(), "not your token");
            require(_price > 0, "price not allow 0");
            _addToken(_msgSender(), _tokenId);
            tokenInfo[_tokenId].owner = _msgSender();
            tokenInfo[_tokenId].price = _price;
            starNFT.transferFrom(_msgSender(), address(this), _tokenId);
        } else {
            require(tokenInfo[_tokenId].owner == _msgSender(), "not your token");
            _removeToken(_msgSender(), _tokenId);
            tokenInfo[_tokenId].owner = address(0);
            tokenInfo[_tokenId].price = 0;
            starNFT.transferFrom(address(this), _msgSender(), _tokenId);
        }
    }

    function purchaseToken(uint256 _tokenId) public nonReentrant {
        require(_msgSender() != address(0));
        require(tokenInfo[_tokenId].owner != address(0), "not sale");
        // add fee
        uint256 _price = tokenInfo[_tokenId].price;
        starToken.transferFrom(_msgSender(), address(this), _price);
        uint256 _fee = _price.mul(fee).div(100);
        starToken.transfer(bonusAddr, _fee);
        userStar[tokenInfo[_tokenId].owner] = userStar[tokenInfo[_tokenId].owner].add(_price.sub(_fee));
        starNFT.transferFrom(address(this), _msgSender(), _tokenId);
        _removeToken(tokenInfo[_tokenId].owner, _tokenId);
    }

    function withdraw() public {
        uint256 _star = userStar[_msgSender()];
        require(_star > 0, "no star");
        userStar[_msgSender()] = 0;
        starToken.transfer(_msgSender(), _star);

    }

    function setFee(uint256 _fee) public onlyOwner {
        fee = _fee;
    }

    function setStarNFT(address _starNFT) onlyOwner public {
        require(_starNFT != address(0), "");
        starNFT = IERC721Upgradeable(_starNFT);
    }

}
        

/_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/security/ReentrancyGuardUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol)

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

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal initializer {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

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":"address"}],"name":"bonusAddr","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"fee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMarketTokensLength","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUserTokensLength","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":"_starNFT","internalType":"address"},{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"marketTokens","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"purchaseToken","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFee","inputs":[{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStarNFT","inputs":[{"type":"address","name":"_starNFT","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokenSale","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"bool","name":"_sale","internalType":"bool"},{"type":"uint256","name":"_price","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":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"price","internalType":"uint256"}],"name":"tokenInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokensIndex","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userStar","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userTokens","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userTokensIndex","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b50611482806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063cc33c8751161007c578063cc33c8751461029e578063cf756fdf146102f0578063ddca3f4314610303578063df3bd7061461030c578063f2fde38b1461032c578063f9f411d81461033f57600080fd5b80638da5cb5b1461024c5780639af8b6b71461025d578063b0bf74e314610265578063b7ca51e814610278578063c2db2c421461028b57600080fd5b80636387ede6116100ff5780636387ede6146101eb57806369fe0e2d146101fe57806370dca97414610211578063715018a6146102245780637c7437831461022c57600080fd5b806313eaabb81461013c57806317911cd01461016c5780633ccfd60b146101a35780635f06018a146101ad578063615b7c2b146101c0575b600080fd5b60995461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61019561017a3660046111c0565b6001600160a01b03166000908152609e602052604090205490565b604051908152602001610163565b6101ab610352565b005b6101956101bb3660046111dd565b610430565b6101956101ce3660046111f6565b609f60209081526000928352604080842090915290825290205481565b6101ab6101f9366004611230565b610451565b6101ab61020c3660046111dd565b6106a1565b60985461014f906001600160a01b031681565b6101ab6106d0565b61019561023a3660046111c0565b60a06020526000908152604090205481565b6033546001600160a01b031661014f565b609c54610195565b6101ab6102733660046111c0565b610706565b60975461014f906001600160a01b031681565b6101ab6102993660046111dd565b610782565b6102d16102ac3660046111dd565b609b60205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610163565b6101ab6102fe366004611268565b610a44565b610195609a5481565b61019561031a3660046111dd565b609d6020526000908152604090205481565b6101ab61033a3660046111c0565b610ac0565b61019561034d3660046111f6565b610b5b565b33600090815260a060205260409020548061039e5760405162461bcd60e51b815260206004820152600760248201526637379039ba30b960c91b60448201526064015b60405180910390fd5b33600081815260a060209081526040808320839055609754815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb93604480830194939283900301908290875af1158015610408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042c91906112b9565b5050565b609c818154811061044057600080fd5b600091825260209091200154905081565b81156105ee57336098546040516331a9108f60e11b8152600481018690526001600160a01b039283169290911690636352211e90602401602060405180830381865afa1580156104a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c991906112d6565b6001600160a01b0316146105105760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b6044820152606401610395565b600081116105545760405162461bcd60e51b815260206004820152601160248201527007072696365206e6f7420616c6c6f77203607c1b6044820152606401610395565b61055e3384610b8c565b336000848152609b6020526040902080546001600160a01b0319166001600160a01b03928316178155600101829055609854166323b872dd3330866040518463ffffffff1660e01b81526004016105b7939291906112f3565b600060405180830381600087803b1580156105d157600080fd5b505af11580156105e5573d6000803e3d6000fd5b50505050505050565b6000838152609b60205260409020546001600160a01b031633146106455760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b6044820152606401610395565b61064f3384610c43565b6000838152609b6020526040812080546001600160a01b0319168155600101556098546001600160a01b03166323b872dd3033866040518463ffffffff1660e01b81526004016105b7939291906112f3565b6033546001600160a01b031633146106cb5760405162461bcd60e51b815260040161039590611317565b609a55565b6033546001600160a01b031633146106fa5760405162461bcd60e51b815260040161039590611317565b6107046000610dea565b565b6033546001600160a01b031633146107305760405162461bcd60e51b815260040161039590611317565b6001600160a01b0381166107605760405162461bcd60e51b81526020600482015260006024820152604401610395565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b600260655414156107d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610395565b6002606555336107e457600080fd5b6000818152609b60205260409020546001600160a01b03166108335760405162461bcd60e51b81526020600482015260086024820152676e6f742073616c6560c01b6044820152606401610395565b6000818152609b60205260409020600101546097546001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401610877939291906112f3565b6020604051808303816000875af1158015610896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ba91906112b9565b5060006108dd60646108d7609a5485610e3c90919063ffffffff16565b90610e4f565b60975460995460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015610934573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095891906112b9565b506109916109668383610e5b565b6000858152609b60209081526040808320546001600160a01b0316835260a090915290205490610e67565b6000848152609b60209081526040808320546001600160a01b03908116845260a090925290912091909155609854166323b872dd3033866040518463ffffffff1660e01b81526004016109e6939291906112f3565b600060405180830381600087803b158015610a0057600080fd5b505af1158015610a14573d6000803e3d6000fd5b5050506000848152609b6020526040902054610a3a91506001600160a01b031684610c43565b5050600160655550565b600054610100900460ff1680610a5d575060005460ff16155b610a795760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610a9b576000805461ffff19166101011790555b610aa785858585610e73565b8015610ab9576000805461ff00191690555b5050505050565b6033546001600160a01b03163314610aea5760405162461bcd60e51b815260040161039590611317565b6001600160a01b038116610b4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b610b5881610dea565b50565b609e6020528160005260406000208181548110610b7757600080fd5b90600052602060002001600091509150505481565b609c80546001818101835560008390527faf85b9071dfafeac1409d3f1d19bafc9bc7c37974cde8df0ee6168f0086e539c9091018390559054610bcf91906113b0565b6000828152609d60209081526040808320939093556001600160a01b0385168252609e815282822080546001808201835591845291832090910184905533825291902054610c1d91906113b0565b6001600160a01b039092166000908152609f602090815260408083209383529290522055565b6000818152609d6020526040812054609c8054919291610c65906001906113b0565b81548110610c7557610c756113c7565b9060005260206000200154905080609c8381548110610c9657610c966113c7565b6000918252602080832090910192909255828152609d9091526040808220849055848252812055609c805480610cce57610cce6113dd565b6000828152602080822083016000199081018390559092019092556001600160a01b038616808352609f82526040808420878552835280842054918452609e9092529082208054919291610d24906001906113b0565b81548110610d3457610d346113c7565b9060005260206000200154905080609e6000886001600160a01b03166001600160a01b031681526020019081526020016000208381548110610d7857610d786113c7565b6000918252602080832091909101929092556001600160a01b038816808252609f835260408083208584528452808320869055888352808320839055908252609e90925220805480610dcc57610dcc6113dd565b60019003818190600052602060002001600090559055505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610e4882846113f3565b9392505050565b6000610e488284611412565b6000610e4882846113b0565b6000610e488284611434565b600054610100900460ff1680610e8c575060005460ff16155b610ea85760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610eca576000805461ffff19166101011790555b610ed2610ee6565b610eda610f61565b610aa785858585610fc0565b600054610100900460ff1680610eff575060005460ff16155b610f1b5760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610f3d576000805461ffff19166101011790555b610f45611071565b610f4d6110db565b8015610b58576000805461ff001916905550565b600054610100900460ff1680610f7a575060005460ff16155b610f965760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610fb8576000805461ffff19166101011790555b610f4d61113b565b600054610100900460ff1680610fd9575060005460ff16155b610ff55760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611017576000805461ffff19166101011790555b609780546001600160a01b038088166001600160a01b031992831617909255609880548684169083161790556099805492871692909116919091179055609a8290558015610ab9576000805461ff00191690555050505050565b600054610100900460ff168061108a575060005460ff16155b6110a65760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610f4d576000805461ffff19166101011790558015610b58576000805461ff001916905550565b600054610100900460ff16806110f4575060005460ff16155b6111105760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611132576000805461ffff19166101011790555b610f4d33610dea565b600054610100900460ff1680611154575060005460ff16155b6111705760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611192576000805461ffff19166101011790555b60016065558015610b58576000805461ff001916905550565b6001600160a01b0381168114610b5857600080fd5b6000602082840312156111d257600080fd5b8135610e48816111ab565b6000602082840312156111ef57600080fd5b5035919050565b6000806040838503121561120957600080fd5b8235611214816111ab565b946020939093013593505050565b8015158114610b5857600080fd5b60008060006060848603121561124557600080fd5b83359250602084013561125781611222565b929592945050506040919091013590565b6000806000806080858703121561127e57600080fd5b8435611289816111ab565b93506020850135611299816111ab565b925060408501356112a9816111ab565b9396929550929360600135925050565b6000602082840312156112cb57600080fd5b8151610e4881611222565b6000602082840312156112e857600080fd5b8151610e48816111ab565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156113c2576113c261139a565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561140d5761140d61139a565b500290565b60008261142f57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156114475761144761139a565b50019056fea26469706673582212209409c1c95a390800cc8cd93f8febc9ada10070cc5aa7ae9b82dc5050baa600cc64736f6c634300080a0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063cc33c8751161007c578063cc33c8751461029e578063cf756fdf146102f0578063ddca3f4314610303578063df3bd7061461030c578063f2fde38b1461032c578063f9f411d81461033f57600080fd5b80638da5cb5b1461024c5780639af8b6b71461025d578063b0bf74e314610265578063b7ca51e814610278578063c2db2c421461028b57600080fd5b80636387ede6116100ff5780636387ede6146101eb57806369fe0e2d146101fe57806370dca97414610211578063715018a6146102245780637c7437831461022c57600080fd5b806313eaabb81461013c57806317911cd01461016c5780633ccfd60b146101a35780635f06018a146101ad578063615b7c2b146101c0575b600080fd5b60995461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61019561017a3660046111c0565b6001600160a01b03166000908152609e602052604090205490565b604051908152602001610163565b6101ab610352565b005b6101956101bb3660046111dd565b610430565b6101956101ce3660046111f6565b609f60209081526000928352604080842090915290825290205481565b6101ab6101f9366004611230565b610451565b6101ab61020c3660046111dd565b6106a1565b60985461014f906001600160a01b031681565b6101ab6106d0565b61019561023a3660046111c0565b60a06020526000908152604090205481565b6033546001600160a01b031661014f565b609c54610195565b6101ab6102733660046111c0565b610706565b60975461014f906001600160a01b031681565b6101ab6102993660046111dd565b610782565b6102d16102ac3660046111dd565b609b60205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610163565b6101ab6102fe366004611268565b610a44565b610195609a5481565b61019561031a3660046111dd565b609d6020526000908152604090205481565b6101ab61033a3660046111c0565b610ac0565b61019561034d3660046111f6565b610b5b565b33600090815260a060205260409020548061039e5760405162461bcd60e51b815260206004820152600760248201526637379039ba30b960c91b60448201526064015b60405180910390fd5b33600081815260a060209081526040808320839055609754815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb93604480830194939283900301908290875af1158015610408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042c91906112b9565b5050565b609c818154811061044057600080fd5b600091825260209091200154905081565b81156105ee57336098546040516331a9108f60e11b8152600481018690526001600160a01b039283169290911690636352211e90602401602060405180830381865afa1580156104a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c991906112d6565b6001600160a01b0316146105105760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b6044820152606401610395565b600081116105545760405162461bcd60e51b815260206004820152601160248201527007072696365206e6f7420616c6c6f77203607c1b6044820152606401610395565b61055e3384610b8c565b336000848152609b6020526040902080546001600160a01b0319166001600160a01b03928316178155600101829055609854166323b872dd3330866040518463ffffffff1660e01b81526004016105b7939291906112f3565b600060405180830381600087803b1580156105d157600080fd5b505af11580156105e5573d6000803e3d6000fd5b50505050505050565b6000838152609b60205260409020546001600160a01b031633146106455760405162461bcd60e51b815260206004820152600e60248201526d3737ba103cb7bab9103a37b5b2b760911b6044820152606401610395565b61064f3384610c43565b6000838152609b6020526040812080546001600160a01b0319168155600101556098546001600160a01b03166323b872dd3033866040518463ffffffff1660e01b81526004016105b7939291906112f3565b6033546001600160a01b031633146106cb5760405162461bcd60e51b815260040161039590611317565b609a55565b6033546001600160a01b031633146106fa5760405162461bcd60e51b815260040161039590611317565b6107046000610dea565b565b6033546001600160a01b031633146107305760405162461bcd60e51b815260040161039590611317565b6001600160a01b0381166107605760405162461bcd60e51b81526020600482015260006024820152604401610395565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b600260655414156107d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610395565b6002606555336107e457600080fd5b6000818152609b60205260409020546001600160a01b03166108335760405162461bcd60e51b81526020600482015260086024820152676e6f742073616c6560c01b6044820152606401610395565b6000818152609b60205260409020600101546097546001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401610877939291906112f3565b6020604051808303816000875af1158015610896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ba91906112b9565b5060006108dd60646108d7609a5485610e3c90919063ffffffff16565b90610e4f565b60975460995460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015610934573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095891906112b9565b506109916109668383610e5b565b6000858152609b60209081526040808320546001600160a01b0316835260a090915290205490610e67565b6000848152609b60209081526040808320546001600160a01b03908116845260a090925290912091909155609854166323b872dd3033866040518463ffffffff1660e01b81526004016109e6939291906112f3565b600060405180830381600087803b158015610a0057600080fd5b505af1158015610a14573d6000803e3d6000fd5b5050506000848152609b6020526040902054610a3a91506001600160a01b031684610c43565b5050600160655550565b600054610100900460ff1680610a5d575060005460ff16155b610a795760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610a9b576000805461ffff19166101011790555b610aa785858585610e73565b8015610ab9576000805461ff00191690555b5050505050565b6033546001600160a01b03163314610aea5760405162461bcd60e51b815260040161039590611317565b6001600160a01b038116610b4f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b610b5881610dea565b50565b609e6020528160005260406000208181548110610b7757600080fd5b90600052602060002001600091509150505481565b609c80546001818101835560008390527faf85b9071dfafeac1409d3f1d19bafc9bc7c37974cde8df0ee6168f0086e539c9091018390559054610bcf91906113b0565b6000828152609d60209081526040808320939093556001600160a01b0385168252609e815282822080546001808201835591845291832090910184905533825291902054610c1d91906113b0565b6001600160a01b039092166000908152609f602090815260408083209383529290522055565b6000818152609d6020526040812054609c8054919291610c65906001906113b0565b81548110610c7557610c756113c7565b9060005260206000200154905080609c8381548110610c9657610c966113c7565b6000918252602080832090910192909255828152609d9091526040808220849055848252812055609c805480610cce57610cce6113dd565b6000828152602080822083016000199081018390559092019092556001600160a01b038616808352609f82526040808420878552835280842054918452609e9092529082208054919291610d24906001906113b0565b81548110610d3457610d346113c7565b9060005260206000200154905080609e6000886001600160a01b03166001600160a01b031681526020019081526020016000208381548110610d7857610d786113c7565b6000918252602080832091909101929092556001600160a01b038816808252609f835260408083208584528452808320869055888352808320839055908252609e90925220805480610dcc57610dcc6113dd565b60019003818190600052602060002001600090559055505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610e4882846113f3565b9392505050565b6000610e488284611412565b6000610e4882846113b0565b6000610e488284611434565b600054610100900460ff1680610e8c575060005460ff16155b610ea85760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610eca576000805461ffff19166101011790555b610ed2610ee6565b610eda610f61565b610aa785858585610fc0565b600054610100900460ff1680610eff575060005460ff16155b610f1b5760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610f3d576000805461ffff19166101011790555b610f45611071565b610f4d6110db565b8015610b58576000805461ff001916905550565b600054610100900460ff1680610f7a575060005460ff16155b610f965760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610fb8576000805461ffff19166101011790555b610f4d61113b565b600054610100900460ff1680610fd9575060005460ff16155b610ff55760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611017576000805461ffff19166101011790555b609780546001600160a01b038088166001600160a01b031992831617909255609880548684169083161790556099805492871692909116919091179055609a8290558015610ab9576000805461ff00191690555050505050565b600054610100900460ff168061108a575060005460ff16155b6110a65760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015610f4d576000805461ffff19166101011790558015610b58576000805461ff001916905550565b600054610100900460ff16806110f4575060005460ff16155b6111105760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611132576000805461ffff19166101011790555b610f4d33610dea565b600054610100900460ff1680611154575060005460ff16155b6111705760405162461bcd60e51b81526004016103959061134c565b600054610100900460ff16158015611192576000805461ffff19166101011790555b60016065558015610b58576000805461ff001916905550565b6001600160a01b0381168114610b5857600080fd5b6000602082840312156111d257600080fd5b8135610e48816111ab565b6000602082840312156111ef57600080fd5b5035919050565b6000806040838503121561120957600080fd5b8235611214816111ab565b946020939093013593505050565b8015158114610b5857600080fd5b60008060006060848603121561124557600080fd5b83359250602084013561125781611222565b929592945050506040919091013590565b6000806000806080858703121561127e57600080fd5b8435611289816111ab565b93506020850135611299816111ab565b925060408501356112a9816111ab565b9396929550929360600135925050565b6000602082840312156112cb57600080fd5b8151610e4881611222565b6000602082840312156112e857600080fd5b8151610e48816111ab565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156113c2576113c261139a565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561140d5761140d61139a565b500290565b60008261142f57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156114475761144761139a565b50019056fea26469706673582212209409c1c95a390800cc8cd93f8febc9ada10070cc5aa7ae9b82dc5050baa600cc64736f6c634300080a0033