Contract 0xCDA803932cd1C7258e373e5eB4AABbC4Ba396939

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf87ead285921389124335bd8c840e6c84d3d38e44071400a2fed67cea2a01cd80x60806040450050762022-08-16 4:45:1739 days 13 hrs ago0x0dc086dba4561a135a3f42736df32c4d46fe7776 IN  Create: Lottery0 FTM0.005208885358
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xf87ead285921389124335bd8c840e6c84d3d38e44071400a2fed67cea2a01cd8450050762022-08-16 4:45:1739 days 13 hrs ago 0x0dc086dba4561a135a3f42736df32c4d46fe7776  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Lottery

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 37 : Lottery.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "./common/WithdrawUpgradeable.sol";
import "./interfaces/IInvestorManager.sol";
import "./interfaces/IMeSeaNft.sol";
import "./interfaces/ILotteryGlobal.sol";
import "./interfaces/ILotteryRandomizer.sol";
import "./interfaces/IERC20Token.sol";
import "./interfaces/ILotteryCommission.sol";

contract Lottery is
    ILotteryGlobal,
    WithdrawUpgradeable,
    AccessControlEnumerableUpgradeable,
    ERC1155HolderUpgradeable,
    ERC721HolderUpgradeable
{
    using AddressUpgradeable for address;
    using SafeMathUpgradeable for uint256;
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant GATEWAY_ROLE = keccak256("GATEWAY_ROLE");

    IMeSeaNft public erc721Token;
    IERC1155 public erc1155Token;
    IERC20 public mesToken;
    IERC20 public usdmToken;
    IERC20Token public usdtToken;
    ILotteryRandomizer public lotteryRandomizer;
    ILotteryCommission public lotteryCommission;

    address[] public userWallets;
    mapping(address => uint256) public refCounts;
    mapping(address => bool) public specialNftWallet;
    address public globalWallet;
    uint256 public erc1155TokenId;
    uint256 public COIN_REWARD_AMOUNT;
    uint256 public MON_REWARD_AMOUNT;
    uint256 public MES_REWARD_AMOUNT;
    uint256 public USDM_REWARD_AMOUNT;
    uint256 public USDT_REWARD_AMOUNT;
    uint256 public ERC1155_REWARD_QUANTITY;
    uint256 public USDM_LIMIT_TO_RECEIVE_REWARD;
    uint256 public usdtDecimal;
    mapping(address => bool) public claimed;
    uint256 public CLAIM_FEE;
    uint256 public totalUsdmPayout;

    mapping(address => RewardType) public specialGuessRewardTypes;

    struct Ranking {
        address wallet;
        uint256 refUseCount;
    }

    function initialize(Config memory _config) public initializer {
        __AccessControl_init();
        __AccessControlEnumerable_init();
        __Ownable_init();
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(ADMIN_ROLE, _msgSender());
        _setupRole(GATEWAY_ROLE, _msgSender());

        setConfig(_config);
        globalWallet = owner();

        erc1155TokenId = 0;
        COIN_REWARD_AMOUNT = 100 ether;
        MON_REWARD_AMOUNT = 10 * 1e18;
        MES_REWARD_AMOUNT = 1000 ether;
        USDM_REWARD_AMOUNT = 50 ether;
        USDT_REWARD_AMOUNT = 50 * 10**usdtDecimal;
        ERC1155_REWARD_QUANTITY = 1;
        USDM_LIMIT_TO_RECEIVE_REWARD = 100 ether;
        CLAIM_FEE = 5 ether;
        totalUsdmPayout = 0;
    }

    struct Config {
        IMeSeaNft erc721Token;
        IERC1155 erc1155Token;
        IERC20 mesToken;
        IERC20 usdmToken;
        IERC20Token usdtToken;
        ILotteryRandomizer lotteryRandomizer;
        ILotteryCommission lotteryCommission;
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(AccessControlEnumerableUpgradeable, ERC1155ReceiverUpgradeable)
        returns (bool)
    {
        return
            interfaceId == type(IERC1155ReceiverUpgradeable).interfaceId ||
            interfaceId ==
            type(IAccessControlEnumerableUpgradeable).interfaceId ||
            interfaceId == type(IERC721ReceiverUpgradeable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function setConfig(Config memory _config) public onlyRole(ADMIN_ROLE) {
        erc721Token = _config.erc721Token;
        erc1155Token = _config.erc1155Token;
        mesToken = _config.mesToken;
        usdmToken = _config.usdmToken;
        usdtToken = _config.usdtToken;
        lotteryRandomizer = _config.lotteryRandomizer;
        lotteryCommission = _config.lotteryCommission;
        usdtDecimal = usdtToken.decimals();
    }

    function getRanking(uint256 fromIndex, uint256 toIndex)
        public
        view
        returns (Ranking[] memory)
    {
        uint256 length = userWallets.length;
        Ranking[] memory emptyResponse = new Ranking[](0);
        if (length == 0) return emptyResponse;
        if (fromIndex >= length) return emptyResponse;

        uint256 normalizedToIndex = toIndex < length ? toIndex : length - 1;
        if (fromIndex > normalizedToIndex) return emptyResponse;

        Ranking[] memory result = new Ranking[](
            normalizedToIndex - fromIndex + 1
        );
        for (uint256 index = fromIndex; index <= normalizedToIndex; index++) {
            result[index - fromIndex] = Ranking(
                userWallets[index],
                refCounts[userWallets[index]]
            );
        }
        return result;
    }

    function getTotalRankingCount() public view returns (uint256) {
        return userWallets.length;
    }

    function setRandomizer(ILotteryRandomizer _lotteryRandomizer)
        public
        onlyRole(ADMIN_ROLE)
    {
        lotteryRandomizer = _lotteryRandomizer;
    }

    function setUsdmLimitToReceiveReward(uint256 _USDM_LIMIT_TO_RECEIVE_REWARD)
        public
        onlyRole(ADMIN_ROLE)
    {
        USDM_LIMIT_TO_RECEIVE_REWARD = _USDM_LIMIT_TO_RECEIVE_REWARD;
    }

    function setSpecialNftWallet(address[] memory _addresses, bool isSpecial)
        public
        onlyRole(ADMIN_ROLE)
    {
        for (uint256 index = 0; index <= _addresses.length; index++) {
            specialNftWallet[_addresses[index]] = isSpecial;
        }
    }

    function setERC1155Quantity(uint256 _ERC1155_REWARD_QUANTITY)
        public
        onlyRole(ADMIN_ROLE)
    {
        ERC1155_REWARD_QUANTITY = _ERC1155_REWARD_QUANTITY;
    }

    function payErc721Token() internal {
        uint256 index = 0;
        uint256 tokenId = erc721Token.tokenOfOwnerByIndex(address(this), index);
        erc721Token.safeTransferFrom(address(this), _msgSender(), tokenId);
        emit PayErc721Token(_msgSender(), tokenId);
        emit Reward(RewardType.ERC721);
    }

    function isAbleToPayERC1155() public view returns (bool) {
        return
            erc1155Token.balanceOf(address(this), erc1155TokenId) >=
            ERC1155_REWARD_QUANTITY;
    }

    function isAbleToPayMes() public view returns (bool) {
        return mesToken.balanceOf(address(this)) >= MES_REWARD_AMOUNT;
    }

    function payERC1155() internal {
        erc1155Token.safeTransferFrom(
            address(this),
            _msgSender(),
            erc1155TokenId,
            ERC1155_REWARD_QUANTITY,
            ""
        );
        emit Reward(RewardType.ERC1155);
    }

    function payMesToken() internal {
        mesToken.transfer(_msgSender(), MES_REWARD_AMOUNT);
        emit Reward(RewardType.MES);
    }

    function payUsdmToken() internal {
        usdmToken.transfer(_msgSender(), USDM_REWARD_AMOUNT);
        emit Reward(RewardType.USDM);
    }

    function isAbleToPayCoin() public view returns (bool) {
        return address(this).balance >= COIN_REWARD_AMOUNT;
    }

    function isAbleToPayNft() public view returns (bool) {
        uint256 NFT_REWARD_QUANTITY = 1;
        return erc721Token.balanceOf(address(this)) >= NFT_REWARD_QUANTITY;
    }

    function setCoinRewardAmount(uint256 _COIN_REWARD_AMOUNT)
        public
        onlyRole(ADMIN_ROLE)
    {
        COIN_REWARD_AMOUNT = _COIN_REWARD_AMOUNT;
    }

    function payCoin() internal {
        payable(_msgSender()).transfer(COIN_REWARD_AMOUNT);
        emit Reward(RewardType.COIN);
    }

    function isAbleToPayUsdt() public view returns (bool) {
        return usdtToken.balanceOf(address(this)) >= USDT_REWARD_AMOUNT;
    }

    function isAbleToPayUsdm() public view returns (bool) {
        return usdmToken.balanceOf(address(this)) >= USDM_REWARD_AMOUNT;
    }

    function setUsdtRewardAmount(uint256 _USDT_REWARD_AMOUNT)
        public
        onlyRole(ADMIN_ROLE)
    {
        USDT_REWARD_AMOUNT = _USDT_REWARD_AMOUNT;
    }

    function payUsdtToken() internal {
        usdtToken.transfer(_msgSender(), USDT_REWARD_AMOUNT);
        emit Reward(RewardType.USDT);
    }

    function payNothing() internal {
        emit Reward(RewardType.NONE);
    }

    event Reward(RewardType rewardType);
    event PayErc721Token(address wallet, uint256 tokenId);

    function setClaimFee(uint256 _CLAIM_FEE) public onlyRole(ADMIN_ROLE) {
        CLAIM_FEE = _CLAIM_FEE;
    }

    function setGlobalWallet(address _globalWallet)
        public
        onlyRole(ADMIN_ROLE)
    {
        globalWallet = _globalWallet;
    }

    function setSpecialGuessRewardTypes(
        address[] memory wallets,
        RewardType _type
    ) public onlyRole(ADMIN_ROLE) {
        uint256 length = wallets.length;
        for (uint256 index = 0; index < length; index++) {
            address wallet = wallets[index];
            specialGuessRewardTypes[wallet] = _type;
        }
    }

    function claim(address presenterAddress) public virtual {
        require(!_msgSender().isContract(), "NON_ALLOW_CONTRACT_CALLS");
        require(!claimed[msg.sender], "ALREADY_CLAIMED");
        claimed[_msgSender()] = true;
        payCommission(_msgSender(), CLAIM_FEE);

        if (refCounts[presenterAddress] == 0)
            userWallets.push(presenterAddress);
        refCounts[presenterAddress] += 1;

        RewardType randomRewardType = lotteryRandomizer.get();
        if (specialGuessRewardTypes[_msgSender()] != RewardType.NONE) {
            randomRewardType = specialGuessRewardTypes[_msgSender()];
            delete specialGuessRewardTypes[_msgSender()];
        }

        if (randomRewardType == RewardType.NONE) return payNothing();

        if (randomRewardType == RewardType.ERC1155)
            return isAbleToPayERC1155() ? payERC1155() : payNothing();
        if (randomRewardType == RewardType.MES)
            return isAbleToPayMes() ? payMesToken() : payNothing();
        if (randomRewardType == RewardType.USDM)
            return isAbleToPayUsdm() ? payUsdmToken() : payNothing();
        if (randomRewardType == RewardType.USDT)
            return isAbleToPayUsdt() ? payUsdtToken() : payNothing();
        if (randomRewardType == RewardType.COIN)
            return isAbleToPayCoin() ? payCoin() : payNothing();
        if (randomRewardType == RewardType.ERC721)
            return isAbleToPayNft() ? payErc721Token() : payNothing();
        return payNothing();
    }

    function unclaim(address account) public onlyRole(ADMIN_ROLE) {
        claimed[account] = false;
    }

    function payCommission(address buyer, uint256 amount) internal {
        if (amount == 0) return;
        usdmToken.transferFrom(buyer, address(this), amount);
        uint256 balance = usdmToken.balanceOf(address(this));
        uint256 balanceBeforeTransaction = balance > amount
            ? balance.sub(amount)
            : balance;

        ILotteryCommission.Commission[] memory commissions = lotteryCommission
            .getCommissions(buyer, amount);
        for (uint256 index = 0; index < commissions.length; index++) {
            ILotteryCommission.Commission memory commission = commissions[
                index
            ];
            if (commission.receiver == address(0) || commission.amount == 0)
                continue;
            if (
                usdmToken.balanceOf(commission.receiver) <
                USDM_LIMIT_TO_RECEIVE_REWARD
            ) continue;
            usdmToken.transfer(commission.receiver, commission.amount);
        }

        lotteryCommission.updateWalletRevenues(_msgSender(), amount);
        totalUsdmPayout += CLAIM_FEE;

        balance = usdmToken.balanceOf(address(this));
        uint256 amountToGlobal = balance > balanceBeforeTransaction
            ? balance.sub(balanceBeforeTransaction)
            : 0;
        if (amountToGlobal > 0 && balance >= amountToGlobal)
            usdmToken.transfer(globalWallet, amountToGlobal);
    }
}

File 2 of 37 : AccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerableUpgradeable.sol";
import "./AccessControlUpgradeable.sol";
import "../utils/structs/EnumerableSetUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {
    function __AccessControlEnumerable_init() internal onlyInitializing {
    }

    function __AccessControlEnumerable_init_unchained() internal onlyInitializing {
    }
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 37 : ERC1155HolderUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

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

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155HolderUpgradeable is Initializable, ERC1155ReceiverUpgradeable {
    function __ERC1155Holder_init() internal onlyInitializing {
    }

    function __ERC1155Holder_init_unchained() internal onlyInitializing {
    }
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 4 of 37 : ERC721HolderUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
    function __ERC721Holder_init() internal onlyInitializing {
    }

    function __ERC721Holder_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 5 of 37 : IERC20.sol
// 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);
}

File 6 of 37 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 7 of 37 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 8 of 37 : IUniswapV2Router02.sol
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 9 of 37 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 10 of 37 : AddressUpgradeable.sol
// 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 AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 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);
            }
        }
    }
}

File 11 of 37 : SafeMathUpgradeable.sol
// 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 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 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;
        }
    }
}

File 12 of 37 : WithdrawUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

contract WithdrawUpgradeable is Initializable, OwnableUpgradeable {
    receive() external payable {}

    function withdrawBalance() public onlyOwner {
        require(address(this).balance > 0, "Balance must be larger than 0");
        payable(msg.sender).transfer(address(this).balance);
    }

    function withdrawToken(uint256 amount, IERC20 token) public onlyOwner {
        require(
            token.balanceOf(address(this)) >= amount,
            "Balance is reached limited"
        );
        token.transfer(owner(), amount);
    }

    function withdrawERC721Token(uint256 tokenId, IERC721 token)
        public
        onlyOwner
    {
        require(
            token.ownerOf(tokenId) == address(this),
            "This token does not belong to Contract"
        );
        token.transferFrom(address(this), owner(), tokenId);
    }

    function withdrawERC1155Token(
        uint256[] memory ids,
        uint256[] memory amounts,
        IERC1155 token
    ) public onlyOwner {
        require(
            ids.length > 0 && ids.length == amounts.length,
            "Params is invalid"
        );
        for (uint256 i = 0; i < ids.length; i++) {
            require(
                token.balanceOf(address(this), ids[i]) >= amounts[i] &&
                    amounts[i] > 0,
                "This token does not belong to Contract"
            );
        }

        token.safeBatchTransferFrom(address(this), owner(), ids, amounts, "");
    }
}

File 13 of 37 : IInvestorManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IInvestorManager {
    struct Investor {
        address investorAddress;
        address presenterAddress;
        uint256 level;
    }

    function isInvestor(address presenterAddress) external view returns (bool);

    function getInvestors(uint256 fromIndex, uint256 toIndex)
        external
        view
        returns (Investor[] memory);

    function getInvestorsTotalLength() external view returns (uint256);

    function getInvestorByInvestorAddress(address _address)
        external
        view
        returns (Investor memory);

    function getInvestorByPresenterAddress(address _address)
        external
        view
        returns (Investor memory);

    function createNormalUser(address investorAddress, address presenterAddress)
        external;
}

File 14 of 37 : IMeSeaNft.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "./IERC721Burnable.sol";
import "./INftGlobal.sol";

interface IMeSeaNft is INftGlobal, IERC721Enumerable {
    function setTokenURI(uint256 tokenId, string memory _tokenURI) external;

    function safeMint(address account, NftInput memory nftInput)
        external
        returns (uint256);

    function getNftById(uint256 tokenId) external view returns (Nft memory);

    function safeBatchMint(address account, NftInput[] memory nftInputs)
        external
        returns (uint256[] memory);
}

File 15 of 37 : ILotteryGlobal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface ILotteryGlobal {
    struct Commission {
        address receiver;
        uint256 amount;
        Rank rank;
    }

    enum Rank {
        NONE,
        CITIZEN,
        SUPERVISOR,
        AGENT,
        SUPER_AGENT,
        SUPER_AGENT_2,
        MASTER_AGENT
    }
    enum RewardType {
        NONE,
        MES,
        USDM,
        USDT,
        ERC1155,
        COIN,
        ERC721
    }
}

File 16 of 37 : ILotteryRandomizer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "./ILotteryGlobal.sol";

interface ILotteryRandomizer is ILotteryGlobal {
    function get() external view returns (RewardType);
}

File 17 of 37 : IERC20Token.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;

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

interface IERC20Token is IERC20 {
    function burn(uint256 amount) external;

    function decimals() external view returns (uint8);
}

File 18 of 37 : ILotteryCommission.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface ILotteryCommission {
    struct Commission {
        address receiver;
        uint256 amount;
        Rank rank;
    }

    enum Rank {
        NONE,
        CITIZEN,
        SUPERVISOR,
        AGENT,
        SUPER_AGENT,
        SUPER_AGENT_2,
        MASTER_AGENT
    }

    function updateWalletRevenues(address buyer, uint256 totalManAmount)
        external;

    function getCommissions(address buyer, uint256 totalManAmount)
        external
        view
        returns (Commission[] memory result);
}

File 19 of 37 : IAccessControlEnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 20 of 37 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 21 of 37 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 22 of 37 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @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 proxied contracts do not make use of 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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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 prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 23 of 37 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 24 of 37 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 onlyInitializing {
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 25 of 37 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

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

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

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

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

pragma solidity ^0.8.0;

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

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

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface 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);
}

File 28 of 37 : ERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155ReceiverUpgradeable.sol";
import "../../../utils/introspection/ERC165Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155ReceiverUpgradeable is Initializable, ERC165Upgradeable, IERC1155ReceiverUpgradeable {
    function __ERC1155Receiver_init() internal onlyInitializing {
    }

    function __ERC1155Receiver_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return interfaceId == type(IERC1155ReceiverUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 29 of 37 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 30 of 37 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

File 32 of 37 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 33 of 37 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 34 of 37 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 36 of 37 : IERC721Burnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IERC721Burnable {
    function burn(uint256 tokenId) external;
}

File 37 of 37 : INftGlobal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface INftGlobal {
    struct NftInput {
        string dna;
    }

    struct Nft {
        uint256 id;
        string dna;
        address creator;
    }

    struct NftInfo {
        Nft nft;
        bool isExist;
        address owner;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"PayErc721Token","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum ILotteryGlobal.RewardType","name":"rewardType","type":"uint8"}],"name":"Reward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CLAIM_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COIN_REWARD_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC1155_REWARD_QUANTITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GATEWAY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MES_REWARD_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MON_REWARD_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDM_LIMIT_TO_RECEIVE_REWARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDM_REWARD_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT_REWARD_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"presenterAddress","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc1155Token","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc1155TokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc721Token","outputs":[{"internalType":"contract IMeSeaNft","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromIndex","type":"uint256"},{"internalType":"uint256","name":"toIndex","type":"uint256"}],"name":"getRanking","outputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"refUseCount","type":"uint256"}],"internalType":"struct Lottery.Ranking[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRankingCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IMeSeaNft","name":"erc721Token","type":"address"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"contract IERC20","name":"mesToken","type":"address"},{"internalType":"contract IERC20","name":"usdmToken","type":"address"},{"internalType":"contract IERC20Token","name":"usdtToken","type":"address"},{"internalType":"contract ILotteryRandomizer","name":"lotteryRandomizer","type":"address"},{"internalType":"contract ILotteryCommission","name":"lotteryCommission","type":"address"}],"internalType":"struct Lottery.Config","name":"_config","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isAbleToPayCoin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAbleToPayERC1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAbleToPayMes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAbleToPayNft","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAbleToPayUsdm","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAbleToPayUsdt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lotteryCommission","outputs":[{"internalType":"contract ILotteryCommission","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lotteryRandomizer","outputs":[{"internalType":"contract ILotteryRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mesToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"refCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_CLAIM_FEE","type":"uint256"}],"name":"setClaimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_COIN_REWARD_AMOUNT","type":"uint256"}],"name":"setCoinRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IMeSeaNft","name":"erc721Token","type":"address"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"contract IERC20","name":"mesToken","type":"address"},{"internalType":"contract IERC20","name":"usdmToken","type":"address"},{"internalType":"contract IERC20Token","name":"usdtToken","type":"address"},{"internalType":"contract ILotteryRandomizer","name":"lotteryRandomizer","type":"address"},{"internalType":"contract ILotteryCommission","name":"lotteryCommission","type":"address"}],"internalType":"struct Lottery.Config","name":"_config","type":"tuple"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ERC1155_REWARD_QUANTITY","type":"uint256"}],"name":"setERC1155Quantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_globalWallet","type":"address"}],"name":"setGlobalWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILotteryRandomizer","name":"_lotteryRandomizer","type":"address"}],"name":"setRandomizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"wallets","type":"address[]"},{"internalType":"enum ILotteryGlobal.RewardType","name":"_type","type":"uint8"}],"name":"setSpecialGuessRewardTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"isSpecial","type":"bool"}],"name":"setSpecialNftWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_USDM_LIMIT_TO_RECEIVE_REWARD","type":"uint256"}],"name":"setUsdmLimitToReceiveReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_USDT_REWARD_AMOUNT","type":"uint256"}],"name":"setUsdtRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"specialGuessRewardTypes","outputs":[{"internalType":"enum ILotteryGlobal.RewardType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"specialNftWallet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUsdmPayout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"unclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdmToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdtDecimal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdtToken","outputs":[{"internalType":"contract IERC20Token","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"userWallets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"contract IERC1155","name":"token","type":"address"}],"name":"withdrawERC1155Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"contract IERC721","name":"token","type":"address"}],"name":"withdrawERC721Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50613cec806100206000396000f3fe6080604052600436106103dd5760003560e01c80639010d07c116101fd578063c884ef8311610118578063dead3373116100ab578063f03560141161007a578063f035601414610bac578063f23a6e6114610bcc578063f2fde38b14610bf8578063fc5fd1a614610c18578063ffe9086914610c4657600080fd5b8063dead337314610b3f578063e3aac45314610b54578063e41e4fc614610b75578063ebf49d8614610b8c57600080fd5b8063d547741f116100e7578063d547741f14610abe578063d6d7156a14610ade578063d83e59fd14610afe578063db72096814610b1f57600080fd5b8063c884ef8314610a38578063ca15c87314610a69578063d11eec1a14610a89578063d43ca1b114610aa957600080fd5b8063ab8d65c811610190578063b7beb9321161015f578063b7beb93214610998578063bc197c81146109b8578063be4b1772146109e4578063c50d6dd914610a0457600080fd5b8063ab8d65c81461092a578063b378b61114610941578063b439cddc14610961578063b64cfa491461097757600080fd5b8063a1e5ea19116101cc578063a1e5ea19146108c6578063a217fddf146108dd578063a70ac02b146108f2578063a98ad46c1461090957600080fd5b80639010d07c1461085657806390de79a61461087657806391d148541461088d5780639b3e067c146108ad57600080fd5b8063362efc3d116102f8578063637a66871161028b578063715018a61161025a578063715018a6146107c157806375b238fc146107d6578063767bcab5146107f8578063815f9183146108185780638da5cb5b1461083857600080fd5b8063637a66871461075e5780636548cbc21461077557806367d5f3371461078a5780636b60b847146107aa57600080fd5b806354611c6f116102c757806354611c6f146106e05780635a4100ff146107115780635f2d6bcd146107285780635fd8c7101461074957600080fd5b8063362efc3d1461067257806336568abe1461068957806349ec4fe2146106a957806353005bdf146106c057600080fd5b806321f4226811610370578063270996471161033f57806327099647146105f057806328e19e011461061d5780632e75ab50146106325780632f2ff15d1461065257600080fd5b806321f4226814610550578063224398ae14610571578063248a9ca31461059157806325a4fbd3146105cf57600080fd5b8063150b7a02116103ac578063150b7a021461049957806317ed3f52146104dd578063185273921461051b5780631e83409a1461053057600080fd5b806301ffc9a7146103e957806303b061471461041e5780630e60b554146104405780631161e5821461047957600080fd5b366103e457005b600080fd5b3480156103f557600080fd5b506104096104043660046130c8565b610c5d565b60405190151581526020015b60405180910390f35b34801561042a57600080fd5b5061043e610439366004613185565b610cbe565b005b34801561044c57600080fd5b5061019654610461906001600160a01b031681565b6040516001600160a01b039091168152602001610415565b34801561048557600080fd5b5061043e61049436600461323c565b610deb565b3480156104a557600080fd5b506104c46104b43660046132c8565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610415565b3480156104e957600080fd5b5061050e6104f836600461323c565b6101a86020526000908152604090205460ff1681565b6040516104159190613349565b34801561052757600080fd5b50610409610e26565b34801561053c57600080fd5b5061043e61054b36600461323c565b610eb0565b34801561055c57600080fd5b5061019254610461906001600160a01b031681565b34801561057d57600080fd5b5061043e61058c366004613371565b611256565b34801561059d57600080fd5b506105c16105ac366004613371565b60009081526097602052604090206001015490565b604051908152602001610415565b3480156105db57600080fd5b5061019454610461906001600160a01b031681565b3480156105fc57600080fd5b5061061061060b36600461338a565b611275565b60405161041591906133ac565b34801561062957600080fd5b50610409611459565b34801561063e57600080fd5b5061043e61064d366004613371565b6114e3565b34801561065e57600080fd5b5061043e61066d366004613404565b611502565b34801561067e57600080fd5b506105c16101a45481565b34801561069557600080fd5b5061043e6106a4366004613404565b61152c565b3480156106b557600080fd5b506105c161019d5481565b3480156106cc57600080fd5b5061043e6106db366004613404565b6115a6565b3480156106ec57600080fd5b506104096106fb36600461323c565b61019a6020526000908152604090205460ff1681565b34801561071d57600080fd5b506105c16101a05481565b34801561073457600080fd5b5061019154610461906001600160a01b031681565b34801561075557600080fd5b5061043e6116db565b34801561076a57600080fd5b506105c161019c5481565b34801561078157600080fd5b50610409611762565b34801561079657600080fd5b5061043e6107a5366004613185565b61179b565b3480156107b657600080fd5b506105c16101a35481565b3480156107cd57600080fd5b5061043e6119b8565b3480156107e257600080fd5b506105c1600080516020613c9783398151915281565b34801561080457600080fd5b5061043e61081336600461323c565b6119cc565b34801561082457600080fd5b5061043e610833366004613371565b611a08565b34801561084457600080fd5b506033546001600160a01b0316610461565b34801561086257600080fd5b5061046161087136600461338a565b611a27565b34801561088257600080fd5b506105c16101a25481565b34801561089957600080fd5b506104096108a8366004613404565b611a46565b3480156108b957600080fd5b5061019d54471015610409565b3480156108d257600080fd5b506105c161019e5481565b3480156108e957600080fd5b506105c1600081565b3480156108fe57600080fd5b506105c16101a75481565b34801561091557600080fd5b5061019554610461906001600160a01b031681565b34801561093657600080fd5b506105c16101a15481565b34801561094d57600080fd5b5061046161095c366004613371565b611a71565b34801561096d57600080fd5b50610198546105c1565b34801561098357600080fd5b5061019354610461906001600160a01b031681565b3480156109a457600080fd5b5061043e6109b33660046134cd565b611a9c565b3480156109c457600080fd5b506104c46109d336600461356e565b63bc197c8160e01b95945050505050565b3480156109f057600080fd5b5061043e6109ff366004613404565b611b3a565b348015610a1057600080fd5b506105c17fb90e9995c6170fff8ea03e9ad6919878e483770c237f1a6f330ceaa7112b344a81565b348015610a4457600080fd5b50610409610a5336600461323c565b6101a56020526000908152604090205460ff1681565b348015610a7557600080fd5b506105c1610a84366004613371565b611c9a565b348015610a9557600080fd5b5061043e610aa436600461361b565b611cb1565b348015610ab557600080fd5b50610409611e97565b348015610aca57600080fd5b5061043e610ad9366004613404565b611ece565b348015610aea57600080fd5b5061043e610af93660046136a0565b611ef3565b348015610b0a57600080fd5b5061019b54610461906001600160a01b031681565b348015610b2b57600080fd5b5061043e610b3a366004613371565b611f78565b348015610b4b57600080fd5b50610409611f97565b348015610b6057600080fd5b5061019754610461906001600160a01b031681565b348015610b8157600080fd5b506105c16101a65481565b348015610b9857600080fd5b5061043e610ba7366004613371565b611fce565b348015610bb857600080fd5b5061043e610bc736600461323c565b611fed565b348015610bd857600080fd5b506104c4610be73660046136e6565b63f23a6e6160e01b95945050505050565b348015610c0457600080fd5b5061043e610c1336600461323c565b612029565b348015610c2457600080fd5b506105c1610c3336600461323c565b6101996020526000908152604090205481565b348015610c5257600080fd5b506105c161019f5481565b60006001600160e01b03198216630271189760e51b1480610c8e57506001600160e01b03198216635a05180f60e01b145b80610ca957506001600160e01b03198216630a85bd0160e11b145b80610cb85750610cb88261209f565b92915050565b600080516020613c97833981519152610cd6816120c4565b815161019180546001600160a01b03199081166001600160a01b03938416179091556020808501516101928054841691851691909117905560408086015161019380548516918616919091179055606086015161019480548516918616919091179055608086015161019580548516918616918217905560a08701516101968054861691871691909117905560c08701516101978054909516951694909417909255815163313ce56760e01b8152915163313ce567926004808201939291829003018186803b158015610da857600080fd5b505afa158015610dbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de0919061374e565b60ff166101a4555050565b600080516020613c97833981519152610e03816120c4565b506001600160a01b031660009081526101a560205260409020805460ff19169055565b610191546040516370a0823160e01b815230600482015260009160019182916001600160a01b0316906370a082319060240160206040518083038186803b158015610e7057600080fd5b505afa158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea89190613771565b101591505090565b333b15610f045760405162461bcd60e51b815260206004820152601860248201527f4e4f4e5f414c4c4f575f434f4e54524143545f43414c4c53000000000000000060448201526064015b60405180910390fd5b3360009081526101a5602052604090205460ff1615610f575760405162461bcd60e51b815260206004820152600f60248201526e1053149150511657d0d31052535151608a1b6044820152606401610efb565b3360008181526101a560205260409020805460ff191660011790556101a654610f8091906120ce565b6001600160a01b03811660009081526101996020526040902054610feb5761019880546001810182556000919091527f3f539f465397ab387efa93a617e37005205c037386b5b474fcfac82f47f77f0d0180546001600160a01b0319166001600160a01b0383161790555b6001600160a01b0381166000908152610199602052604081208054600192906110159084906137a0565b90915550506101965460408051631b53398f60e21b815290516000926001600160a01b031691636d4ce63c916004808301926020929190829003018186803b15801561106057600080fd5b505afa158015611074573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109891906137b8565b3360009081526101a860205260408120549192509060ff1660068111156110c1576110c1613333565b146110e557503360009081526101a860205260409020805460ff19811690915560ff165b60008160068111156110f9576110f9613333565b141561110b576111076125ce565b5050565b600481600681111561111f5761111f613333565b14156111415761112d611762565b611139576111076125ce565b6111076125f6565b600181600681111561115557611155613333565b141561117757611163611f97565b61116f576111076125ce565b6111076126aa565b600281600681111561118b5761118b613333565b14156111ad57611199611e97565b6111a5576111076125ce565b61110761274f565b60038160068111156111c1576111c1613333565b14156111e3576111cf611459565b6111db576111076125ce565b6111076127f4565b60058160068111156111f7576111f7613333565b14156112185761019d54471015611210576111076125ce565b611107612899565b600681600681111561122c5761122c613333565b141561124e5761123a610e26565b611246576111076125ce565b6111076128e7565b6111076125ce565b600080516020613c9783398151915261126e816120c4565b5061019d55565b61019854604080516000808252602082019092526060929190816112bb565b60408051808201909152600080825260208201528152602001906001900390816112945790505b509050816112cc579150610cb89050565b8185106112dc579150610cb89050565b60008285106112f5576112f06001846137d5565b6112f7565b845b90508086111561130b57509150610cb89050565b600061131787836137d5565b6113229060016137a0565b6001600160401b03811115611339576113396130f2565b60405190808252806020026020018201604052801561137e57816020015b60408051808201909152600080825260208201528152602001906001900390816113575790505b509050865b82811161144e57604051806040016040528061019883815481106113a9576113a96137ec565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03168152602001610199600061019885815481106113ee576113ee6137ec565b60009182526020808320909101546001600160a01b031683528201929092526040019020549052826114208a846137d5565b81518110611430576114306137ec565b6020026020010181905250808061144690613802565b915050611383565b509695505050505050565b6101a154610195546040516370a0823160e01b8152306004820152600092916001600160a01b0316906370a08231906024015b60206040518083038186803b1580156114a457600080fd5b505afa1580156114b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114dc9190613771565b1015905090565b600080516020613c978339815191526114fb816120c4565b506101a655565b60008281526097602052604090206001015461151d816120c4565b6115278383612a4a565b505050565b6001600160a01b038116331461159c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610efb565b6111078282612a6c565b6115ae612a8e565b6040516331a9108f60e11b81526004810183905230906001600160a01b03831690636352211e9060240160206040518083038186803b1580156115f057600080fd5b505afa158015611604573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611628919061381d565b6001600160a01b03161461164e5760405162461bcd60e51b8152600401610efb9061383a565b806001600160a01b03166323b872dd306116706033546001600160a01b031690565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101859052606401600060405180830381600087803b1580156116bf57600080fd5b505af11580156116d3573d6000803e3d6000fd5b505050505050565b6116e3612a8e565b600047116117335760405162461bcd60e51b815260206004820152601d60248201527f42616c616e6365206d757374206265206c6172676572207468616e20300000006044820152606401610efb565b60405133904780156108fc02916000818181858888f1935050505015801561175f573d6000803e3d6000fd5b50565b6101a2546101925461019c54604051627eeac760e11b8152600093926001600160a01b03169162fdd58e9161148c913091600401613880565b600054610100900460ff16158080156117bb5750600054600160ff909116105b806117d55750303b1580156117d5575060005460ff166001145b6118385760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610efb565b6000805460ff19166001179055801561185b576000805461ff0019166101001790555b611863612ae8565b61186b612ae8565b611873612b0f565b61187e600033612b3e565b611896600080516020613c9783398151915233612b3e565b6118c07fb90e9995c6170fff8ea03e9ad6919878e483770c237f1a6f330ceaa7112b344a33612b3e565b6118c982610cbe565b60335461019b80546001600160a01b0319166001600160a01b03909216919091179055600061019c5568056bc75e2d6310000061019d55678ac7230489e8000061019e55683635c9adc5dea0000061019f556802b5e3af16b18800006101a0556101a45461193890600a61397d565b611943906032613989565b6101a15560016101a25568056bc75e2d631000006101a355674563918244f400006101a65560006101a7558015611107576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b6119c0612a8e565b6119ca6000612b48565b565b600080516020613c978339815191526119e4816120c4565b5061019680546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020613c97833981519152611a20816120c4565b506101a355565b600082815260c960205260408120611a3f9083612b9a565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6101988181548110611a8257600080fd5b6000918252602090912001546001600160a01b0316905081565b600080516020613c97833981519152611ab4816120c4565b825160005b81811015611b33576000858281518110611ad557611ad56137ec565b6020908102919091018101516001600160a01b03811660009081526101a890925260409091208054919250869160ff19166001836006811115611b1a57611b1a613333565b0217905550508080611b2b90613802565b915050611ab9565b5050505050565b611b42612a8e565b6040516370a0823160e01b815230600482015282906001600160a01b038316906370a082319060240160206040518083038186803b158015611b8357600080fd5b505afa158015611b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bbb9190613771565b1015611c095760405162461bcd60e51b815260206004820152601a60248201527f42616c616e63652069732072656163686564206c696d697465640000000000006044820152606401610efb565b806001600160a01b031663a9059cbb611c2a6033546001600160a01b031690565b846040518363ffffffff1660e01b8152600401611c48929190613880565b602060405180830381600087803b158015611c6257600080fd5b505af1158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152791906139a8565b600081815260c960205260408120610cb890612ba6565b611cb9612a8e565b60008351118015611ccb575081518351145b611d0b5760405162461bcd60e51b815260206004820152601160248201527014185c985b5cc81a5cc81a5b9d985b1a59607a1b6044820152606401610efb565b60005b8351811015611e1c57828181518110611d2957611d296137ec565b6020026020010151826001600160a01b031662fdd58e30878581518110611d5257611d526137ec565b60200260200101516040518363ffffffff1660e01b8152600401611d77929190613880565b60206040518083038186803b158015611d8f57600080fd5b505afa158015611da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc79190613771565b10158015611dee57506000838281518110611de457611de46137ec565b6020026020010151115b611e0a5760405162461bcd60e51b8152600401610efb9061383a565b80611e1481613802565b915050611d0e565b50806001600160a01b0316632eb2c2d630611e3f6033546001600160a01b031690565b86866040518563ffffffff1660e01b8152600401611e609493929190613a00565b600060405180830381600087803b158015611e7a57600080fd5b505af1158015611e8e573d6000803e3d6000fd5b50505050505050565b6101a054610194546040516370a0823160e01b8152306004820152600092916001600160a01b0316906370a082319060240161148c565b600082815260976020526040902060010154611ee9816120c4565b6115278383612a6c565b600080516020613c97833981519152611f0b816120c4565b60005b83518111611f72578261019a6000868481518110611f2e57611f2e6137ec565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611f6a81613802565b915050611f0e565b50505050565b600080516020613c97833981519152611f90816120c4565b506101a155565b61019f54610193546040516370a0823160e01b8152306004820152600092916001600160a01b0316906370a082319060240161148c565b600080516020613c97833981519152611fe6816120c4565b506101a255565b600080516020613c97833981519152612005816120c4565b5061019b80546001600160a01b0319166001600160a01b0392909216919091179055565b612031612a8e565b6001600160a01b0381166120965760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610efb565b61175f81612b48565b60006001600160e01b03198216630271189760e51b1480610cb85750610cb882612bb0565b61175f8133612bd5565b806120d7575050565b610194546040516323b872dd60e01b81526001600160a01b03848116600483015230602483015260448201849052909116906323b872dd90606401602060405180830381600087803b15801561212c57600080fd5b505af1158015612140573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216491906139a8565b50610194546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156121aa57600080fd5b505afa1580156121be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e29190613771565b905060008282116121f357816121fd565b6121fd8284612c39565b6101975460405163195afea160e01b81529192506000916001600160a01b039091169063195afea1906122369088908890600401613880565b60006040518083038186803b15801561224e57600080fd5b505afa158015612262573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261228a9190810190613a5b565b905060005b81518110156124165760008282815181106122ac576122ac6137ec565b6020026020010151905060006001600160a01b031681600001516001600160a01b031614806122dd57506020810151155b156122e85750612404565b6101a3546101945482516040516370a0823160e01b81526001600160a01b0391821660048201529116906370a082319060240160206040518083038186803b15801561233357600080fd5b505afa158015612347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236b9190613771565b10156123775750612404565b610194548151602083015160405163a9059cbb60e01b81526001600160a01b039093169263a9059cbb926123af929091600401613880565b602060405180830381600087803b1580156123c957600080fd5b505af11580156123dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240191906139a8565b50505b8061240e81613802565b91505061228f565b50610197546001600160a01b0316638e6d7eb133866040518363ffffffff1660e01b8152600401612448929190613880565b600060405180830381600087803b15801561246257600080fd5b505af1158015612476573d6000803e3d6000fd5b505050506101a6546101a7600082825461249091906137a0565b9091555050610194546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b1580156124d957600080fd5b505afa1580156124ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125119190613771565b9250600082841161252357600061252d565b61252d8484612c39565b905060008111801561253f5750808410155b156116d3576101945461019b5460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb9261257c929116908590600401613880565b602060405180830381600087803b15801561259657600080fd5b505af11580156125aa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e8e91906139a8565b600080516020613c7783398151915260006040516125ec9190613349565b60405180910390a1565b610192546001600160a01b031663f242432a303361019c546101a2546040516001600160e01b031960e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561267457600080fd5b505af1158015612688573d6000803e3d6000fd5b50505050600080516020613c7783398151915260046040516125ec9190613349565b610193546001600160a01b031663a9059cbb3361019f546040518363ffffffff1660e01b81526004016126de929190613880565b602060405180830381600087803b1580156126f857600080fd5b505af115801561270c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273091906139a8565b50600080516020613c7783398151915260016040516125ec9190613349565b610194546001600160a01b031663a9059cbb336101a0546040518363ffffffff1660e01b8152600401612783929190613880565b602060405180830381600087803b15801561279d57600080fd5b505af11580156127b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127d591906139a8565b50600080516020613c7783398151915260026040516125ec9190613349565b610195546001600160a01b031663a9059cbb336101a1546040518363ffffffff1660e01b8152600401612828929190613880565b602060405180830381600087803b15801561284257600080fd5b505af1158015612856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061287a91906139a8565b50600080516020613c7783398151915260036040516125ec9190613349565b61019d54604051339180156108fc02916000818181858888f193505050501580156128c8573d6000803e3d6000fd5b50600080516020613c7783398151915260056040516125ec9190613349565b61019154604051632f745c5960e01b815260009182916001600160a01b0390911690632f745c599061291f9030908590600401613880565b60206040518083038186803b15801561293757600080fd5b505afa15801561294b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296f9190613771565b610191549091506001600160a01b03166342842e0e30336040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b1580156129d557600080fd5b505af11580156129e9573d6000803e3d6000fd5b505050507f82f4c6bbeaeaf1c5d10ee5ff306be41e8b559bc7b19273208ce8be7d55881502612a153390565b82604051612a24929190613880565b60405180910390a1600080516020613c7783398151915260066040516119ac9190613349565b612a548282612c45565b600082815260c9602052604090206115279082612ccb565b612a768282612ce0565b600082815260c9602052604090206115279082612d47565b6033546001600160a01b031633146119ca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610efb565b600054610100900460ff166119ca5760405162461bcd60e51b8152600401610efb90613b2a565b600054610100900460ff16612b365760405162461bcd60e51b8152600401610efb90613b2a565b6119ca612d5c565b6111078282612a4a565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611a3f8383612d8c565b6000610cb8825490565b60006001600160e01b03198216635a05180f60e01b1480610cb85750610cb882612db6565b612bdf8282611a46565b61110757612bf7816001600160a01b03166014612deb565b612c02836020612deb565b604051602001612c13929190613ba1565b60408051601f198184030181529082905262461bcd60e51b8252610efb91600401613c16565b6000611a3f82846137d5565b612c4f8282611a46565b6111075760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612c873390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611a3f836001600160a01b038416612f86565b612cea8282611a46565b156111075760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611a3f836001600160a01b038416612fd5565b600054610100900460ff16612d835760405162461bcd60e51b8152600401610efb90613b2a565b6119ca33612b48565b6000826000018281548110612da357612da36137ec565b9060005260206000200154905092915050565b60006001600160e01b03198216637965db0b60e01b1480610cb857506301ffc9a760e01b6001600160e01b0319831614610cb8565b60606000612dfa836002613989565b612e059060026137a0565b6001600160401b03811115612e1c57612e1c6130f2565b6040519080825280601f01601f191660200182016040528015612e46576020820181803683370190505b509050600360fc1b81600081518110612e6157612e616137ec565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612e9057612e906137ec565b60200101906001600160f81b031916908160001a9053506000612eb4846002613989565b612ebf9060016137a0565b90505b6001811115612f37576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612ef357612ef36137ec565b1a60f81b828281518110612f0957612f096137ec565b60200101906001600160f81b031916908160001a90535060049490941c93612f3081613c49565b9050612ec2565b508315611a3f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610efb565b6000818152600183016020526040812054612fcd57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610cb8565b506000610cb8565b600081815260018301602052604081205480156130be576000612ff96001836137d5565b855490915060009061300d906001906137d5565b905081811461307257600086600001828154811061302d5761302d6137ec565b9060005260206000200154905080876000018481548110613050576130506137ec565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061308357613083613c60565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610cb8565b6000915050610cb8565b6000602082840312156130da57600080fd5b81356001600160e01b031981168114611a3f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b038111828210171561312a5761312a6130f2565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613158576131586130f2565b604052919050565b6001600160a01b038116811461175f57600080fd5b803561318081613160565b919050565b600060e0828403121561319757600080fd5b60405160e081018181106001600160401b03821117156131b9576131b96130f2565b60405282356131c781613160565b815260208301356131d781613160565b602082015260408301356131ea81613160565b604082015260608301356131fd81613160565b606082015261320e60808401613175565b608082015261321f60a08401613175565b60a082015261323060c08401613175565b60c08201529392505050565b60006020828403121561324e57600080fd5b8135611a3f81613160565b600082601f83011261326a57600080fd5b81356001600160401b03811115613283576132836130f2565b613296601f8201601f1916602001613130565b8181528460208386010111156132ab57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156132de57600080fd5b84356132e981613160565b935060208501356132f981613160565b92506040850135915060608501356001600160401b0381111561331b57600080fd5b61332787828801613259565b91505092959194509250565b634e487b7160e01b600052602160045260246000fd5b602081016007831061336b57634e487b7160e01b600052602160045260246000fd5b91905290565b60006020828403121561338357600080fd5b5035919050565b6000806040838503121561339d57600080fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b828110156133f757815180516001600160a01b031685528601518685015292840192908501906001016133c9565b5091979650505050505050565b6000806040838503121561341757600080fd5b82359150602083013561342981613160565b809150509250929050565b60006001600160401b0382111561344d5761344d6130f2565b5060051b60200190565b600082601f83011261346857600080fd5b8135602061347d61347883613434565b613130565b82815260059290921b8401810191818101908684111561349c57600080fd5b8286015b8481101561144e5780356134b381613160565b83529183019183016134a0565b6007811061175f57600080fd5b600080604083850312156134e057600080fd5b82356001600160401b038111156134f657600080fd5b61350285828601613457565b9250506020830135613429816134c0565b600082601f83011261352457600080fd5b8135602061353461347883613434565b82815260059290921b8401810191818101908684111561355357600080fd5b8286015b8481101561144e5780358352918301918301613557565b600080600080600060a0868803121561358657600080fd5b853561359181613160565b945060208601356135a181613160565b935060408601356001600160401b03808211156135bd57600080fd5b6135c989838a01613513565b945060608801359150808211156135df57600080fd5b6135eb89838a01613513565b9350608088013591508082111561360157600080fd5b5061360e88828901613259565b9150509295509295909350565b60008060006060848603121561363057600080fd5b83356001600160401b038082111561364757600080fd5b61365387838801613513565b9450602086013591508082111561366957600080fd5b5061367686828701613513565b925050604084013561368781613160565b809150509250925092565b801515811461175f57600080fd5b600080604083850312156136b357600080fd5b82356001600160401b038111156136c957600080fd5b6136d585828601613457565b925050602083013561342981613692565b600080600080600060a086880312156136fe57600080fd5b853561370981613160565b9450602086013561371981613160565b9350604086013592506060860135915060808601356001600160401b0381111561374257600080fd5b61360e88828901613259565b60006020828403121561376057600080fd5b815160ff81168114611a3f57600080fd5b60006020828403121561378357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156137b3576137b361378a565b500190565b6000602082840312156137ca57600080fd5b8151611a3f816134c0565b6000828210156137e7576137e761378a565b500390565b634e487b7160e01b600052603260045260246000fd5b60006000198214156138165761381661378a565b5060010190565b60006020828403121561382f57600080fd5b8151611a3f81613160565b60208082526026908201527f5468697320746f6b656e20646f6573206e6f742062656c6f6e6720746f20436f6040820152651b9d1c9858dd60d21b606082015260800190565b6001600160a01b03929092168252602082015260400190565b600181815b808511156138d45781600019048211156138ba576138ba61378a565b808516156138c757918102915b93841c939080029061389e565b509250929050565b6000826138eb57506001610cb8565b816138f857506000610cb8565b816001811461390e576002811461391857613934565b6001915050610cb8565b60ff8411156139295761392961378a565b50506001821b610cb8565b5060208310610133831016604e8410600b8410161715613957575081810a610cb8565b6139618383613899565b80600019048211156139755761397561378a565b029392505050565b6000611a3f83836138dc565b60008160001904831182151516156139a3576139a361378a565b500290565b6000602082840312156139ba57600080fd5b8151611a3f81613692565b600081518084526020808501945080840160005b838110156139f5578151875295820195908201906001016139d9565b509495945050505050565b6001600160a01b0385811682528416602082015260a060408201819052600090613a2c908301856139c5565b8281036060840152613a3e81856139c5565b838103608090940193909352505060008152602001949350505050565b60006020808385031215613a6e57600080fd5b82516001600160401b03811115613a8457600080fd5b8301601f81018513613a9557600080fd5b8051613aa361347882613434565b81815260609182028301840191848201919088841115613ac257600080fd5b938501935b83851015613b1e5780858a031215613adf5760008081fd5b613ae7613108565b8551613af281613160565b81528587015187820152604080870151613b0b816134c0565b9082015283529384019391850191613ac7565b50979650505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b83811015613b90578181015183820152602001613b78565b83811115611f725750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613bd9816017850160208801613b75565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613c0a816028840160208801613b75565b01602801949350505050565b6020815260008251806020840152613c35816040850160208701613b75565b601f01601f19169190910160400192915050565b600081613c5857613c5861378a565b506000190190565b634e487b7160e01b600052603160045260246000fdfeb55dd07bc02a0cc174395c2e50ca29fff74d4fc5ededf8adfdac374463d93f8aa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220362dff7f1190a44c7c33fd53dbac9317b73aa86c2a69ecf335348df457e5a88d64736f6c63430008090033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.