ETH Price: $2,048.79 (-1.36%)

Contract

0xdc59Cf10D64c894C71FA2Ba1cFf9bCDeBC7B96ef
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Token169470042023-03-31 11:51:351077 days ago1680263495IN
0xdc59Cf10...eBC7B96ef
0 ETH0.001986123.89386161
Buy Token166690032023-02-20 9:55:351116 days ago1676886935IN
0xdc59Cf10...eBC7B96ef
0 ETH0.002122421.17707189
Buy Token164696752023-01-23 13:02:351144 days ago1674478955IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0016819914.94815625
Buy NFT163763562023-01-10 12:17:591157 days ago1673353079IN
0xdc59Cf10...eBC7B96ef
0 ETH0.004309215.35025517
Buy Token163763452023-01-10 12:15:471157 days ago1673352947IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0020667217.61581436
Buy NFT163339972023-01-04 14:23:231163 days ago1672842203IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0054962519.24962885
Buy Token163329452023-01-04 10:51:591163 days ago1672829519IN
0xdc59Cf10...eBC7B96ef
0 ETH0.001410716.04491346
Buy Token163270402023-01-03 15:05:351164 days ago1672758335IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0031057930.98912092
Buy Token161967002022-12-16 10:36:111182 days ago1671186971IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0015567215.53091597
Set Marketplace ...161748882022-12-13 9:27:591185 days ago1670923679IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0003976113.84629904
Buy Token161747682022-12-13 9:03:591185 days ago1670922239IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0021013317.91267126
Transfer Ownersh...161729042022-12-13 2:49:351185 days ago1670899775IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0004328315.13621635
Set Marketplace ...161727272022-12-13 2:14:111185 days ago1670897651IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0008694618.97737489
Buy NFT161727212022-12-13 2:12:591185 days ago1670897579IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0066793222.0712881
Buy Token161727122022-12-13 2:11:111185 days ago1670897471IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0021945929.0590316
Set Marketplace ...161727092022-12-13 2:10:351185 days ago1670897435IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0006537627.39086846
Set Kanga POS Ad...161725842022-12-13 1:45:231185 days ago1670895923IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0007090314.8774948
Upsert NFT Sale ...161725832022-12-13 1:45:111185 days ago1670895911IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0017879415.26692473
Upsert NFT Sale ...161725822022-12-13 1:44:591185 days ago1670895899IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0016754214.3061835
Upsert NFT Sale ...161725812022-12-13 1:44:471185 days ago1670895887IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0017191314.67642094
Upsert NFT Sale ...161725802022-12-13 1:44:351185 days ago1670895875IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0014356414.77942803
Upsert NFT Sale ...161725792022-12-13 1:44:231185 days ago1670895863IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0014462714.88522484
Upsert NFT Sale ...161725782022-12-13 1:44:111185 days ago1670895851IN
0xdc59Cf10...eBC7B96ef
0 ETH0.0014644315.0757969

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Marketplace

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interfaces/INFT.sol";
import "../interfaces/IMarketplace.sol";
import "../interfaces/ISaleToken.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Marketplace is Ownable, IMarketplace, ReentrancyGuard {
    using SafeERC20 for IERC20;

    event KangaPOSAddressUpdated(address indexed oldAddress, address indexed newAddress);
    event NFTSTypeForSaleDataUpdated(
        string membershipType,
        uint256 quantity,
        bool isEnabled,
        uint256 price,
        uint256 validity
    );

    event NFTSold(
        address indexed to,
        uint256 nftId,
        string membershipType,
        uint256 membershipTypeSerialId,
        uint256 price
    );

    event BETokenBought(address indexed to, uint256 tokenAmount, uint256 exchangedTokenAmount);

    struct NFTTypeSaleData {
        uint256 quantity;
        bool isEnabled;
        uint256 price;
        uint256 validity;
    }

    mapping(string => NFTTypeSaleData) public nftsSaleDataByType;

    uint256 private constant _INITIAL_BE_PRICE = 1 ether;
    uint256 public marketplaceSaleUnlock = 1670922000;

    INFT private _nftContract;
    ISaleToken private _tokenContract;
    IERC20 private _usdtContract;
    address private _kangaPOS;

    modifier marketplaceSaleGuard() {
        require(block.timestamp >= marketplaceSaleUnlock, "Marketplace: The sale is not unlocked yet");
        _;
    }

    constructor(
        address beTokenAddress,
        address nftContract,
        address usdtTokenAddress
    ) {
        _nftContract = INFT(nftContract);
        _tokenContract = ISaleToken(beTokenAddress);
        _usdtContract = IERC20(usdtTokenAddress);
    }

    function setMarketplaceUnlockTime(uint256 unlockTime) external onlyOwner {
        marketplaceSaleUnlock = unlockTime;
    }

    function renounceOwnership() public view override onlyOwner {
        revert("Token: ownership renounce not allowed");
    }

    function setKangaPOSAddress(address kangaPOS) external onlyOwner {
        address previousAddress = _kangaPOS;

        _kangaPOS = kangaPOS;

        emit KangaPOSAddressUpdated(previousAddress, kangaPOS);
    }

    function remainingTokenSupply() external view returns (uint256) {
        return _tokenContract.balanceOf(address(this));
    }

    function buyToken(uint256 amount) external nonReentrant marketplaceSaleGuard {
        require(_tokenContract.balanceOf(address(this)) >= amount, "Marketplace: Not enough token supply for the sale");

        address caller = _msgSender();
        uint256 exchangedAmount = _beTokensPriceInUSDT(amount);

        _usdtContract.safeTransferFrom(caller, owner(), exchangedAmount);
        _tokenContract.transfer(caller, amount);

        emit BETokenBought(caller, amount, exchangedAmount);
    }

    function upsertNFTSaleTypeData(
        string memory membershipType,
        uint256 quantity,
        bool isEnabled,
        uint256 price,
        uint256 validity
    ) external onlyOwner {
        require(validity == 0 || validity >= 1 hours, "Marketplace: NFT validity should be at least 1 hour");

        nftsSaleDataByType[membershipType] = NFTTypeSaleData({
            quantity: quantity,
            isEnabled: isEnabled,
            price: price,
            validity: validity
        });

        emit NFTSTypeForSaleDataUpdated(membershipType, quantity, isEnabled, price, validity);
    }

    function _remainingNFTSupplyByType(string memory membershipType) internal view returns (uint256) {
        uint256 soldNfts = _nftContract.soldNftsByDataType(membershipType);
        uint256 nftSupply = nftsSaleDataByType[membershipType].quantity;

        if (nftSupply >= soldNfts) {
            return nftSupply - soldNfts;
        } else {
            return 0;
        }
    }

    function remainingNFTSupplyByType(string memory membershipType) external view returns (uint256) {
        if (nftsSaleDataByType[membershipType].isEnabled) {
            return _remainingNFTSupplyByType(membershipType);
        } else {
            return 0;
        }
    }

    function _beTokenPrice() internal view returns (uint256) {
        uint256 currentRound = _tokenContract.currentRound();

        if (currentRound <= 1) {
            return _INITIAL_BE_PRICE;
        }

        return (_INITIAL_BE_PRICE * (105**(currentRound - 1))) / (100**(currentRound - 1));
    }

    function _beTokensPriceInUSDT(uint256 amount) internal view returns (uint256) {
      return SafeMath.div(SafeMath.div(SafeMath.mul(amount, _beTokenPrice()), 1 ether), 10 ** 12);
    }

    function beTokensPriceInUSDT(uint256 amount) external view returns (uint256) {
        return _beTokensPriceInUSDT(amount);
    }

    function buyNFT(string memory membershipType) external nonReentrant marketplaceSaleGuard {
        require(_kangaPOS != address(0), "Marketplace: kangaPOS has to be set before lunching the NFT sale");
        require(
            nftsSaleDataByType[membershipType].isEnabled,
            "Marketplace: specified membership type NFT is not for sale"
        );
        require(
            _remainingNFTSupplyByType(membershipType) > 0,
            "Marketplace: no NFT supply for specified membership type"
        );

        address caller = _msgSender();
        NFTTypeSaleData memory dataType = nftsSaleDataByType[membershipType];

        uint256 nftPrice = dataType.price;
        uint256 burnableAmount = SafeMath.div(SafeMath.mul(nftPrice, 19), 20);
        uint256 posReward = nftPrice - burnableAmount;

        /**
         * First burn the 95% of the amount and transfer rest to contract address
         */
        _tokenContract.burnFrom(caller, burnableAmount);

        /**
         * Transfer reward with allowance to kangaPOS
         */
        _tokenContract.transferFrom(caller, _kangaPOS, posReward);

        /**
         * Mint a NFT to an address and store the change
         */
        (uint256 nftId, uint256 membershipTypeSerialId) = _nftContract.mintNFT(
            caller,
            membershipType,
            dataType.validity
        );

        emit NFTSold(caller, nftId, membershipType, membershipTypeSerialId, nftPrice);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 SafeMath {
    /**
     * @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 subtraction 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;
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IMarketplace {
    function buyToken(uint256 amount) external;

    function buyNFT(string memory membershipType) external;

    function setKangaPOSAddress(address kangaPOSAddress) external;

    function upsertNFTSaleTypeData(
        string memory membershipType,
        uint256 quantity,
        bool isEnabled,
        uint256 price,
        uint256 validity
    ) external;

    function remainingTokenSupply() external view returns (uint256);

    function remainingNFTSupplyByType(string memory membershipType) external view returns (uint256);

    function beTokensPriceInUSDT(uint256 amount) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface INFT {
    function mintNFT(
        address to,
        string memory membershipType,
        uint256 validity
    ) external returns (uint256, uint256);

    function soldNftsByDataType(string memory membershipType) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISaleToken is IERC20 {
    function currentRound() external view returns (uint256);

    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);

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

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"beTokenAddress","type":"address"},{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"usdtTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exchangedTokenAmount","type":"uint256"}],"name":"BETokenBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"KangaPOSAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"membershipType","type":"string"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isEnabled","type":"bool"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"validity","type":"uint256"}],"name":"NFTSTypeForSaleDataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"string","name":"membershipType","type":"string"},{"indexed":false,"internalType":"uint256","name":"membershipTypeSerialId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"NFTSold","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"beTokensPriceInUSDT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"membershipType","type":"string"}],"name":"buyNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buyToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"marketplaceSaleUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"nftsSaleDataByType","outputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bool","name":"isEnabled","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"validity","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"membershipType","type":"string"}],"name":"remainingNFTSupplyByType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingTokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"kangaPOS","type":"address"}],"name":"setKangaPOSAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"name":"setMarketplaceUnlockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"membershipType","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bool","name":"isEnabled","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"validity","type":"uint256"}],"name":"upsertNFTSaleTypeData","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526363983f106003553480156200001957600080fd5b50604051620016fd380380620016fd8339810160408190526200003c91620000f9565b62000047336200008c565b60018055600480546001600160a01b03199081166001600160a01b03948516179091556005805482169484169490941790935560068054909316911617905562000143565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f457600080fd5b919050565b6000806000606084860312156200010f57600080fd5b6200011a84620000dc565b92506200012a60208501620000dc565b91506200013a60408501620000dc565b90509250925092565b6115aa80620001536000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063cc99a11711610066578063cc99a117146101dd578063ec68c54e146101f0578063f2fde38b146101f8578063fe50ae951461020b57600080fd5b80638da5cb5b146101465780638edf980114610161578063aecace721461017457600080fd5b80632d296bf1146100d45780636052715f146100e957806363bd98841461010f578063715018a61461011857806385ac022d146101205780638d01230014610133575b600080fd5b6100e76100e23660046110d6565b61021e565b005b6100fc6100f73660046110d6565b61046d565b6040519081526020015b60405180910390f35b6100fc60035481565b6100e761047e565b6100e761012e3660046110ef565b6104dc565b6100e76101413660046111bb565b610536565b6000546040516001600160a01b039091168152602001610106565b6100fc61016f3660046111bb565b610984565b6101bd6101823660046111bb565b8051602081830181018051600280835293830192909401919091209290528154600183015491830154600390930154909260ff909216919084565b604080519485529215156020850152918301526060820152608001610106565b6100e76101eb3660046111fe565b6109c2565b6100fc610af9565b6100e76102063660046110ef565b610b6b565b6100e76102193660046110d6565b610be4565b6002600154036102755760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260015560035442101561029c5760405162461bcd60e51b815260040161026c90611269565b6005546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156102e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030891906112b2565b10156103705760405162461bcd60e51b815260206004820152603160248201527f4d61726b6574706c6163653a204e6f7420656e6f75676820746f6b656e20737560448201527070706c7920666f72207468652073616c6560781b606482015260840161026c565b33600061037c83610bf1565b90506103a8826103946000546001600160a01b031690565b6006546001600160a01b0316919084610c23565b60055460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018690529091169063a9059cbb906044016020604051808303816000875af11580156103fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041f91906112cb565b5060408051848152602081018390526001600160a01b038416917fe7f8413b126669e3f36ba1cb6997fa52beb1f77c8716408b88b183d114ebab18910160405180910390a250506001805550565b600061047882610bf1565b92915050565b610486610c83565b60405162461bcd60e51b815260206004820152602560248201527f546f6b656e3a206f776e6572736869702072656e6f756e6365206e6f7420616c6044820152641b1bddd95960da1b606482015260840161026c565b6104e4610c83565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fc76109f8a29d14e1a9f48b26ce2b140b6c364fc1379299d34ac8c0614e62aeb090600090a35050565b6002600154036105885760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026c565b60026001556003544210156105af5760405162461bcd60e51b815260040161026c90611269565b6007546001600160a01b031661062f576040805162461bcd60e51b81526020600482015260248101919091527f4d61726b6574706c6163653a206b616e6761504f532068617320746f2062652060448201527f736574206265666f7265206c756e6368696e6720746865204e46542073616c65606482015260840161026c565b60028160405161063f919061130c565b9081526040519081900360200190206001015460ff166106c75760405162461bcd60e51b815260206004820152603a60248201527f4d61726b6574706c6163653a20737065636966696564206d656d62657273686960448201527f702074797065204e4654206973206e6f7420666f722073616c65000000000000606482015260840161026c565b60006106d282610cdf565b116107455760405162461bcd60e51b815260206004820152603860248201527f4d61726b6574706c6163653a206e6f204e465420737570706c7920666f72207360448201527f7065636966696564206d656d6265727368697020747970650000000000000000606482015260840161026c565b6000339050600060028360405161075c919061130c565b90815260408051918290036020908101832060808401835280548452600181015460ff16151591840191909152600281015491830182905260030154606083015290915060006107b76107b0836013610d9b565b6014610dae565b905060006107c5828461133e565b60055460405163079cc67960e41b81526001600160a01b038881166004830152602482018690529293509116906379cc679090604401600060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b50506005546007546040516323b872dd60e01b81526001600160a01b038a81166004830152918216602482015260448101869052911692506323b872dd91506064016020604051808303816000875af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae91906112cb565b50600480546060860151604051628598df60e41b815260009384936001600160a01b0316926308598df0926108e9928c928e9290910161137d565b60408051808303816000875af1158015610907573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092b91906113b1565b91509150866001600160a01b03167fa040e17186a82dc5bdbbc43eaffbab8289b3adb86f05abfc0a7c94fef9cbf789838a848960405161096e94939291906113d5565b60405180910390a2505060018055505050505050565b6000600282604051610996919061130c565b9081526040519081900360200190206001015460ff16156109ba5761047882610cdf565b506000919050565b6109ca610c83565b8015806109d95750610e108110155b610a415760405162461bcd60e51b815260206004820152603360248201527f4d61726b6574706c6163653a204e46542076616c69646974792073686f756c646044820152721031329030ba103632b0b9ba1018903437bab960691b606482015260840161026c565b6040518060800160405280858152602001841515815260200183815260200182815250600286604051610a74919061130c565b9081526040805160209281900383018120845181559284015160018401805460ff19169115159190911790559083015160028301556060909201516003909101557f9bb54424844cfdd938d952a0f129a440349eae1ad87d32c061ce2e76d45b46e190610aea9087908790879087908790611401565b60405180910390a15050505050565b6005546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6691906112b2565b905090565b610b73610c83565b6001600160a01b038116610bd85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026c565b610be181610dba565b50565b610bec610c83565b600355565b6000610478610c18610c0a84610c05610e0a565b610d9b565b670de0b6b3a7640000610dae565b64e8d4a51000610dae565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610c7d908590610eeb565b50505050565b6000546001600160a01b03163314610cdd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b565b6004805460405163390b451f60e01b815260009283926001600160a01b03169163390b451f91610d1191879101611438565b602060405180830381865afa158015610d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5291906112b2565b90506000600284604051610d66919061130c565b908152604051908190036020019020549050818110610d9157610d89828261133e565b949350505050565b5060009392505050565b6000610da7828461144b565b9392505050565b6000610da78284611462565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600560009054906101000a90046001600160a01b03166001600160a01b0316638a19c8bc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8491906112b2565b905060018111610e9d57670de0b6b3a764000091505090565b610ea860018261133e565b610eb3906064611568565b610ebe60018361133e565b610ec9906069611568565b610edb90670de0b6b3a764000061144b565b610ee59190611462565b91505090565b6000610f40826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fc29092919063ffffffff16565b805190915015610fbd5780806020019051810190610f5e91906112cb565b610fbd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161026c565b505050565b6060610d898484600085856001600160a01b0385163b6110245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161026c565b600080866001600160a01b03168587604051611040919061130c565b60006040518083038185875af1925050503d806000811461107d576040519150601f19603f3d011682016040523d82523d6000602084013e611082565b606091505b509150915061109282828661109d565b979650505050505050565b606083156110ac575081610da7565b8251156110bc5782518084602001fd5b8160405162461bcd60e51b815260040161026c9190611438565b6000602082840312156110e857600080fd5b5035919050565b60006020828403121561110157600080fd5b81356001600160a01b0381168114610da757600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261113f57600080fd5b813567ffffffffffffffff8082111561115a5761115a611118565b604051601f8301601f19908116603f0116810190828211818310171561118257611182611118565b8160405283815286602085880101111561119b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156111cd57600080fd5b813567ffffffffffffffff8111156111e457600080fd5b610d898482850161112e565b8015158114610be157600080fd5b600080600080600060a0868803121561121657600080fd5b853567ffffffffffffffff81111561122d57600080fd5b6112398882890161112e565b955050602086013593506040860135611251816111f0565b94979396509394606081013594506080013592915050565b60208082526029908201527f4d61726b6574706c6163653a205468652073616c65206973206e6f7420756e6c6040820152681bd8dad959081e595d60ba1b606082015260800190565b6000602082840312156112c457600080fd5b5051919050565b6000602082840312156112dd57600080fd5b8151610da7816111f0565b60005b838110156113035781810151838201526020016112eb565b50506000910152565b6000825161131e8184602087016112e8565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561047857610478611328565b600081518084526113698160208601602086016112e8565b601f01601f19169290920160200192915050565b6001600160a01b03841681526060602082018190526000906113a190830185611351565b9050826040830152949350505050565b600080604083850312156113c457600080fd5b505080516020909101519092909150565b8481526080602082015260006113ee6080830186611351565b6040830194909452506060015292915050565b60a08152600061141460a0830188611351565b60208301969096525092151560408401526060830191909152608090910152919050565b602081526000610da76020830184611351565b808202811582820484141761047857610478611328565b60008261147f57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156114bf5781600019048211156114a5576114a5611328565b808516156114b257918102915b93841c9390800290611489565b509250929050565b6000826114d657506001610478565b816114e357506000610478565b81600181146114f957600281146115035761151f565b6001915050610478565b60ff84111561151457611514611328565b50506001821b610478565b5060208310610133831016604e8410600b8410161715611542575081810a610478565b61154c8383611484565b806000190482111561156057611560611328565b029392505050565b6000610da783836114c756fea26469706673582212204c49d5edf3b95e84c14b12032d932f0f2bd39aa79193b99811c6f7471beebff764736f6c63430008110033000000000000000000000000763a4c6ab1865e784ca0c4f5bb22ef453e6f727e000000000000000000000000ae0b9e0d1e91a12da214a3810b405368468a0907000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063cc99a11711610066578063cc99a117146101dd578063ec68c54e146101f0578063f2fde38b146101f8578063fe50ae951461020b57600080fd5b80638da5cb5b146101465780638edf980114610161578063aecace721461017457600080fd5b80632d296bf1146100d45780636052715f146100e957806363bd98841461010f578063715018a61461011857806385ac022d146101205780638d01230014610133575b600080fd5b6100e76100e23660046110d6565b61021e565b005b6100fc6100f73660046110d6565b61046d565b6040519081526020015b60405180910390f35b6100fc60035481565b6100e761047e565b6100e761012e3660046110ef565b6104dc565b6100e76101413660046111bb565b610536565b6000546040516001600160a01b039091168152602001610106565b6100fc61016f3660046111bb565b610984565b6101bd6101823660046111bb565b8051602081830181018051600280835293830192909401919091209290528154600183015491830154600390930154909260ff909216919084565b604080519485529215156020850152918301526060820152608001610106565b6100e76101eb3660046111fe565b6109c2565b6100fc610af9565b6100e76102063660046110ef565b610b6b565b6100e76102193660046110d6565b610be4565b6002600154036102755760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260015560035442101561029c5760405162461bcd60e51b815260040161026c90611269565b6005546040516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156102e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030891906112b2565b10156103705760405162461bcd60e51b815260206004820152603160248201527f4d61726b6574706c6163653a204e6f7420656e6f75676820746f6b656e20737560448201527070706c7920666f72207468652073616c6560781b606482015260840161026c565b33600061037c83610bf1565b90506103a8826103946000546001600160a01b031690565b6006546001600160a01b0316919084610c23565b60055460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018690529091169063a9059cbb906044016020604051808303816000875af11580156103fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041f91906112cb565b5060408051848152602081018390526001600160a01b038416917fe7f8413b126669e3f36ba1cb6997fa52beb1f77c8716408b88b183d114ebab18910160405180910390a250506001805550565b600061047882610bf1565b92915050565b610486610c83565b60405162461bcd60e51b815260206004820152602560248201527f546f6b656e3a206f776e6572736869702072656e6f756e6365206e6f7420616c6044820152641b1bddd95960da1b606482015260840161026c565b6104e4610c83565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fc76109f8a29d14e1a9f48b26ce2b140b6c364fc1379299d34ac8c0614e62aeb090600090a35050565b6002600154036105885760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026c565b60026001556003544210156105af5760405162461bcd60e51b815260040161026c90611269565b6007546001600160a01b031661062f576040805162461bcd60e51b81526020600482015260248101919091527f4d61726b6574706c6163653a206b616e6761504f532068617320746f2062652060448201527f736574206265666f7265206c756e6368696e6720746865204e46542073616c65606482015260840161026c565b60028160405161063f919061130c565b9081526040519081900360200190206001015460ff166106c75760405162461bcd60e51b815260206004820152603a60248201527f4d61726b6574706c6163653a20737065636966696564206d656d62657273686960448201527f702074797065204e4654206973206e6f7420666f722073616c65000000000000606482015260840161026c565b60006106d282610cdf565b116107455760405162461bcd60e51b815260206004820152603860248201527f4d61726b6574706c6163653a206e6f204e465420737570706c7920666f72207360448201527f7065636966696564206d656d6265727368697020747970650000000000000000606482015260840161026c565b6000339050600060028360405161075c919061130c565b90815260408051918290036020908101832060808401835280548452600181015460ff16151591840191909152600281015491830182905260030154606083015290915060006107b76107b0836013610d9b565b6014610dae565b905060006107c5828461133e565b60055460405163079cc67960e41b81526001600160a01b038881166004830152602482018690529293509116906379cc679090604401600060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b50506005546007546040516323b872dd60e01b81526001600160a01b038a81166004830152918216602482015260448101869052911692506323b872dd91506064016020604051808303816000875af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae91906112cb565b50600480546060860151604051628598df60e41b815260009384936001600160a01b0316926308598df0926108e9928c928e9290910161137d565b60408051808303816000875af1158015610907573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092b91906113b1565b91509150866001600160a01b03167fa040e17186a82dc5bdbbc43eaffbab8289b3adb86f05abfc0a7c94fef9cbf789838a848960405161096e94939291906113d5565b60405180910390a2505060018055505050505050565b6000600282604051610996919061130c565b9081526040519081900360200190206001015460ff16156109ba5761047882610cdf565b506000919050565b6109ca610c83565b8015806109d95750610e108110155b610a415760405162461bcd60e51b815260206004820152603360248201527f4d61726b6574706c6163653a204e46542076616c69646974792073686f756c646044820152721031329030ba103632b0b9ba1018903437bab960691b606482015260840161026c565b6040518060800160405280858152602001841515815260200183815260200182815250600286604051610a74919061130c565b9081526040805160209281900383018120845181559284015160018401805460ff19169115159190911790559083015160028301556060909201516003909101557f9bb54424844cfdd938d952a0f129a440349eae1ad87d32c061ce2e76d45b46e190610aea9087908790879087908790611401565b60405180910390a15050505050565b6005546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6691906112b2565b905090565b610b73610c83565b6001600160a01b038116610bd85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026c565b610be181610dba565b50565b610bec610c83565b600355565b6000610478610c18610c0a84610c05610e0a565b610d9b565b670de0b6b3a7640000610dae565b64e8d4a51000610dae565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610c7d908590610eeb565b50505050565b6000546001600160a01b03163314610cdd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b565b6004805460405163390b451f60e01b815260009283926001600160a01b03169163390b451f91610d1191879101611438565b602060405180830381865afa158015610d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5291906112b2565b90506000600284604051610d66919061130c565b908152604051908190036020019020549050818110610d9157610d89828261133e565b949350505050565b5060009392505050565b6000610da7828461144b565b9392505050565b6000610da78284611462565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600560009054906101000a90046001600160a01b03166001600160a01b0316638a19c8bc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8491906112b2565b905060018111610e9d57670de0b6b3a764000091505090565b610ea860018261133e565b610eb3906064611568565b610ebe60018361133e565b610ec9906069611568565b610edb90670de0b6b3a764000061144b565b610ee59190611462565b91505090565b6000610f40826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fc29092919063ffffffff16565b805190915015610fbd5780806020019051810190610f5e91906112cb565b610fbd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161026c565b505050565b6060610d898484600085856001600160a01b0385163b6110245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161026c565b600080866001600160a01b03168587604051611040919061130c565b60006040518083038185875af1925050503d806000811461107d576040519150601f19603f3d011682016040523d82523d6000602084013e611082565b606091505b509150915061109282828661109d565b979650505050505050565b606083156110ac575081610da7565b8251156110bc5782518084602001fd5b8160405162461bcd60e51b815260040161026c9190611438565b6000602082840312156110e857600080fd5b5035919050565b60006020828403121561110157600080fd5b81356001600160a01b0381168114610da757600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261113f57600080fd5b813567ffffffffffffffff8082111561115a5761115a611118565b604051601f8301601f19908116603f0116810190828211818310171561118257611182611118565b8160405283815286602085880101111561119b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000602082840312156111cd57600080fd5b813567ffffffffffffffff8111156111e457600080fd5b610d898482850161112e565b8015158114610be157600080fd5b600080600080600060a0868803121561121657600080fd5b853567ffffffffffffffff81111561122d57600080fd5b6112398882890161112e565b955050602086013593506040860135611251816111f0565b94979396509394606081013594506080013592915050565b60208082526029908201527f4d61726b6574706c6163653a205468652073616c65206973206e6f7420756e6c6040820152681bd8dad959081e595d60ba1b606082015260800190565b6000602082840312156112c457600080fd5b5051919050565b6000602082840312156112dd57600080fd5b8151610da7816111f0565b60005b838110156113035781810151838201526020016112eb565b50506000910152565b6000825161131e8184602087016112e8565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561047857610478611328565b600081518084526113698160208601602086016112e8565b601f01601f19169290920160200192915050565b6001600160a01b03841681526060602082018190526000906113a190830185611351565b9050826040830152949350505050565b600080604083850312156113c457600080fd5b505080516020909101519092909150565b8481526080602082015260006113ee6080830186611351565b6040830194909452506060015292915050565b60a08152600061141460a0830188611351565b60208301969096525092151560408401526060830191909152608090910152919050565b602081526000610da76020830184611351565b808202811582820484141761047857610478611328565b60008261147f57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156114bf5781600019048211156114a5576114a5611328565b808516156114b257918102915b93841c9390800290611489565b509250929050565b6000826114d657506001610478565b816114e357506000610478565b81600181146114f957600281146115035761151f565b6001915050610478565b60ff84111561151457611514611328565b50506001821b610478565b5060208310610133831016604e8410600b8410161715611542575081810a610478565b61154c8383611484565b806000190482111561156057611560611328565b029392505050565b6000610da783836114c756fea26469706673582212204c49d5edf3b95e84c14b12032d932f0f2bd39aa79193b99811c6f7471beebff764736f6c63430008110033

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

000000000000000000000000763a4c6ab1865e784ca0c4f5bb22ef453e6f727e000000000000000000000000ae0b9e0d1e91a12da214a3810b405368468a0907000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

-----Decoded View---------------
Arg [0] : beTokenAddress (address): 0x763A4C6ab1865e784CA0c4f5bB22ef453E6F727E
Arg [1] : nftContract (address): 0xAE0B9e0D1e91A12Da214a3810B405368468a0907
Arg [2] : usdtTokenAddress (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000763a4c6ab1865e784ca0c4f5bb22ef453e6f727e
Arg [1] : 000000000000000000000000ae0b9e0d1e91a12da214a3810b405368468a0907
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.