Amoy Testnet

Contract

0xF685d6766A383F5B76D176b423D1dA1954A09180

Overview

POL Balance

Polygon PoS Chain Amoy LogoPolygon PoS Chain Amoy LogoPolygon PoS Chain Amoy Logo0 POL

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
End Round162324612024-12-30 6:34:1550 days ago1735540455IN
0xF685d676...954A09180
0 POL0.0042756525.64559331
Start Round162324542024-12-30 6:34:0150 days ago1735540441IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162324432024-12-30 6:33:3750 days ago1735540417IN
0xF685d676...954A09180
0 POL0.0047705425.64559331
Make Trade162324432024-12-30 6:33:3750 days ago1735540417IN
0xF685d676...954A09180
0 POL0.0052093825.64559331
End Round162324402024-12-30 6:33:3150 days ago1735540411IN
0xF685d676...954A09180
0 POL0.0035069325.64559331
Start Round162324332024-12-30 6:33:1750 days ago1735540397IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162324212024-12-30 6:32:5150 days ago1735540371IN
0xF685d676...954A09180
0 POL0.0034552325.64559331
Make Trade162324212024-12-30 6:32:5150 days ago1735540371IN
0xF685d676...954A09180
0 POL0.0052093825.64559331
End Round162324182024-12-30 6:32:4550 days ago1735540365IN
0xF685d676...954A09180
0 POL0.0035096525.64559331
Start Round162324122024-12-30 6:32:3150 days ago1735540351IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162324002024-12-30 6:32:0750 days ago1735540327IN
0xF685d676...954A09180
0 POL0.0034549225.64559331
Make Trade162324002024-12-30 6:32:0750 days ago1735540327IN
0xF685d676...954A09180
0 POL0.0052090825.64559331
End Round162323982024-12-30 6:32:0150 days ago1735540321IN
0xF685d676...954A09180
0 POL0.0035069325.64559331
Start Round162323902024-12-30 6:31:4550 days ago1735540305IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162323792024-12-30 6:31:2150 days ago1735540281IN
0xF685d676...954A09180
0 POL0.0034552325.64559331
Make Trade162323792024-12-30 6:31:2150 days ago1735540281IN
0xF685d676...954A09180
0 POL0.0052093825.64559331
End Round162323762024-12-30 6:31:1550 days ago1735540275IN
0xF685d676...954A09180
0 POL0.0035069325.64559331
Start Round162323692024-12-30 6:31:0150 days ago1735540261IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162323572024-12-30 6:30:3550 days ago1735540235IN
0xF685d676...954A09180
0 POL0.0034552325.64559331
Make Trade162323572024-12-30 6:30:3550 days ago1735540235IN
0xF685d676...954A09180
0 POL0.0052093825.64559331
End Round162323552024-12-30 6:30:3150 days ago1735540231IN
0xF685d676...954A09180
0 POL0.0042756525.64559331
Start Round162323482024-12-30 6:30:1550 days ago1735540215IN
0xF685d676...954A09180
0 POL0.0019737825.64559331
Make Trade162323372024-12-30 6:29:5350 days ago1735540193IN
0xF685d676...954A09180
0 POL0.0047705425.64559331
Make Trade162323372024-12-30 6:29:5350 days ago1735540193IN
0xF685d676...954A09180
0 POL0.0052093825.64559331
End Round162323342024-12-30 6:29:4550 days ago1735540185IN
0xF685d676...954A09180
0 POL0.0035069325.64559331
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TradeGameV5

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : TradeGameV5.sol
// SPDX-License-Identifier: MIT
// With ERC20 token support and token type defined in startGame function
pragma solidity 0.8.19;

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract TradeGameV5 is Ownable {
    using SafeERC20 for IERC20;

    struct BetGroup {
        uint256[] bets;
        address[] addresses;
        uint256 total;
        uint256 distributedCount;
        uint256 totalDistributed;
    }

    struct Round {
        bool isOpen;
        uint256 startPrice;
        uint256 endPrice;
        uint256 minBetAmount;
        uint256 maxBetAmount;
        uint256 poolBetsLimit;
        uint256 roundStartTime;
        uint256 tradesStartTimeMS;
        uint256 tradesEndTimeMS;
        BetGroup upBetGroup;
        BetGroup downBetGroup;
    }

    struct Distribution {
        uint256 fee;
        uint256 feeJackpot;
        uint256 totalMinusFee;
        uint256 totalMinusJackpotFee;
        uint256 totalFees;
        uint256 pending;
    }

    struct MakeTradeStruct {
        bytes poolId;
        bool upOrDown;
        uint256 bet;
    }

    uint256 public feePercentage = 1000; // 10%
    uint256 public feeJackpotPercentage = 0;
    address public gameController;
    address public feeAddress = msg.sender; //default fee address
    address public feeJackpotAddress = msg.sender; //default fee jackpot address
    address public gameToken;
    bytes public notRunningReason;
    bool public isRunning;
    bool isEther;

    mapping(bytes => Round) public pools;

    // Errors
    error PendingDistributions();

    // Events
    event RoundStarted(
        bytes poolId,
        uint256 timestamp,
        uint256 price,
        uint256 minTradeAmount,
        uint256 maxTradeAmount,
        uint256 poolTradesLimit,
        bytes indexed indexedPoolId
    );
    event RoundEnded(
        bytes poolId,
        uint256 timestamp,
        uint256 startPrice,
        uint256 endPrice,
        bytes indexed indexedPoolId
    );
    event TradePlaced(
        bytes poolId,
        address sender,
        uint256 amount,
        string prediction,
        uint256 newTotal,
        bytes indexed indexedPoolId,
        address indexed indexedSender,
        uint256 roundStartTime
    );
    event TradeReturned(
        bytes poolId,
        address sender,
        uint256 amount
    );
    event GameStopped(bytes reason);
    event GameStarted();
    event RoundDistributed(
        bytes poolId,
        uint totalWinners,
        uint from,
        uint to,
        uint256 timestamp
    );
    event TradeWinningsSent(
        bytes poolId,
        address sender,
        uint256 tradeAmount,
        uint256 winningsAmount,
        address indexed indexedSender,
        uint256 feePercentage,
        uint256 feeJackpotPercentage
    );

    // Modifiers
    modifier onlyGameController() {
        require(
            msg.sender == gameController,
            "Only game controller can do this"
        );
        _;
    }

    modifier onlyOpenPool(bytes calldata poolId) {
        require(isPoolOpen(poolId), "This pool has a round in progress");
        _;
    }

    modifier onlyGameRunning() {
        require(isRunning, "The game is not running");
        _;
    }

    constructor(address newGameController) {
        gameController = newGameController;
    }

    ////////////////////////////////
    /// Admin role
    ////////////////////////////////
    function changeGameControllerAddress(
        address newGameControllerAddress
    ) external onlyOwner {
        require(
            newGameControllerAddress != address(0x0),
            "Address cannot be zero address"
        );

        gameController = newGameControllerAddress;
    }

    function changeGameFeePercentage(
        uint256 newFeePercentage
    ) external onlyOwner {
        require(newFeePercentage <= 10000, "Wrong fee percentage value");

        feePercentage = newFeePercentage;
    }

    function changeGameFeeJackpotPercentage(
        uint256 newFeeJackpotPercentage
    ) external onlyOwner {
        require(
            newFeeJackpotPercentage <= 10000,
            "Wrong jackpot fee percentage value"
        );

        feeJackpotPercentage = newFeeJackpotPercentage;
    }

    function changeGameFeeAddress(address newFeeAddress) external onlyOwner {
        require(
            newFeeAddress != address(0x0),
            "Address cannot be zero address"
        );

        feeAddress = newFeeAddress;
    }

    function changeGameFeeJackpotAddress(
        address newFeeJackpotAddress
    ) external onlyOwner {
        require(
            newFeeJackpotAddress != address(0x0),
            "Address cannot be zero address"
        );

        feeJackpotAddress = newFeeJackpotAddress;
    }

    function startGame(address _token, bool _isEther) external onlyOwner {
        isRunning = true;
        notRunningReason = "";
        gameToken = _token;
        isEther = _isEther;
        emit GameStarted();
    }

    function stopGame(bytes calldata reason) external onlyOwner {
        isRunning = false;
        notRunningReason = reason;
        emit GameStopped(reason);
    }

    ////////////////////////////////
    /// Game controller role
    ////////////////////////////////
    function createPool(
        bytes calldata poolId,
        uint256 minBetAmount,
        uint256 maxBetAmount,
        uint256 poolBetsLimit
    ) external onlyGameController {
        pools[poolId].isOpen = true;
        pools[poolId].minBetAmount = minBetAmount;
        pools[poolId].maxBetAmount = maxBetAmount;
        pools[poolId].poolBetsLimit = poolBetsLimit;
    }

    function startRound(
        bytes calldata poolId,
        uint256 timeMS,
        uint256 tradesStartTimeMS,
        uint256 tradesEndTimeMS,
        uint256 price
    ) external onlyGameController onlyOpenPool(poolId) {
        Round storage currentRound = pools[poolId];

         require(currentRound.startPrice == 0, "Round already started for this pool");

        if (currentRound.startPrice == 0) {
            require(
                isRunning,
                "The game is not running, rounds can only be ended at this point"
            );
            currentRound.startPrice = price;
            currentRound.roundStartTime = timeMS;
            currentRound.tradesStartTimeMS = tradesStartTimeMS;
            currentRound.tradesEndTimeMS = tradesEndTimeMS;

            emit RoundStarted(
                poolId,
                timeMS,
                currentRound.startPrice,
                currentRound.minBetAmount,
                currentRound.maxBetAmount,
                currentRound.poolBetsLimit,
                poolId
            );
        } else {
            revert PendingDistributions();
        }
    }

    function endRound(
        bytes calldata poolId,
        uint256 timeMS,
        uint256 price,
        uint256 batchSize
    ) external onlyGameController onlyOpenPool(poolId) {
        Round storage currentRound = pools[poolId];

        if (currentRound.endPrice == 0) {
            currentRound.endPrice = price;

            emit RoundEnded(
                poolId,
                timeMS,
                currentRound.startPrice,
                currentRound.endPrice,
                poolId
            );

            distribute(poolId, batchSize, timeMS);
        } else {
            revert PendingDistributions();
        }
    }

    function distribute(
        bytes calldata poolId,
        uint256 batchSize,
        uint256 timeMS
    ) public onlyGameController onlyOpenPool(poolId) {
        Round storage round = pools[poolId];

        if (
            round.upBetGroup.bets.length == 0 ||
            round.downBetGroup.bets.length == 0 ||
            round.startPrice == round.endPrice
        ) {
            BetGroup storage returnGroupUp = round.upBetGroup;
            BetGroup storage returnGroupDown = round.downBetGroup;

            if (
                returnGroupUp.bets.length > 0 &&
                returnGroupUp.bets.length > returnGroupUp.distributedCount
            ) {
                uint256 fromReturnUp = returnGroupUp.distributedCount;
                returnBets(poolId, returnGroupUp, batchSize);

                emit RoundDistributed(
                    poolId,
                    returnGroupUp.bets.length,
                    fromReturnUp,
                    returnGroupUp.distributedCount,
                    timeMS
                );
            }

            if (
                returnGroupDown.bets.length > 0 &&
                returnGroupDown.bets.length > returnGroupDown.distributedCount
            ) {
                uint256 fromReturnDown = returnGroupDown.distributedCount;
                returnBets(poolId, returnGroupDown, batchSize);

                emit RoundDistributed(
                    poolId,
                    returnGroupDown.bets.length,
                    fromReturnDown,
                    returnGroupDown.distributedCount,
                    timeMS
                );
            }

            if (
                returnGroupUp.distributedCount == returnGroupUp.bets.length &&
                returnGroupDown.distributedCount == returnGroupDown.bets.length
            ) {
                clearPool(poolId);
            }
        } else {
            BetGroup storage winners = round.startPrice < round.endPrice
                ? round.upBetGroup
                : round.downBetGroup;
            BetGroup storage losers = round.startPrice < round.endPrice
                ? round.downBetGroup
                : round.upBetGroup;

            uint256 totalRewards = losers.total;
            uint256 feeAmount = (totalRewards * feePercentage) / 10000;
            uint256 jackpotFeeAmount = (totalRewards * feeJackpotPercentage) /
                10000;
            uint256 totalAllocations = totalRewards -
                feeAmount -
                jackpotFeeAmount;
            uint256 pending = winners.bets.length - winners.distributedCount;
            uint256 limit = pending > batchSize ? batchSize : pending;
            uint256 to = winners.distributedCount + limit;

            for (uint i = winners.distributedCount; i < to; i++) {
                uint256 winnings = (winners.bets[i] * totalAllocations) /
                    winners.total;

                sendEther(winners.addresses[i], winnings + winners.bets[i]);
                emit TradeWinningsSent(
                    poolId,
                    winners.addresses[i],
                    winners.bets[i],
                    winnings,
                    winners.addresses[i],
                    feePercentage,
                    feeJackpotPercentage
                );
                winners.totalDistributed = winners.totalDistributed + winnings;
            }

            emit RoundDistributed(
                poolId,
                winners.bets.length,
                winners.distributedCount,
                to,
                timeMS
            );

            winners.distributedCount = to;
            if (winners.distributedCount == winners.bets.length) {
                sendEther(feeAddress, feeAmount);
                sendEther(feeJackpotAddress, jackpotFeeAmount);

                //Send leftovers to fee address
                uint256 balance = isEther
                    ? getContractBalance()
                    : IERC20(gameToken).balanceOf(address(this));
                sendEther(feeAddress, balance);

                clearPool(poolId);
            }
        }
    }

    ////////////////////////////////
    /// User role
    ////////////////////////////////
    function makeTrade(
        MakeTradeStruct calldata userTrade
    ) external payable onlyOpenPool(userTrade.poolId) onlyGameRunning {
        uint256 amount = isEther ? msg.value : userTrade.bet;

        require(
            amount >= pools[userTrade.poolId].minBetAmount,
            "Trade amount should be higher than the minimum"
        );
        require(
            amount <= pools[userTrade.poolId].maxBetAmount,
            "Trade amount should be lower than the maximum"
        );
        require(
            block.timestamp <= pools[userTrade.poolId].tradesEndTimeMS,
            "Round is closing"
        );

        //Prevent making trade while round starts
        require(
            block.timestamp >= pools[userTrade.poolId].tradesStartTimeMS,
            "Round not started yet"
        );

        if (!isEther) {
            IERC20 token = IERC20(gameToken);
            address sender = msg.sender;
            uint256 balance = token.balanceOf(sender);
            uint256 allowance = token.allowance(sender, address(this));

            require(allowance >= amount, "Insufficient allowance");
            require(balance >= amount, "Insufficient balance");

            // Transfer tokens from sender to contract
            token.safeTransferFrom(sender, address(this), amount);
        }

        BetGroup storage targetBetGroup = userTrade.upOrDown
            ? pools[userTrade.poolId].upBetGroup
            : pools[userTrade.poolId].downBetGroup;

        require(
            targetBetGroup.bets.length <=
                pools[userTrade.poolId].poolBetsLimit - 1,
            "Pool is full, wait for next round"
        );

        uint256 newTotal = addBet(
            targetBetGroup,
            amount
        );

        emit TradePlaced(
            userTrade.poolId,
            msg.sender,
            amount,
            userTrade.upOrDown ? "UP" : "DOWN",
            newTotal,
            userTrade.poolId,
            msg.sender,
            pools[userTrade.poolId].roundStartTime
        );
    }

    ////////////////////////////////
    /// Private call methods
    ////////////////////////////////
    function clearPool (
        bytes calldata poolId
    ) private {
        delete pools[poolId].upBetGroup;
        delete pools[poolId].downBetGroup;
        delete pools[poolId].startPrice;
        delete pools[poolId].endPrice;
    }

    function addBet(
        BetGroup storage betGroup,
        uint256 amount
    ) private returns (uint256) {
        betGroup.bets.push(amount);
        betGroup.addresses.push(msg.sender);
        betGroup.total += amount;
        return betGroup.total;
    }

    function returnBets(
        bytes calldata poolId,
        BetGroup storage group,
        uint256 batchSize
    ) private {
        uint256 pending = group.bets.length - group.distributedCount;
        uint256 limit = pending > batchSize ? batchSize : pending;
        uint256 to = group.distributedCount + limit;

        for (uint i = group.distributedCount; i < to; i++) {
            sendEther(group.addresses[i], group.bets[i]);
            emit TradeReturned(
                poolId,
                group.addresses[i],
                group.bets[i]
            );
        }

        group.distributedCount = to;
    }

    function sendEther(address to, uint256 amount) private {
        if (amount > 0) {
            if (isEther) {
                (bool sent, ) = payable(to).call{value: amount}("");
                require(sent, "Couldn't send ether");
            } else {
                IERC20 tokenContract = IERC20(gameToken);
                tokenContract.safeTransfer(to, amount);
            }
        }
    }

    ////////////////////////////////
    /// View methods
    ////////////////////////////////
    function getContractBalance() public view returns (uint256) {
        return address(this).balance;
    }

    function getContractBalance(
        bool checkTokenBalance
    ) public view returns (uint256) {
        require(
            checkTokenBalance,
            "checkTokenBalance must be true for token balance"
        );
        IERC20 tokenContract = IERC20(gameToken);
        return tokenContract.balanceOf(address(this));
    }

    function hasPendingDistributions(
        bytes calldata poolId
    ) external view returns (bool) {
        return
            (pools[poolId].upBetGroup.bets.length +
                pools[poolId].downBetGroup.bets.length) > 0;
    }

    function isPoolOpen(bytes calldata poolId) public view returns (bool) {
        return pools[poolId].isOpen;
    }

    function isRoundStarted(bytes calldata poolId) public view returns (bool) {
        Round storage currentRound = pools[poolId];
        return currentRound.startPrice != 0 && currentRound.endPrice == 0;
    }
}

File 2 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 4 of 8 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 5 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 6 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(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);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"newGameController","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"PendingDistributions","type":"error"},{"anonymous":false,"inputs":[],"name":"GameStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"GameStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"totalWinners","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"from","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"to","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RoundDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endPrice","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"indexedPoolId","type":"bytes"}],"name":"RoundEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minTradeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxTradeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"poolTradesLimit","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"indexedPoolId","type":"bytes"}],"name":"RoundStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"prediction","type":"string"},{"indexed":false,"internalType":"uint256","name":"newTotal","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"indexedPoolId","type":"bytes"},{"indexed":true,"internalType":"address","name":"indexedSender","type":"address"},{"indexed":false,"internalType":"uint256","name":"roundStartTime","type":"uint256"}],"name":"TradePlaced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TradeReturned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"poolId","type":"bytes"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tradeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winningsAmount","type":"uint256"},{"indexed":true,"internalType":"address","name":"indexedSender","type":"address"},{"indexed":false,"internalType":"uint256","name":"feePercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeJackpotPercentage","type":"uint256"}],"name":"TradeWinningsSent","type":"event"},{"inputs":[{"internalType":"address","name":"newGameControllerAddress","type":"address"}],"name":"changeGameControllerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeAddress","type":"address"}],"name":"changeGameFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeJackpotAddress","type":"address"}],"name":"changeGameFeeJackpotAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeJackpotPercentage","type":"uint256"}],"name":"changeGameFeeJackpotPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeePercentage","type":"uint256"}],"name":"changeGameFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"},{"internalType":"uint256","name":"minBetAmount","type":"uint256"},{"internalType":"uint256","name":"maxBetAmount","type":"uint256"},{"internalType":"uint256","name":"poolBetsLimit","type":"uint256"}],"name":"createPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"},{"internalType":"uint256","name":"batchSize","type":"uint256"},{"internalType":"uint256","name":"timeMS","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"},{"internalType":"uint256","name":"timeMS","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"batchSize","type":"uint256"}],"name":"endRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeJackpotAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeJackpotPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"checkTokenBalance","type":"bool"}],"name":"getContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"}],"name":"hasPendingDistributions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"}],"name":"isPoolOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"}],"name":"isRoundStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRunning","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes","name":"poolId","type":"bytes"},{"internalType":"bool","name":"upOrDown","type":"bool"},{"internalType":"uint256","name":"bet","type":"uint256"}],"internalType":"struct TradeGameV5.MakeTradeStruct","name":"userTrade","type":"tuple"}],"name":"makeTrade","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"notRunningReason","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"pools","outputs":[{"internalType":"bool","name":"isOpen","type":"bool"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"endPrice","type":"uint256"},{"internalType":"uint256","name":"minBetAmount","type":"uint256"},{"internalType":"uint256","name":"maxBetAmount","type":"uint256"},{"internalType":"uint256","name":"poolBetsLimit","type":"uint256"},{"internalType":"uint256","name":"roundStartTime","type":"uint256"},{"internalType":"uint256","name":"tradesStartTimeMS","type":"uint256"},{"internalType":"uint256","name":"tradesEndTimeMS","type":"uint256"},{"components":[{"internalType":"uint256[]","name":"bets","type":"uint256[]"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"distributedCount","type":"uint256"},{"internalType":"uint256","name":"totalDistributed","type":"uint256"}],"internalType":"struct TradeGameV5.BetGroup","name":"upBetGroup","type":"tuple"},{"components":[{"internalType":"uint256[]","name":"bets","type":"uint256[]"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"distributedCount","type":"uint256"},{"internalType":"uint256","name":"totalDistributed","type":"uint256"}],"internalType":"struct TradeGameV5.BetGroup","name":"downBetGroup","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_isEther","type":"bool"}],"name":"startGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"poolId","type":"bytes"},{"internalType":"uint256","name":"timeMS","type":"uint256"},{"internalType":"uint256","name":"tradesStartTimeMS","type":"uint256"},{"internalType":"uint256","name":"tradesEndTimeMS","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"startRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"stopGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080346100c657601f61294738819003918201601f19168301916001600160401b038311848410176100cb578084926020946040528339810103126100c657516001600160a01b0390818116908190036100c65760005460018060a01b0319903382821617600055604051933391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a36103e860015560006002553381600454161760045533816005541617600555600354161760035561286590816100e28239f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b60003560e01c9081630c2f915e14611dc257508063159dc63414611da45780631c2db19214611d575780631d0d625b14611d0a5780632014e5d114611ce757806320b474be14611c6d57806330efabd414611c2a57806334bb02f2146118d7578063358d0145146117f65780633b9fe1ee146117cd5780633fafac921461169c5780634127535814611673578063595dc897146116265780636518a0a91461155257806367d74d1c14610e905780636f9fb98a14610e74578063715018a614610e1b5780638da5cb5b14610df2578063992819cf14610d84578063a001ecdd14610d66578063c3dfdae614610d3d578063e470996914610ca9578063e7bb1c6014610bb9578063eab79b7d146109f1578063f15412ba146104b9578063f2fde38b146103f5578063f58fda0814610386578063f68256a81461035d5763fcf34c811461015e57600080fd5b346103585760a0366003190112610358576004356001600160401b0381116103585761018e903690600401611e38565b9060243590608435926101ac60018060a01b036003541633146121eb565b6101c260ff6101bb8385612236565b541661224f565b604051818382376020818381016009815203019020926001840193845415801561030757156102f55760ff600854161561028a57857f8c5ef155d5700c1b4b45a6e58530fb75846d27eb552f9c8a8ed906c53200f70995558160068201556044356007820155606435600882015560038101549060056004820154910154916040518587823780868101600081520390209761026b60405197889760c0895260c08901916121ca565b94602087015260408601526060850152608084015260a08301520390a2005b60405162461bcd60e51b815260206004820152603f60248201527f5468652067616d65206973206e6f742072756e6e696e672c20726f756e64732060448201527f63616e206f6e6c7920626520656e646564206174207468697320706f696e74006064820152608490fd5b60405163d56be5db60e01b8152600490fd5b60405162461bcd60e51b815260206004820152602360248201527f526f756e6420616c7265616479207374617274656420666f72207468697320706044820152621bdbdb60ea1b6064820152608490fd5b600080fd5b34610358576000366003190112610358576003546040516001600160a01b039091168152602090f35b34610358576020366003190112610358576004356103a261210f565b61271081116103b057600155005b60405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206665652070657263656e746167652076616c75650000000000006044820152606490fd5b346103585760203660031901126103585761040e611e65565b61041661210f565b6001600160a01b0390811690811561046557600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b34610358576104c7366120d5565b906104dd60018060a01b036003541633146121eb565b6104ec60ff6101bb8688612236565b604051848682376020818681016009815203019020600281018054156000146102f5577f76c95e20f3dd4f09029b4778c6a95eb0314959b104a44f4e1eb64c818266a62391836001925501546040518688823780878101600081520390209260405191829160808352610563608084018a8c6121ca565b91886020850152604084015260608301520390a261058c60018060a01b036003541633146121eb565b61059b60ff6101bb8587612236565b6040518385823760208185810160098152030190209160098301541580156109e5575b80156109d4575b156106d157600e830191600984015480151590816106c3575b5061067d575b8254801515908161066f575b5061062d575b5050600c820154600983015414918261061d575b505061061257005b61061b916125bc565b005b601101549054149050838061060a565b6000805160206127f0833981519152916106656011860191610653835494878a8c612631565b855492546040519485948a8c8761232f565b0390a184806105f6565b9050601185015410876105f0565b6000805160206127f083398151915285876106bb85600c890180546106a78860098d018888612631565b60098b01549154916040519687968761232f565b0390a16105e4565b9050600c85015410876105de565b82916002600161072a950154818501541193846000146109ca5760098101945b156109c257600e015b01549261072f6127109485610711600154836122a5565b04968796610721600254846122a5565b049687926122d8565b6122d8565b610758825493610744600385015480966122d8565b818111156109b75750939291935b836122e5565b9283925b838110610881575050806000805160206127f0833981519152888a610791600395549887878701548b6040519687968761232f565b0390a101551461079d57005b6004546107c7926107b6916001600160a01b0316612723565b6005546001600160a01b0316612723565b60ff60085460081c166000146107f65761061b916107f1475b6004546001600160a01b0316612723565b6125bc565b6006546040516370a0823160e01b81523060048201529290602090849060249082906001600160a01b03165afa9283156108755760009361083f575b506107f161061b936107e0565b92506020833d60201161086d575b8161085a60209383611e96565b81010312610358579151916107f1610832565b3d915061084d565b6040513d6000823e3d90fd5b8293506108b06108a583610899846109ae9697612301565b90549060031b1c6122a5565b6002860154906122b8565b600185016108f36108c18483612301565b905460039190911b1c6001600160a01b03166108ed6108e0868a612301565b90549060031b1c856122e5565b90612723565b7f02300dbde6caed640514e02ad18a51d4843768f22567699ce94c69c2c8b358488c8c6109208685612301565b905460039190911b1c6001600160a01b031661094d87610940818d612301565b90549060031b1c96612301565b60018060a01b0391549060031b1c16946001546002549161097a60405196879660c08089528801916121ca565b9360208601526040850152876060850152608084015260a08301520390a26109a7600486019182546122e5565b90556122f2565b9083929161075c565b905093929193610752565b6009016106fa565b600e8101946106f1565b5060018301546002840154146105c5565b50600e830154156105be565b3461035857602080600319360112610358576001600160401b039060043582811161035857610a24903690600401611e38565b919092610a2f61210f565b60ff19600854166008558211610ba357610a4a600754612076565b601f8111610b5c575b506000601f8311600114610ac6577fbbed56c796999ec9481de9169e54d6f193c57a335189c8b82053d80e263fdbd69383610ab692600091610abb575b508460011b906000198660031b1c1916176007555b6040519383859485528401916121ca565b0390a1005b905081013586610a90565b601f1983169060076000526000805160206128108339815191529160005b818110610b455750917fbbed56c796999ec9481de9169e54d6f193c57a335189c8b82053d80e263fdbd6959185610ab69410610b2b575b5050600184811b01600755610aa5565b820135600019600387901b60f8161c191690558580610b1b565b91928460018192868a013581550194019201610ae4565b610b93906007600052600080516020612810833981519152601f850160051c810191848610610b99575b601f0160051c01906121b3565b83610a53565b9091508190610b86565b634e487b7160e01b600052604160045260246000fd5b34610358576020806003193601126103585760043580159081150361035857610c4c576006546040516370a0823160e01b8152306004820152908290829060249082906001600160a01b03165afa90811561087557600091610c1f575b50604051908152f35b90508181813d8311610c45575b610c368183611e96565b81010312610358575182610c16565b503d610c2c565b6084906040519062461bcd60e51b82526004820152603060248201527f636865636b546f6b656e42616c616e6365206d7573742062652074727565206660448201526f6f7220746f6b656e2062616c616e636560801b6064820152fd5b346103585760206005610cbb366120d5565b95929391610cd460018060a01b036003541633146121eb565b6040518584823784818781016009815203019020600160ff19825416179055600360405186858237858188810160098152030190200155600460405185848237848187810160098152030190200155826040519384928337810160098152030190200155600080f35b34610358576000366003190112610358576006546040516001600160a01b039091168152602090f35b34610358576000366003190112610358576020600154604051908152f35b34610358576020366003190112610358576004356001600160401b038111610358576020610db781923690600401611e38565b919082604051938492833781016009815203019020600181015415159081610de5575b506040519015158152f35b6002915001541582610dda565b34610358576000366003190112610358576000546040516001600160a01b039091168152602090f35b3461035857600036600319011261035857610e3461210f565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461035857600036600319011261035857602047604051908152f35b60206003198181360112610358576001600160401b03916004358381116103585760608160040193823603011261035857610ed960ff6101bb610ed3868061235e565b90612236565b60085460ff81161561150d5760081c60ff16936003919085156115025734955b610f03868061235e565b604051959181908737850194868160099788815203019020015487106114a657600485610f30888061235e565b91908260405193849283378101888152030190200154871161144b57600885610f59888061235e565b91908260405193849283378101888152030190200154421161141357600785610f82888061235e565b9190826040519384928337810188815203019020015442106113d65715611228575b5060240192610fb284612390565b15611200578183610fc3838061235e565b919082604051938492833781018481520301902001915b825493600581610fea858061235e565b91908260405193849283378101868152030190200154600019908181019081116111ea57861161119b57680100000000000000009586811015610ba3578060016110379201875586612301565b819291549060031b918a831b921b19161790556001840191825495861015610ba35760026110ce956110938861115e9660017ffba5b61aecd627931f77333352c21ea1cea5c9ce4c23b1a39ed6ea9a4dfd9eed9b018155612301565b81549060031b9033821b9160018060a01b03901b191617905501976110b9818a546122e5565b8099556110c6858061235e565b969098612390565b156111715761114661110b60066040516110e781611e7b565b6002815261055560f41b87820152945b866111028a8061235e565b94909a8061235e565b92836040519485938437820190815203019020015496816040519283928337810160008152039020986040519760c0895260c08901916121ca565b923390870152604086015284820360608601526120b0565b94608083015260a08201528033940390a3005b61114661110b600660405161118581611e7b565b60048152632227aba760e11b87820152946110f7565b60405162461bcd60e51b815260048101839052602160248201527f506f6f6c2069732066756c6c2c207761697420666f72206e65787420726f756e6044820152601960fa1b6064820152608490fd5b634e487b7160e01b600052601160045260246000fd5b600e8361120d838061235e565b91908260405193849283378101868152030190200191610fda565b6006546040516370a0823160e01b81523360048201526024926001600160a01b03909216919086818581865afa908115610875576000916113a9575b50604051636eb1769f60e11b815233600482015230858201528781604481875afa8015610875578a91600091611378575b501061133b578811611300576040516323b872dd60e01b87820152338482015230604482015260648082018a905281529260a08401918211848310176112ec5750604052602492916112e69161239d565b90610fa4565b634e487b7160e01b60009081526041600452fd5b60405162461bcd60e51b81526004810187905260148185015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b60405162461bcd60e51b81526004810188905260168186015275496e73756666696369656e7420616c6c6f77616e636560501b6044820152606490fd5b809250898092503d83116113a2575b6113918183611e96565b81010312610358578990518b611295565b503d611387565b90508681813d83116113cf575b6113c08183611e96565b81010312610358575189611264565b503d6113b6565b60405162461bcd60e51b8152600481018690526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606490fd5b60405162461bcd60e51b815260048101869052601060248201526f526f756e6420697320636c6f73696e6760801b6044820152606490fd5b60405162461bcd60e51b815260048101869052602d60248201527f547261646520616d6f756e742073686f756c64206265206c6f7765722074686160448201526c6e20746865206d6178696d756d60981b6064820152608490fd5b60405162461bcd60e51b815260048101869052602e60248201527f547261646520616d6f756e742073686f756c642062652068696768657220746860448201526d616e20746865206d696e696d756d60901b6064820152608490fd5b604482013595610ef9565b60405162461bcd60e51b815260048101849052601760248201527f5468652067616d65206973206e6f742072756e6e696e670000000000000000006044820152606490fd5b3461035857600036600319011261035857604051600060075461157481612076565b808452906001908181169081156115ff57506001146115b6575b6115b28461159e81860382611e96565b6040519182916020835260208301906120b0565b0390f35b6007600090815292506000805160206128108339815191525b8284106115e757505050810160200161159e8261158e565b805460208587018101919091529093019281016115cf565b60ff191660208087019190915292151560051b8501909201925061159e915083905061158e565b346103585760203660031901126103585761163f611e65565b61164761210f565b6001600160a01b031661165b811515612167565b6001600160601b0360a01b6004541617600455600080f35b34610358576000366003190112610358576004546040516001600160a01b039091168152602090f35b34610358576020366003190112610358576004356001600160401b0381116103585736602382011215610358578060040135906116d882611eb7565b6116e56040519182611e96565b8281526020810190366024858501011161035857600060208561171e966024839701863783010152604051938492839251928391611ed2565b8101600981520301902060ff8154166115b26001830154926117be600282015491600381015460048201546005830154600684015490600785015492600886015494611778600e61177160098a01611ef5565b9801611ef5565b986040519c8d9c15158d5260208d015260408c015260608b015260808a015260a089015260c088015260e087015261010086015261016080610120870152850190611fd6565b90838203610140850152611fd6565b34610358576000366003190112610358576005546040516001600160a01b039091168152602090f35b346103585760403660031901126103585761180f611e65565b602435908115158092036103585761182561210f565b60018060ff19600854161760085561183e600754612076565b601f81116118a5575b5050600060075560018060a01b03166001600160601b0360a01b600654161760065561ff006008549160081b169061ff001916176008557f762f260439bb4be3ef6e4dc2786e2e7bd187d3d80b79057d7a424fe98563e335600080a1005b601f600080516020612810833981519152910160051c8101905b8181106118cc5750611847565b6000815582016118bf565b34610358576060366003190112610358576004356001600160401b03811161035857611907903690600401611e38565b60243561191f60018060a01b036003541633146121eb565b61192e60ff6101bb8486612236565b60405182848237602081848101600981520301902090600982018054158015611c1e575b8015611c0d575b15611a4257600e83019181548015159081611a34575b506119f1575b825480151590816119e3575b5061199e575b50600c830154905414918261061d57505061061257005b6011840180546000805160206127f0833981519152926119c09086898b612631565b6119da8554925492604051938493604435928b8d8761232f565b0390a185611987565b905060118501541087611981565b6000805160206127f0833981519152600c8501805490611a1384868a8c612631565b611a2c89865492546040519485948c604435948761232f565b0390a1611975565b9050600c850154108761196f565b91600261072a93600183015482840154119283600014611c035781935b15611bfd57600e9150015b015491611a9a6127109384611a81600154836122a5565b04958695611a91600254846122a5565b049586926122d8565b611abe835492611aaf600386015480956122d8565b81811115611bf65750836122e5565b915b828110611af95750508060038354936000805160206127f083398151915285896107918c8787870154604051958695604435948761232f565b80611b19611b0e84610899611bf19589612301565b6002870154906122b8565b60018601611b49611b2a8483612301565b905460039190911b1c6001600160a01b03166108ed6108e0868b612301565b7f02300dbde6caed640514e02ad18a51d4843768f22567699ce94c69c2c8b358488b8b89611b978761094081611b7f818a612301565b905460039190911b1c6001600160a01b031694612301565b60018060a01b0391549060031b1c169460015460025491611bc460405196879660c08089528801916121ca565b9360208601526040850152876060850152608084015260a08301520390a26109a7600487019182546122e5565b611ac0565b9050610752565b50611a6a565b600e810193611a5f565b506001830154600284015414611959565b50600e83015415611952565b34610358576020366003190112610358576004356001600160401b0381116103585760ff611c61610ed36020933690600401611e38565b54166040519015158152f35b3461035857602036600319011261035857600435611c8961210f565b6127108111611c9757600255005b60405162461bcd60e51b815260206004820152602260248201527f57726f6e67206a61636b706f74206665652070657263656e746167652076616c604482015261756560f01b6064820152608490fd5b3461035857600036600319011261035857602060ff600854166040519015158152f35b3461035857602036600319011261035857611d23611e65565b611d2b61210f565b6001600160a01b0316611d3f811515612167565b6001600160601b0360a01b6003541617600355600080f35b3461035857602036600319011261035857611d70611e65565b611d7861210f565b6001600160a01b0316611d8c811515612167565b6001600160601b0360a01b6005541617600555600080f35b34610358576000366003190112610358576020600254604051908152f35b34610358576020366003190112610358576004356001600160401b03811161035857602091600e600984611dfd611e2e953690600401611e38565b92909483868237828185810184815203019020015493826040519384928337810160098152030190200154906122e5565b1515604051908152f35b9181601f84011215610358578235916001600160401b038311610358576020838186019501011161035857565b600435906001600160a01b038216820361035857565b604081019081106001600160401b03821117610ba357604052565b90601f801991011681019081106001600160401b03821117610ba357604052565b6001600160401b038111610ba357601f01601f191660200190565b60005b838110611ee55750506000910152565b8181015183820152602001611ed5565b9060405160a08101928184106001600160401b03851117610ba35783604052819381549081815260c084019060009284845260209283852091855b85828210611fc35750611f4d93505050869003609f190182611e96565b84526001918284019060405193848484549182815201938352848320925b818110611fa757505050509160809391611f89826004950383611e96565b85015260028101546040850152600381015460608501520154910152565b83546001600160a01b0316855293850193928201928201611f6b565b8454845260019485019493019201611f30565b9060a0810191805160a08352805180945260c083019360208092019060005b8181106120625750505080820151938381038285015281808651928381520195019160005b8281106120455750505050608081604082930151604085015260608101516060850152015191015290565b83516001600160a01b03168752958101959281019260010161201a565b825187529583019591830191600101611ff5565b90600182811c921680156120a6575b602083101461209057565b634e487b7160e01b600052602260045260246000fd5b91607f1691612085565b906020916120c981518092818552858086019101611ed2565b601f01601f1916010190565b608060031982011261035857600435906001600160401b038211610358576120ff91600401611e38565b9091602435906044359060643590565b6000546001600160a01b0316330361212357565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561216e57565b60405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e6e6f74206265207a65726f206164647265737300006044820152606490fd5b8181106121be575050565b600081556001016121b3565b908060209392818452848401376000828201840152601f01601f1916010190565b156121f257565b606460405162461bcd60e51b815260206004820152602060248201527f4f6e6c792067616d6520636f6e74726f6c6c65722063616e20646f20746869736044820152fd5b6020908260405193849283378101600981520301902090565b1561225657565b60405162461bcd60e51b815260206004820152602160248201527f5468697320706f6f6c20686173206120726f756e6420696e2070726f677265736044820152607360f81b6064820152608490fd5b818102929181159184041417156111ea57565b81156122c2570490565b634e487b7160e01b600052601260045260246000fd5b919082039182116111ea57565b919082018092116111ea57565b60001981146111ea5760010190565b80548210156123195760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b92969594916080949161234a9160a0865260a08601916121ca565b966020840152604083015260608201520152565b903590601e198136030182121561035857018035906001600160401b0382116103585760200191813603831361035857565b3580151581036103585790565b60018060a01b0316906123fc6040516123b581611e7b565b6020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af16123f6612499565b916124c9565b80519182159184831561246e575b5050509050156124175750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126124955782015190811515820361249257508038808461240a565b80fd5b5080fd5b3d156124c4573d906124aa82611eb7565b916124b86040519384611e96565b82523d6000602084013e565b606090565b9192901561252b57508151156124dd575090565b3b156124e65790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561253e5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906125629060248301906120b0565b0390fd5b9080612570575050565b612585916000526020600020908101906121b3565b565b600460009161259a815484835582612566565b6125ac60018201805490858155612566565b8260028201558260038201550155565b60009160206002926125e260096040518584823784818781018481520301902001612587565b612601600e604051858482378481878101600981520301902001612587565b84600160405185848237848187810160098152030190200155826040519384928337810160098152030190200155565b9291909281549360039261265e8482019561264e875480996122d8565b8181111561271c57505b876122e5565b955b86811061266f57505050505055565b807f0ef369ab00174499e32a26cfe220b3dd58fad9d231e8319504ce52fa0801e0b46126d06126d561271794600187016126a98282612301565b90546001600160a01b0395918d1b1c85168c6126c5858c612301565b9054911b1c90612723565b612301565b905490891b1c166126e68386612301565b905490891b1c906040908151928392612706606080865285018b8d6121ca565b9260208501528301520390a16122f2565b612660565b9050612658565b8161272c575050565b60ff60085460081c1660001461279b576000918291829182916001600160a01b03165af1612758612499565b501561276057565b60405162461bcd60e51b815260206004820152601360248201527221b7bab6323713ba1039b2b7321032ba3432b960691b6044820152606490fd5b60065460405163a9059cbb60e01b60208201526001600160a01b039283166024820152604480820194909452928352608083019291166001600160401b03831182841017610ba3576125859260405261239d56feb820b0d4081c55dc0645407ca8590224b29395e4b862a37ff100f763ef0b04d1a66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688a26469706673582212202e060086baeb6ab9c2a40c3388a1d4f4d827956e363f649731666e4c765731b064736f6c63430008130033000000000000000000000000942924d8f3368725239724cf94a0a844bf4eacd4

Deployed Bytecode

0x608080604052600436101561001357600080fd5b60003560e01c9081630c2f915e14611dc257508063159dc63414611da45780631c2db19214611d575780631d0d625b14611d0a5780632014e5d114611ce757806320b474be14611c6d57806330efabd414611c2a57806334bb02f2146118d7578063358d0145146117f65780633b9fe1ee146117cd5780633fafac921461169c5780634127535814611673578063595dc897146116265780636518a0a91461155257806367d74d1c14610e905780636f9fb98a14610e74578063715018a614610e1b5780638da5cb5b14610df2578063992819cf14610d84578063a001ecdd14610d66578063c3dfdae614610d3d578063e470996914610ca9578063e7bb1c6014610bb9578063eab79b7d146109f1578063f15412ba146104b9578063f2fde38b146103f5578063f58fda0814610386578063f68256a81461035d5763fcf34c811461015e57600080fd5b346103585760a0366003190112610358576004356001600160401b0381116103585761018e903690600401611e38565b9060243590608435926101ac60018060a01b036003541633146121eb565b6101c260ff6101bb8385612236565b541661224f565b604051818382376020818381016009815203019020926001840193845415801561030757156102f55760ff600854161561028a57857f8c5ef155d5700c1b4b45a6e58530fb75846d27eb552f9c8a8ed906c53200f70995558160068201556044356007820155606435600882015560038101549060056004820154910154916040518587823780868101600081520390209761026b60405197889760c0895260c08901916121ca565b94602087015260408601526060850152608084015260a08301520390a2005b60405162461bcd60e51b815260206004820152603f60248201527f5468652067616d65206973206e6f742072756e6e696e672c20726f756e64732060448201527f63616e206f6e6c7920626520656e646564206174207468697320706f696e74006064820152608490fd5b60405163d56be5db60e01b8152600490fd5b60405162461bcd60e51b815260206004820152602360248201527f526f756e6420616c7265616479207374617274656420666f72207468697320706044820152621bdbdb60ea1b6064820152608490fd5b600080fd5b34610358576000366003190112610358576003546040516001600160a01b039091168152602090f35b34610358576020366003190112610358576004356103a261210f565b61271081116103b057600155005b60405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206665652070657263656e746167652076616c75650000000000006044820152606490fd5b346103585760203660031901126103585761040e611e65565b61041661210f565b6001600160a01b0390811690811561046557600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b34610358576104c7366120d5565b906104dd60018060a01b036003541633146121eb565b6104ec60ff6101bb8688612236565b604051848682376020818681016009815203019020600281018054156000146102f5577f76c95e20f3dd4f09029b4778c6a95eb0314959b104a44f4e1eb64c818266a62391836001925501546040518688823780878101600081520390209260405191829160808352610563608084018a8c6121ca565b91886020850152604084015260608301520390a261058c60018060a01b036003541633146121eb565b61059b60ff6101bb8587612236565b6040518385823760208185810160098152030190209160098301541580156109e5575b80156109d4575b156106d157600e830191600984015480151590816106c3575b5061067d575b8254801515908161066f575b5061062d575b5050600c820154600983015414918261061d575b505061061257005b61061b916125bc565b005b601101549054149050838061060a565b6000805160206127f0833981519152916106656011860191610653835494878a8c612631565b855492546040519485948a8c8761232f565b0390a184806105f6565b9050601185015410876105f0565b6000805160206127f083398151915285876106bb85600c890180546106a78860098d018888612631565b60098b01549154916040519687968761232f565b0390a16105e4565b9050600c85015410876105de565b82916002600161072a950154818501541193846000146109ca5760098101945b156109c257600e015b01549261072f6127109485610711600154836122a5565b04968796610721600254846122a5565b049687926122d8565b6122d8565b610758825493610744600385015480966122d8565b818111156109b75750939291935b836122e5565b9283925b838110610881575050806000805160206127f0833981519152888a610791600395549887878701548b6040519687968761232f565b0390a101551461079d57005b6004546107c7926107b6916001600160a01b0316612723565b6005546001600160a01b0316612723565b60ff60085460081c166000146107f65761061b916107f1475b6004546001600160a01b0316612723565b6125bc565b6006546040516370a0823160e01b81523060048201529290602090849060249082906001600160a01b03165afa9283156108755760009361083f575b506107f161061b936107e0565b92506020833d60201161086d575b8161085a60209383611e96565b81010312610358579151916107f1610832565b3d915061084d565b6040513d6000823e3d90fd5b8293506108b06108a583610899846109ae9697612301565b90549060031b1c6122a5565b6002860154906122b8565b600185016108f36108c18483612301565b905460039190911b1c6001600160a01b03166108ed6108e0868a612301565b90549060031b1c856122e5565b90612723565b7f02300dbde6caed640514e02ad18a51d4843768f22567699ce94c69c2c8b358488c8c6109208685612301565b905460039190911b1c6001600160a01b031661094d87610940818d612301565b90549060031b1c96612301565b60018060a01b0391549060031b1c16946001546002549161097a60405196879660c08089528801916121ca565b9360208601526040850152876060850152608084015260a08301520390a26109a7600486019182546122e5565b90556122f2565b9083929161075c565b905093929193610752565b6009016106fa565b600e8101946106f1565b5060018301546002840154146105c5565b50600e830154156105be565b3461035857602080600319360112610358576001600160401b039060043582811161035857610a24903690600401611e38565b919092610a2f61210f565b60ff19600854166008558211610ba357610a4a600754612076565b601f8111610b5c575b506000601f8311600114610ac6577fbbed56c796999ec9481de9169e54d6f193c57a335189c8b82053d80e263fdbd69383610ab692600091610abb575b508460011b906000198660031b1c1916176007555b6040519383859485528401916121ca565b0390a1005b905081013586610a90565b601f1983169060076000526000805160206128108339815191529160005b818110610b455750917fbbed56c796999ec9481de9169e54d6f193c57a335189c8b82053d80e263fdbd6959185610ab69410610b2b575b5050600184811b01600755610aa5565b820135600019600387901b60f8161c191690558580610b1b565b91928460018192868a013581550194019201610ae4565b610b93906007600052600080516020612810833981519152601f850160051c810191848610610b99575b601f0160051c01906121b3565b83610a53565b9091508190610b86565b634e487b7160e01b600052604160045260246000fd5b34610358576020806003193601126103585760043580159081150361035857610c4c576006546040516370a0823160e01b8152306004820152908290829060249082906001600160a01b03165afa90811561087557600091610c1f575b50604051908152f35b90508181813d8311610c45575b610c368183611e96565b81010312610358575182610c16565b503d610c2c565b6084906040519062461bcd60e51b82526004820152603060248201527f636865636b546f6b656e42616c616e6365206d7573742062652074727565206660448201526f6f7220746f6b656e2062616c616e636560801b6064820152fd5b346103585760206005610cbb366120d5565b95929391610cd460018060a01b036003541633146121eb565b6040518584823784818781016009815203019020600160ff19825416179055600360405186858237858188810160098152030190200155600460405185848237848187810160098152030190200155826040519384928337810160098152030190200155600080f35b34610358576000366003190112610358576006546040516001600160a01b039091168152602090f35b34610358576000366003190112610358576020600154604051908152f35b34610358576020366003190112610358576004356001600160401b038111610358576020610db781923690600401611e38565b919082604051938492833781016009815203019020600181015415159081610de5575b506040519015158152f35b6002915001541582610dda565b34610358576000366003190112610358576000546040516001600160a01b039091168152602090f35b3461035857600036600319011261035857610e3461210f565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461035857600036600319011261035857602047604051908152f35b60206003198181360112610358576001600160401b03916004358381116103585760608160040193823603011261035857610ed960ff6101bb610ed3868061235e565b90612236565b60085460ff81161561150d5760081c60ff16936003919085156115025734955b610f03868061235e565b604051959181908737850194868160099788815203019020015487106114a657600485610f30888061235e565b91908260405193849283378101888152030190200154871161144b57600885610f59888061235e565b91908260405193849283378101888152030190200154421161141357600785610f82888061235e565b9190826040519384928337810188815203019020015442106113d65715611228575b5060240192610fb284612390565b15611200578183610fc3838061235e565b919082604051938492833781018481520301902001915b825493600581610fea858061235e565b91908260405193849283378101868152030190200154600019908181019081116111ea57861161119b57680100000000000000009586811015610ba3578060016110379201875586612301565b819291549060031b918a831b921b19161790556001840191825495861015610ba35760026110ce956110938861115e9660017ffba5b61aecd627931f77333352c21ea1cea5c9ce4c23b1a39ed6ea9a4dfd9eed9b018155612301565b81549060031b9033821b9160018060a01b03901b191617905501976110b9818a546122e5565b8099556110c6858061235e565b969098612390565b156111715761114661110b60066040516110e781611e7b565b6002815261055560f41b87820152945b866111028a8061235e565b94909a8061235e565b92836040519485938437820190815203019020015496816040519283928337810160008152039020986040519760c0895260c08901916121ca565b923390870152604086015284820360608601526120b0565b94608083015260a08201528033940390a3005b61114661110b600660405161118581611e7b565b60048152632227aba760e11b87820152946110f7565b60405162461bcd60e51b815260048101839052602160248201527f506f6f6c2069732066756c6c2c207761697420666f72206e65787420726f756e6044820152601960fa1b6064820152608490fd5b634e487b7160e01b600052601160045260246000fd5b600e8361120d838061235e565b91908260405193849283378101868152030190200191610fda565b6006546040516370a0823160e01b81523360048201526024926001600160a01b03909216919086818581865afa908115610875576000916113a9575b50604051636eb1769f60e11b815233600482015230858201528781604481875afa8015610875578a91600091611378575b501061133b578811611300576040516323b872dd60e01b87820152338482015230604482015260648082018a905281529260a08401918211848310176112ec5750604052602492916112e69161239d565b90610fa4565b634e487b7160e01b60009081526041600452fd5b60405162461bcd60e51b81526004810187905260148185015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b60405162461bcd60e51b81526004810188905260168186015275496e73756666696369656e7420616c6c6f77616e636560501b6044820152606490fd5b809250898092503d83116113a2575b6113918183611e96565b81010312610358578990518b611295565b503d611387565b90508681813d83116113cf575b6113c08183611e96565b81010312610358575189611264565b503d6113b6565b60405162461bcd60e51b8152600481018690526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606490fd5b60405162461bcd60e51b815260048101869052601060248201526f526f756e6420697320636c6f73696e6760801b6044820152606490fd5b60405162461bcd60e51b815260048101869052602d60248201527f547261646520616d6f756e742073686f756c64206265206c6f7765722074686160448201526c6e20746865206d6178696d756d60981b6064820152608490fd5b60405162461bcd60e51b815260048101869052602e60248201527f547261646520616d6f756e742073686f756c642062652068696768657220746860448201526d616e20746865206d696e696d756d60901b6064820152608490fd5b604482013595610ef9565b60405162461bcd60e51b815260048101849052601760248201527f5468652067616d65206973206e6f742072756e6e696e670000000000000000006044820152606490fd5b3461035857600036600319011261035857604051600060075461157481612076565b808452906001908181169081156115ff57506001146115b6575b6115b28461159e81860382611e96565b6040519182916020835260208301906120b0565b0390f35b6007600090815292506000805160206128108339815191525b8284106115e757505050810160200161159e8261158e565b805460208587018101919091529093019281016115cf565b60ff191660208087019190915292151560051b8501909201925061159e915083905061158e565b346103585760203660031901126103585761163f611e65565b61164761210f565b6001600160a01b031661165b811515612167565b6001600160601b0360a01b6004541617600455600080f35b34610358576000366003190112610358576004546040516001600160a01b039091168152602090f35b34610358576020366003190112610358576004356001600160401b0381116103585736602382011215610358578060040135906116d882611eb7565b6116e56040519182611e96565b8281526020810190366024858501011161035857600060208561171e966024839701863783010152604051938492839251928391611ed2565b8101600981520301902060ff8154166115b26001830154926117be600282015491600381015460048201546005830154600684015490600785015492600886015494611778600e61177160098a01611ef5565b9801611ef5565b986040519c8d9c15158d5260208d015260408c015260608b015260808a015260a089015260c088015260e087015261010086015261016080610120870152850190611fd6565b90838203610140850152611fd6565b34610358576000366003190112610358576005546040516001600160a01b039091168152602090f35b346103585760403660031901126103585761180f611e65565b602435908115158092036103585761182561210f565b60018060ff19600854161760085561183e600754612076565b601f81116118a5575b5050600060075560018060a01b03166001600160601b0360a01b600654161760065561ff006008549160081b169061ff001916176008557f762f260439bb4be3ef6e4dc2786e2e7bd187d3d80b79057d7a424fe98563e335600080a1005b601f600080516020612810833981519152910160051c8101905b8181106118cc5750611847565b6000815582016118bf565b34610358576060366003190112610358576004356001600160401b03811161035857611907903690600401611e38565b60243561191f60018060a01b036003541633146121eb565b61192e60ff6101bb8486612236565b60405182848237602081848101600981520301902090600982018054158015611c1e575b8015611c0d575b15611a4257600e83019181548015159081611a34575b506119f1575b825480151590816119e3575b5061199e575b50600c830154905414918261061d57505061061257005b6011840180546000805160206127f0833981519152926119c09086898b612631565b6119da8554925492604051938493604435928b8d8761232f565b0390a185611987565b905060118501541087611981565b6000805160206127f0833981519152600c8501805490611a1384868a8c612631565b611a2c89865492546040519485948c604435948761232f565b0390a1611975565b9050600c850154108761196f565b91600261072a93600183015482840154119283600014611c035781935b15611bfd57600e9150015b015491611a9a6127109384611a81600154836122a5565b04958695611a91600254846122a5565b049586926122d8565b611abe835492611aaf600386015480956122d8565b81811115611bf65750836122e5565b915b828110611af95750508060038354936000805160206127f083398151915285896107918c8787870154604051958695604435948761232f565b80611b19611b0e84610899611bf19589612301565b6002870154906122b8565b60018601611b49611b2a8483612301565b905460039190911b1c6001600160a01b03166108ed6108e0868b612301565b7f02300dbde6caed640514e02ad18a51d4843768f22567699ce94c69c2c8b358488b8b89611b978761094081611b7f818a612301565b905460039190911b1c6001600160a01b031694612301565b60018060a01b0391549060031b1c169460015460025491611bc460405196879660c08089528801916121ca565b9360208601526040850152876060850152608084015260a08301520390a26109a7600487019182546122e5565b611ac0565b9050610752565b50611a6a565b600e810193611a5f565b506001830154600284015414611959565b50600e83015415611952565b34610358576020366003190112610358576004356001600160401b0381116103585760ff611c61610ed36020933690600401611e38565b54166040519015158152f35b3461035857602036600319011261035857600435611c8961210f565b6127108111611c9757600255005b60405162461bcd60e51b815260206004820152602260248201527f57726f6e67206a61636b706f74206665652070657263656e746167652076616c604482015261756560f01b6064820152608490fd5b3461035857600036600319011261035857602060ff600854166040519015158152f35b3461035857602036600319011261035857611d23611e65565b611d2b61210f565b6001600160a01b0316611d3f811515612167565b6001600160601b0360a01b6003541617600355600080f35b3461035857602036600319011261035857611d70611e65565b611d7861210f565b6001600160a01b0316611d8c811515612167565b6001600160601b0360a01b6005541617600555600080f35b34610358576000366003190112610358576020600254604051908152f35b34610358576020366003190112610358576004356001600160401b03811161035857602091600e600984611dfd611e2e953690600401611e38565b92909483868237828185810184815203019020015493826040519384928337810160098152030190200154906122e5565b1515604051908152f35b9181601f84011215610358578235916001600160401b038311610358576020838186019501011161035857565b600435906001600160a01b038216820361035857565b604081019081106001600160401b03821117610ba357604052565b90601f801991011681019081106001600160401b03821117610ba357604052565b6001600160401b038111610ba357601f01601f191660200190565b60005b838110611ee55750506000910152565b8181015183820152602001611ed5565b9060405160a08101928184106001600160401b03851117610ba35783604052819381549081815260c084019060009284845260209283852091855b85828210611fc35750611f4d93505050869003609f190182611e96565b84526001918284019060405193848484549182815201938352848320925b818110611fa757505050509160809391611f89826004950383611e96565b85015260028101546040850152600381015460608501520154910152565b83546001600160a01b0316855293850193928201928201611f6b565b8454845260019485019493019201611f30565b9060a0810191805160a08352805180945260c083019360208092019060005b8181106120625750505080820151938381038285015281808651928381520195019160005b8281106120455750505050608081604082930151604085015260608101516060850152015191015290565b83516001600160a01b03168752958101959281019260010161201a565b825187529583019591830191600101611ff5565b90600182811c921680156120a6575b602083101461209057565b634e487b7160e01b600052602260045260246000fd5b91607f1691612085565b906020916120c981518092818552858086019101611ed2565b601f01601f1916010190565b608060031982011261035857600435906001600160401b038211610358576120ff91600401611e38565b9091602435906044359060643590565b6000546001600160a01b0316330361212357565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561216e57565b60405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e6e6f74206265207a65726f206164647265737300006044820152606490fd5b8181106121be575050565b600081556001016121b3565b908060209392818452848401376000828201840152601f01601f1916010190565b156121f257565b606460405162461bcd60e51b815260206004820152602060248201527f4f6e6c792067616d6520636f6e74726f6c6c65722063616e20646f20746869736044820152fd5b6020908260405193849283378101600981520301902090565b1561225657565b60405162461bcd60e51b815260206004820152602160248201527f5468697320706f6f6c20686173206120726f756e6420696e2070726f677265736044820152607360f81b6064820152608490fd5b818102929181159184041417156111ea57565b81156122c2570490565b634e487b7160e01b600052601260045260246000fd5b919082039182116111ea57565b919082018092116111ea57565b60001981146111ea5760010190565b80548210156123195760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b92969594916080949161234a9160a0865260a08601916121ca565b966020840152604083015260608201520152565b903590601e198136030182121561035857018035906001600160401b0382116103585760200191813603831361035857565b3580151581036103585790565b60018060a01b0316906123fc6040516123b581611e7b565b6020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af16123f6612499565b916124c9565b80519182159184831561246e575b5050509050156124175750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126124955782015190811515820361249257508038808461240a565b80fd5b5080fd5b3d156124c4573d906124aa82611eb7565b916124b86040519384611e96565b82523d6000602084013e565b606090565b9192901561252b57508151156124dd575090565b3b156124e65790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561253e5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906125629060248301906120b0565b0390fd5b9080612570575050565b612585916000526020600020908101906121b3565b565b600460009161259a815484835582612566565b6125ac60018201805490858155612566565b8260028201558260038201550155565b60009160206002926125e260096040518584823784818781018481520301902001612587565b612601600e604051858482378481878101600981520301902001612587565b84600160405185848237848187810160098152030190200155826040519384928337810160098152030190200155565b9291909281549360039261265e8482019561264e875480996122d8565b8181111561271c57505b876122e5565b955b86811061266f57505050505055565b807f0ef369ab00174499e32a26cfe220b3dd58fad9d231e8319504ce52fa0801e0b46126d06126d561271794600187016126a98282612301565b90546001600160a01b0395918d1b1c85168c6126c5858c612301565b9054911b1c90612723565b612301565b905490891b1c166126e68386612301565b905490891b1c906040908151928392612706606080865285018b8d6121ca565b9260208501528301520390a16122f2565b612660565b9050612658565b8161272c575050565b60ff60085460081c1660001461279b576000918291829182916001600160a01b03165af1612758612499565b501561276057565b60405162461bcd60e51b815260206004820152601360248201527221b7bab6323713ba1039b2b7321032ba3432b960691b6044820152606490fd5b60065460405163a9059cbb60e01b60208201526001600160a01b039283166024820152604480820194909452928352608083019291166001600160401b03831182841017610ba3576125859260405261239d56feb820b0d4081c55dc0645407ca8590224b29395e4b862a37ff100f763ef0b04d1a66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688a26469706673582212202e060086baeb6ab9c2a40c3388a1d4f4d827956e363f649731666e4c765731b064736f6c63430008130033

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

000000000000000000000000942924d8f3368725239724cf94a0a844bf4eacd4

-----Decoded View---------------
Arg [0] : newGameController (address): 0x942924d8f3368725239724Cf94a0A844bF4EAcD4

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000942924d8f3368725239724cf94a0a844bf4eacd4


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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