false
true
0

Contract Address Details

0xdaD010B56Dd766704A6c6867Da6E175C3eCC947e

Contract Name
BounceLottery
Creator
0xc6a34b–e710d7 at 0x2ddc59–88d8dd
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
26326724
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
BounceLottery




Optimization enabled
true
Compiler version
v0.8.17+commit.8df45f5f




Optimization runs
200
EVM Version
london




Verified at
2026-04-19T10:08:22.447698Z

Constructor Arguments

000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca

Arg [0] (address) : 0x271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [1] (address) : 0x514910771af9ca656af840dff83e8264ecf986ca

              

contracts/BounceLottery.sol

// SPDX-License-Identifier: GPL-3.0

pragma solidity =0.8.17;

import "./BounceBase.sol";
import "./Random.sol";

contract BounceLottery is BounceBase, Random {
    using SafeMathUpgradeable for uint256;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    struct CreateReq {
        string name;
        address token0;
        address token1;
        uint256 amountTotal0;
        uint256 amount1PerWallet;
        uint48 openAt;
        uint48 closeAt;
        uint48 claimAt;
        uint16 maxPlayer;
        uint16 nShare;
        bytes32 whitelistRoot;
    }

    struct Pool {
        address creator;
        address token0;
        address token1;
        uint256 amountTotal0;
        uint256 amount1PerWallet;
        uint48 openAt;
        uint48 closeAt;
        uint48 claimAt;
        uint16 maxPlayer;
        uint16 curPlayer;
        uint16 nShare;
    }

    Pool[] public pools;

    mapping(uint256 => uint256) public requestIdToIndexes;
    mapping(uint256 => uint256) public winnerSeed;
    // pool id => claimed
    mapping(uint256 => bool) public creatorClaimed;
    // player => pool id => claimed
    mapping(address => mapping(uint256 => bool)) public myClaimed;
    // player => pool id => Serial number-start from 1
    mapping(address => mapping(uint256 => uint256)) public betNo;

    event Created(uint256 indexed index, address indexed sender, Pool pool, string name, bytes32 whitelistRoot);
    event Bet(uint256 indexed index, address indexed sender);
    event CreatorClaimed(
        uint256 indexed index,
        address indexed sender,
        uint256 amount0,
        uint256 amount1,
        uint256 txFee
    );
    event UserClaimed(uint256 indexed index, address indexed sender, uint256 amount0, uint256 amount1);
    event Reversed(uint256 indexed index, address indexed sender, uint256 amount1);
    event RandomRequested(uint256 indexed index, address indexed sender, uint256 requestId);

    // solhint-disable-next-line no-empty-blocks
    constructor(address _vrfCoordinator, address _linkTokenContract) Random(_vrfCoordinator, _linkTokenContract) {}

    function initialize(
        uint256 _txFeeRatio,
        address _stakeContract,
        address _signer,
        bytes32 _keyHash
    ) public initializer {
        super.__BounceBase_init(_txFeeRatio, _stakeContract, _signer);
        super.__Random_init(_keyHash);
    }

    function create(CreateReq memory poolReq, uint256 expireAt, bytes memory signature) external nonReentrant {
        require(poolReq.amountTotal0 >= poolReq.nShare, "amountTotal0 less than nShare");
        require(poolReq.amount1PerWallet != 0, "amount1PerWallet is zero");
        require(poolReq.nShare != 0, "nShare is zero");
        require(poolReq.nShare <= poolReq.maxPlayer, "max player less than nShare");
        require(poolReq.maxPlayer > 0, "maxPlayer is zero");
        require(poolReq.openAt >= block.timestamp, "invalid openAt");
        require(poolReq.closeAt > poolReq.openAt, "invalid closeAt");
        require(poolReq.claimAt >= poolReq.closeAt, "invalid claimAt");
        require(bytes(poolReq.name).length <= 60, "name is too long");

        checkCreator(keccak256(abi.encode(poolReq, PoolType.Lottery)), expireAt, signature);

        uint256 index = pools.length;

        if (poolReq.whitelistRoot != bytes32(0)) {
            whitelistRootP[index] = poolReq.whitelistRoot;
        }

        // transfer amount of token0 to this contract
        transferAndCheck(poolReq.token0, msg.sender, poolReq.amountTotal0);

        Pool memory pool;
        pool.creator = msg.sender;
        pool.token0 = poolReq.token0;
        pool.token1 = poolReq.token1;
        pool.amountTotal0 = poolReq.amountTotal0;
        pool.amount1PerWallet = poolReq.amount1PerWallet;
        pool.openAt = poolReq.openAt;
        pool.closeAt = poolReq.closeAt;
        pool.claimAt = poolReq.claimAt;
        pool.maxPlayer = poolReq.maxPlayer;
        pool.nShare = poolReq.nShare;
        pools.push(pool);

        subscriptionIds[index] = super.createNewSubscription();

        emit Created(index, msg.sender, pool, poolReq.name, whitelistRootP[index]);
    }

    function bet(
        uint256 index,
        bytes32[] memory proof
    ) external payable nonReentrant isPoolExist(index) isPoolNotClosed(index) {
        checkWhitelist(index, proof);
        Pool memory pool = pools[index];
        require(betNo[msg.sender][index] == 0, "already bet");
        require(pool.openAt <= block.timestamp, "pool not open");
        require(pool.curPlayer <= pool.maxPlayer, "reached upper limit");

        pools[index].curPlayer += 1;
        betNo[msg.sender][index] = pools[index].curPlayer;

        if (pool.token1 == address(0)) {
            require(msg.value == pool.amount1PerWallet, "invalid amount of ETH");
        } else {
            IERC20Upgradeable(pool.token1).safeTransferFrom(msg.sender, address(this), pool.amount1PerWallet);
        }

        emit Bet(index, msg.sender);
    }

    function creatorClaim(uint256 index) external nonReentrant isPoolExist(index) isPoolClosed(index) {
        Pool memory pool = pools[index];
        require(pool.creator == msg.sender, "invalid pool creator");
        require(!creatorClaimed[index], "creator claimed");
        creatorClaimed[index] = true;

        super.cancelSubscription(subscriptionIds[index], address(this));

        if (pool.curPlayer == 0) {
            IERC20Upgradeable(pool.token0).safeTransfer(msg.sender, pool.amountTotal0);
            emit CreatorClaimed(index, msg.sender, pool.amountTotal0, 0, 0);
            return;
        }

        uint256 nShare = pools[index].nShare;
        uint256 hitShare = (pool.curPlayer > nShare ? nShare : pool.curPlayer);
        uint256 amount0 = 0;
        if (nShare > pool.curPlayer) {
            amount0 = pool.amountTotal0.div(nShare).mul(nShare.sub(pool.curPlayer));
            IERC20Upgradeable(pool.token0).safeTransfer(msg.sender, amount0);
        }

        uint256 amount1 = pool.amount1PerWallet.mul(hitShare);
        uint256 txFee = amount1.mul(txFeeRatio).div(TX_FEE_DENOMINATOR);
        uint256 _amount1 = amount1.sub(txFee);
        if (_amount1 > 0) {
            if (pool.token1 == address(0)) {
                payable(pool.creator).transfer(_amount1);
            } else {
                IERC20Upgradeable(pool.token1).safeTransfer(pool.creator, _amount1);
            }
        }

        if (txFee > 0) {
            if (pool.token1 == address(0)) {
                // deposit transaction fee to staking contract
                // solhint-disable-next-line avoid-low-level-calls
                (bool success, ) = stakeContract.call{value: txFee}(abi.encodeWithSignature("depositReward()"));
                if (!success) {
                    revert("Revert: depositReward()");
                }
            } else {
                IERC20Upgradeable(pool.token1).safeTransfer(stakeContract, txFee);
            }
        }

        emit CreatorClaimed(index, msg.sender, amount0, _amount1, txFee);
    }

    function userClaim(uint256 index) external nonReentrant isPoolExist(index) isClaimReady(index) {
        require(!myClaimed[msg.sender][index], "claimed");
        myClaimed[msg.sender][index] = true;
        require(winnerSeed[index] > 0, "waiting seed");
        require(betNo[msg.sender][index] > 0, "no bet");

        Pool memory pool = pools[index];
        uint256 amount0 = 0;
        uint256 amount1 = 0;
        if (isWinner(index, msg.sender)) {
            amount0 = pool.amountTotal0.div(pools[index].nShare);
            IERC20Upgradeable(pool.token0).safeTransfer(msg.sender, amount0);
        } else {
            amount1 = pool.amount1PerWallet;
            if (pool.token1 == address(0)) {
                payable(msg.sender).transfer(amount1);
            } else {
                IERC20Upgradeable(pool.token1).safeTransfer(msg.sender, amount1);
            }
        }

        emit UserClaimed(index, msg.sender, amount0, amount1);
    }

    function reverse(uint256 index) external nonReentrant isPoolExist(index) isPoolNotClosed(index) {
        require(betNo[msg.sender][index] > 0, "no bet");
        delete betNo[msg.sender][index];
        pools[index].curPlayer -= 1;

        Pool memory pool = pools[index];
        if (pool.token1 == address(0)) {
            payable(msg.sender).transfer(pool.amount1PerWallet);
        } else {
            IERC20Upgradeable(pool.token1).safeTransfer(msg.sender, pool.amount1PerWallet);
        }

        emit Reversed(index, msg.sender, pool.amount1PerWallet);
    }

    function requestRandom(uint256 index) external nonReentrant isPoolExist(index) isPoolClosed(index) {
        require(pools[index].curPlayer > 0, "no bet");
        uint256 requestId = requestRandomWords(subscriptionIds[index]);
        requestIdToIndexes[requestId] = index;

        emit RandomRequested(index, msg.sender, requestId);
    }

    function lo2(uint256 value) private pure returns (uint256) {
        require(value < 65536, "too large");
        if (value <= 2) {
            return uint256(0);
        } else if (value == 3) {
            return uint256(2);
        }
        uint256 x = 0;
        uint256 s = value;
        while (value > 1) {
            value >>= 1;
            x++;
        }
        if (s > ((2 << (x.sub(1))) + (2 << (x.sub(2))))) return (x.mul(2).add(1));
        return (x.mul(2));
    }

    function calcRet(uint256 index, uint256 m) private pure returns (uint256) {
        uint256[32] memory p = [
            uint256(3),
            3,
            5,
            7,
            17,
            11,
            7,
            11,
            13,
            23,
            31,
            47,
            61,
            89,
            127,
            191,
            251,
            383,
            509,
            761,
            1021,
            1531,
            2039,
            3067,
            4093,
            6143,
            8191,
            12281,
            16381,
            24571,
            32749,
            49139
        ];
        uint256 nSel = lo2(m);
        return (index.mul(p[nSel])) % m;
    }

    function isWinner(uint256 index, address sender) public view returns (bool) {
        require(pools[index].closeAt < block.timestamp, "It's not time to start the prize");
        if (betNo[sender][index] == 0) {
            return false;
        }
        uint256 nShare = pools[index].nShare;
        uint256 curPlayer = pools[index].curPlayer;

        if (curPlayer <= nShare) {
            return true;
        }

        uint256 n = winnerSeed[index] - 1;

        uint256 pos = calcRet(betNo[sender][index] - 1, curPlayer);

        if ((n.add(nShare)) % curPlayer > n) {
            if ((pos >= n) && (pos < (n + nShare))) {
                return true;
            }
        } else {
            if ((pos >= n) && (pos < curPlayer)) {
                return true;
            }
            if (pos < (n.add(nShare)) % curPlayer) {
                return true;
            }
        }
        return false;
    }

    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        uint256 index = requestIdToIndexes[requestId];
        if (winnerSeed[index] == 0) {
            winnerSeed[index] = (randomWords[0] % pools[index].curPlayer) + 1;
        }
    }

    function getPoolCount() external view returns (uint256) {
        return pools.length;
    }

    modifier isPoolClosed(uint256 index) {
        require(pools[index].closeAt <= block.timestamp, "this pool is not closed");
        _;
    }

    modifier isPoolNotClosed(uint256 index) {
        require(pools[index].closeAt > block.timestamp, "this pool is closed");
        _;
    }

    modifier isClaimReady(uint256 index) {
        require(pools[index].claimAt <= block.timestamp, "claim not ready");
        _;
    }

    modifier isPoolExist(uint256 index) {
        require(index < pools.length, "this pool does not exist");
        _;
    }
}
        

/

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

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

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

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

    uint256 private _status;

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

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

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

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

/interfaces/VRFCoordinatorV2Interface.sol

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

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;

  /*
   * @notice Check to see if there exists a request commitment consumers
   * for all consumers and keyhashes for a given sub.
   * @param subId - ID of the subscription
   * @return true if there exists at least one unfulfilled request for the subscription, false
   * otherwise.
   */
  function pendingRequestExists(uint64 subId) external view returns (bool);
}
          

/

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

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _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) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

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

/

// SPDX-License-Identifier: GPL-3.0

pragma solidity =0.8.17;

import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract Random is OwnableUpgradeable, VRFConsumerBaseV2 {
    VRFCoordinatorV2Interface private coordinator;
    LinkTokenInterface private linkToken;

    // The gas lane to use, which specifies the maximum gas price to bump to.
    // For a list of available gas lanes on each network,
    // see https://docs.chain.link/docs/vrf-contracts/#configurations
    bytes32 private keyHash;

    // A reasonable default is 100000, but this value could be different
    // on other networks.
    uint32 private callbackGasLimit = 100000;

    // The default is 3, but you can set this higher.
    uint16 private requestConfirmations = 3;

    // For this example, retrieve 2 random values in one request.
    // Cannot exceed VRFCoordinatorV2.MAX_NUM_WORDS.
    uint32 private numWords = 1;

    // pool id => subscription id
    mapping(uint256 => uint64) public subscriptionIds;

    constructor(address _vrfCoordinator, address _linkTokenContract) VRFConsumerBaseV2(_vrfCoordinator) {
        coordinator = VRFCoordinatorV2Interface(_vrfCoordinator);
        linkToken = LinkTokenInterface(_linkTokenContract);
    }

    // solhint-disable-next-line func-name-mixedcase
    function __Random_init(bytes32 _keyHash) internal onlyInitializing {
        __Ownable_init();
        keyHash = _keyHash;
    }

    // Assumes the subscription is funded sufficiently.
    function requestRandomWords(uint64 subscriptionId) internal returns (uint256 requestId) {
        // Will revert if subscription is not set and funded.
        requestId = coordinator.requestRandomWords(
            keyHash,
            subscriptionId,
            requestConfirmations,
            callbackGasLimit,
            numWords
        );
    }

    // Create a new subscription when the contract is initially deployed.
    function createNewSubscription() internal returns (uint64 subscriptionId) {
        subscriptionId = coordinator.createSubscription();
        // Add this contract as a consumer of its own subscription.
        coordinator.addConsumer(subscriptionId, address(this));
    }

    function cancelSubscription(uint64 subscriptionId, address receivingWallet) internal {
        // Cancel the subscription and send the remaining LINK to a wallet address.
        coordinator.cancelSubscription(subscriptionId, receivingWallet);
    }

    // Assumes this contract owns link.
    // 1000000000000000000 = 1 LINK
    function topUpSubscription(uint64 subscriptionId, uint256 amount) external onlyOwner {
        linkToken.transferAndCall(address(coordinator), amount, abi.encode(subscriptionId));
    }

    // Transfer this contract's funds to an address.
    // 1000000000000000000 = 1 LINK
    function withdraw(uint256 amount, address to) external onlyOwner {
        linkToken.transfer(to, amount);
    }
}
          

/

// SPDX-License-Identifier: GPL-3.0

pragma solidity =0.8.17;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";

contract BounceBase is OwnableUpgradeable, ReentrancyGuardUpgradeable {
    using ECDSAUpgradeable for bytes32;
    using SafeMathUpgradeable for uint256;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    enum PoolType {
        FixedSwap,
        DutchAuction,
        SealedBid,
        Lottery,
        FixedSwapNFT,
        EnglishAuctionNFT,
        LotteryNFT
    }

    uint256 public constant TX_FEE_DENOMINATOR = 1e18;

    uint256 public txFeeRatio;
    address public stakeContract;
    address public signer;
    // pool index => whitelist merkle root
    mapping(uint256 => bytes32) public whitelistRootP;
    // address => pool message => pool message used or not
    mapping(address => mapping(bytes32 => bool)) public poolMessages;

    // solhint-disable-next-line func-name-mixedcase
    function __BounceBase_init(uint256 _txFeeRatio, address _stakeContract, address _signer) internal onlyInitializing {
        super.__Ownable_init();
        super.__ReentrancyGuard_init();

        _setTxFeeRatio(_txFeeRatio);
        _setStakeContract(_stakeContract);
        _setSigner(_signer);
    }

    function transferAndCheck(address token0, address from, uint256 amount) internal {
        IERC20Upgradeable _token0 = IERC20Upgradeable(token0);
        uint256 token0BalanceBefore = _token0.balanceOf(address(this));
        _token0.safeTransferFrom(from, address(this), amount);
        require(_token0.balanceOf(address(this)).sub(token0BalanceBefore) == amount, "not support deflationary token");
    }

    function checkWhitelist(uint256 index, bytes32[] memory proof) internal view {
        if (whitelistRootP[index] != bytes32(0)) {
            bytes32 leaf = keccak256(abi.encode(msg.sender));
            require(MerkleProofUpgradeable.verify(proof, whitelistRootP[index], leaf), "not whitelisted");
        }
    }

    function checkCreator(bytes32 hash, uint256 expireAt, bytes memory signature) internal {
        require(block.timestamp < expireAt, "signature expired");
        bytes32 message = keccak256(abi.encode(msg.sender, hash, block.chainid, expireAt));
        bytes32 hashMessage = message.toEthSignedMessageHash();
        require(signer == hashMessage.recover(signature), "invalid signature");
        require(!poolMessages[msg.sender][message], "pool message used");
        poolMessages[msg.sender][message] = true;
    }

    function setTxFeeRatio(uint256 _txFeeRatio) external onlyOwner {
        _setTxFeeRatio(_txFeeRatio);
    }

    function setStakeContract(address _stakeContract) external onlyOwner {
        _setStakeContract(_stakeContract);
    }

    function setSigner(address _signer) external onlyOwner {
        _setSigner(_signer);
    }

    function _setTxFeeRatio(uint256 _txFeeRatio) private {
        require(_txFeeRatio <= TX_FEE_DENOMINATOR, "invalid txFeeRatio");
        txFeeRatio = _txFeeRatio;
    }

    function _setStakeContract(address _stakeContract) private {
        require(_stakeContract != address(0), "invalid stakeContract");
        stakeContract = _stakeContract;
    }

    function _setSigner(address _signer) private {
        require(_signer != address(0), "invalid signer");
        signer = _signer;
    }

    uint256[45] private __gap;
}
          

/MerkleProofUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProofUpgradeable {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}
          

/utils/SafeERC20Upgradeable.sol

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

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../extensions/draft-IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";

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

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

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

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

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

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

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

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

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

/extensions/draft-IERC20PermitUpgradeable.sol

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

pragma solidity ^0.8.0;

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

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

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

/VRFConsumerBaseV2.sol

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

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}
          

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

/ECDSAUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}
          

/

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

/

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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);
        }
    }
}
          

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

/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (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.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * 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.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * 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.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    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.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}
          

/

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

/interfaces/LinkTokenInterface.sol

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

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

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

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

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}
          

/MathUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"london","compilationTarget":{"contracts/BounceLottery.sol":"BounceLottery"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_vrfCoordinator","internalType":"address"},{"type":"address","name":"_linkTokenContract","internalType":"address"}]},{"type":"error","name":"OnlyCoordinatorCanFulfill","inputs":[{"type":"address","name":"have","internalType":"address"},{"type":"address","name":"want","internalType":"address"}]},{"type":"event","name":"Bet","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Created","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"tuple","name":"pool","internalType":"struct BounceLottery.Pool","indexed":false,"components":[{"type":"address","name":"creator","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"uint256","name":"amountTotal0","internalType":"uint256"},{"type":"uint256","name":"amount1PerWallet","internalType":"uint256"},{"type":"uint48","name":"openAt","internalType":"uint48"},{"type":"uint48","name":"closeAt","internalType":"uint48"},{"type":"uint48","name":"claimAt","internalType":"uint48"},{"type":"uint16","name":"maxPlayer","internalType":"uint16"},{"type":"uint16","name":"curPlayer","internalType":"uint16"},{"type":"uint16","name":"nShare","internalType":"uint16"}]},{"type":"string","name":"name","internalType":"string","indexed":false},{"type":"bytes32","name":"whitelistRoot","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"CreatorClaimed","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false},{"type":"uint256","name":"txFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RandomRequested","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"requestId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Reversed","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserClaimed","inputs":[{"type":"uint256","name":"index","internalType":"uint256","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true},{"type":"uint256","name":"amount0","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount1","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TX_FEE_DENOMINATOR","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"bet","inputs":[{"type":"uint256","name":"index","internalType":"uint256"},{"type":"bytes32[]","name":"proof","internalType":"bytes32[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"betNo","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"create","inputs":[{"type":"tuple","name":"poolReq","internalType":"struct BounceLottery.CreateReq","components":[{"type":"string","name":"name","internalType":"string"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"uint256","name":"amountTotal0","internalType":"uint256"},{"type":"uint256","name":"amount1PerWallet","internalType":"uint256"},{"type":"uint48","name":"openAt","internalType":"uint48"},{"type":"uint48","name":"closeAt","internalType":"uint48"},{"type":"uint48","name":"claimAt","internalType":"uint48"},{"type":"uint16","name":"maxPlayer","internalType":"uint16"},{"type":"uint16","name":"nShare","internalType":"uint16"},{"type":"bytes32","name":"whitelistRoot","internalType":"bytes32"}]},{"type":"uint256","name":"expireAt","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"creatorClaim","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"creatorClaimed","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPoolCount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"uint256","name":"_txFeeRatio","internalType":"uint256"},{"type":"address","name":"_stakeContract","internalType":"address"},{"type":"address","name":"_signer","internalType":"address"},{"type":"bytes32","name":"_keyHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWinner","inputs":[{"type":"uint256","name":"index","internalType":"uint256"},{"type":"address","name":"sender","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"myClaimed","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"poolMessages","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"creator","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"uint256","name":"amountTotal0","internalType":"uint256"},{"type":"uint256","name":"amount1PerWallet","internalType":"uint256"},{"type":"uint48","name":"openAt","internalType":"uint48"},{"type":"uint48","name":"closeAt","internalType":"uint48"},{"type":"uint48","name":"claimAt","internalType":"uint48"},{"type":"uint16","name":"maxPlayer","internalType":"uint16"},{"type":"uint16","name":"curPlayer","internalType":"uint16"},{"type":"uint16","name":"nShare","internalType":"uint16"}],"name":"pools","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rawFulfillRandomWords","inputs":[{"type":"uint256","name":"requestId","internalType":"uint256"},{"type":"uint256[]","name":"randomWords","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"requestIdToIndexes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"requestRandom","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"reverse","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSigner","inputs":[{"type":"address","name":"_signer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStakeContract","inputs":[{"type":"address","name":"_stakeContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTxFeeRatio","inputs":[{"type":"uint256","name":"_txFeeRatio","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"signer","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakeContract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"subscriptionIds","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"topUpSubscription","inputs":[{"type":"uint64","name":"subscriptionId","internalType":"uint64"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"txFeeRatio","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"userClaim","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"whitelistRootP","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"winnerSeed","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]}]
              

Contract Creation Code

0x60a060405260cc80546001600160501b03191666010003000186a01790553480156200002a57600080fd5b506040516200418b3803806200418b8339810160408190526200004d91620000a2565b6001600160a01b03918216608081905260c980546001600160a01b0319908116909217905560ca8054929093169116179055620000da565b80516001600160a01b03811681146200009d57600080fd5b919050565b60008060408385031215620000b657600080fd5b620000c18362000085565b9150620000d16020840162000085565b90509250929050565b60805161408e620000fd600039600081816110150152611057015261408e6000f3fe6080604052600436106101d75760003560e01c8063688a819711610102578063bdd415af11610095578063d4e398c911610064578063d4e398c91461065f578063e471039014610675578063f2fde38b146106b0578063fe43efda146106d057600080fd5b8063bdd415af146105cf578063c6a67b3f146105ef578063c6e989451461061f578063d4a4a92a1461064c57600080fd5b80638da5cb5b116100d15780638da5cb5b146104e55780638eec5d701461050357806397d1542514610518578063ac4afa381461053857600080fd5b8063688a8197146104355780636c19e78314610462578063715018a6146104825780638cafc3581461049757600080fd5b8063411e5b9c1161017a57806347c34dc11161014957806347c34dc1146103ac57806348f85bbb146103cc578063509484d5146103f957806362e08c811461041957600080fd5b8063411e5b9c146102db5780634445c700146102fb578063445fc8fc1461031b578063466fca7f1461036657600080fd5b80631a186227116101b65780631a1862271461023e5780631fe543e31461027b578063238ac9331461029b5780632ad540ed146102bb57600080fd5b8062f714ce146101dc57806309cb987c146101fe5780630ea045621461021e575b600080fd5b3480156101e857600080fd5b506101fc6101f736600461378c565b6106f0565b005b34801561020a57600080fd5b506101fc6102193660046138be565b610775565b34801561022a57600080fd5b506101fc6102393660046139f4565b610e8b565b34801561024a57600080fd5b5060985461025e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561028757600080fd5b506101fc610296366004613a30565b61100a565b3480156102a757600080fd5b5060995461025e906001600160a01b031681565b3480156102c757600080fd5b506101fc6102d63660046139f4565b611092565b3480156102e757600080fd5b506101fc6102f63660046139f4565b61164c565b34801561030757600080fd5b506101fc610316366004613ae6565b61165d565b34801561032757600080fd5b50610356610336366004613b12565b609b60209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610272565b34801561037257600080fd5b5061039e610381366004613b12565b60d360209081526000928352604080842090915290825290205481565b604051908152602001610272565b3480156103b857600080fd5b506101fc6103c7366004613b2e565b6116c2565b3480156103d857600080fd5b5061039e6103e73660046139f4565b60cf6020526000908152604090205481565b34801561040557600080fd5b506101fc610414366004613b72565b6117e3565b34801561042557600080fd5b5061039e670de0b6b3a764000081565b34801561044157600080fd5b5061039e6104503660046139f4565b609a6020526000908152604090205481565b34801561046e57600080fd5b506101fc61047d366004613b72565b6117f4565b34801561048e57600080fd5b506101fc611805565b3480156104a357600080fd5b506104cd6104b23660046139f4565b60cd602052600090815260409020546001600160401b031681565b6040516001600160401b039091168152602001610272565b3480156104f157600080fd5b506033546001600160a01b031661025e565b34801561050f57600080fd5b5060ce5461039e565b34801561052457600080fd5b506101fc6105333660046139f4565b611819565b34801561054457600080fd5b506105586105533660046139f4565b611ae4565b604080516001600160a01b039c8d1681529a8c1660208c015298909a16978901979097526060880195909552608087019390935265ffffffffffff91821660a0870152811660c08601521660e084015261ffff90811661010084015290811661012083015290911661014082015261016001610272565b3480156105db57600080fd5b506103566105ea36600461378c565b611b78565b3480156105fb57600080fd5b5061035661060a3660046139f4565b60d16020526000908152604090205460ff1681565b34801561062b57600080fd5b5061039e61063a3660046139f4565b60d06020526000908152604090205481565b6101fc61065a366004613a30565b611db2565b34801561066b57600080fd5b5061039e60975481565b34801561068157600080fd5b50610356610690366004613b12565b60d260209081526000928352604080842090915290825290205460ff1681565b3480156106bc57600080fd5b506101fc6106cb366004613b72565b61218d565b3480156106dc57600080fd5b506101fc6106eb3660046139f4565b612203565b6106f861258a565b60ca5460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044015b6020604051808303816000875af115801561074c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107709190613b8d565b505050565b61077d6125e4565b82610120015161ffff16836060015110156107df5760405162461bcd60e51b815260206004820152601d60248201527f616d6f756e74546f74616c30206c657373207468616e206e536861726500000060448201526064015b60405180910390fd5b82608001516000036108335760405162461bcd60e51b815260206004820152601860248201527f616d6f756e743150657257616c6c6574206973207a65726f000000000000000060448201526064016107d6565b82610120015161ffff1660000361087d5760405162461bcd60e51b815260206004820152600e60248201526d6e5368617265206973207a65726f60901b60448201526064016107d6565b82610100015161ffff1683610120015161ffff1611156108df5760405162461bcd60e51b815260206004820152601b60248201527f6d617820706c61796572206c657373207468616e206e5368617265000000000060448201526064016107d6565b600083610100015161ffff161161092c5760405162461bcd60e51b81526020600482015260116024820152706d6178506c61796572206973207a65726f60781b60448201526064016107d6565b428360a0015165ffffffffffff1610156109795760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081bdc195b905d60921b60448201526064016107d6565b8260a0015165ffffffffffff168360c0015165ffffffffffff16116109d25760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a590818db1bdcd9505d608a1b60448201526064016107d6565b8260c0015165ffffffffffff168360e0015165ffffffffffff161015610a2c5760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a590818db185a5b505d608a1b60448201526064016107d6565b825151603c1015610a725760405162461bcd60e51b815260206004820152601060248201526f6e616d6520697320746f6f206c6f6e6760801b60448201526064016107d6565b610aa6836003604051602001610a89929190613c37565b60405160208183030381529060405280519060200120838361263d565b60ce5461014084015115610aca576101408401516000828152609a60205260409020555b610add84602001513386606001516127e1565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101919091523381600001906001600160a01b031690816001600160a01b031681525050846020015181602001906001600160a01b031690816001600160a01b031681525050846040015181604001906001600160a01b031690816001600160a01b031681525050846060015181606001818152505084608001518160800181815250508460a001518160a0019065ffffffffffff16908165ffffffffffff16815250508460c001518160c0019065ffffffffffff16908165ffffffffffff16815250508460e001518160e0019065ffffffffffff16908165ffffffffffff168152505084610100015181610100019061ffff16908161ffff168152505084610120015181610140019061ffff16908161ffff168152505060ce81908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060c08201518160050160066101000a81548165ffffffffffff021916908365ffffffffffff16021790555060e082015181600501600c6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506101008201518160050160126101000a81548161ffff021916908361ffff1602179055506101208201518160050160146101000a81548161ffff021916908361ffff1602179055506101408201518160050160166101000a81548161ffff021916908361ffff1602179055505050610e06612928565b600083815260cd60209081526040808320805467ffffffffffffffff19166001600160401b0395909516949094179093558751609a90915290829020549151339285927fa4e77d4a925eec7683bf12e8c2471c3190110cb8b69659a4ff9ff4f41866ab5292610e7792879291613d2e565b60405180910390a350506107706001606555565b610e936125e4565b60ce5481908110610eb65760405162461bcd60e51b81526004016107d690613e2d565b814260ce8281548110610ecb57610ecb613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff161115610f365760405162461bcd60e51b81526020600482015260176024820152761d1a1a5cc81c1bdbdb081a5cc81b9bdd0818db1bdcd959604a1b60448201526064016107d6565b600060ce8481548110610f4b57610f4b613e64565b6000918252602090912060069091020160050154600160a01b900461ffff1611610f875760405162461bcd60e51b81526004016107d690613e7a565b600083815260cd6020526040812054610fa8906001600160401b0316612a0e565b600081815260cf60205260409081902086905551909150339085907fafcd4056ad38818223498da8edc6d46df7129d5e828cfb7fb3e100093f28dbdf90610ff29085815260200190565b60405180910390a35050506110076001606555565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110845760405163073e64fd60e21b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044016107d6565b61108e8282612ac0565b5050565b61109a6125e4565b60ce54819081106110bd5760405162461bcd60e51b81526004016107d690613e2d565b814260ce82815481106110d2576110d2613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff16111561113d5760405162461bcd60e51b81526020600482015260176024820152761d1a1a5cc81c1bdbdb081a5cc81b9bdd0818db1bdcd959604a1b60448201526064016107d6565b600060ce848154811061115257611152613e64565b60009182526020918290206040805161016081018252600690930290910180546001600160a01b0390811680855260018301548216958501959095526002820154169183019190915260038101546060830152600481015460808301526005015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b90910416610140820152915033146112545760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103837b7b61031b932b0ba37b960611b60448201526064016107d6565b600084815260d1602052604090205460ff16156112a55760405162461bcd60e51b815260206004820152600f60248201526e18dc99585d1bdc8818db185a5b5959608a1b60448201526064016107d6565b600084815260d160209081526040808320805460ff1916600117905560cd9091529020546112dc906001600160401b031630612b5f565b80610120015161ffff166000036113625761131333826060015183602001516001600160a01b0316612bd19092919063ffffffff16565b6060808201516040805191825260006020830181905290820152339186917fcc18e7bd1b741e3758cf9ab9e95470fee5a623324d2ad935624b0533f6a52716910160405180910390a350611640565b600060ce858154811061137757611377613e64565b6000918252602082206005600690920201015461012084015161ffff600160b01b909204821693501682106113b55782610120015161ffff166113b7565b815b9050600083610120015161ffff1683111561141c576114006113eb85610120015161ffff1685612c3490919063ffffffff16565b60608601516113fa9086612c47565b90612c53565b602085015190915061141c906001600160a01b03163383612bd1565b608084015160009061142e9084612c53565b90506000611459670de0b6b3a764000061145360975485612c5390919063ffffffff16565b90612c47565b905060006114678383612c34565b905080156114dd5760408701516001600160a01b03166114c05786516040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156114ba573d6000803e3d6000fd5b506114dd565b865160408801516114dd916001600160a01b039091169083612bd1565b81156115f35760408701516001600160a01b03166115d45760985460408051600481526024810182526020810180516001600160e01b0316635ec2dc8d60e01b17905290516000926001600160a01b031691859161153b9190613e9a565b60006040518083038185875af1925050503d8060008114611578576040519150601f19603f3d011682016040523d82523d6000602084013e61157d565b606091505b50509050806115ce5760405162461bcd60e51b815260206004820152601760248201527f5265766572743a206465706f736974526577617264282900000000000000000060448201526064016107d6565b506115f3565b60985460408801516115f3916001600160a01b03918216911684612bd1565b604080518581526020810183905290810183905233908b907fcc18e7bd1b741e3758cf9ab9e95470fee5a623324d2ad935624b0533f6a527169060600160405180910390a3505050505050505b50506110076001606555565b61165461258a565b61100781612c5f565b61166561258a565b60ca5460c954604080516001600160401b03861660208201526001600160a01b0393841693634000aea09316918591016040516020818303038152906040526040518463ffffffff1660e01b815260040161072d93929190613eb6565b600054610100900460ff16158080156116e25750600054600160ff909116105b806116fc5750303b1580156116fc575060005460ff166001145b61175f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107d6565b6000805460ff191660011790558015611782576000805461ff0019166101001790555b61178d858585612cb1565b61179682612d03565b80156117dc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6117eb61258a565b61100781612d37565b6117fc61258a565b61100781612da7565b61180d61258a565b6118176000612e10565b565b6118216125e4565b60ce54819081106118445760405162461bcd60e51b81526004016107d690613e2d565b814260ce828154811061185957611859613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff16116118bf5760405162461bcd60e51b81526020600482015260136024820152721d1a1a5cc81c1bdbdb081a5cc818db1bdcd959606a1b60448201526064016107d6565b33600090815260d3602090815260408083208684529091529020546118f65760405162461bcd60e51b81526004016107d690613e7a565b33600090815260d36020908152604080832086845290915281205560ce8054600191908590811061192957611929613e64565b906000526020600020906006020160050160148282829054906101000a900461ffff166119569190613ef3565b92506101000a81548161ffff021916908361ffff160217905550600060ce848154811061198557611985613e64565b60009182526020918290206040805161016081018252600690930290910180546001600160a01b03908116845260018201548116948401949094526002810154909316908201819052600383015460608301526004830154608083015260059092015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b909104166101408201529150611a7e576080810151604051339180156108fc02916000818181858888f19350505050158015611a78573d6000803e3d6000fd5b50611aa4565b611aa433826080015183604001516001600160a01b0316612bd19092919063ffffffff16565b336001600160a01b0316847f7bd1ff26b15be8c8d62cfbdf1921eea621feeb2f8bb70edd060311fb3296877c8360800151604051610ff291815260200190565b60ce8181548110611af457600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0394851696509284169491909316929165ffffffffffff80821691600160301b8104821691600160601b8204169061ffff600160901b8204811691600160a01b8104821691600160b01b909104168b565b60004260ce8481548110611b8e57611b8e613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff1610611bfe5760405162461bcd60e51b815260206004820181905260248201527f49742773206e6f742074696d6520746f20737461727420746865207072697a6560448201526064016107d6565b6001600160a01b038216600090815260d3602090815260408083208684529091528120549003611c3057506000611dac565b600060ce8481548110611c4557611c45613e64565b906000526020600020906006020160050160169054906101000a900461ffff1661ffff169050600060ce8581548110611c8057611c80613e64565b6000918252602090912060069091020160050154600160a01b900461ffff169050818111611cb357600192505050611dac565b600085815260d06020526040812054611cce90600190613f15565b6001600160a01b038616600090815260d3602090815260408083208a845290915281205491925090611d0c90611d0690600190613f15565b84612e62565b90508183611d1a8287612fa2565b611d249190613f3e565b1115611d5957818110158015611d425750611d3f8483613f52565b81105b15611d54576001945050505050611dac565b611da3565b818110158015611d6857508281105b15611d7a576001945050505050611dac565b82611d858386612fa2565b611d8f9190613f3e565b811015611da3576001945050505050611dac565b60009450505050505b92915050565b611dba6125e4565b60ce5482908110611ddd5760405162461bcd60e51b81526004016107d690613e2d565b824260ce8281548110611df257611df2613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff1611611e585760405162461bcd60e51b81526020600482015260136024820152721d1a1a5cc81c1bdbdb081a5cc818db1bdcd959606a1b60448201526064016107d6565b611e628484612fae565b600060ce8581548110611e7757611e77613e64565b600091825260208083206040805161016081018252600690940290910180546001600160a01b03908116855260018201548116858501526002820154168483015260038101546060850152600481015460808501526005015465ffffffffffff80821660a0860152600160301b8204811660c0860152600160601b82041660e085015261ffff600160901b82048116610100860152600160a01b82048116610120860152600160b01b9091041661014084015233845260d382528084208985529091529091205490915015611f7c5760405162461bcd60e51b815260206004820152600b60248201526a185b1c9958591e4818995d60aa1b60448201526064016107d6565b428160a0015165ffffffffffff161115611fc85760405162461bcd60e51b815260206004820152600d60248201526c3837b7b6103737ba1037b832b760991b60448201526064016107d6565b80610100015161ffff1681610120015161ffff1611156120205760405162461bcd60e51b81526020600482015260136024820152721c995858da1959081d5c1c195c881b1a5b5a5d606a1b60448201526064016107d6565b600160ce868154811061203557612035613e64565b906000526020600020906006020160050160148282829054906101000a900461ffff166120629190613f65565b92506101000a81548161ffff021916908361ffff16021790555060ce858154811061208f5761208f613e64565b600091825260208083206006929092029091016005015433835260d38252604080842089855290925291819020600160a01b90920461ffff169091558101516001600160a01b031661212b57806080015134146121265760405162461bcd60e51b81526020600482015260156024820152740d2dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b60448201526064016107d6565b612153565b6121533330836080015184604001516001600160a01b0316613044909392919063ffffffff16565b604051339086907fc0cf6f6539dd26a13b724325f9d675aeb7686003595f761a617b892522d0c98c90600090a350505061108e6001606555565b61219561258a565b6001600160a01b0381166121fa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d6565b61100781612e10565b61220b6125e4565b60ce548190811061222e5760405162461bcd60e51b81526004016107d690613e2d565b814260ce828154811061224357612243613e64565b6000918252602090912060069091020160050154600160601b900465ffffffffffff1611156122a65760405162461bcd60e51b815260206004820152600f60248201526e636c61696d206e6f7420726561647960881b60448201526064016107d6565b33600090815260d26020908152604080832086845290915290205460ff16156122fb5760405162461bcd60e51b815260206004820152600760248201526618db185a5b595960ca1b60448201526064016107d6565b33600090815260d2602090815260408083208684528252808320805460ff1916600117905560d09091529020546123635760405162461bcd60e51b815260206004820152600c60248201526b1dd85a5d1a5b99c81cd9595960a21b60448201526064016107d6565b33600090815260d36020908152604080832086845290915290205461239a5760405162461bcd60e51b81526004016107d690613e7a565b600060ce84815481106123af576123af613e64565b600091825260208083206040805161016081018252600690940290910180546001600160a01b039081168552600182015481169385019390935260028101549092169083015260038101546060830152600481015460808301526005015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b909104166101408201529150806124748633611b78565b156124da576124b960ce878154811061248f5761248f613e64565b6000918252602090912060069091020160050154606085015190600160b01b900461ffff16612c47565b60208401519092506124d5906001600160a01b03163384612bd1565b61253e565b50608082015160408301516001600160a01b031661252557604051339082156108fc029083906000818181858888f1935050505015801561251f573d6000803e3d6000fd5b5061253e565b604083015161253e906001600160a01b03163383612bd1565b6040805183815260208101839052339188917f4eed845a8c2dab6b8f3276326563ae95a67314d068314298838cc3246bb3e3e0910160405180910390a350505050506110076001606555565b6033546001600160a01b031633146118175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d6565b6002606554036126365760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107d6565b6002606555565b8142106126805760405162461bcd60e51b81526020600482015260116024820152701cda59db985d1d5c9948195e1c1a5c9959607a1b60448201526064016107d6565b604080513360208083019190915281830186905246606083015260808083018690528351808403909101815260a0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060c084015260dc8084018290528451808503909101815260fc90930190935281519101206127078184613082565b6099546001600160a01b039081169116146127585760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b60448201526064016107d6565b336000908152609b6020908152604080832085845290915290205460ff16156127b75760405162461bcd60e51b81526020600482015260116024820152701c1bdbdb081b595cdcd859d9481d5cd959607a1b60448201526064016107d6565b50336000908152609b6020908152604080832093835292905220805460ff19166001179055505050565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561282a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061284e9190613f80565b90506128656001600160a01b038316853086613044565b6040516370a0823160e01b815230600482015283906128db9083906001600160a01b038616906370a0823190602401602060405180830381865afa1580156128b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d59190613f80565b90612c34565b146117dc5760405162461bcd60e51b815260206004820152601e60248201527f6e6f7420737570706f7274206465666c6174696f6e61727920746f6b656e000060448201526064016107d6565b60c9546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e4916004808301926020929190829003018187875af1158015612973573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129979190613f99565b60c954604051631cd0704360e21b81526001600160401b03831660048201523060248201529192506001600160a01b031690637341c10c90604401600060405180830381600087803b1580156129ec57600080fd5b505af1158015612a00573d6000803e3d6000fd5b5050505090565b6001606555565b60c95460cb5460cc546040516305d3b1d360e41b815260048101929092526001600160401b0384166024830152640100000000810461ffff16604483015263ffffffff8082166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015612a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dac9190613f80565b600082815260cf602090815260408083205480845260d09092528220549091036107705760ce8181548110612af757612af7613e64565b906000526020600020906006020160050160149054906101000a900461ffff1661ffff1682600081518110612b2e57612b2e613e64565b6020026020010151612b409190613f3e565b612b4b906001613f52565b600082815260d06020526040902055505050565b60c954604051630d7ae1d360e41b81526001600160401b03841660048201526001600160a01b0383811660248301529091169063d7ae1d3090604401600060405180830381600087803b158015612bb557600080fd5b505af1158015612bc9573d6000803e3d6000fd5b505050505050565b6040516001600160a01b03831660248201526044810182905261077090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526130a6565b6000612c408284613f15565b9392505050565b6000612c408284613fb6565b6000612c408284613fca565b670de0b6b3a7640000811115612cac5760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964207478466565526174696f60701b60448201526064016107d6565b609755565b600054610100900460ff16612cd85760405162461bcd60e51b81526004016107d690613fe1565b612ce0613178565b612ce86131a7565b612cf183612c5f565b612cfa82612d37565b61077081612da7565b600054610100900460ff16612d2a5760405162461bcd60e51b81526004016107d690613fe1565b612d32613178565b60cb55565b6001600160a01b038116612d855760405162461bcd60e51b81526020600482015260156024820152741a5b9d985b1a59081cdd185ad950dbdb9d1c9858dd605a1b60448201526064016107d6565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116612dee5760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b21039b4b3b732b960911b60448201526064016107d6565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806040518061040001604052806003815260200160038152602001600581526020016007815260200160118152602001600b815260200160078152602001600b8152602001600d815260200160178152602001601f8152602001602f8152602001603d815260200160598152602001607f815260200160bf815260200160fb815260200161017f81526020016101fd81526020016102f981526020016103fd81526020016105fb81526020016107f78152602001610bfb8152602001610ffd81526020016117ff8152602001611fff8152602001612ff98152602001613ffd8152602001615ffb8152602001617fed815260200161bff381525090506000612f6b846131d6565b905083612f8f838360208110612f8357612f83613e64565b60200201518790612c53565b612f999190613f3e565b95945050505050565b6000612c408284613f52565b6000828152609a60205260409020541561108e57604080513360208201526000910160405160208183030381529060405280519060200120905061300682609a600086815260200190815260200160002054836132b4565b6107705760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081dda1a5d195b1a5cdd1959608a1b60448201526064016107d6565b6040516001600160a01b038085166024830152831660448201526064810182905261307c9085906323b872dd60e01b90608401612bfd565b50505050565b600080600061309185856132ca565b9150915061309e8161330f565b509392505050565b60006130fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134599092919063ffffffff16565b80519091501561077057808060200190518101906131199190613b8d565b6107705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107d6565b600054610100900460ff1661319f5760405162461bcd60e51b81526004016107d690613fe1565b611817613468565b600054610100900460ff166131ce5760405162461bcd60e51b81526004016107d690613fe1565b611817613498565b60006201000082106132165760405162461bcd60e51b8152602060048201526009602482015268746f6f206c6172676560b81b60448201526064016107d6565b6002821161322657506000919050565b8160030361323657506002919050565b6000825b600184111561325c5760019390931c92816132548161402c565b92505061323a565b613267826002612c34565b6002901b613276836001612c34565b6002901b6132849190613f52565b8111156132a9576132a1600161329b846002612c53565b90612fa2565b949350505050565b6132a1826002612c53565b6000826132c185846134bf565b14949350505050565b60008082516041036133005760208301516040840151606085015160001a6132f487828585613504565b94509450505050613308565b506000905060025b9250929050565b600081600481111561332357613323613bff565b0361332b5750565b600181600481111561333f5761333f613bff565b0361338c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016107d6565b60028160048111156133a0576133a0613bff565b036133ed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016107d6565b600381600481111561340157613401613bff565b036110075760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016107d6565b60606132a184846000856135c8565b600054610100900460ff1661348f5760405162461bcd60e51b81526004016107d690613fe1565b61181733612e10565b600054610100900460ff16612a075760405162461bcd60e51b81526004016107d690613fe1565b600081815b845181101561309e576134f0828683815181106134e3576134e3613e64565b60200260200101516136a3565b9150806134fc8161402c565b9150506134c4565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561353b57506000905060036135bf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561358f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166135b8576000600192509250506135bf565b9150600090505b94509492505050565b6060824710156136295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107d6565b600080866001600160a01b031685876040516136459190613e9a565b60006040518083038185875af1925050503d8060008114613682576040519150601f19603f3d011682016040523d82523d6000602084013e613687565b606091505b5091509150613698878383876136d2565b979650505050505050565b60008183106136bf576000828152602084905260409020612c40565b6000838152602083905260409020612c40565b6060831561374157825160000361373a576001600160a01b0385163b61373a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d6565b50816132a1565b6132a183838151156137565781518083602001fd5b8060405162461bcd60e51b81526004016107d69190614045565b80356001600160a01b038116811461378757600080fd5b919050565b6000806040838503121561379f57600080fd5b823591506137af60208401613770565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156137f1576137f16137b8565b60405290565b604051601f8201601f191681016001600160401b038111828210171561381f5761381f6137b8565b604052919050565b600082601f83011261383857600080fd5b81356001600160401b03811115613851576138516137b8565b613864601f8201601f19166020016137f7565b81815284602083860101111561387957600080fd5b816020850160208301376000918101602001919091529392505050565b803565ffffffffffff8116811461378757600080fd5b803561ffff8116811461378757600080fd5b6000806000606084860312156138d357600080fd5b83356001600160401b03808211156138ea57600080fd5b9085019061016082880312156138ff57600080fd5b6139076137ce565b82358281111561391657600080fd5b61392289828601613827565b82525061393160208401613770565b602082015261394260408401613770565b6040820152606083013560608201526080830135608082015261396760a08401613896565b60a082015261397860c08401613896565b60c082015261398960e08401613896565b60e082015261010061399c8185016138ac565b908201526101206139ae8482016138ac565b90820152610140928301359281019290925290935060208501359250604085013590808211156139dd57600080fd5b506139ea86828701613827565b9150509250925092565b600060208284031215613a0657600080fd5b5035919050565b60006001600160401b03821115613a2657613a266137b8565b5060051b60200190565b60008060408385031215613a4357600080fd5b823591506020808401356001600160401b03811115613a6157600080fd5b8401601f81018613613a7257600080fd5b8035613a85613a8082613a0d565b6137f7565b81815260059190911b82018301908381019088831115613aa457600080fd5b928401925b82841015613ac257833582529284019290840190613aa9565b80955050505050509250929050565b6001600160401b038116811461100757600080fd5b60008060408385031215613af957600080fd5b8235613b0481613ad1565b946020939093013593505050565b60008060408385031215613b2557600080fd5b613b0483613770565b60008060008060808587031215613b4457600080fd5b84359350613b5460208601613770565b9250613b6260408601613770565b9396929550929360600135925050565b600060208284031215613b8457600080fd5b612c4082613770565b600060208284031215613b9f57600080fd5b81518015158114612c4057600080fd5b60005b83811015613bca578181015183820152602001613bb2565b50506000910152565b60008151808452613beb816020860160208601613baf565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b60078110613c3357634e487b7160e01b600052602160045260246000fd5b9052565b6040815260008351610160806040850152613c566101a0850183613bd3565b91506020860151613c7260608601826001600160a01b03169052565b5060408601516001600160a01b038116608086015250606086015160a0850152608086015160c085015260a0860151613cb560e086018265ffffffffffff169052565b5060c0860151610100613cd18187018365ffffffffffff169052565b60e08801519150610120613cee8188018465ffffffffffff169052565b90880151915061014090613d078783018461ffff169052565b88015161ffff1692860192909252508501516101808401529050612c406020830184613c15565b83516001600160a01b0316815260006101a06020860151613d5a60208501826001600160a01b03169052565b506040860151613d7560408501826001600160a01b03169052565b50606086015160608401526080860151608084015260a0860151613da360a085018265ffffffffffff169052565b5060c0860151613dbd60c085018265ffffffffffff169052565b5060e0860151613dd760e085018265ffffffffffff169052565b506101008681015161ffff908116918501919091526101208088015182169085015261014080880151909116908401526101608301819052613e1b81840186613bd3565b91505082610180830152949350505050565b60208082526018908201527f7468697320706f6f6c20646f6573206e6f742065786973740000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600690820152651b9bc818995d60d21b604082015260600190565b60008251613eac818460208701613baf565b9190910192915050565b60018060a01b0384168152826020820152606060408201526000612f996060830184613bd3565b634e487b7160e01b600052601160045260246000fd5b61ffff828116828216039080821115613f0e57613f0e613edd565b5092915050565b81810381811115611dac57611dac613edd565b634e487b7160e01b600052601260045260246000fd5b600082613f4d57613f4d613f28565b500690565b80820180821115611dac57611dac613edd565b61ffff818116838216019080821115613f0e57613f0e613edd565b600060208284031215613f9257600080fd5b5051919050565b600060208284031215613fab57600080fd5b8151612c4081613ad1565b600082613fc557613fc5613f28565b500490565b8082028115828204841417611dac57611dac613edd565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161403e5761403e613edd565b5060010190565b602081526000612c406020830184613bd356fea264697066735822122060dfd5e48bf2e672dbfa61e9ce5ef7c75ef5023467ee07c7b58f7fda78a3810564736f6c63430008110033000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca

Deployed ByteCode

0x6080604052600436106101d75760003560e01c8063688a819711610102578063bdd415af11610095578063d4e398c911610064578063d4e398c91461065f578063e471039014610675578063f2fde38b146106b0578063fe43efda146106d057600080fd5b8063bdd415af146105cf578063c6a67b3f146105ef578063c6e989451461061f578063d4a4a92a1461064c57600080fd5b80638da5cb5b116100d15780638da5cb5b146104e55780638eec5d701461050357806397d1542514610518578063ac4afa381461053857600080fd5b8063688a8197146104355780636c19e78314610462578063715018a6146104825780638cafc3581461049757600080fd5b8063411e5b9c1161017a57806347c34dc11161014957806347c34dc1146103ac57806348f85bbb146103cc578063509484d5146103f957806362e08c811461041957600080fd5b8063411e5b9c146102db5780634445c700146102fb578063445fc8fc1461031b578063466fca7f1461036657600080fd5b80631a186227116101b65780631a1862271461023e5780631fe543e31461027b578063238ac9331461029b5780632ad540ed146102bb57600080fd5b8062f714ce146101dc57806309cb987c146101fe5780630ea045621461021e575b600080fd5b3480156101e857600080fd5b506101fc6101f736600461378c565b6106f0565b005b34801561020a57600080fd5b506101fc6102193660046138be565b610775565b34801561022a57600080fd5b506101fc6102393660046139f4565b610e8b565b34801561024a57600080fd5b5060985461025e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561028757600080fd5b506101fc610296366004613a30565b61100a565b3480156102a757600080fd5b5060995461025e906001600160a01b031681565b3480156102c757600080fd5b506101fc6102d63660046139f4565b611092565b3480156102e757600080fd5b506101fc6102f63660046139f4565b61164c565b34801561030757600080fd5b506101fc610316366004613ae6565b61165d565b34801561032757600080fd5b50610356610336366004613b12565b609b60209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610272565b34801561037257600080fd5b5061039e610381366004613b12565b60d360209081526000928352604080842090915290825290205481565b604051908152602001610272565b3480156103b857600080fd5b506101fc6103c7366004613b2e565b6116c2565b3480156103d857600080fd5b5061039e6103e73660046139f4565b60cf6020526000908152604090205481565b34801561040557600080fd5b506101fc610414366004613b72565b6117e3565b34801561042557600080fd5b5061039e670de0b6b3a764000081565b34801561044157600080fd5b5061039e6104503660046139f4565b609a6020526000908152604090205481565b34801561046e57600080fd5b506101fc61047d366004613b72565b6117f4565b34801561048e57600080fd5b506101fc611805565b3480156104a357600080fd5b506104cd6104b23660046139f4565b60cd602052600090815260409020546001600160401b031681565b6040516001600160401b039091168152602001610272565b3480156104f157600080fd5b506033546001600160a01b031661025e565b34801561050f57600080fd5b5060ce5461039e565b34801561052457600080fd5b506101fc6105333660046139f4565b611819565b34801561054457600080fd5b506105586105533660046139f4565b611ae4565b604080516001600160a01b039c8d1681529a8c1660208c015298909a16978901979097526060880195909552608087019390935265ffffffffffff91821660a0870152811660c08601521660e084015261ffff90811661010084015290811661012083015290911661014082015261016001610272565b3480156105db57600080fd5b506103566105ea36600461378c565b611b78565b3480156105fb57600080fd5b5061035661060a3660046139f4565b60d16020526000908152604090205460ff1681565b34801561062b57600080fd5b5061039e61063a3660046139f4565b60d06020526000908152604090205481565b6101fc61065a366004613a30565b611db2565b34801561066b57600080fd5b5061039e60975481565b34801561068157600080fd5b50610356610690366004613b12565b60d260209081526000928352604080842090915290825290205460ff1681565b3480156106bc57600080fd5b506101fc6106cb366004613b72565b61218d565b3480156106dc57600080fd5b506101fc6106eb3660046139f4565b612203565b6106f861258a565b60ca5460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044015b6020604051808303816000875af115801561074c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107709190613b8d565b505050565b61077d6125e4565b82610120015161ffff16836060015110156107df5760405162461bcd60e51b815260206004820152601d60248201527f616d6f756e74546f74616c30206c657373207468616e206e536861726500000060448201526064015b60405180910390fd5b82608001516000036108335760405162461bcd60e51b815260206004820152601860248201527f616d6f756e743150657257616c6c6574206973207a65726f000000000000000060448201526064016107d6565b82610120015161ffff1660000361087d5760405162461bcd60e51b815260206004820152600e60248201526d6e5368617265206973207a65726f60901b60448201526064016107d6565b82610100015161ffff1683610120015161ffff1611156108df5760405162461bcd60e51b815260206004820152601b60248201527f6d617820706c61796572206c657373207468616e206e5368617265000000000060448201526064016107d6565b600083610100015161ffff161161092c5760405162461bcd60e51b81526020600482015260116024820152706d6178506c61796572206973207a65726f60781b60448201526064016107d6565b428360a0015165ffffffffffff1610156109795760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081bdc195b905d60921b60448201526064016107d6565b8260a0015165ffffffffffff168360c0015165ffffffffffff16116109d25760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a590818db1bdcd9505d608a1b60448201526064016107d6565b8260c0015165ffffffffffff168360e0015165ffffffffffff161015610a2c5760405162461bcd60e51b815260206004820152600f60248201526e1a5b9d985b1a590818db185a5b505d608a1b60448201526064016107d6565b825151603c1015610a725760405162461bcd60e51b815260206004820152601060248201526f6e616d6520697320746f6f206c6f6e6760801b60448201526064016107d6565b610aa6836003604051602001610a89929190613c37565b60405160208183030381529060405280519060200120838361263d565b60ce5461014084015115610aca576101408401516000828152609a60205260409020555b610add84602001513386606001516127e1565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101919091523381600001906001600160a01b031690816001600160a01b031681525050846020015181602001906001600160a01b031690816001600160a01b031681525050846040015181604001906001600160a01b031690816001600160a01b031681525050846060015181606001818152505084608001518160800181815250508460a001518160a0019065ffffffffffff16908165ffffffffffff16815250508460c001518160c0019065ffffffffffff16908165ffffffffffff16815250508460e001518160e0019065ffffffffffff16908165ffffffffffff168152505084610100015181610100019061ffff16908161ffff168152505084610120015181610140019061ffff16908161ffff168152505060ce81908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600301556080820151816004015560a08201518160050160006101000a81548165ffffffffffff021916908365ffffffffffff16021790555060c08201518160050160066101000a81548165ffffffffffff021916908365ffffffffffff16021790555060e082015181600501600c6101000a81548165ffffffffffff021916908365ffffffffffff1602179055506101008201518160050160126101000a81548161ffff021916908361ffff1602179055506101208201518160050160146101000a81548161ffff021916908361ffff1602179055506101408201518160050160166101000a81548161ffff021916908361ffff1602179055505050610e06612928565b600083815260cd60209081526040808320805467ffffffffffffffff19166001600160401b0395909516949094179093558751609a90915290829020549151339285927fa4e77d4a925eec7683bf12e8c2471c3190110cb8b69659a4ff9ff4f41866ab5292610e7792879291613d2e565b60405180910390a350506107706001606555565b610e936125e4565b60ce5481908110610eb65760405162461bcd60e51b81526004016107d690613e2d565b814260ce8281548110610ecb57610ecb613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff161115610f365760405162461bcd60e51b81526020600482015260176024820152761d1a1a5cc81c1bdbdb081a5cc81b9bdd0818db1bdcd959604a1b60448201526064016107d6565b600060ce8481548110610f4b57610f4b613e64565b6000918252602090912060069091020160050154600160a01b900461ffff1611610f875760405162461bcd60e51b81526004016107d690613e7a565b600083815260cd6020526040812054610fa8906001600160401b0316612a0e565b600081815260cf60205260409081902086905551909150339085907fafcd4056ad38818223498da8edc6d46df7129d5e828cfb7fb3e100093f28dbdf90610ff29085815260200190565b60405180910390a35050506110076001606555565b50565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146110845760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091660248201526044016107d6565b61108e8282612ac0565b5050565b61109a6125e4565b60ce54819081106110bd5760405162461bcd60e51b81526004016107d690613e2d565b814260ce82815481106110d2576110d2613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff16111561113d5760405162461bcd60e51b81526020600482015260176024820152761d1a1a5cc81c1bdbdb081a5cc81b9bdd0818db1bdcd959604a1b60448201526064016107d6565b600060ce848154811061115257611152613e64565b60009182526020918290206040805161016081018252600690930290910180546001600160a01b0390811680855260018301548216958501959095526002820154169183019190915260038101546060830152600481015460808301526005015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b90910416610140820152915033146112545760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b2103837b7b61031b932b0ba37b960611b60448201526064016107d6565b600084815260d1602052604090205460ff16156112a55760405162461bcd60e51b815260206004820152600f60248201526e18dc99585d1bdc8818db185a5b5959608a1b60448201526064016107d6565b600084815260d160209081526040808320805460ff1916600117905560cd9091529020546112dc906001600160401b031630612b5f565b80610120015161ffff166000036113625761131333826060015183602001516001600160a01b0316612bd19092919063ffffffff16565b6060808201516040805191825260006020830181905290820152339186917fcc18e7bd1b741e3758cf9ab9e95470fee5a623324d2ad935624b0533f6a52716910160405180910390a350611640565b600060ce858154811061137757611377613e64565b6000918252602082206005600690920201015461012084015161ffff600160b01b909204821693501682106113b55782610120015161ffff166113b7565b815b9050600083610120015161ffff1683111561141c576114006113eb85610120015161ffff1685612c3490919063ffffffff16565b60608601516113fa9086612c47565b90612c53565b602085015190915061141c906001600160a01b03163383612bd1565b608084015160009061142e9084612c53565b90506000611459670de0b6b3a764000061145360975485612c5390919063ffffffff16565b90612c47565b905060006114678383612c34565b905080156114dd5760408701516001600160a01b03166114c05786516040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156114ba573d6000803e3d6000fd5b506114dd565b865160408801516114dd916001600160a01b039091169083612bd1565b81156115f35760408701516001600160a01b03166115d45760985460408051600481526024810182526020810180516001600160e01b0316635ec2dc8d60e01b17905290516000926001600160a01b031691859161153b9190613e9a565b60006040518083038185875af1925050503d8060008114611578576040519150601f19603f3d011682016040523d82523d6000602084013e61157d565b606091505b50509050806115ce5760405162461bcd60e51b815260206004820152601760248201527f5265766572743a206465706f736974526577617264282900000000000000000060448201526064016107d6565b506115f3565b60985460408801516115f3916001600160a01b03918216911684612bd1565b604080518581526020810183905290810183905233908b907fcc18e7bd1b741e3758cf9ab9e95470fee5a623324d2ad935624b0533f6a527169060600160405180910390a3505050505050505b50506110076001606555565b61165461258a565b61100781612c5f565b61166561258a565b60ca5460c954604080516001600160401b03861660208201526001600160a01b0393841693634000aea09316918591016040516020818303038152906040526040518463ffffffff1660e01b815260040161072d93929190613eb6565b600054610100900460ff16158080156116e25750600054600160ff909116105b806116fc5750303b1580156116fc575060005460ff166001145b61175f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107d6565b6000805460ff191660011790558015611782576000805461ff0019166101001790555b61178d858585612cb1565b61179682612d03565b80156117dc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6117eb61258a565b61100781612d37565b6117fc61258a565b61100781612da7565b61180d61258a565b6118176000612e10565b565b6118216125e4565b60ce54819081106118445760405162461bcd60e51b81526004016107d690613e2d565b814260ce828154811061185957611859613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff16116118bf5760405162461bcd60e51b81526020600482015260136024820152721d1a1a5cc81c1bdbdb081a5cc818db1bdcd959606a1b60448201526064016107d6565b33600090815260d3602090815260408083208684529091529020546118f65760405162461bcd60e51b81526004016107d690613e7a565b33600090815260d36020908152604080832086845290915281205560ce8054600191908590811061192957611929613e64565b906000526020600020906006020160050160148282829054906101000a900461ffff166119569190613ef3565b92506101000a81548161ffff021916908361ffff160217905550600060ce848154811061198557611985613e64565b60009182526020918290206040805161016081018252600690930290910180546001600160a01b03908116845260018201548116948401949094526002810154909316908201819052600383015460608301526004830154608083015260059092015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b909104166101408201529150611a7e576080810151604051339180156108fc02916000818181858888f19350505050158015611a78573d6000803e3d6000fd5b50611aa4565b611aa433826080015183604001516001600160a01b0316612bd19092919063ffffffff16565b336001600160a01b0316847f7bd1ff26b15be8c8d62cfbdf1921eea621feeb2f8bb70edd060311fb3296877c8360800151604051610ff291815260200190565b60ce8181548110611af457600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0394851696509284169491909316929165ffffffffffff80821691600160301b8104821691600160601b8204169061ffff600160901b8204811691600160a01b8104821691600160b01b909104168b565b60004260ce8481548110611b8e57611b8e613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff1610611bfe5760405162461bcd60e51b815260206004820181905260248201527f49742773206e6f742074696d6520746f20737461727420746865207072697a6560448201526064016107d6565b6001600160a01b038216600090815260d3602090815260408083208684529091528120549003611c3057506000611dac565b600060ce8481548110611c4557611c45613e64565b906000526020600020906006020160050160169054906101000a900461ffff1661ffff169050600060ce8581548110611c8057611c80613e64565b6000918252602090912060069091020160050154600160a01b900461ffff169050818111611cb357600192505050611dac565b600085815260d06020526040812054611cce90600190613f15565b6001600160a01b038616600090815260d3602090815260408083208a845290915281205491925090611d0c90611d0690600190613f15565b84612e62565b90508183611d1a8287612fa2565b611d249190613f3e565b1115611d5957818110158015611d425750611d3f8483613f52565b81105b15611d54576001945050505050611dac565b611da3565b818110158015611d6857508281105b15611d7a576001945050505050611dac565b82611d858386612fa2565b611d8f9190613f3e565b811015611da3576001945050505050611dac565b60009450505050505b92915050565b611dba6125e4565b60ce5482908110611ddd5760405162461bcd60e51b81526004016107d690613e2d565b824260ce8281548110611df257611df2613e64565b6000918252602090912060069091020160050154600160301b900465ffffffffffff1611611e585760405162461bcd60e51b81526020600482015260136024820152721d1a1a5cc81c1bdbdb081a5cc818db1bdcd959606a1b60448201526064016107d6565b611e628484612fae565b600060ce8581548110611e7757611e77613e64565b600091825260208083206040805161016081018252600690940290910180546001600160a01b03908116855260018201548116858501526002820154168483015260038101546060850152600481015460808501526005015465ffffffffffff80821660a0860152600160301b8204811660c0860152600160601b82041660e085015261ffff600160901b82048116610100860152600160a01b82048116610120860152600160b01b9091041661014084015233845260d382528084208985529091529091205490915015611f7c5760405162461bcd60e51b815260206004820152600b60248201526a185b1c9958591e4818995d60aa1b60448201526064016107d6565b428160a0015165ffffffffffff161115611fc85760405162461bcd60e51b815260206004820152600d60248201526c3837b7b6103737ba1037b832b760991b60448201526064016107d6565b80610100015161ffff1681610120015161ffff1611156120205760405162461bcd60e51b81526020600482015260136024820152721c995858da1959081d5c1c195c881b1a5b5a5d606a1b60448201526064016107d6565b600160ce868154811061203557612035613e64565b906000526020600020906006020160050160148282829054906101000a900461ffff166120629190613f65565b92506101000a81548161ffff021916908361ffff16021790555060ce858154811061208f5761208f613e64565b600091825260208083206006929092029091016005015433835260d38252604080842089855290925291819020600160a01b90920461ffff169091558101516001600160a01b031661212b57806080015134146121265760405162461bcd60e51b81526020600482015260156024820152740d2dcecc2d8d2c840c2dadeeadce840decc408aa89605b1b60448201526064016107d6565b612153565b6121533330836080015184604001516001600160a01b0316613044909392919063ffffffff16565b604051339086907fc0cf6f6539dd26a13b724325f9d675aeb7686003595f761a617b892522d0c98c90600090a350505061108e6001606555565b61219561258a565b6001600160a01b0381166121fa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d6565b61100781612e10565b61220b6125e4565b60ce548190811061222e5760405162461bcd60e51b81526004016107d690613e2d565b814260ce828154811061224357612243613e64565b6000918252602090912060069091020160050154600160601b900465ffffffffffff1611156122a65760405162461bcd60e51b815260206004820152600f60248201526e636c61696d206e6f7420726561647960881b60448201526064016107d6565b33600090815260d26020908152604080832086845290915290205460ff16156122fb5760405162461bcd60e51b815260206004820152600760248201526618db185a5b595960ca1b60448201526064016107d6565b33600090815260d2602090815260408083208684528252808320805460ff1916600117905560d09091529020546123635760405162461bcd60e51b815260206004820152600c60248201526b1dd85a5d1a5b99c81cd9595960a21b60448201526064016107d6565b33600090815260d36020908152604080832086845290915290205461239a5760405162461bcd60e51b81526004016107d690613e7a565b600060ce84815481106123af576123af613e64565b600091825260208083206040805161016081018252600690940290910180546001600160a01b039081168552600182015481169385019390935260028101549092169083015260038101546060830152600481015460808301526005015465ffffffffffff80821660a0840152600160301b8204811660c0840152600160601b82041660e083015261ffff600160901b82048116610100840152600160a01b82048116610120840152600160b01b909104166101408201529150806124748633611b78565b156124da576124b960ce878154811061248f5761248f613e64565b6000918252602090912060069091020160050154606085015190600160b01b900461ffff16612c47565b60208401519092506124d5906001600160a01b03163384612bd1565b61253e565b50608082015160408301516001600160a01b031661252557604051339082156108fc029083906000818181858888f1935050505015801561251f573d6000803e3d6000fd5b5061253e565b604083015161253e906001600160a01b03163383612bd1565b6040805183815260208101839052339188917f4eed845a8c2dab6b8f3276326563ae95a67314d068314298838cc3246bb3e3e0910160405180910390a350505050506110076001606555565b6033546001600160a01b031633146118175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d6565b6002606554036126365760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107d6565b6002606555565b8142106126805760405162461bcd60e51b81526020600482015260116024820152701cda59db985d1d5c9948195e1c1a5c9959607a1b60448201526064016107d6565b604080513360208083019190915281830186905246606083015260808083018690528351808403909101815260a0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060c084015260dc8084018290528451808503909101815260fc90930190935281519101206127078184613082565b6099546001600160a01b039081169116146127585760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b60448201526064016107d6565b336000908152609b6020908152604080832085845290915290205460ff16156127b75760405162461bcd60e51b81526020600482015260116024820152701c1bdbdb081b595cdcd859d9481d5cd959607a1b60448201526064016107d6565b50336000908152609b6020908152604080832093835292905220805460ff19166001179055505050565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561282a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061284e9190613f80565b90506128656001600160a01b038316853086613044565b6040516370a0823160e01b815230600482015283906128db9083906001600160a01b038616906370a0823190602401602060405180830381865afa1580156128b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d59190613f80565b90612c34565b146117dc5760405162461bcd60e51b815260206004820152601e60248201527f6e6f7420737570706f7274206465666c6174696f6e61727920746f6b656e000060448201526064016107d6565b60c9546040805163288688f960e21b815290516000926001600160a01b03169163a21a23e4916004808301926020929190829003018187875af1158015612973573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129979190613f99565b60c954604051631cd0704360e21b81526001600160401b03831660048201523060248201529192506001600160a01b031690637341c10c90604401600060405180830381600087803b1580156129ec57600080fd5b505af1158015612a00573d6000803e3d6000fd5b5050505090565b6001606555565b60c95460cb5460cc546040516305d3b1d360e41b815260048101929092526001600160401b0384166024830152640100000000810461ffff16604483015263ffffffff8082166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015612a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dac9190613f80565b600082815260cf602090815260408083205480845260d09092528220549091036107705760ce8181548110612af757612af7613e64565b906000526020600020906006020160050160149054906101000a900461ffff1661ffff1682600081518110612b2e57612b2e613e64565b6020026020010151612b409190613f3e565b612b4b906001613f52565b600082815260d06020526040902055505050565b60c954604051630d7ae1d360e41b81526001600160401b03841660048201526001600160a01b0383811660248301529091169063d7ae1d3090604401600060405180830381600087803b158015612bb557600080fd5b505af1158015612bc9573d6000803e3d6000fd5b505050505050565b6040516001600160a01b03831660248201526044810182905261077090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526130a6565b6000612c408284613f15565b9392505050565b6000612c408284613fb6565b6000612c408284613fca565b670de0b6b3a7640000811115612cac5760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964207478466565526174696f60701b60448201526064016107d6565b609755565b600054610100900460ff16612cd85760405162461bcd60e51b81526004016107d690613fe1565b612ce0613178565b612ce86131a7565b612cf183612c5f565b612cfa82612d37565b61077081612da7565b600054610100900460ff16612d2a5760405162461bcd60e51b81526004016107d690613fe1565b612d32613178565b60cb55565b6001600160a01b038116612d855760405162461bcd60e51b81526020600482015260156024820152741a5b9d985b1a59081cdd185ad950dbdb9d1c9858dd605a1b60448201526064016107d6565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116612dee5760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b21039b4b3b732b960911b60448201526064016107d6565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806040518061040001604052806003815260200160038152602001600581526020016007815260200160118152602001600b815260200160078152602001600b8152602001600d815260200160178152602001601f8152602001602f8152602001603d815260200160598152602001607f815260200160bf815260200160fb815260200161017f81526020016101fd81526020016102f981526020016103fd81526020016105fb81526020016107f78152602001610bfb8152602001610ffd81526020016117ff8152602001611fff8152602001612ff98152602001613ffd8152602001615ffb8152602001617fed815260200161bff381525090506000612f6b846131d6565b905083612f8f838360208110612f8357612f83613e64565b60200201518790612c53565b612f999190613f3e565b95945050505050565b6000612c408284613f52565b6000828152609a60205260409020541561108e57604080513360208201526000910160405160208183030381529060405280519060200120905061300682609a600086815260200190815260200160002054836132b4565b6107705760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081dda1a5d195b1a5cdd1959608a1b60448201526064016107d6565b6040516001600160a01b038085166024830152831660448201526064810182905261307c9085906323b872dd60e01b90608401612bfd565b50505050565b600080600061309185856132ca565b9150915061309e8161330f565b509392505050565b60006130fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134599092919063ffffffff16565b80519091501561077057808060200190518101906131199190613b8d565b6107705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107d6565b600054610100900460ff1661319f5760405162461bcd60e51b81526004016107d690613fe1565b611817613468565b600054610100900460ff166131ce5760405162461bcd60e51b81526004016107d690613fe1565b611817613498565b60006201000082106132165760405162461bcd60e51b8152602060048201526009602482015268746f6f206c6172676560b81b60448201526064016107d6565b6002821161322657506000919050565b8160030361323657506002919050565b6000825b600184111561325c5760019390931c92816132548161402c565b92505061323a565b613267826002612c34565b6002901b613276836001612c34565b6002901b6132849190613f52565b8111156132a9576132a1600161329b846002612c53565b90612fa2565b949350505050565b6132a1826002612c53565b6000826132c185846134bf565b14949350505050565b60008082516041036133005760208301516040840151606085015160001a6132f487828585613504565b94509450505050613308565b506000905060025b9250929050565b600081600481111561332357613323613bff565b0361332b5750565b600181600481111561333f5761333f613bff565b0361338c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016107d6565b60028160048111156133a0576133a0613bff565b036133ed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016107d6565b600381600481111561340157613401613bff565b036110075760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016107d6565b60606132a184846000856135c8565b600054610100900460ff1661348f5760405162461bcd60e51b81526004016107d690613fe1565b61181733612e10565b600054610100900460ff16612a075760405162461bcd60e51b81526004016107d690613fe1565b600081815b845181101561309e576134f0828683815181106134e3576134e3613e64565b60200260200101516136a3565b9150806134fc8161402c565b9150506134c4565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561353b57506000905060036135bf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561358f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166135b8576000600192509250506135bf565b9150600090505b94509492505050565b6060824710156136295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107d6565b600080866001600160a01b031685876040516136459190613e9a565b60006040518083038185875af1925050503d8060008114613682576040519150601f19603f3d011682016040523d82523d6000602084013e613687565b606091505b5091509150613698878383876136d2565b979650505050505050565b60008183106136bf576000828152602084905260409020612c40565b6000838152602083905260409020612c40565b6060831561374157825160000361373a576001600160a01b0385163b61373a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d6565b50816132a1565b6132a183838151156137565781518083602001fd5b8060405162461bcd60e51b81526004016107d69190614045565b80356001600160a01b038116811461378757600080fd5b919050565b6000806040838503121561379f57600080fd5b823591506137af60208401613770565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156137f1576137f16137b8565b60405290565b604051601f8201601f191681016001600160401b038111828210171561381f5761381f6137b8565b604052919050565b600082601f83011261383857600080fd5b81356001600160401b03811115613851576138516137b8565b613864601f8201601f19166020016137f7565b81815284602083860101111561387957600080fd5b816020850160208301376000918101602001919091529392505050565b803565ffffffffffff8116811461378757600080fd5b803561ffff8116811461378757600080fd5b6000806000606084860312156138d357600080fd5b83356001600160401b03808211156138ea57600080fd5b9085019061016082880312156138ff57600080fd5b6139076137ce565b82358281111561391657600080fd5b61392289828601613827565b82525061393160208401613770565b602082015261394260408401613770565b6040820152606083013560608201526080830135608082015261396760a08401613896565b60a082015261397860c08401613896565b60c082015261398960e08401613896565b60e082015261010061399c8185016138ac565b908201526101206139ae8482016138ac565b90820152610140928301359281019290925290935060208501359250604085013590808211156139dd57600080fd5b506139ea86828701613827565b9150509250925092565b600060208284031215613a0657600080fd5b5035919050565b60006001600160401b03821115613a2657613a266137b8565b5060051b60200190565b60008060408385031215613a4357600080fd5b823591506020808401356001600160401b03811115613a6157600080fd5b8401601f81018613613a7257600080fd5b8035613a85613a8082613a0d565b6137f7565b81815260059190911b82018301908381019088831115613aa457600080fd5b928401925b82841015613ac257833582529284019290840190613aa9565b80955050505050509250929050565b6001600160401b038116811461100757600080fd5b60008060408385031215613af957600080fd5b8235613b0481613ad1565b946020939093013593505050565b60008060408385031215613b2557600080fd5b613b0483613770565b60008060008060808587031215613b4457600080fd5b84359350613b5460208601613770565b9250613b6260408601613770565b9396929550929360600135925050565b600060208284031215613b8457600080fd5b612c4082613770565b600060208284031215613b9f57600080fd5b81518015158114612c4057600080fd5b60005b83811015613bca578181015183820152602001613bb2565b50506000910152565b60008151808452613beb816020860160208601613baf565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b60078110613c3357634e487b7160e01b600052602160045260246000fd5b9052565b6040815260008351610160806040850152613c566101a0850183613bd3565b91506020860151613c7260608601826001600160a01b03169052565b5060408601516001600160a01b038116608086015250606086015160a0850152608086015160c085015260a0860151613cb560e086018265ffffffffffff169052565b5060c0860151610100613cd18187018365ffffffffffff169052565b60e08801519150610120613cee8188018465ffffffffffff169052565b90880151915061014090613d078783018461ffff169052565b88015161ffff1692860192909252508501516101808401529050612c406020830184613c15565b83516001600160a01b0316815260006101a06020860151613d5a60208501826001600160a01b03169052565b506040860151613d7560408501826001600160a01b03169052565b50606086015160608401526080860151608084015260a0860151613da360a085018265ffffffffffff169052565b5060c0860151613dbd60c085018265ffffffffffff169052565b5060e0860151613dd760e085018265ffffffffffff169052565b506101008681015161ffff908116918501919091526101208088015182169085015261014080880151909116908401526101608301819052613e1b81840186613bd3565b91505082610180830152949350505050565b60208082526018908201527f7468697320706f6f6c20646f6573206e6f742065786973740000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600690820152651b9bc818995d60d21b604082015260600190565b60008251613eac818460208701613baf565b9190910192915050565b60018060a01b0384168152826020820152606060408201526000612f996060830184613bd3565b634e487b7160e01b600052601160045260246000fd5b61ffff828116828216039080821115613f0e57613f0e613edd565b5092915050565b81810381811115611dac57611dac613edd565b634e487b7160e01b600052601260045260246000fd5b600082613f4d57613f4d613f28565b500690565b80820180821115611dac57611dac613edd565b61ffff818116838216019080821115613f0e57613f0e613edd565b600060208284031215613f9257600080fd5b5051919050565b600060208284031215613fab57600080fd5b8151612c4081613ad1565b600082613fc557613fc5613f28565b500490565b8082028115828204841417611dac57611dac613edd565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161403e5761403e613edd565b5060010190565b602081526000612c406020830184613bd356fea264697066735822122060dfd5e48bf2e672dbfa61e9ce5ef7c75ef5023467ee07c7b58f7fda78a3810564736f6c63430008110033