ETH Price: $3,167.08 (-0.70%)

Contract

0xEdaf7dDCEB55c5b14a96f57e31Cb34a796a118Ed
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Settle Round182797192023-10-04 21:04:23467 days ago1696453463IN
0xEdaf7dDC...796a118Ed
0 ETH0.0022547311.87475892
Join Game182793002023-10-04 19:39:47467 days ago1696448387IN
0xEdaf7dDC...796a118Ed
0 ETH0.001288913.16515197
Join Game182791912023-10-04 19:17:47467 days ago1696447067IN
0xEdaf7dDC...796a118Ed
0 ETH0.0030271322.9149807
Add Contract Fun...182791812023-10-04 19:15:47467 days ago1696446947IN
0xEdaf7dDC...796a118Ed
0 ETH0.0009571713.49877369
Start New Round182791772023-10-04 19:14:59467 days ago1696446899IN
0xEdaf7dDC...796a118Ed
0 ETH0.0013471512.97526513
Settle Round182791252023-10-04 19:04:35467 days ago1696446275IN
0xEdaf7dDC...796a118Ed
0 ETH0.0026968114.20305695
Join Game182789732023-10-04 18:33:59467 days ago1696444439IN
0xEdaf7dDC...796a118Ed
0 ETH0.0011502611.74905087
Join Game182788522023-10-04 18:09:47467 days ago1696442987IN
0xEdaf7dDC...796a118Ed
0 ETH0.0019803514.99098019
Add Contract Fun...182787372023-10-04 17:46:23467 days ago1696441583IN
0xEdaf7dDC...796a118Ed
0 ETH0.0011575216.32436538
Start New Round182787312023-10-04 17:45:11467 days ago1696441511IN
0xEdaf7dDC...796a118Ed
0 ETH0.0017356816.71741476
Claim Prize182785562023-10-04 17:10:11467 days ago1696439411IN
0xEdaf7dDC...796a118Ed
0 ETH0.0007133525
Settle Round182785232023-10-04 17:03:35467 days ago1696439015IN
0xEdaf7dDC...796a118Ed
0 ETH0.010240139.14758684
Join Game182784942023-10-04 16:57:47467 days ago1696438667IN
0xEdaf7dDC...796a118Ed
0 ETH0.0016211216.55849718
Join Game182784892023-10-04 16:56:47467 days ago1696438607IN
0xEdaf7dDC...796a118Ed
0 ETH0.0016465416.81812871
Join Game182784252023-10-04 16:43:59467 days ago1696437839IN
0xEdaf7dDC...796a118Ed
0 ETH0.0016581716.93695253
Join Game182783572023-10-04 16:29:59467 days ago1696436999IN
0xEdaf7dDC...796a118Ed
0 ETH0.0015664416
Join Game182780372023-10-04 15:25:59467 days ago1696433159IN
0xEdaf7dDC...796a118Ed
0 ETH0.001610516.45002027
Join Game182779492023-10-04 15:07:59467 days ago1696432079IN
0xEdaf7dDC...796a118Ed
0 ETH0.0020689115.66139774
Add Contract Fun...182779402023-10-04 15:06:11467 days ago1696431971IN
0xEdaf7dDC...796a118Ed
0 ETH0.0012293817.33776104
Start New Round182779352023-10-04 15:05:11467 days ago1696431911IN
0xEdaf7dDC...796a118Ed
0 ETH0.0018443317.76391793
Settle Round182731792023-10-03 23:08:23468 days ago1696374503IN
0xEdaf7dDC...796a118Ed
0 ETH0.002870788.61313408
Join Game182731482023-10-03 23:02:11468 days ago1696374131IN
0xEdaf7dDC...796a118Ed
0 ETH0.000757857.74092361
Set Current Roun...182731382023-10-03 23:00:11468 days ago1696374011IN
0xEdaf7dDC...796a118Ed
0 ETH0.000301228.70156069
Join Game182731012023-10-03 22:52:47468 days ago1696373567IN
0xEdaf7dDC...796a118Ed
0 ETH0.000767587.84024283
Set Current Roun...182730972023-10-03 22:51:59468 days ago1696373519IN
0xEdaf7dDC...796a118Ed
0 ETH0.000312279.02098825
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
QuizGame

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : qgame_flattened.sol
// SPDX-License-Identifier: MIT

// https://playquiz.xyz

// File: @openzeppelin/contracts/utils/math/SafeMath.sol


// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

// File: @looksrare/contracts-libs/contracts/interfaces/IReentrancyGuard.sol


pragma solidity ^0.8.17;

/**
 * @title IReentrancyGuard
 * @author LooksRare protocol team (👀,💎)
 */
interface IReentrancyGuard {
    /**
     * @notice This is returned when there is a reentrant call.
     */
    error ReentrancyFail();
}

// File: @looksrare/contracts-libs/contracts/ReentrancyGuard.sol


pragma solidity ^0.8.17;

// Interfaces


/**
 * @title ReentrancyGuard
 * @notice This contract protects against reentrancy attacks.
 *         It is adjusted from OpenZeppelin.
 * @author LooksRare protocol team (👀,💎)
 */
abstract contract ReentrancyGuard is IReentrancyGuard {
    uint256 private _status;

    /**
     * @notice Modifier to wrap functions to prevent reentrancy calls.
     */
    modifier nonReentrant() {
        if (_status == 2) {
            revert ReentrancyFail();
        }

        _status = 2;
        _;
        _status = 1;
    }

    constructor() {
        _status = 1;
    }
}

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


// 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: @openzeppelin/contracts/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;
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol



pragma solidity ^0.8.0;


/**
 * @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() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: contracts/qgame.sol


/*
    https://playquiz.xyz
*/
pragma solidity ^0.8.0;






contract QuizGame is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    IERC20 public gameToken;

    // 80% of the pot that is shared between winners
    // 20% goes to the treasury to account for fees and promotions
    uint256 public prizePercentage = 80;

    // Time before startDate to start blocking new users joining the game
    uint256 public joinGameDeadline = 2 minutes;
    uint256 public maxPlayers = 1000;
    uint256 public currentRoundId = 0;

    mapping(uint256 => Game) public games;

    // The total each address can withdraw
    mapping(address => uint256) public unclaimedPrizes;

    // The total each address has of free play credits
    // This is used for promotional purposes.
    // This amount cannot be withdrawn, it can only be used
    // to play games for free.
    mapping(address => uint256) public freePlayCredits;

    // Total unclaimed balance summing all of unclaimedPrizes
    uint256 unclaimedTotal = 0;

    // Total free play credits summing all of freePlayCredits
    uint256 freePlayCreditsTotal = 0;

    // Allow claiming/withdrawing prizes
    // Clam will be disabled during our
    // pre-launch free games
    // Then after the token launch it will open
    bool public claimEnabled = false;

    // Allow users to play with free play credits
    bool public freePlayCreditsEnabled = true;

    struct Player {
        bool joined;
        uint256 score;
    }

    struct Game {
        uint256 roundId;
        uint256 entryPrice;
        uint256 totalPot;
        uint256 prizePerWinner;
        uint256 playerCount;
        uint256 numQuestions;
        uint256 startDate;
        bool settled;
        mapping(address => Player) players;
        address[] playerList;
        mapping(uint256 => address[]) scoreToWallet;
    }

    event NewRoundOpen(uint256 roundId, uint256 startDate);
    event AdditionalFundsAddedToRound(uint256 roundId, uint256 value);
    event PlayerJoined(uint256 roundId, address player, uint256 entryPrice);
    event RoundSettled(uint256 roundId, uint256 totalPrize, uint256 prizePerWinner, address[] winners);
    event ClaimedPrize(address winner, uint256 prize);
    event FreePlayCreditsGiven(address[] players, uint256 credits);
    event FreePlayCreditsRemoved(address[] players, uint256 totalRemoved);

    event StartDateUpdated(uint256 roundId, uint256 startDate);

    modifier lastRoundSettled() {
        require(games[currentRoundId].settled, "Current round not settled yet");
        _;
    }

    constructor(
        address _gameTokenAdd,
        uint256 _maxPlayers,
        uint256 _prizePercentage
    ) {
        gameToken = IERC20(_gameTokenAdd);
        maxPlayers = _maxPlayers;
        prizePercentage = _prizePercentage;

        // Create an empty round id = 0, settled = true
        Game storage g = games[currentRoundId];
        g.roundId = currentRoundId;
        g.entryPrice = 0;
        g.settled = true;
    }

    /**
        Allows users to claim their available prizes.
        Function requires claimEnabled to be set true
        and that the user balance of unclaimed prizes
        is greater than 0.

        The user unclaimed prize balance is stored in
        `unclaimedPrizes` and the contract's total
        unclaimed balance is stores in `unclaimedTotal`
        After successfully sending the tokens to the user,
        this function will zero the user's unclaimed balance
        and subtract this amount from the contrac't unclaimed
        total.
    */

    function claimPrize() external nonReentrant {
        require(claimEnabled, "Withdrawing not enabled yet.");
        uint256 playerPrize = unclaimedPrizes[msg.sender];
        require(playerPrize > 0, "No prize to claim");

        bool claimed = gameToken.transfer(
            msg.sender,
            playerPrize
        );

        require(claimed, "Failed to claim prize");

        unclaimedTotal = unclaimedTotal.sub(playerPrize);
        unclaimedPrizes[msg.sender] = 0;
        emit ClaimedPrize(msg.sender, playerPrize);
    }

    function startNewRound(
        uint256 _roundId,
        uint256 _entryPrice,
        uint256 _startDate,
        uint256 _numQuestions
    ) external onlyOwner nonReentrant lastRoundSettled {

        require(_roundId > currentRoundId, "Use incremental roundId numbers");

        currentRoundId = _roundId;

        Game storage g = games[currentRoundId];
        g.roundId = _roundId;
        g.entryPrice = _entryPrice;
        g.startDate = _startDate;
        g.numQuestions = _numQuestions;

        emit NewRoundOpen(_roundId, _startDate);
    }

    function joinGame() external payable nonReentrant {
        Game storage g = games[currentRoundId];

        require(g.settled == false, "Game has settled");
        require(block.timestamp < (g.startDate - joinGameDeadline), "Game not available to join");
        require(g.playerCount < maxPlayers, "Max players reached");
        require(
            g.players[msg.sender].joined == false,
            "User already joined"
        );
        bool paid = false;
        //uint256 storage unclaimedPlayerBalance = unclaimedPrizes[msg.sender];
        //uint256 storage playerFreePlayCredits = freePlayCredits[msg.sender];

        // Free game, don't charge
        if (g.entryPrice == 0) {
            paid = true;
        }

            // If the player has free credits balance, then use it instead of
            // using unclaimed balance or transferring tokens
        else if (freePlayCreditsEnabled && freePlayCreditsTotal >= g.entryPrice) {
            freePlayCredits[msg.sender] = freePlayCredits[msg.sender].sub(g.entryPrice);
            freePlayCreditsTotal = freePlayCreditsTotal.sub(g.entryPrice);
            paid = true;
        }

            // If the player has unclaimed balance, then use it instead of
            // transferring tokens
        else if (unclaimedPrizes[msg.sender] >= g.entryPrice) {
            unclaimedPrizes[msg.sender] = unclaimedPrizes[msg.sender].sub(g.entryPrice);
            unclaimedTotal = unclaimedTotal.sub(g.entryPrice);
            paid = true;
        }
            // The game is not free and the player does not have
            // free credits or unclaimed prizes, then transfer tokens
        else {
            require(
                gameToken.allowance(msg.sender, address(this)) >= g.entryPrice,
                "Not enough allowance"
            );
            paid = gameToken.transferFrom(
                msg.sender,
                address(this),
                g.entryPrice
            );
        }

        require(paid, "Failed to pay the entry price");

        Player memory p;
        p.joined = true;
        p.score = 0;

        g.players[msg.sender] = p;
        g.playerList.push(msg.sender);
        g.totalPot = g.totalPot.add(g.entryPrice);
        ++g.playerCount;

        emit PlayerJoined(currentRoundId, msg.sender, g.entryPrice);
    }

    function forceSettleRound() external onlyOwner nonReentrant {
        Game storage g = games[currentRoundId];
        g.settled = true;
    }

    function settleRound(uint256[] memory correctAnswers, address[] memory winnersAddresses, uint256 maxScore) external onlyOwner nonReentrant {
        Game storage g = games[currentRoundId];
        require(!g.settled, "Game has already been settled");
        require(correctAnswers.length == g.numQuestions, "Incorrect answers length");
        require(winnersAddresses.length <= g.playerCount, "Mismatch between contract joined players and answers array");

        uint256 totalPrize = 0;
        uint256 prizePerWinner = 0;

        // Store winners only if maxScore is > 0
        // If nobody makes any point, then it is not considered a win
        if(maxScore > 0) {
            // Save scores
            for (uint256 i = 0; i < winnersAddresses.length; i++) {
                require(
                    g.players[winnersAddresses[i]].joined == true,
                    "Sent answer address has not joined in current game"
                );
                g.players[winnersAddresses[i]].score = maxScore;
                g.scoreToWallet[maxScore].push(winnersAddresses[i]);
            }

            // Compute prize
            totalPrize = g.totalPot.mul(prizePercentage).div(100);
            // Divide the prize by the total number of winners
            prizePerWinner = totalPrize.div(g.scoreToWallet[maxScore].length);

            g.prizePerWinner = prizePerWinner;
            for (uint256 i = 0; i < g.scoreToWallet[maxScore].length; i++) {
                unclaimedPrizes[g.scoreToWallet[maxScore][i]] = unclaimedPrizes[g.scoreToWallet[maxScore][i]].add(prizePerWinner);
            }
            unclaimedTotal = unclaimedTotal.add(totalPrize);
        }

        g.settled = true;

        emit RoundSettled(
            g.roundId,
            totalPrize,
            prizePerWinner,
            g.scoreToWallet[maxScore]
        );
    }

    function setGameToken(address _tokenAddress) external onlyOwner nonReentrant {
        gameToken = IERC20(_tokenAddress);
    }

    // Add funds from the Contract to the current game's total pot
    // This will be used for promotions and free games where
    // funds from the treasury will be used as prizes
    function addContractFundsToRound(uint256 value) external payable onlyOwner nonReentrant {
        Game storage g = games[currentRoundId];
        require(g.settled == false, "Game has settled");
        require(
            getAvailableContractBalance() >= value,
            "Not enough balance in the contract"
        );

        g.totalPot = g.totalPot.add(value);
        emit AdditionalFundsAddedToRound(currentRoundId, value);
    }

    function setMaxPlayers(uint256 _maxPlayers) external onlyOwner {
        maxPlayers = _maxPlayers;
    }

    function getPlayerScore(uint256 _gameId, address _player) public view returns (uint256) {
        return games[_gameId].players[_player].score;
    }

    function getPlayerList(uint256 _gameId) public view returns (address[] memory){
        Game storage g = games[_gameId];
        address[] memory addresses = new address[](g.playerCount);
        for (uint i = 0; i < g.playerCount; i++) {
            addresses[i] = g.playerList[i];
        }
        return addresses;
    }

    function getEntryPrice(uint256 _gameId) public view returns (uint256){
        return games[_gameId].entryPrice;
    }

    function getTotalPot(uint256 _gameId) public view returns (uint256){
        return games[_gameId].totalPot;
    }

    function getPrizePerWinner(uint256 _gameId) public view returns (uint256){
        return games[_gameId].prizePerWinner;
    }

    function getPlayerCount(uint256 _gameId) public view returns (uint256){
        return games[_gameId].playerCount;
    }

    function getNumQuestions(uint256 _gameId) public view returns (uint256){
        return games[_gameId].numQuestions;
    }

    function getStartDate(uint256 _gameId) public view returns (uint256){
        return games[_gameId].startDate;
    }

    function isGameSettled(uint256 _gameId) public view returns (bool){
        return games[_gameId].settled;
    }

    function getUnclaimedTotal() external view returns (uint256) {
        return unclaimedTotal;
    }

    function getFreePlayCreditsTotal() external view returns (uint256) {
        return freePlayCreditsTotal;
    }

    function getAvailableContractBalance() public view returns (uint256) {
        return gameToken.balanceOf(address(this))
        .sub(unclaimedTotal)
        .sub(games[currentRoundId].settled ? 0 : games[currentRoundId].totalPot)
        .sub(freePlayCreditsTotal);
    }

    function getPlayerUnclaimedPrize(address _player) public view returns (uint256) {
        return unclaimedPrizes[_player];
    }

    function getPlayerFreeCredits(address _player) public view returns (uint256) {
        return freePlayCredits[_player];
    }

    function withdrawAvailableBalance(address to) external onlyOwner nonReentrant {
        uint256 value = getAvailableContractBalance();
        gameToken.transfer(to, value);
    }

    function withdrawBalance(address to, uint256 value) external onlyOwner nonReentrant {
        require(getAvailableContractBalance() >= value, "Not enough balance");
        gameToken.transfer(to, value);
    }

    function setCurrentRoundStartDate(uint256 _startDate) external onlyOwner nonReentrant {
        games[currentRoundId].startDate = _startDate;
        emit StartDateUpdated(currentRoundId, _startDate);
    }

    function setJoinGameDeadline(uint256 _joinGameDeadline) external onlyOwner {
        joinGameDeadline = _joinGameDeadline;
    }

    function setClaimEnabled(bool _claimEnabled) external onlyOwner nonReentrant {
        claimEnabled = _claimEnabled;
    }

    function setFreePlayCreditsEnabled(bool _freePlayCreditsEnabled) external onlyOwner nonReentrant {
        freePlayCreditsEnabled = _freePlayCreditsEnabled;
    }

    function setPrizePercentage(uint256 _prizePercentage) external onlyOwner {
        prizePercentage = _prizePercentage;
    }

    function giveFreeCredits(address[] memory players, uint256 credits) external onlyOwner nonReentrant {
        require(credits > 0, "credits should be greater than 0");
        require(players.length > 0, "There should be at least one player");

        uint256 total = players.length.mul(credits);
        require(total < getAvailableContractBalance(), "Not enough contract balance");

        for (uint256 i = 0; i < players.length; i++) {
            freePlayCredits[players[i]] = freePlayCredits[players[i]].add(credits);
        }
        freePlayCreditsTotal = freePlayCreditsTotal.add(total);
        emit FreePlayCreditsGiven(players, credits);
    }

    function removeFreeCredits(address[] memory players) external onlyOwner nonReentrant {
        require(players.length > 0, "There should be at least one player");

        uint256 totalRemoved = 0;

        for (uint256 i = 0; i < players.length; i++) {
            totalRemoved = totalRemoved.add(freePlayCredits[players[i]]);
            freePlayCredits[players[i]] = 0;
        }
        freePlayCreditsTotal = freePlayCreditsTotal.sub(totalRemoved);
        emit FreePlayCreditsRemoved(players, totalRemoved);
    }

    function emergencyWithdrawToken(address tokenAddress, address to) external onlyOwner {
        IERC20 token = IERC20(tokenAddress);
        uint256 tokenBalance = token.balanceOf(address(this));
        require(tokenBalance > 0, "No tokens to withdraw");

        token.transfer(to, tokenBalance);
    }

    function emergencyWithdrawEther(address payable to) external onlyOwner {
        uint256 contractBalance = address(this).balance;
        require(contractBalance > 0, "No Ether to withdraw");

        (bool success, ) = to.call{value: contractBalance}("");
        require(success, "Withdraw failed");
    }

    function withdrawExcessFunds(address payable to) external onlyOwner nonReentrant {
        payable(to).transfer(address(this).balance);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_gameTokenAdd","type":"address"},{"internalType":"uint256","name":"_maxPlayers","type":"uint256"},{"internalType":"uint256","name":"_prizePercentage","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyFail","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"AdditionalFundsAddedToRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"prize","type":"uint256"}],"name":"ClaimedPrize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"players","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"credits","type":"uint256"}],"name":"FreePlayCreditsGiven","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"players","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"totalRemoved","type":"uint256"}],"name":"FreePlayCreditsRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startDate","type":"uint256"}],"name":"NewRoundOpen","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":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"entryPrice","type":"uint256"}],"name":"PlayerJoined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalPrize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prizePerWinner","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"winners","type":"address[]"}],"name":"RoundSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startDate","type":"uint256"}],"name":"StartDateUpdated","type":"event"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"addContractFundsToRound","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentRoundId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"emergencyWithdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"emergencyWithdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"forceSettleRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freePlayCredits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freePlayCreditsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"games","outputs":[{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"uint256","name":"entryPrice","type":"uint256"},{"internalType":"uint256","name":"totalPot","type":"uint256"},{"internalType":"uint256","name":"prizePerWinner","type":"uint256"},{"internalType":"uint256","name":"playerCount","type":"uint256"},{"internalType":"uint256","name":"numQuestions","type":"uint256"},{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"bool","name":"settled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getEntryPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFreePlayCreditsTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getNumQuestions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getPlayerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_player","type":"address"}],"name":"getPlayerFreeCredits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getPlayerList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"},{"internalType":"address","name":"_player","type":"address"}],"name":"getPlayerScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_player","type":"address"}],"name":"getPlayerUnclaimedPrize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getPrizePerWinner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getStartDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"getTotalPot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnclaimedTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"players","type":"address[]"},{"internalType":"uint256","name":"credits","type":"uint256"}],"name":"giveFreeCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameId","type":"uint256"}],"name":"isGameSettled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joinGame","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"joinGameDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"players","type":"address[]"}],"name":"removeFreeCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_claimEnabled","type":"bool"}],"name":"setClaimEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startDate","type":"uint256"}],"name":"setCurrentRoundStartDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_freePlayCreditsEnabled","type":"bool"}],"name":"setFreePlayCreditsEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"setGameToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_joinGameDeadline","type":"uint256"}],"name":"setJoinGameDeadline","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPlayers","type":"uint256"}],"name":"setMaxPlayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizePercentage","type":"uint256"}],"name":"setPrizePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"correctAnswers","type":"uint256[]"},{"internalType":"address[]","name":"winnersAddresses","type":"address[]"},{"internalType":"uint256","name":"maxScore","type":"uint256"}],"name":"settleRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundId","type":"uint256"},{"internalType":"uint256","name":"_entryPrice","type":"uint256"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_numQuestions","type":"uint256"}],"name":"startNewRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"unclaimedPrizes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdrawAvailableBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"withdrawExcessFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052605060035560786004556103e860055560006006819055600a819055600b55600c805461ffff19166101001790553480156200003f57600080fd5b5060405162002d1138038062002d1183398101604081905262000062916200011b565b6200006d33620000cb565b6001808055600280546001600160a01b0319166001600160a01b039590951694909417909355600591909155600355600654600081815260076020819052604082209283558284019190915501805460ff1916909117905562000160565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000606084860312156200013157600080fd5b83516001600160a01b03811681146200014957600080fd5b602085015160409095015190969495509392505050565b612ba180620001706000396000f3fe6080604052600436106102885760003560e01c8063848d192c1161015a578063c983c01a116100c1578063df47203c1161007a578063df47203c1461086a578063e7d141131461088a578063ed885897146108ba578063f1be7a57146108ea578063f2fde38b14610920578063fa55e2b41461094057600080fd5b8063c983c01a146107a3578063d4f0bcf6146107d7578063d4f77b1c146107ec578063d6beded9146107f4578063dbf8a28a1461082a578063deeb2b9c1461084a57600080fd5b8063ab1205e911610113578063ab1205e9146106b3578063af75a7cc146106e3578063b7ba419b14610713578063ba92763a14610733578063c3dfdae614610763578063c617b26a1461078357600080fd5b8063848d192c146105e957806389edb8ed146105fe5780638da5cb5b1461061e5780638e235d061461065057806392929a091461067d5780639cbe5efd1461069d57600080fd5b80634737a072116101fe578063682458bd116101b7578063682458bd1461052f57806370740ac91461054f578063715018a6146105645780637ebb9c25146105795780637f1f4e35146105a957806380d29e66146105c957600080fd5b80634737a072146104795780634c2412a21461049957806351999cb2146104af57806352ac797c146104cf5780635ba32769146104ef578063659a99ea1461050f57600080fd5b806322a5849a1161025057806322a5849a146103d45780632866ed21146103ea578063288dee3b1461040457806331818b0b1461042457806336b9c7fe1461043957806343e23bc61461046657600080fd5b80630cf20cc91461028d5780630e18d662146102af578063117a5b90146102e357806311dc733514610383578063200ad21b146103a7575b600080fd5b34801561029957600080fd5b506102ad6102a83660046125f6565b610955565b005b3480156102bb57600080fd5b50600c546102ce90610100900460ff1681565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b506103466102fe366004612622565b60076020819052600091825260409091208054600182015460028301546003840154600485015460058601546006870154969097015494969395929491939092909160ff1688565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c0830152151560e0820152610100016102da565b34801561038f57600080fd5b5061039960035481565b6040519081526020016102da565b3480156103b357600080fd5b506103c76103c2366004612622565b610a7d565b6040516102da919061267f565b3480156103e057600080fd5b5061039960045481565b3480156103f657600080fd5b50600c546102ce9060ff1681565b34801561041057600080fd5b506102ad61041f366004612622565b610b5e565b34801561043057600080fd5b506102ad610b8d565b34801561044557600080fd5b50610399610454366004612692565b60096020526000908152604090205481565b6102ad610474366004612622565b610c04565b34801561048557600080fd5b506102ad610494366004612622565b610d6c565b3480156104a557600080fd5b5061039960055481565b3480156104bb57600080fd5b506102ad6104ca366004612622565b610e18565b3480156104db57600080fd5b506102ad6104ea3660046126af565b610e47565b3480156104fb57600080fd5b506102ad61050a3660046127c0565b610fbe565b34801561051b57600080fd5b506102ad61052a366004612692565b61145b565b34801561053b57600080fd5b506102ad61054a366004612882565b6114ea565b34801561055b57600080fd5b506102ad611645565b34801561057057600080fd5b506102ad611825565b34801561058557600080fd5b50610399610594366004612622565b60009081526007602052604090206003015490565b3480156105b557600080fd5b506102ad6105c4366004612692565b61185b565b3480156105d557600080fd5b506102ad6105e4366004612692565b6118f2565b3480156105f557600080fd5b50600a54610399565b34801561060a57600080fd5b506102ad6106193660046128c9565b611965565b34801561062a57600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016102da565b34801561065c57600080fd5b5061039961066b366004612692565b60086020526000908152604090205481565b34801561068957600080fd5b506102ad6106983660046128c9565b6119d0565b3480156106a957600080fd5b5061039960065481565b3480156106bf57600080fd5b506103996106ce366004612622565b60009081526007602052604090206004015490565b3480156106ef57600080fd5b506103996106fe366004612622565b60009081526007602052604090206001015490565b34801561071f57600080fd5b506102ad61072e3660046128e6565b611a34565b34801561073f57600080fd5b5061039961074e366004612622565b60009081526007602052604090206006015490565b34801561076f57600080fd5b50600254610638906001600160a01b031681565b34801561078f57600080fd5b5061039961079e36600461292b565b611c61565b3480156107af57600080fd5b506102ce6107be366004612622565b6000908152600760208190526040909120015460ff1690565b3480156107e357600080fd5b50610399611c91565b6102ad611d54565b34801561080057600080fd5b5061039961080f366004612692565b6001600160a01b031660009081526008602052604090205490565b34801561083657600080fd5b506102ad610845366004612622565b61221d565b34801561085657600080fd5b506102ad610865366004612692565b61224c565b34801561087657600080fd5b506102ad610885366004612950565b612355565b34801561089657600080fd5b506103996108a5366004612622565b60009081526007602052604090206005015490565b3480156108c657600080fd5b506103996108d5366004612622565b60009081526007602052604090206002015490565b3480156108f657600080fd5b50610399610905366004612692565b6001600160a01b031660009081526009602052604090205490565b34801561092c57600080fd5b506102ad61093b366004612692565b6124bf565b34801561094c57600080fd5b50600b54610399565b6000546001600160a01b031633146109885760405162461bcd60e51b815260040161097f9061298d565b60405180910390fd5b6001546002036109ab57604051630ddf739360e11b815260040160405180910390fd5b6002600155806109b9611c91565b10156109fc5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161097f565b60025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb906044015b6020604051808303816000875af1158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906129c2565b50506001805550565b600081815260076020526040812060048101546060929067ffffffffffffffff811115610aac57610aac6126e1565b604051908082528060200260200182016040528015610ad5578160200160208202803683370190505b50905060005b8260040154811015610b5657826009018181548110610afc57610afc6129df565b9060005260206000200160009054906101000a90046001600160a01b0316828281518110610b2c57610b2c6129df565b6001600160a01b039092166020928302919091019091015280610b4e81612a0b565b915050610adb565b509392505050565b6000546001600160a01b03163314610b885760405162461bcd60e51b815260040161097f9061298d565b600555565b6000546001600160a01b03163314610bb75760405162461bcd60e51b815260040161097f9061298d565b600154600203610bda57604051630ddf739360e11b815260040160405180910390fd5b60026001908155600654600090815260076020819052604090912001805460ff1916821790558055565b6000546001600160a01b03163314610c2e5760405162461bcd60e51b815260040161097f9061298d565b600154600203610c5157604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff1615610cb15760405162461bcd60e51b815260206004820152601060248201526f11d85b59481a185cc81cd95d1d1b195960821b604482015260640161097f565b81610cba611c91565b1015610d135760405162461bcd60e51b815260206004820152602260248201527f4e6f7420656e6f7567682062616c616e636520696e2074686520636f6e74726160448201526118dd60f21b606482015260840161097f565b6002810154610d22908361255a565b600282015560065460408051918252602082018490527ff577174c617771fc10a88da12f2ac8ce5f3b9ddbde78845c50b5f6ddc08cb57191015b60405180910390a1505060018055565b6000546001600160a01b03163314610d965760405162461bcd60e51b815260040161097f9061298d565b600154600203610db957604051630ddf739360e11b815260040160405180910390fd5b6002600155600680546000908152600760209081526040918290208301849055915481519081529182018390527fb412a2d7de723b82b0a3cae8b10ae2d255e645dd0231a1a4c83cb8e3ebc05bd8910160405180910390a15060018055565b6000546001600160a01b03163314610e425760405162461bcd60e51b815260040161097f9061298d565b600455565b6000546001600160a01b03163314610e715760405162461bcd60e51b815260040161097f9061298d565b600154600203610e9457604051630ddf739360e11b815260040160405180910390fd5b60026001556006546000908152600760208190526040909120015460ff16610efe5760405162461bcd60e51b815260206004820152601d60248201527f43757272656e7420726f756e64206e6f7420736574746c656420796574000000604482015260640161097f565b6006548411610f4f5760405162461bcd60e51b815260206004820152601f60248201527f55736520696e6372656d656e74616c20726f756e644964206e756d6265727300604482015260640161097f565b6006848155600085815260076020908152604091829020878155600181018790559283018590556005830184905581518781529081018590527f69286a075100e2ae2469a1c30e959e736d7b1b08e6d678af3379591b7d351df0910160405180910390a1505060018055505050565b6000546001600160a01b03163314610fe85760405162461bcd60e51b815260040161097f9061298d565b60015460020361100b57604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff16156110785760405162461bcd60e51b815260206004820152601d60248201527f47616d652068617320616c7265616479206265656e20736574746c6564000000604482015260640161097f565b80600501548451146110cc5760405162461bcd60e51b815260206004820152601860248201527f496e636f727265637420616e7377657273206c656e6774680000000000000000604482015260640161097f565b8060040154835111156111475760405162461bcd60e51b815260206004820152603a60248201527f4d69736d61746368206265747765656e20636f6e7472616374206a6f696e656460448201527f20706c617965727320616e6420616e7377657273206172726179000000000000606482015260840161097f565b60008083156113f15760005b85518110156112c357836008016000878381518110611174576111746129df565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615156001146112075760405162461bcd60e51b815260206004820152603260248201527f53656e7420616e73776572206164647265737320686173206e6f74206a6f696e604482015271656420696e2063757272656e742067616d6560701b606482015260840161097f565b84846008016000888481518110611220576112206129df565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206001018190555083600a016000868152602001908152602001600020868281518110611276576112766129df565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806112bb81612a0b565b915050611153565b506112e860646112e2600354866002015461256d90919063ffffffff16565b90612579565b6000858152600a85016020526040902054909250611307908390612579565b60038401819055905060005b6000858152600a850160205260409020548110156113df576000858152600a850160205260408120805461138192859260089286908110611356576113566129df565b60009182526020808320909101546001600160a01b031683528201929092526040019020549061255a565b6000868152600a86016020526040812080546008929190859081106113a8576113a86129df565b60009182526020808320909101546001600160a01b03168352820192909252604001902055806113d781612a0b565b915050611313565b50600a546113ed908361255a565b600a555b60078301805460ff1916600117905582546000858152600a850160205260409081902090517f1cd8465e2ee3902ef973e10c4cfe326c28616ff3b42cc92c5d9d241371b4b6329261144792909186918691612a24565b60405180910390a150506001805550505050565b6000546001600160a01b031633146114855760405162461bcd60e51b815260040161097f9061298d565b6001546002036114a857604051630ddf739360e11b815260040160405180910390fd5b60026001556040516001600160a01b038216904780156108fc02916000818181858888f193505050501580156114e2573d6000803e3d6000fd5b505060018055565b6000546001600160a01b031633146115145760405162461bcd60e51b815260040161097f9061298d565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561155d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115819190612a8e565b9050600081116115cb5760405162461bcd60e51b81526020600482015260156024820152744e6f20746f6b656e7320746f20776974686472617760581b604482015260640161097f565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af115801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906129c2565b5050505050565b60015460020361166857604051630ddf739360e11b815260040160405180910390fd5b6002600155600c5460ff166116bf5760405162461bcd60e51b815260206004820152601c60248201527f5769746864726177696e67206e6f7420656e61626c6564207965742e00000000604482015260640161097f565b33600090815260086020526040902054806117105760405162461bcd60e51b81526020600482015260116024820152704e6f207072697a6520746f20636c61696d60781b604482015260640161097f565b60025460405163a9059cbb60e01b8152336004820152602481018390526000916001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015611762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178691906129c2565b9050806117cd5760405162461bcd60e51b81526020600482015260156024820152744661696c656420746f20636c61696d207072697a6560581b604482015260640161097f565b600a546117da9083612585565b600a5533600081815260086020908152604080832092909255815192835282018490527f7fe7ea649949105a0194e5bea581aa4da4243f495fd1d69ea7fad648c0749bf89101610d5c565b6000546001600160a01b0316331461184f5760405162461bcd60e51b815260040161097f9061298d565b6118596000612591565b565b6000546001600160a01b031633146118855760405162461bcd60e51b815260040161097f9061298d565b6001546002036118a857604051630ddf739360e11b815260040160405180910390fd5b600260015560006118b7611c91565b60025460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb90604401610a31565b6000546001600160a01b0316331461191c5760405162461bcd60e51b815260040161097f9061298d565b60015460020361193f57604051630ddf739360e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b039290921691909117905560018055565b6000546001600160a01b0316331461198f5760405162461bcd60e51b815260040161097f9061298d565b6001546002036119b257604051630ddf739360e11b815260040160405180910390fd5b600c80549115156101000261ff001990921691909117905560018055565b6000546001600160a01b031633146119fa5760405162461bcd60e51b815260040161097f9061298d565b600154600203611a1d57604051630ddf739360e11b815260040160405180910390fd5b600c805460ff191691151591909117905560018055565b6000546001600160a01b03163314611a5e5760405162461bcd60e51b815260040161097f9061298d565b600154600203611a8157604051630ddf739360e11b815260040160405180910390fd5b600260015580611ad35760405162461bcd60e51b815260206004820181905260248201527f637265646974732073686f756c642062652067726561746572207468616e2030604482015260640161097f565b6000825111611af45760405162461bcd60e51b815260040161097f90612aa7565b8151600090611b03908361256d565b9050611b0d611c91565b8110611b5b5760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820636f6e74726163742062616c616e63650000000000604482015260640161097f565b60005b8351811015611c0d57611bb88360096000878581518110611b8157611b816129df565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205461255a90919063ffffffff16565b60096000868481518110611bce57611bce6129df565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080611c0590612a0b565b915050611b5e565b50600b54611c1b908261255a565b600b556040517f28be0d3b44702b56f98579c43ad296737d17d6f15095d88687322dd92e7c62de90611c509085908590612aea565b60405180910390a150506001805550565b60008281526007602090815260408083206001600160a01b03851684526008019091529020600101545b92915050565b600b546006546000908152600760208190526040822001549091611d4f91611d499060ff16611cd457600654600090815260076020526040902060020154611cd7565b60005b600a546002546040516370a0823160e01b8152306004820152611d4992916001600160a01b0316906370a0823190602401602060405180830381865afa158015611d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d499190612a8e565b90612585565b905090565b600154600203611d7757604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff1615611dd75760405162461bcd60e51b815260206004820152601060248201526f11d85b59481a185cc81cd95d1d1b195960821b604482015260640161097f565b6004548160060154611de99190612b0c565b4210611e375760405162461bcd60e51b815260206004820152601a60248201527f47616d65206e6f7420617661696c61626c6520746f206a6f696e000000000000604482015260640161097f565b600554816004015410611e825760405162461bcd60e51b815260206004820152601360248201527213585e081c1b185e595c9cc81c995858da1959606a1b604482015260640161097f565b33600090815260088201602052604090205460ff1615611eda5760405162461bcd60e51b8152602060048201526013602482015272155cd95c88185b1c9958591e481a9bda5b9959606a1b604482015260640161097f565b60008160010154600003611ef057506001612100565b600c54610100900460ff168015611f0d57508160010154600b5410155b15611f5c57600182015433600090815260096020526040902054611f3091612585565b336000908152600960205260409020556001820154600b54611f5191612585565b600b55506001612100565b60018201543360009081526008602052604090205410611fc057600182015433600090815260086020526040902054611f9491612585565b336000908152600860205260409020556001820154600a54611fb591612585565b600a55506001612100565b6001820154600254604051636eb1769f60e11b81523360048201523060248201526001600160a01b039091169063dd62ed3e90604401602060405180830381865afa158015612013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120379190612a8e565b101561207c5760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820616c6c6f77616e636560601b604482015260640161097f565b60025460018301546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156120d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120fd91906129c2565b90505b8061214d5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207061792074686520656e747279207072696365000000604482015260640161097f565b604080518082018252600060208083018281526001808552338085526008890184529584208551815460ff19169015151781559151918101919091556009870180548083018255908452919092200180546001600160a01b0319169093179092559083015460028401546121c09161255a565b60028401556004830180546000906121d790612a0b565b909155506006546001840154604080519283523360208401528201527f03dfbe1fcb4e2d61f3b4a0c93d8f814c92250618b3387f396cc9fc9fafe2c20390606001611c50565b6000546001600160a01b031633146122475760405162461bcd60e51b815260040161097f9061298d565b600355565b6000546001600160a01b031633146122765760405162461bcd60e51b815260040161097f9061298d565b47806122bb5760405162461bcd60e51b81526020600482015260146024820152734e6f20457468657220746f20776974686472617760601b604482015260640161097f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612308576040519150601f19603f3d011682016040523d82523d6000602084013e61230d565b606091505b50509050806123505760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b604482015260640161097f565b505050565b6000546001600160a01b0316331461237f5760405162461bcd60e51b815260040161097f9061298d565b6001546002036123a257604051630ddf739360e11b815260040160405180910390fd5b600260015580516123c55760405162461bcd60e51b815260040161097f90612aa7565b6000805b825181101561247c57612423600960008584815181106123eb576123eb6129df565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548361255a90919063ffffffff16565b915060006009600085848151811061243d5761243d6129df565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061247490612a0b565b9150506123c9565b50600b5461248a9082612585565b600b556040517fb9e9c32075897c5560d4b67f863b26c9645f1886971e8529c6247e615505bc2890610d5c9084908490612aea565b6000546001600160a01b031633146124e95760405162461bcd60e51b815260040161097f9061298d565b6001600160a01b03811661254e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161097f565b61255781612591565b50565b60006125668284612b1f565b9392505050565b60006125668284612b32565b60006125668284612b49565b60006125668284612b0c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461255757600080fd5b6000806040838503121561260957600080fd5b8235612614816125e1565b946020939093013593505050565b60006020828403121561263457600080fd5b5035919050565b600081518084526020808501945080840160005b838110156126745781516001600160a01b03168752958201959082019060010161264f565b509495945050505050565b602081526000612566602083018461263b565b6000602082840312156126a457600080fd5b8135612566816125e1565b600080600080608085870312156126c557600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612720576127206126e1565b604052919050565b600067ffffffffffffffff821115612742576127426126e1565b5060051b60200190565b600082601f83011261275d57600080fd5b8135602061277261276d83612728565b6126f7565b82815260059290921b8401810191818101908684111561279157600080fd5b8286015b848110156127b55780356127a8816125e1565b8352918301918301612795565b509695505050505050565b6000806000606084860312156127d557600080fd5b833567ffffffffffffffff808211156127ed57600080fd5b818601915086601f83011261280157600080fd5b8135602061281161276d83612728565b82815260059290921b8401810191818101908a84111561283057600080fd5b948201945b8386101561284e57853582529482019490820190612835565b9750508701359250508082111561286457600080fd5b506128718682870161274c565b925050604084013590509250925092565b6000806040838503121561289557600080fd5b82356128a0816125e1565b915060208301356128b0816125e1565b809150509250929050565b801515811461255757600080fd5b6000602082840312156128db57600080fd5b8135612566816128bb565b600080604083850312156128f957600080fd5b823567ffffffffffffffff81111561291057600080fd5b61291c8582860161274c565b95602094909401359450505050565b6000806040838503121561293e57600080fd5b8235915060208301356128b0816125e1565b60006020828403121561296257600080fd5b813567ffffffffffffffff81111561297957600080fd5b6129858482850161274c565b949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156129d457600080fd5b8151612566816128bb565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612a1d57612a1d6129f5565b5060010190565b600060808201868352602086818501528560408501526080606085015281855480845260a0860191508660005282600020935060005b81811015612a7f5784546001600160a01b031683526001948501949284019201612a5a565b50909998505050505050505050565b600060208284031215612aa057600080fd5b5051919050565b60208082526023908201527f54686572652073686f756c64206265206174206c65617374206f6e6520706c616040820152623cb2b960e91b606082015260800190565b604081526000612afd604083018561263b565b90508260208301529392505050565b81810381811115611c8b57611c8b6129f5565b80820180821115611c8b57611c8b6129f5565b8082028115828204841417611c8b57611c8b6129f5565b600082612b6657634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f4dfe88b98e333e187e3d1259d565d9d04cd793a1c1d1e5056b8c6aa4e44ee8c64736f6c63430008120033000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000050

Deployed Bytecode

0x6080604052600436106102885760003560e01c8063848d192c1161015a578063c983c01a116100c1578063df47203c1161007a578063df47203c1461086a578063e7d141131461088a578063ed885897146108ba578063f1be7a57146108ea578063f2fde38b14610920578063fa55e2b41461094057600080fd5b8063c983c01a146107a3578063d4f0bcf6146107d7578063d4f77b1c146107ec578063d6beded9146107f4578063dbf8a28a1461082a578063deeb2b9c1461084a57600080fd5b8063ab1205e911610113578063ab1205e9146106b3578063af75a7cc146106e3578063b7ba419b14610713578063ba92763a14610733578063c3dfdae614610763578063c617b26a1461078357600080fd5b8063848d192c146105e957806389edb8ed146105fe5780638da5cb5b1461061e5780638e235d061461065057806392929a091461067d5780639cbe5efd1461069d57600080fd5b80634737a072116101fe578063682458bd116101b7578063682458bd1461052f57806370740ac91461054f578063715018a6146105645780637ebb9c25146105795780637f1f4e35146105a957806380d29e66146105c957600080fd5b80634737a072146104795780634c2412a21461049957806351999cb2146104af57806352ac797c146104cf5780635ba32769146104ef578063659a99ea1461050f57600080fd5b806322a5849a1161025057806322a5849a146103d45780632866ed21146103ea578063288dee3b1461040457806331818b0b1461042457806336b9c7fe1461043957806343e23bc61461046657600080fd5b80630cf20cc91461028d5780630e18d662146102af578063117a5b90146102e357806311dc733514610383578063200ad21b146103a7575b600080fd5b34801561029957600080fd5b506102ad6102a83660046125f6565b610955565b005b3480156102bb57600080fd5b50600c546102ce90610100900460ff1681565b60405190151581526020015b60405180910390f35b3480156102ef57600080fd5b506103466102fe366004612622565b60076020819052600091825260409091208054600182015460028301546003840154600485015460058601546006870154969097015494969395929491939092909160ff1688565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c0830152151560e0820152610100016102da565b34801561038f57600080fd5b5061039960035481565b6040519081526020016102da565b3480156103b357600080fd5b506103c76103c2366004612622565b610a7d565b6040516102da919061267f565b3480156103e057600080fd5b5061039960045481565b3480156103f657600080fd5b50600c546102ce9060ff1681565b34801561041057600080fd5b506102ad61041f366004612622565b610b5e565b34801561043057600080fd5b506102ad610b8d565b34801561044557600080fd5b50610399610454366004612692565b60096020526000908152604090205481565b6102ad610474366004612622565b610c04565b34801561048557600080fd5b506102ad610494366004612622565b610d6c565b3480156104a557600080fd5b5061039960055481565b3480156104bb57600080fd5b506102ad6104ca366004612622565b610e18565b3480156104db57600080fd5b506102ad6104ea3660046126af565b610e47565b3480156104fb57600080fd5b506102ad61050a3660046127c0565b610fbe565b34801561051b57600080fd5b506102ad61052a366004612692565b61145b565b34801561053b57600080fd5b506102ad61054a366004612882565b6114ea565b34801561055b57600080fd5b506102ad611645565b34801561057057600080fd5b506102ad611825565b34801561058557600080fd5b50610399610594366004612622565b60009081526007602052604090206003015490565b3480156105b557600080fd5b506102ad6105c4366004612692565b61185b565b3480156105d557600080fd5b506102ad6105e4366004612692565b6118f2565b3480156105f557600080fd5b50600a54610399565b34801561060a57600080fd5b506102ad6106193660046128c9565b611965565b34801561062a57600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016102da565b34801561065c57600080fd5b5061039961066b366004612692565b60086020526000908152604090205481565b34801561068957600080fd5b506102ad6106983660046128c9565b6119d0565b3480156106a957600080fd5b5061039960065481565b3480156106bf57600080fd5b506103996106ce366004612622565b60009081526007602052604090206004015490565b3480156106ef57600080fd5b506103996106fe366004612622565b60009081526007602052604090206001015490565b34801561071f57600080fd5b506102ad61072e3660046128e6565b611a34565b34801561073f57600080fd5b5061039961074e366004612622565b60009081526007602052604090206006015490565b34801561076f57600080fd5b50600254610638906001600160a01b031681565b34801561078f57600080fd5b5061039961079e36600461292b565b611c61565b3480156107af57600080fd5b506102ce6107be366004612622565b6000908152600760208190526040909120015460ff1690565b3480156107e357600080fd5b50610399611c91565b6102ad611d54565b34801561080057600080fd5b5061039961080f366004612692565b6001600160a01b031660009081526008602052604090205490565b34801561083657600080fd5b506102ad610845366004612622565b61221d565b34801561085657600080fd5b506102ad610865366004612692565b61224c565b34801561087657600080fd5b506102ad610885366004612950565b612355565b34801561089657600080fd5b506103996108a5366004612622565b60009081526007602052604090206005015490565b3480156108c657600080fd5b506103996108d5366004612622565b60009081526007602052604090206002015490565b3480156108f657600080fd5b50610399610905366004612692565b6001600160a01b031660009081526009602052604090205490565b34801561092c57600080fd5b506102ad61093b366004612692565b6124bf565b34801561094c57600080fd5b50600b54610399565b6000546001600160a01b031633146109885760405162461bcd60e51b815260040161097f9061298d565b60405180910390fd5b6001546002036109ab57604051630ddf739360e11b815260040160405180910390fd5b6002600155806109b9611c91565b10156109fc5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161097f565b60025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb906044015b6020604051808303816000875af1158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7491906129c2565b50506001805550565b600081815260076020526040812060048101546060929067ffffffffffffffff811115610aac57610aac6126e1565b604051908082528060200260200182016040528015610ad5578160200160208202803683370190505b50905060005b8260040154811015610b5657826009018181548110610afc57610afc6129df565b9060005260206000200160009054906101000a90046001600160a01b0316828281518110610b2c57610b2c6129df565b6001600160a01b039092166020928302919091019091015280610b4e81612a0b565b915050610adb565b509392505050565b6000546001600160a01b03163314610b885760405162461bcd60e51b815260040161097f9061298d565b600555565b6000546001600160a01b03163314610bb75760405162461bcd60e51b815260040161097f9061298d565b600154600203610bda57604051630ddf739360e11b815260040160405180910390fd5b60026001908155600654600090815260076020819052604090912001805460ff1916821790558055565b6000546001600160a01b03163314610c2e5760405162461bcd60e51b815260040161097f9061298d565b600154600203610c5157604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff1615610cb15760405162461bcd60e51b815260206004820152601060248201526f11d85b59481a185cc81cd95d1d1b195960821b604482015260640161097f565b81610cba611c91565b1015610d135760405162461bcd60e51b815260206004820152602260248201527f4e6f7420656e6f7567682062616c616e636520696e2074686520636f6e74726160448201526118dd60f21b606482015260840161097f565b6002810154610d22908361255a565b600282015560065460408051918252602082018490527ff577174c617771fc10a88da12f2ac8ce5f3b9ddbde78845c50b5f6ddc08cb57191015b60405180910390a1505060018055565b6000546001600160a01b03163314610d965760405162461bcd60e51b815260040161097f9061298d565b600154600203610db957604051630ddf739360e11b815260040160405180910390fd5b6002600155600680546000908152600760209081526040918290208301849055915481519081529182018390527fb412a2d7de723b82b0a3cae8b10ae2d255e645dd0231a1a4c83cb8e3ebc05bd8910160405180910390a15060018055565b6000546001600160a01b03163314610e425760405162461bcd60e51b815260040161097f9061298d565b600455565b6000546001600160a01b03163314610e715760405162461bcd60e51b815260040161097f9061298d565b600154600203610e9457604051630ddf739360e11b815260040160405180910390fd5b60026001556006546000908152600760208190526040909120015460ff16610efe5760405162461bcd60e51b815260206004820152601d60248201527f43757272656e7420726f756e64206e6f7420736574746c656420796574000000604482015260640161097f565b6006548411610f4f5760405162461bcd60e51b815260206004820152601f60248201527f55736520696e6372656d656e74616c20726f756e644964206e756d6265727300604482015260640161097f565b6006848155600085815260076020908152604091829020878155600181018790559283018590556005830184905581518781529081018590527f69286a075100e2ae2469a1c30e959e736d7b1b08e6d678af3379591b7d351df0910160405180910390a1505060018055505050565b6000546001600160a01b03163314610fe85760405162461bcd60e51b815260040161097f9061298d565b60015460020361100b57604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff16156110785760405162461bcd60e51b815260206004820152601d60248201527f47616d652068617320616c7265616479206265656e20736574746c6564000000604482015260640161097f565b80600501548451146110cc5760405162461bcd60e51b815260206004820152601860248201527f496e636f727265637420616e7377657273206c656e6774680000000000000000604482015260640161097f565b8060040154835111156111475760405162461bcd60e51b815260206004820152603a60248201527f4d69736d61746368206265747765656e20636f6e7472616374206a6f696e656460448201527f20706c617965727320616e6420616e7377657273206172726179000000000000606482015260840161097f565b60008083156113f15760005b85518110156112c357836008016000878381518110611174576111746129df565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615156001146112075760405162461bcd60e51b815260206004820152603260248201527f53656e7420616e73776572206164647265737320686173206e6f74206a6f696e604482015271656420696e2063757272656e742067616d6560701b606482015260840161097f565b84846008016000888481518110611220576112206129df565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206001018190555083600a016000868152602001908152602001600020868281518110611276576112766129df565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806112bb81612a0b565b915050611153565b506112e860646112e2600354866002015461256d90919063ffffffff16565b90612579565b6000858152600a85016020526040902054909250611307908390612579565b60038401819055905060005b6000858152600a850160205260409020548110156113df576000858152600a850160205260408120805461138192859260089286908110611356576113566129df565b60009182526020808320909101546001600160a01b031683528201929092526040019020549061255a565b6000868152600a86016020526040812080546008929190859081106113a8576113a86129df565b60009182526020808320909101546001600160a01b03168352820192909252604001902055806113d781612a0b565b915050611313565b50600a546113ed908361255a565b600a555b60078301805460ff1916600117905582546000858152600a850160205260409081902090517f1cd8465e2ee3902ef973e10c4cfe326c28616ff3b42cc92c5d9d241371b4b6329261144792909186918691612a24565b60405180910390a150506001805550505050565b6000546001600160a01b031633146114855760405162461bcd60e51b815260040161097f9061298d565b6001546002036114a857604051630ddf739360e11b815260040160405180910390fd5b60026001556040516001600160a01b038216904780156108fc02916000818181858888f193505050501580156114e2573d6000803e3d6000fd5b505060018055565b6000546001600160a01b031633146115145760405162461bcd60e51b815260040161097f9061298d565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561155d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115819190612a8e565b9050600081116115cb5760405162461bcd60e51b81526020600482015260156024820152744e6f20746f6b656e7320746f20776974686472617760581b604482015260640161097f565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af115801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906129c2565b5050505050565b60015460020361166857604051630ddf739360e11b815260040160405180910390fd5b6002600155600c5460ff166116bf5760405162461bcd60e51b815260206004820152601c60248201527f5769746864726177696e67206e6f7420656e61626c6564207965742e00000000604482015260640161097f565b33600090815260086020526040902054806117105760405162461bcd60e51b81526020600482015260116024820152704e6f207072697a6520746f20636c61696d60781b604482015260640161097f565b60025460405163a9059cbb60e01b8152336004820152602481018390526000916001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015611762573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178691906129c2565b9050806117cd5760405162461bcd60e51b81526020600482015260156024820152744661696c656420746f20636c61696d207072697a6560581b604482015260640161097f565b600a546117da9083612585565b600a5533600081815260086020908152604080832092909255815192835282018490527f7fe7ea649949105a0194e5bea581aa4da4243f495fd1d69ea7fad648c0749bf89101610d5c565b6000546001600160a01b0316331461184f5760405162461bcd60e51b815260040161097f9061298d565b6118596000612591565b565b6000546001600160a01b031633146118855760405162461bcd60e51b815260040161097f9061298d565b6001546002036118a857604051630ddf739360e11b815260040160405180910390fd5b600260015560006118b7611c91565b60025460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb90604401610a31565b6000546001600160a01b0316331461191c5760405162461bcd60e51b815260040161097f9061298d565b60015460020361193f57604051630ddf739360e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b039290921691909117905560018055565b6000546001600160a01b0316331461198f5760405162461bcd60e51b815260040161097f9061298d565b6001546002036119b257604051630ddf739360e11b815260040160405180910390fd5b600c80549115156101000261ff001990921691909117905560018055565b6000546001600160a01b031633146119fa5760405162461bcd60e51b815260040161097f9061298d565b600154600203611a1d57604051630ddf739360e11b815260040160405180910390fd5b600c805460ff191691151591909117905560018055565b6000546001600160a01b03163314611a5e5760405162461bcd60e51b815260040161097f9061298d565b600154600203611a8157604051630ddf739360e11b815260040160405180910390fd5b600260015580611ad35760405162461bcd60e51b815260206004820181905260248201527f637265646974732073686f756c642062652067726561746572207468616e2030604482015260640161097f565b6000825111611af45760405162461bcd60e51b815260040161097f90612aa7565b8151600090611b03908361256d565b9050611b0d611c91565b8110611b5b5760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820636f6e74726163742062616c616e63650000000000604482015260640161097f565b60005b8351811015611c0d57611bb88360096000878581518110611b8157611b816129df565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205461255a90919063ffffffff16565b60096000868481518110611bce57611bce6129df565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080611c0590612a0b565b915050611b5e565b50600b54611c1b908261255a565b600b556040517f28be0d3b44702b56f98579c43ad296737d17d6f15095d88687322dd92e7c62de90611c509085908590612aea565b60405180910390a150506001805550565b60008281526007602090815260408083206001600160a01b03851684526008019091529020600101545b92915050565b600b546006546000908152600760208190526040822001549091611d4f91611d499060ff16611cd457600654600090815260076020526040902060020154611cd7565b60005b600a546002546040516370a0823160e01b8152306004820152611d4992916001600160a01b0316906370a0823190602401602060405180830381865afa158015611d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d499190612a8e565b90612585565b905090565b600154600203611d7757604051630ddf739360e11b815260040160405180910390fd5b600260015560065460009081526007602081905260409091209081015460ff1615611dd75760405162461bcd60e51b815260206004820152601060248201526f11d85b59481a185cc81cd95d1d1b195960821b604482015260640161097f565b6004548160060154611de99190612b0c565b4210611e375760405162461bcd60e51b815260206004820152601a60248201527f47616d65206e6f7420617661696c61626c6520746f206a6f696e000000000000604482015260640161097f565b600554816004015410611e825760405162461bcd60e51b815260206004820152601360248201527213585e081c1b185e595c9cc81c995858da1959606a1b604482015260640161097f565b33600090815260088201602052604090205460ff1615611eda5760405162461bcd60e51b8152602060048201526013602482015272155cd95c88185b1c9958591e481a9bda5b9959606a1b604482015260640161097f565b60008160010154600003611ef057506001612100565b600c54610100900460ff168015611f0d57508160010154600b5410155b15611f5c57600182015433600090815260096020526040902054611f3091612585565b336000908152600960205260409020556001820154600b54611f5191612585565b600b55506001612100565b60018201543360009081526008602052604090205410611fc057600182015433600090815260086020526040902054611f9491612585565b336000908152600860205260409020556001820154600a54611fb591612585565b600a55506001612100565b6001820154600254604051636eb1769f60e11b81523360048201523060248201526001600160a01b039091169063dd62ed3e90604401602060405180830381865afa158015612013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120379190612a8e565b101561207c5760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820616c6c6f77616e636560601b604482015260640161097f565b60025460018301546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156120d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120fd91906129c2565b90505b8061214d5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207061792074686520656e747279207072696365000000604482015260640161097f565b604080518082018252600060208083018281526001808552338085526008890184529584208551815460ff19169015151781559151918101919091556009870180548083018255908452919092200180546001600160a01b0319169093179092559083015460028401546121c09161255a565b60028401556004830180546000906121d790612a0b565b909155506006546001840154604080519283523360208401528201527f03dfbe1fcb4e2d61f3b4a0c93d8f814c92250618b3387f396cc9fc9fafe2c20390606001611c50565b6000546001600160a01b031633146122475760405162461bcd60e51b815260040161097f9061298d565b600355565b6000546001600160a01b031633146122765760405162461bcd60e51b815260040161097f9061298d565b47806122bb5760405162461bcd60e51b81526020600482015260146024820152734e6f20457468657220746f20776974686472617760601b604482015260640161097f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612308576040519150601f19603f3d011682016040523d82523d6000602084013e61230d565b606091505b50509050806123505760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b604482015260640161097f565b505050565b6000546001600160a01b0316331461237f5760405162461bcd60e51b815260040161097f9061298d565b6001546002036123a257604051630ddf739360e11b815260040160405180910390fd5b600260015580516123c55760405162461bcd60e51b815260040161097f90612aa7565b6000805b825181101561247c57612423600960008584815181106123eb576123eb6129df565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548361255a90919063ffffffff16565b915060006009600085848151811061243d5761243d6129df565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061247490612a0b565b9150506123c9565b50600b5461248a9082612585565b600b556040517fb9e9c32075897c5560d4b67f863b26c9645f1886971e8529c6247e615505bc2890610d5c9084908490612aea565b6000546001600160a01b031633146124e95760405162461bcd60e51b815260040161097f9061298d565b6001600160a01b03811661254e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161097f565b61255781612591565b50565b60006125668284612b1f565b9392505050565b60006125668284612b32565b60006125668284612b49565b60006125668284612b0c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461255757600080fd5b6000806040838503121561260957600080fd5b8235612614816125e1565b946020939093013593505050565b60006020828403121561263457600080fd5b5035919050565b600081518084526020808501945080840160005b838110156126745781516001600160a01b03168752958201959082019060010161264f565b509495945050505050565b602081526000612566602083018461263b565b6000602082840312156126a457600080fd5b8135612566816125e1565b600080600080608085870312156126c557600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612720576127206126e1565b604052919050565b600067ffffffffffffffff821115612742576127426126e1565b5060051b60200190565b600082601f83011261275d57600080fd5b8135602061277261276d83612728565b6126f7565b82815260059290921b8401810191818101908684111561279157600080fd5b8286015b848110156127b55780356127a8816125e1565b8352918301918301612795565b509695505050505050565b6000806000606084860312156127d557600080fd5b833567ffffffffffffffff808211156127ed57600080fd5b818601915086601f83011261280157600080fd5b8135602061281161276d83612728565b82815260059290921b8401810191818101908a84111561283057600080fd5b948201945b8386101561284e57853582529482019490820190612835565b9750508701359250508082111561286457600080fd5b506128718682870161274c565b925050604084013590509250925092565b6000806040838503121561289557600080fd5b82356128a0816125e1565b915060208301356128b0816125e1565b809150509250929050565b801515811461255757600080fd5b6000602082840312156128db57600080fd5b8135612566816128bb565b600080604083850312156128f957600080fd5b823567ffffffffffffffff81111561291057600080fd5b61291c8582860161274c565b95602094909401359450505050565b6000806040838503121561293e57600080fd5b8235915060208301356128b0816125e1565b60006020828403121561296257600080fd5b813567ffffffffffffffff81111561297957600080fd5b6129858482850161274c565b949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156129d457600080fd5b8151612566816128bb565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612a1d57612a1d6129f5565b5060010190565b600060808201868352602086818501528560408501526080606085015281855480845260a0860191508660005282600020935060005b81811015612a7f5784546001600160a01b031683526001948501949284019201612a5a565b50909998505050505050505050565b600060208284031215612aa057600080fd5b5051919050565b60208082526023908201527f54686572652073686f756c64206265206174206c65617374206f6e6520706c616040820152623cb2b960e91b606082015260800190565b604081526000612afd604083018561263b565b90508260208301529392505050565b81810381811115611c8b57611c8b6129f5565b80820180821115611c8b57611c8b6129f5565b8082028115828204841417611c8b57611c8b6129f5565b600082612b6657634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f4dfe88b98e333e187e3d1259d565d9d04cd793a1c1d1e5056b8c6aa4e44ee8c64736f6c63430008120033

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

000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000050

-----Decoded View---------------
Arg [0] : _gameTokenAdd (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [1] : _maxPlayers (uint256): 100
Arg [2] : _prizePercentage (uint256): 80

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000050


Block Transaction Difficulty 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
Loading...
Loading
[ Download: CSV Export  ]

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