ETH Price: $3,440.82 (-0.40%)
Gas: 8 Gwei

Contract

0x196247c168F1B94D969CF24F044C1FBa9d394B48
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...186881152023-12-01 0:53:11235 days ago1701391991IN
0x196247c1...a9d394B48
0 ETH0.0010368736.24281233
Claim186876562023-11-30 23:20:59235 days ago1701386459IN
0x196247c1...a9d394B48
0 ETH0.0049623645.52209091
Claim Treasury186875272023-11-30 22:54:59235 days ago1701384899IN
0x196247c1...a9d394B48
0 ETH0.0016347340.30598793
Claim177008682023-07-15 19:34:35373 days ago1689449675IN
0x196247c1...a9d394B48
0 ETH0.0118808916.4436912
Claim177006842023-07-15 18:56:35373 days ago1689447395IN
0x196247c1...a9d394B48
0 ETH0.010207913.13710874
Claim177003332023-07-15 17:45:35373 days ago1689443135IN
0x196247c1...a9d394B48
0 ETH0.0070758513.03474178
Claim177002182023-07-15 17:21:59373 days ago1689441719IN
0x196247c1...a9d394B48
0 ETH0.0078714713.18742806
Claim177001632023-07-15 17:10:59373 days ago1689441059IN
0x196247c1...a9d394B48
0 ETH0.0036796716.92155377
Claim177000902023-07-15 16:56:23373 days ago1689440183IN
0x196247c1...a9d394B48
0 ETH0.0065179815.0122398
Claim176999452023-07-15 16:26:23374 days ago1689438383IN
0x196247c1...a9d394B48
0 ETH0.0076226620.05574798
Claim176999042023-07-15 16:17:59374 days ago1689437879IN
0x196247c1...a9d394B48
0 ETH0.0163981325.18391912
Claim176998982023-07-15 16:16:35374 days ago1689437795IN
0x196247c1...a9d394B48
0 ETH0.0158001124.26066067
Claim176998872023-07-15 16:14:11374 days ago1689437651IN
0x196247c1...a9d394B48
0 ETH0.0088927827.29155059
Claim176997072023-07-15 15:37:47374 days ago1689435467IN
0x196247c1...a9d394B48
0 ETH0.0036222213.33587566
Claim Treasury176993252023-07-15 14:18:47374 days ago1689430727IN
0x196247c1...a9d394B48
0 ETH0.0007022817.31553056
Claim Treasury176993012023-07-15 14:13:47374 days ago1689430427IN
0x196247c1...a9d394B48
0 ETH0.0006420115.82957387
Claim Treasury174924652023-06-16 12:41:59403 days ago1686919319IN
0x196247c1...a9d394B48
0 ETH0.0009179515.85912667
Claim174696692023-06-13 7:44:47406 days ago1686642287IN
0x196247c1...a9d394B48
0 ETH0.0018220114.44041013
Claim174696662023-06-13 7:44:11406 days ago1686642251IN
0x196247c1...a9d394B48
0 ETH0.0019979215.83457842
Claim173398752023-05-26 1:00:59424 days ago1685062859IN
0x196247c1...a9d394B48
0 ETH0.0026501524.31114827
Claim172961122023-05-19 21:11:59430 days ago1684530719IN
0x196247c1...a9d394B48
0 ETH0.0045926636.39915579
Claim172739612023-05-16 18:13:11433 days ago1684260791IN
0x196247c1...a9d394B48
0 ETH0.0070650364.77223149
Claim172476822023-05-13 1:02:47437 days ago1683939767IN
0x196247c1...a9d394B48
0 ETH0.0065507460.09309907
Close Round172434252023-05-12 10:04:59438 days ago1683885899IN
0x196247c1...a9d394B48
0 ETH0.005794851.16960249
Start New Round172238172023-05-09 15:35:23441 days ago1683646523IN
0x196247c1...a9d394B48
0 ETH0.0035699136.31302437
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:
PredictionMarket

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : PredictionMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/**
 * @title Prediction Market Contract with ERC20 bets and allows for concurrent
 */
contract PredictionMarket is Ownable, Pausable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IERC20 public immutable token; // Prediction token

    address public adminAddress; // address of the admin
    address public operatorAddress; // address of the operator

    uint256 public minBetAmount; // minimum betting amount (denominated in wei)
    uint256 public treasuryFee; // treasury rate (e.g. 200 = 2%, 150 = 1.50%)
    uint256 public treasuryAmount; // treasury amount that was not claimed

    uint256 public currentRound; // current epoch for prediction round

    uint256 public constant MAX_TREASURY_FEE = 1000; // 10%

    mapping(uint256 => mapping(address => BetInfo)) public ledger;
    mapping(uint256 => Round) public rounds;
    mapping(address => uint256[]) public userRounds;

    enum Position {
        Bull,
        Bear
    }

    enum Outcome {
        Up,
        Down,
        Draw
    }

    struct Round {
        uint256 epoch;
        uint256 startTimestamp;
        uint256 lockTimestamp;
        uint256 closeTimestamp;
        uint256 totalAmount;
        uint256 bullAmount;
        uint256 bearAmount;
        uint256 rewardBaseCalAmount;
        uint256 rewardAmount;
        bool roundClosed;
        Outcome outcome;
    }

    struct BetInfo {
        Position position;
        uint256 amount;
        bool claimed; // default false
    }

    event StartRound(uint256 indexed round);
    event EndRound(uint256 indexed round, Outcome outcome);
    event BetBear(
        address indexed sender,
        uint256 indexed round,
        uint256 amount
    );
    event BetBull(
        address indexed sender,
        uint256 indexed round,
        uint256 amount
    );
    event Claim(address indexed sender, uint256 indexed round, uint256 amount);

    event NewAdminAddress(address admin);
    event NewMinBetAmount(uint256 indexed round, uint256 minBetAmount);
    event NewTreasuryFee(uint256 indexed round, uint256 treasuryFee);
    event NewOperatorAddress(address operator);

    event RewardsCalculated(
        uint256 indexed round,
        uint256 rewardBaseCalAmount,
        uint256 rewardAmount,
        uint256 treasuryAmount
    );

    event TokenRecovery(address indexed token, uint256 amount);
    event TreasuryClaim(uint256 amount);
    event Pause(uint256 indexed round);
    event Unpause(uint256 indexed round);

    modifier onlyAdmin() {
        require(msg.sender == adminAddress, "Not admin");
        _;
    }

    modifier onlyAdminOrOperator() {
        require(
            msg.sender == adminAddress || msg.sender == operatorAddress,
            "Not operator/admin"
        );
        _;
    }

    modifier onlyOperator() {
        require(msg.sender == operatorAddress, "Not operator");
        _;
    }

    modifier notContract() {
        require(!_isContract(msg.sender), "Contract not allowed");
        require(msg.sender == tx.origin, "Proxy contract not allowed");
        _;
    }

    /**
     * @notice Constructor
     * @param _token: prediction token
     * @param _adminAddress: admin address
     * @param _operatorAddress: operator address
     * @param _minBetAmount: minimum bet amounts (in wei)
     * @param _treasuryFee: treasury fee (1000 = 10%)
     */
    constructor(
        IERC20 _token,
        address _adminAddress,
        address _operatorAddress,
        uint256 _minBetAmount,
        uint256 _treasuryFee
    ) {
        require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high");

        token = _token;
        adminAddress = _adminAddress;
        operatorAddress = _operatorAddress;
        minBetAmount = _minBetAmount;
        treasuryFee = _treasuryFee;
    }

    /**
     * @notice Bet bear position
     * @param epoch: epoch
     */
    function betBear(
        uint256 epoch,
        uint256 _amount
    ) external whenNotPaused nonReentrant notContract {
        //todo update bettable to check that epoch exists and that current timestamp is less than lock timestamp
        require(_bettable(epoch), "Round not bettable");
        require(
            _amount >= minBetAmount,
            "Bet amount must be greater than minBetAmount"
        );
        require(
            ledger[epoch][msg.sender].amount == 0,
            "Can only bet once per round"
        );

        token.safeTransferFrom(msg.sender, address(this), _amount);
        // Update round data
        uint256 amount = _amount;
        Round storage round = rounds[epoch];
        round.totalAmount = round.totalAmount + amount;
        round.bearAmount = round.bearAmount + amount;

        // Update user data
        BetInfo storage betInfo = ledger[epoch][msg.sender];
        betInfo.position = Position.Bear;
        betInfo.amount = amount;
        userRounds[msg.sender].push(epoch);

        emit BetBear(msg.sender, epoch, amount);
    }

    /**
     * @notice Bet bull position
     * @param epoch: epoch
     */
    function betBull(
        uint256 epoch,
        uint256 _amount
    ) external whenNotPaused nonReentrant notContract {
        //todo update bettable to check that epoch exists and that current timestamp is less than lock timestamp,
        require(_bettable(epoch), "Round not bettable");
        require(
            _amount >= minBetAmount,
            "Bet amount must be greater than minBetAmount"
        );
        require(
            ledger[epoch][msg.sender].amount == 0,
            "Can only bet once per round"
        );

        token.safeTransferFrom(msg.sender, address(this), _amount);
        // Update round data
        uint256 amount = _amount;
        Round storage round = rounds[epoch];
        round.totalAmount = round.totalAmount + amount;
        round.bullAmount = round.bullAmount + amount;

        // Update user data
        BetInfo storage betInfo = ledger[epoch][msg.sender];
        betInfo.position = Position.Bull;
        betInfo.amount = amount;
        userRounds[msg.sender].push(epoch);

        emit BetBull(msg.sender, epoch, amount);
    }

    /**
     * @notice Claim reward for an array of epochs
     * @param epochs: array of epochs
     */
    function claim(
        uint256[] calldata epochs
    ) external nonReentrant notContract {
        uint256 reward; // Initializes reward

        for (uint256 i = 0; i < epochs.length; i++) {
            require(
                rounds[epochs[i]].startTimestamp != 0,
                "Round has not started"
            );
            require(
                block.timestamp > rounds[epochs[i]].closeTimestamp,
                "Round has not ended"
            );

            uint256 addedReward = 0;

            // Round valid, claim rewards
            if (rounds[epochs[i]].roundClosed) {
                require(
                    claimable(epochs[i], msg.sender),
                    "Not eligible for claim"
                );
                Round memory round = rounds[epochs[i]];
                addedReward =
                    (ledger[epochs[i]][msg.sender].amount *
                        round.rewardAmount) /
                    round.rewardBaseCalAmount;
            }

            ledger[epochs[i]][msg.sender].claimed = true;
            reward += addedReward;

            emit Claim(msg.sender, epochs[i], addedReward);
        }

        if (reward > 0) {
            token.safeTransfer(msg.sender, reward);
        }
    }

    /**
     * @notice Closes round with epoch
     * @param _epochToEnd: the round that is being closed
     * @param _outcome: result of the round
     * @dev Callable by operator
     */
    function closeRound(
        uint256 _epochToEnd,
        Outcome _outcome
    ) external whenNotPaused onlyOperator {
        require(_epochToEnd <= currentRound, "Round does not exist");
        require(
            !rounds[_epochToEnd].roundClosed,
            "Round has already been closed"
        );
        //todo take input for which side won here and send to _safeLockRound or more likely _safeEndRound, since we only have start and finish calls per epoch
        _safeEndRound(_epochToEnd, _outcome);
        _calculateRewards(_epochToEnd);
    }

    /**
     * @notice Start genesis round
     * @dev Callable by admin or operator
     */
    function startNewRound(
        uint256 _lockTimestamp,
        uint256 _closeTimestamp
    ) external whenNotPaused onlyOperator {
        //todo review/remove genesis start booleans
        require(
            _lockTimestamp > block.timestamp,
            "lockTimestamp must be greater than current timestamp"
        );
        require(
            _lockTimestamp < _closeTimestamp,
            "lock timestamp must be less than close timestamp"
        );

        currentRound = currentRound + 1;
        Round storage round = rounds[currentRound];
        round.startTimestamp = block.timestamp;
        round.lockTimestamp = _lockTimestamp;
        round.closeTimestamp = _closeTimestamp;
        round.epoch = currentRound;
        round.totalAmount = 0;

        emit StartRound(currentRound);
    }

    /**
    /**
     * @notice called by the admin to pause, triggers stopped state
     * @dev Callable by admin or operator
     */
    function pause() external whenNotPaused onlyAdminOrOperator {
        _pause();

        emit Pause(currentRound);
    }

    /**
     * @notice Claim all rewards in treasury
     * @dev Callable by admin
     */
    function claimTreasury() external nonReentrant onlyAdmin {
        uint256 currentTreasuryAmount = treasuryAmount;
        treasuryAmount = 0;
        token.safeTransfer(adminAddress, currentTreasuryAmount);
        emit TreasuryClaim(currentTreasuryAmount);
    }

    /**
     * @notice called by the admin to unpause, returns to normal state
     * Reset genesis state. Once paused, the rounds would need to be kickstarted by genesis
     * @dev Callable by admin or operator
     */
    function unpause() external whenPaused onlyAdminOrOperator {
        _unpause();

        emit Unpause(currentRound);
    }

    /**
     * @notice Set minBetAmount
     * @dev Callable by admin
     */
    function setMinBetAmount(
        uint256 _minBetAmount
    ) external whenPaused onlyAdmin {
        require(_minBetAmount != 0, "Must be superior to 0");
        minBetAmount = _minBetAmount;

        emit NewMinBetAmount(currentRound, minBetAmount);
    }

    /**
     * @notice Set operator address
     * @dev Callable by admin
     */
    function setOperator(address _operatorAddress) external onlyAdmin {
        require(_operatorAddress != address(0), "Cannot be zero address");
        operatorAddress = _operatorAddress;

        emit NewOperatorAddress(_operatorAddress);
    }

    /**
     * @notice Set treasury fee
     * @dev Callable by admin
     */
    function setTreasuryFee(
        uint256 _treasuryFee
    ) external whenPaused onlyAdmin {
        require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high");
        treasuryFee = _treasuryFee;

        emit NewTreasuryFee(currentRound, treasuryFee);
    }

    /**
     * @notice It allows the owner to recover tokens sent to the contract by mistake
     * @param _token: token address
     * @param _amount: token amount
     * @dev Callable by owner
     */
    function recoverToken(address _token, uint256 _amount) external onlyOwner {
        require(_token != address(token), "Cannot be prediction token address");
        IERC20(_token).safeTransfer(address(msg.sender), _amount);

        emit TokenRecovery(_token, _amount);
    }

    /**
     * @notice Set admin address
     * @dev Callable by owner
     */
    function setAdmin(address _adminAddress) external onlyOwner {
        require(_adminAddress != address(0), "Cannot be zero address");
        adminAddress = _adminAddress;

        emit NewAdminAddress(_adminAddress);
    }

    /**
     * @notice Returns round epochs and bet information for a user that has participated
     * @param user: user address
     * @param cursor: cursor
     * @param size: size
     */
    function getUserRounds(
        address user,
        uint256 cursor,
        uint256 size
    ) external view returns (uint256[] memory, BetInfo[] memory, uint256) {
        uint256 length = size;

        if (length > userRounds[user].length - cursor) {
            length = userRounds[user].length - cursor;
        }

        uint256[] memory values = new uint256[](length);
        BetInfo[] memory betInfo = new BetInfo[](length);

        for (uint256 i = 0; i < length; i++) {
            values[i] = userRounds[user][cursor + i];
            betInfo[i] = ledger[values[i]][user];
        }

        return (values, betInfo, cursor + length);
    }

    /**
     * @notice Returns round epochs length
     * @param user: user address
     */
    function getUserRoundsLength(address user) external view returns (uint256) {
        return userRounds[user].length;
    }

    /**
     * @notice Get the claimable stats of specific epoch and user account
     * @param epoch: epoch
     * @param user: user address
     */
    function claimable(uint256 epoch, address user) public view returns (bool) {
        BetInfo memory betInfo = ledger[epoch][user];
        Round memory round = rounds[epoch];
        if (round.outcome == Outcome.Draw) {
            return false;
        }
        return
            round.roundClosed &&
            betInfo.amount != 0 &&
            !betInfo.claimed &&
            ((round.outcome == Outcome.Up &&
                betInfo.position == Position.Bull) ||
                (round.outcome == Outcome.Down &&
                    betInfo.position == Position.Bear));
    }

    /**
     * @notice Calculate rewards for round
     * @param epoch: epoch
     */
    function _calculateRewards(uint256 epoch) internal {
        require(
            rounds[epoch].rewardBaseCalAmount == 0 &&
                rounds[epoch].rewardAmount == 0,
            "Rewards calculated"
        );
        Round storage round = rounds[epoch];
        uint256 rewardBaseCalAmount;
        uint256 treasuryAmt;
        uint256 rewardAmount;

        // Bull wins
        //todo adjust these to be values from the outcomes enum
        if (round.outcome == Outcome.Up) {
            rewardBaseCalAmount = round.bullAmount;
            treasuryAmt = (round.totalAmount * treasuryFee) / 10000;
            rewardAmount = round.totalAmount - treasuryAmt;
        }
        // Bear wins
        else if (round.outcome == Outcome.Down) {
            rewardBaseCalAmount = round.bearAmount;
            treasuryAmt = (round.totalAmount * treasuryFee) / 10000;
            rewardAmount = round.totalAmount - treasuryAmt;
        }
        // House wins
        else {
            rewardBaseCalAmount = 0;
            rewardAmount = 0;
            treasuryAmt = round.totalAmount;
        }
        round.rewardBaseCalAmount = rewardBaseCalAmount;
        round.rewardAmount = rewardAmount;

        // Add to treasury
        treasuryAmount += treasuryAmt;

        emit RewardsCalculated(
            epoch,
            rewardBaseCalAmount,
            rewardAmount,
            treasuryAmt
        );
    }

    /**
     * @notice End round
     * @param epoch: epoch
     * @param _outcome: winning side of the round
     */
    function _safeEndRound(uint256 epoch, Outcome _outcome) internal {
        require(
            block.timestamp >= rounds[epoch].closeTimestamp,
            "Can only end round after closeTimestamp"
        );
        Round storage round = rounds[epoch];
        round.outcome = _outcome;
        round.roundClosed = true;

        emit EndRound(epoch, round.outcome);
    }

    /**
     * @notice Determine if a round is valid for receiving bets
     * Round must have started and not be locked
     * Current timestamp must be within startTimestamp and closeTimestamp
     */
    function _bettable(uint256 epoch) internal view returns (bool) {
        return
            rounds[epoch].startTimestamp != 0 &&
            rounds[epoch].lockTimestamp != 0 &&
            block.timestamp > rounds[epoch].startTimestamp &&
            block.timestamp < rounds[epoch].lockTimestamp;
    }

    /**
     * @notice Returns true if `account` is a contract.
     * @param account: account address
     */
    function _isContract(address account) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 9 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface 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 6 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_operatorAddress","type":"address"},{"internalType":"uint256","name":"_minBetAmount","type":"uint256"},{"internalType":"uint256","name":"_treasuryFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetBear","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetBull","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"enum PredictionMarket.Outcome","name":"outcome","type":"uint8"}],"name":"EndRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"NewAdminAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minBetAmount","type":"uint256"}],"name":"NewMinBetAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"NewOperatorAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryFee","type":"uint256"}],"name":"NewTreasuryFee","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":true,"internalType":"uint256","name":"round","type":"uint256"}],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardBaseCalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryAmount","type":"uint256"}],"name":"RewardsCalculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"}],"name":"StartRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TreasuryClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"}],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_TREASURY_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"betBear","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"betBull","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"epochs","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"claimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epochToEnd","type":"uint256"},{"internalType":"enum PredictionMarket.Outcome","name":"_outcome","type":"uint8"}],"name":"closeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getUserRounds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"components":[{"internalType":"enum PredictionMarket.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"internalType":"struct PredictionMarket.BetInfo[]","name":"","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserRoundsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"ledger","outputs":[{"internalType":"enum PredictionMarket.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rounds","outputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"lockTimestamp","type":"uint256"},{"internalType":"uint256","name":"closeTimestamp","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"bullAmount","type":"uint256"},{"internalType":"uint256","name":"bearAmount","type":"uint256"},{"internalType":"uint256","name":"rewardBaseCalAmount","type":"uint256"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"internalType":"bool","name":"roundClosed","type":"bool"},{"internalType":"enum PredictionMarket.Outcome","name":"outcome","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBetAmount","type":"uint256"}],"name":"setMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryFee","type":"uint256"}],"name":"setTreasuryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockTimestamp","type":"uint256"},{"internalType":"uint256","name":"_closeTimestamp","type":"uint256"}],"name":"startNewRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userRounds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b5060405162002ab638038062002ab6833981016040819052620000349162000155565b6200003f33620000ec565b6000805460ff60a01b19169055600180556103e8811115620000a75760405162461bcd60e51b815260206004820152601560248201527f54726561737572792066656520746f6f20686967680000000000000000000000604482015260640160405180910390fd5b6001600160a01b03948516608052600280546001600160a01b0319908116958716959095179055600380549094169290941691909117909155600455600555620001ba565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200015257600080fd5b50565b600080600080600060a086880312156200016e57600080fd5b85516200017b816200013c565b60208701519095506200018e816200013c565b6040870151909450620001a1816200013c565b6060870151608090970151959894975095949392505050565b6080516128bd620001f9600039600081816104be015281816105480152818161087801528181610a970152818161102c015261179201526128bd6000f3fe608060405234801561001057600080fd5b50600436106101e45760003560e01c80638456cb591161010f578063c89c1a89116100a2578063f2fde38b11610071578063f2fde38b1461049d578063fa968eea146104b0578063fc0c546a146104b9578063fc6f9468146104e057600080fd5b8063c89c1a8914610465578063cc32d17614610478578063dd1f759614610481578063f2b3c8091461049457600080fd5b8063951fd600116100de578063951fd6001461040a578063a0c7f71c1461042c578063b29a81401461043f578063b3ab15fb1461045257600080fd5b80638456cb59146103645780638a19c8bc1461036c5780638c65c81f146103755780638da5cb5b146103f957600080fd5b80633f4ba83a11610187578063704b6c0211610156578063704b6c02146102e8578063715018a6146102fb5780637285c58b1461030357806377e741c71461035157600080fd5b80633f4ba83a1461029c5780635c975abb146102a45780636ba4c138146102c25780636c188593146102d557600080fd5b8063127effb2116101c3578063127effb214610219578063273867d414610249578063368acb09146102805780633923e1b41461028957600080fd5b80623bdc74146101e9578063040ae259146101f35780630e89e5a414610206575b600080fd5b6101f16104f3565b005b6101f1610201366004612346565b6105b0565b6101f1610214366004612346565b610747565b60035461022c906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610272610257366004612384565b6001600160a01b03166000908152600a602052604090205490565b604051908152602001610240565b61027260065481565b6101f1610297366004612346565b610966565b6101f1610b6e565b600054600160a01b900460ff165b6040519015158152602001610240565b6101f16102d03660046123a6565b610c10565b6101f16102e336600461241b565b61105d565b6101f16102f6366004612384565b611116565b6101f16111c2565b610342610311366004612434565b600860209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b6040516102409392919061248a565b6101f161035f36600461241b565b6111d4565b6101f1611288565b61027260075481565b6103e261038336600461241b565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015498909901549698959794969395929491939092919060ff808216916101009004168b565b6040516102409b9a999897969594939291906124be565b6000546001600160a01b031661022c565b61041d610418366004612522565b61132a565b60405161024093929190612555565b6102b261043a366004612434565b611581565b6101f161044d3660046125f8565b611788565b6101f1610460366004612384565b611877565b6101f1610473366004612622565b61193e565b61027260055481565b61027261048f3660046125f8565b611a4e565b6102726103e881565b6101f16104ab366004612384565b611a7f565b61027260045481565b61022c7f000000000000000000000000000000000000000000000000000000000000000081565b60025461022c906001600160a01b031681565b6104fb611af8565b6002546001600160a01b0316331461052e5760405162461bcd60e51b815260040161052590612656565b60405180910390fd5b600680546000909155600254610571906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683611b51565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a1506105ae60018055565b565b6105b8611bb9565b6003546001600160a01b031633146106015760405162461bcd60e51b815260206004820152600c60248201526b2737ba1037b832b930ba37b960a11b6044820152606401610525565b42821161066d5760405162461bcd60e51b815260206004820152603460248201527f6c6f636b54696d657374616d70206d75737420626520677265617465722074686044820152730616e2063757272656e742074696d657374616d760641b6064820152608401610525565b8082106106d55760405162461bcd60e51b815260206004820152603060248201527f6c6f636b2074696d657374616d70206d757374206265206c657373207468616e60448201526f020636c6f73652074696d657374616d760841b6064820152608401610525565b6007546106e390600161268f565b60078181556000918252600960205260408083204260018201556002810186905560038101859055825481556004810184905591549051919290917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b4529190a2505050565b61074f611bb9565b610757611af8565b333b156107765760405162461bcd60e51b8152600401610525906126a2565b3332146107955760405162461bcd60e51b8152600401610525906126d0565b61079e82611c06565b6107df5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610525565b6004548110156108015760405162461bcd60e51b815260040161052590612707565b60008281526008602090815260408083203384529091529020600101541561086b5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610525565b6108a06001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611c71565b600082815260096020526040902060048101548291906108c190839061268f565b600482015560068101546108d690839061268f565b6006820155600084815260086020908152604080832033808552908352818420805460ff191660019081178255808201889055600a855283862080549182018155865294849020909401889055905185815287927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d91015b60405180910390a350505061096260018055565b5050565b61096e611bb9565b610976611af8565b333b156109955760405162461bcd60e51b8152600401610525906126a2565b3332146109b45760405162461bcd60e51b8152600401610525906126d0565b6109bd82611c06565b6109fe5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610525565b600454811015610a205760405162461bcd60e51b815260040161052590612707565b600082815260086020908152604080832033845290915290206001015415610a8a5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610525565b610abf6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611c71565b60008281526009602052604090206004810154829190610ae090839061268f565b60048201556005810154610af590839061268f565b6005820155600084815260086020908152604080832033808552908352818420805460ff191681556001808201889055600a855283862080549182018155865294849020909401889055905185815287927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c12910161094e565b610b76611caf565b6002546001600160a01b0316331480610b9957506003546001600160a01b031633145b610bda5760405162461bcd60e51b81526020600482015260126024820152712737ba1037b832b930ba37b917b0b236b4b760711b6044820152606401610525565b610be2611cff565b6007546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b610c18611af8565b333b15610c375760405162461bcd60e51b8152600401610525906126a2565b333214610c565760405162461bcd60e51b8152600401610525906126d0565b6000805b828110156110185760096000858584818110610c7857610c78612753565b90506020020135815260200190815260200160002060010154600003610cd85760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081a185cc81b9bdd081cdd185c9d1959605a1b6044820152606401610525565b60096000858584818110610cee57610cee612753565b905060200201358152602001908152602001600020600301544211610d4b5760405162461bcd60e51b8152602060048201526013602482015272149bdd5b99081a185cc81b9bdd08195b991959606a1b6044820152606401610525565b600060096000868685818110610d6357610d63612753565b602090810292909201358352508101919091526040016000206009015460ff1615610f4d57610daa858584818110610d9d57610d9d612753565b9050602002013533611581565b610def5760405162461bcd60e51b81526020600482015260166024820152754e6f7420656c696769626c6520666f7220636c61696d60501b6044820152606401610525565b600060096000878786818110610e0757610e07612753565b905060200201358152602001908152602001600020604051806101600160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481526020016009820160009054906101000a900460ff161515151581526020016009820160019054906101000a900460ff166002811115610ec157610ec1612460565b6002811115610ed257610ed2612460565b8152505090508060e0015181610100015160086000898988818110610ef957610ef9612753565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b0316815260200190815260200160002060010154610f3f9190612769565b610f499190612780565b9150505b600160086000878786818110610f6557610f65612753565b6020908102929092013583525081810192909252604090810160009081203382529092529020600201805460ff1916911515919091179055610fa7818461268f565b9250848483818110610fbb57610fbb612753565b90506020020135336001600160a01b03167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf783604051610ffd91815260200190565b60405180910390a35080611010816127a2565b915050610c5a565b508015611053576110536001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383611b51565b5061096260018055565b611065611caf565b6002546001600160a01b0316331461108f5760405162461bcd60e51b815260040161052590612656565b806000036110d75760405162461bcd60e51b815260206004820152601560248201527404d757374206265207375706572696f7220746f203605c1b6044820152606401610525565b60048190556007546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b61111e611d54565b6001600160a01b03811661116d5760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b6044820152606401610525565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b6111ca611d54565b6105ae6000611dae565b6111dc611caf565b6002546001600160a01b031633146112065760405162461bcd60e51b815260040161052590612656565b6103e88111156112505760405162461bcd60e51b81526020600482015260156024820152740a8e4cac2e6eae4f240cccaca40e8dede40d0d2ced605b1b6044820152606401610525565b60058190556007546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a8579060200161110b565b611290611bb9565b6002546001600160a01b03163314806112b357506003546001600160a01b031633145b6112f45760405162461bcd60e51b81526020600482015260126024820152712737ba1037b832b930ba37b917b0b236b4b760711b6044820152606401610525565b6112fc611dfe565b6007546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6001600160a01b0383166000908152600a6020526040812054606091829184906113559087906127bb565b811115611383576001600160a01b0387166000908152600a60205260409020546113809087906127bb565b90505b60008167ffffffffffffffff81111561139e5761139e6127ce565b6040519080825280602002602001820160405280156113c7578160200160208202803683370190505b50905060008267ffffffffffffffff8111156113e5576113e56127ce565b60405190808252806020026020018201604052801561143057816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816114035790505b50905060005b83811015611562576001600160a01b038a166000908152600a60205260409020611460828b61268f565b8154811061147057611470612753565b906000526020600020015483828151811061148d5761148d612753565b602002602001018181525050600860008483815181106114af576114af612753565b602090810291909101810151825281810192909252604090810160009081206001600160a01b038e168252909252908190208151606081019092528054829060ff16600181111561150257611502612460565b600181111561151357611513612460565b81526001820154602082015260029091015460ff161515604090910152825183908390811061154457611544612753565b6020026020010181905250808061155a906127a2565b915050611436565b50818161156f858b61268f565b95509550955050505093509350939050565b60008281526008602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff1660018111156115c9576115c9612460565b60018111156115da576115da612460565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600980845285822086516101608101885281548152958101549486019490945283870154958501959095526003830154606085015260048301546080850152600583015460a0850152600683015460c0850152600783015460e0850152600883015461010085810191909152948301548083161515610120860152969750959294919361014086019304169081111561169e5761169e612460565b60028111156116af576116af612460565b9052509050600281610140015160028111156116cd576116cd612460565b036116dd57600092505050611782565b80610120015180156116f25750602082015115155b801561170057508160400151155b801561177d57506000816101400151600281111561172057611720612460565b14801561173f575060008251600181111561173d5761173d612460565b145b8061177d57506001816101400151600281111561175e5761175e612460565b14801561177d575060018251600181111561177b5761177b612460565b145b925050505b92915050565b611790611d54565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361181c5760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f742062652070726564696374696f6e20746f6b656e206164647265604482015261737360f01b6064820152608401610525565b6118306001600160a01b0383163383611b51565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e988260405161186b91815260200190565b60405180910390a25050565b6002546001600160a01b031633146118a15760405162461bcd60e51b815260040161052590612656565b6001600160a01b0381166118f05760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b6044820152606401610525565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e2906020016111b7565b611946611bb9565b6003546001600160a01b0316331461198f5760405162461bcd60e51b815260206004820152600c60248201526b2737ba1037b832b930ba37b960a11b6044820152606401610525565b6007548211156119d85760405162461bcd60e51b8152602060048201526014602482015273149bdd5b9908191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610525565b6000828152600960208190526040909120015460ff1615611a3b5760405162461bcd60e51b815260206004820152601d60248201527f526f756e642068617320616c7265616479206265656e20636c6f7365640000006044820152606401610525565b611a458282611e41565b61096282611f41565b600a6020528160005260406000208181548110611a6a57600080fd5b90600052602060002001600091509150505481565b611a87611d54565b6001600160a01b038116611aec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610525565b611af581611dae565b50565b600260015403611b4a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610525565b6002600155565b6040516001600160a01b038316602482015260448101829052611bb490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120e4565b505050565b600054600160a01b900460ff16156105ae5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610525565b60008181526009602052604081206001015415801590611c36575060008281526009602052604090206002015415155b8015611c52575060008281526009602052604090206001015442115b8015611782575050600090815260096020526040902060020154421090565b6040516001600160a01b0380851660248301528316604482015260648101829052611ca99085906323b872dd60e01b90608401611b7d565b50505050565b600054600160a01b900460ff166105ae5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610525565b611d07611caf565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000546001600160a01b031633146105ae5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610525565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611e06611bb9565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d373390565b600082815260096020526040902060030154421015611eb25760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201526606d657374616d760cc1b6064820152608401610525565b6000828152600960208190526040909120908101805483919061ff001916610100836002811115611ee557611ee5612460565b021790555060098101805460ff19166001179081905560405184917fd91cafda889a8123e29d543803c1e45746936ddae8d882ec23c5b0e8d394aecd91611f3491610100900460ff16906127e4565b60405180910390a2505050565b600081815260096020526040902060070154158015611f6f5750600081815260096020526040902060080154155b611fb05760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc818d85b18dd5b185d195960721b6044820152606401610525565b6000818152600960205260408120908080806009850154610100900460ff166002811115611fe057611fe0612460565b03612024578360050154925061271060055485600401546120019190612769565b61200b9190612780565b915081846004015461201d91906127bb565b9050612072565b60016009850154610100900460ff16600281111561204457612044612460565b03612065578360060154925061271060055485600401546120019190612769565b5050506004810154600090815b60078401839055600884018190556006805483919060009061209590849061268f565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b6000612139826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121b69092919063ffffffff16565b805190915015611bb4578080602001905181019061215791906127f2565b611bb45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610525565b60606121c584846000856121cd565b949350505050565b60608247101561222e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610525565b600080866001600160a01b0316858760405161224a9190612838565b60006040518083038185875af1925050503d8060008114612287576040519150601f19603f3d011682016040523d82523d6000602084013e61228c565b606091505b509150915061229d878383876122a8565b979650505050505050565b60608315612317578251600003612310576001600160a01b0385163b6123105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610525565b50816121c5565b6121c5838381511561232c5781518083602001fd5b8060405162461bcd60e51b81526004016105259190612854565b6000806040838503121561235957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461237f57600080fd5b919050565b60006020828403121561239657600080fd5b61239f82612368565b9392505050565b600080602083850312156123b957600080fd5b823567ffffffffffffffff808211156123d157600080fd5b818501915085601f8301126123e557600080fd5b8135818111156123f457600080fd5b8660208260051b850101111561240957600080fd5b60209290920196919550909350505050565b60006020828403121561242d57600080fd5b5035919050565b6000806040838503121561244757600080fd5b8235915061245760208401612368565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b6002811061248657612486612460565b9052565b606081016124988286612476565b8360208301528215156040830152949350505050565b6003811061248657612486612460565b6000610160820190508c82528b60208301528a60408301528960608301528860808301528760a08301528660c08301528560e0830152846101008301528315156101208301526125126101408301846124ae565b9c9b505050505050505050505050565b60008060006060848603121561253757600080fd5b61254084612368565b95602085013595506040909401359392505050565b60608082528451828201819052600091906020906080850190828901855b8281101561258f57815184529284019290840190600101612573565b5050508481038286015286518082528783019183019060005b818110156125e15783516125bd848251612476565b808601518487015260409081015115159084015292840192918501916001016125a8565b505080945050505050826040830152949350505050565b6000806040838503121561260b57600080fd5b61261483612368565b946020939093013593505050565b6000806040838503121561263557600080fd5b8235915060208301356003811061264b57600080fd5b809150509250929050565b6020808252600990820152682737ba1030b236b4b760b91b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561178257611782612679565b60208082526014908201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604082015260600190565b6020808252601a908201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604082015260600190565b6020808252602c908201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060408201526b1b5a5b90995d105b5bdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141761178257611782612679565b60008261279d57634e487b7160e01b600052601260045260246000fd5b500490565b6000600182016127b4576127b4612679565b5060010190565b8181038181111561178257611782612679565b634e487b7160e01b600052604160045260246000fd5b6020810161178282846124ae565b60006020828403121561280457600080fd5b8151801515811461239f57600080fd5b60005b8381101561282f578181015183820152602001612817565b50506000910152565b6000825161284a818460208701612814565b9190910192915050565b6020815260008251806020840152612873816040850160208701612814565b601f01601f1916919091016040019291505056fea2646970667358221220311f8b3321672ab3eebdff49b0d5ee3d88d2bc42211a24cf2a2fc1a296327bf664736f6c63430008110033000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff60000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e30000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000000000064

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e45760003560e01c80638456cb591161010f578063c89c1a89116100a2578063f2fde38b11610071578063f2fde38b1461049d578063fa968eea146104b0578063fc0c546a146104b9578063fc6f9468146104e057600080fd5b8063c89c1a8914610465578063cc32d17614610478578063dd1f759614610481578063f2b3c8091461049457600080fd5b8063951fd600116100de578063951fd6001461040a578063a0c7f71c1461042c578063b29a81401461043f578063b3ab15fb1461045257600080fd5b80638456cb59146103645780638a19c8bc1461036c5780638c65c81f146103755780638da5cb5b146103f957600080fd5b80633f4ba83a11610187578063704b6c0211610156578063704b6c02146102e8578063715018a6146102fb5780637285c58b1461030357806377e741c71461035157600080fd5b80633f4ba83a1461029c5780635c975abb146102a45780636ba4c138146102c25780636c188593146102d557600080fd5b8063127effb2116101c3578063127effb214610219578063273867d414610249578063368acb09146102805780633923e1b41461028957600080fd5b80623bdc74146101e9578063040ae259146101f35780630e89e5a414610206575b600080fd5b6101f16104f3565b005b6101f1610201366004612346565b6105b0565b6101f1610214366004612346565b610747565b60035461022c906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610272610257366004612384565b6001600160a01b03166000908152600a602052604090205490565b604051908152602001610240565b61027260065481565b6101f1610297366004612346565b610966565b6101f1610b6e565b600054600160a01b900460ff165b6040519015158152602001610240565b6101f16102d03660046123a6565b610c10565b6101f16102e336600461241b565b61105d565b6101f16102f6366004612384565b611116565b6101f16111c2565b610342610311366004612434565b600860209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b6040516102409392919061248a565b6101f161035f36600461241b565b6111d4565b6101f1611288565b61027260075481565b6103e261038336600461241b565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015498909901549698959794969395929491939092919060ff808216916101009004168b565b6040516102409b9a999897969594939291906124be565b6000546001600160a01b031661022c565b61041d610418366004612522565b61132a565b60405161024093929190612555565b6102b261043a366004612434565b611581565b6101f161044d3660046125f8565b611788565b6101f1610460366004612384565b611877565b6101f1610473366004612622565b61193e565b61027260055481565b61027261048f3660046125f8565b611a4e565b6102726103e881565b6101f16104ab366004612384565b611a7f565b61027260045481565b61022c7f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff681565b60025461022c906001600160a01b031681565b6104fb611af8565b6002546001600160a01b0316331461052e5760405162461bcd60e51b815260040161052590612656565b60405180910390fd5b600680546000909155600254610571906001600160a01b037f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff68116911683611b51565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a1506105ae60018055565b565b6105b8611bb9565b6003546001600160a01b031633146106015760405162461bcd60e51b815260206004820152600c60248201526b2737ba1037b832b930ba37b960a11b6044820152606401610525565b42821161066d5760405162461bcd60e51b815260206004820152603460248201527f6c6f636b54696d657374616d70206d75737420626520677265617465722074686044820152730616e2063757272656e742074696d657374616d760641b6064820152608401610525565b8082106106d55760405162461bcd60e51b815260206004820152603060248201527f6c6f636b2074696d657374616d70206d757374206265206c657373207468616e60448201526f020636c6f73652074696d657374616d760841b6064820152608401610525565b6007546106e390600161268f565b60078181556000918252600960205260408083204260018201556002810186905560038101859055825481556004810184905591549051919290917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b4529190a2505050565b61074f611bb9565b610757611af8565b333b156107765760405162461bcd60e51b8152600401610525906126a2565b3332146107955760405162461bcd60e51b8152600401610525906126d0565b61079e82611c06565b6107df5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610525565b6004548110156108015760405162461bcd60e51b815260040161052590612707565b60008281526008602090815260408083203384529091529020600101541561086b5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610525565b6108a06001600160a01b037f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff616333084611c71565b600082815260096020526040902060048101548291906108c190839061268f565b600482015560068101546108d690839061268f565b6006820155600084815260086020908152604080832033808552908352818420805460ff191660019081178255808201889055600a855283862080549182018155865294849020909401889055905185815287927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d91015b60405180910390a350505061096260018055565b5050565b61096e611bb9565b610976611af8565b333b156109955760405162461bcd60e51b8152600401610525906126a2565b3332146109b45760405162461bcd60e51b8152600401610525906126d0565b6109bd82611c06565b6109fe5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610525565b600454811015610a205760405162461bcd60e51b815260040161052590612707565b600082815260086020908152604080832033845290915290206001015415610a8a5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610525565b610abf6001600160a01b037f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff616333084611c71565b60008281526009602052604090206004810154829190610ae090839061268f565b60048201556005810154610af590839061268f565b6005820155600084815260086020908152604080832033808552908352818420805460ff191681556001808201889055600a855283862080549182018155865294849020909401889055905185815287927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c12910161094e565b610b76611caf565b6002546001600160a01b0316331480610b9957506003546001600160a01b031633145b610bda5760405162461bcd60e51b81526020600482015260126024820152712737ba1037b832b930ba37b917b0b236b4b760711b6044820152606401610525565b610be2611cff565b6007546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b610c18611af8565b333b15610c375760405162461bcd60e51b8152600401610525906126a2565b333214610c565760405162461bcd60e51b8152600401610525906126d0565b6000805b828110156110185760096000858584818110610c7857610c78612753565b90506020020135815260200190815260200160002060010154600003610cd85760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081a185cc81b9bdd081cdd185c9d1959605a1b6044820152606401610525565b60096000858584818110610cee57610cee612753565b905060200201358152602001908152602001600020600301544211610d4b5760405162461bcd60e51b8152602060048201526013602482015272149bdd5b99081a185cc81b9bdd08195b991959606a1b6044820152606401610525565b600060096000868685818110610d6357610d63612753565b602090810292909201358352508101919091526040016000206009015460ff1615610f4d57610daa858584818110610d9d57610d9d612753565b9050602002013533611581565b610def5760405162461bcd60e51b81526020600482015260166024820152754e6f7420656c696769626c6520666f7220636c61696d60501b6044820152606401610525565b600060096000878786818110610e0757610e07612753565b905060200201358152602001908152602001600020604051806101600160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481526020016009820160009054906101000a900460ff161515151581526020016009820160019054906101000a900460ff166002811115610ec157610ec1612460565b6002811115610ed257610ed2612460565b8152505090508060e0015181610100015160086000898988818110610ef957610ef9612753565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b0316815260200190815260200160002060010154610f3f9190612769565b610f499190612780565b9150505b600160086000878786818110610f6557610f65612753565b6020908102929092013583525081810192909252604090810160009081203382529092529020600201805460ff1916911515919091179055610fa7818461268f565b9250848483818110610fbb57610fbb612753565b90506020020135336001600160a01b03167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf783604051610ffd91815260200190565b60405180910390a35080611010816127a2565b915050610c5a565b508015611053576110536001600160a01b037f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff6163383611b51565b5061096260018055565b611065611caf565b6002546001600160a01b0316331461108f5760405162461bcd60e51b815260040161052590612656565b806000036110d75760405162461bcd60e51b815260206004820152601560248201527404d757374206265207375706572696f7220746f203605c1b6044820152606401610525565b60048190556007546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b61111e611d54565b6001600160a01b03811661116d5760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b6044820152606401610525565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b6111ca611d54565b6105ae6000611dae565b6111dc611caf565b6002546001600160a01b031633146112065760405162461bcd60e51b815260040161052590612656565b6103e88111156112505760405162461bcd60e51b81526020600482015260156024820152740a8e4cac2e6eae4f240cccaca40e8dede40d0d2ced605b1b6044820152606401610525565b60058190556007546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a8579060200161110b565b611290611bb9565b6002546001600160a01b03163314806112b357506003546001600160a01b031633145b6112f45760405162461bcd60e51b81526020600482015260126024820152712737ba1037b832b930ba37b917b0b236b4b760711b6044820152606401610525565b6112fc611dfe565b6007546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6001600160a01b0383166000908152600a6020526040812054606091829184906113559087906127bb565b811115611383576001600160a01b0387166000908152600a60205260409020546113809087906127bb565b90505b60008167ffffffffffffffff81111561139e5761139e6127ce565b6040519080825280602002602001820160405280156113c7578160200160208202803683370190505b50905060008267ffffffffffffffff8111156113e5576113e56127ce565b60405190808252806020026020018201604052801561143057816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816114035790505b50905060005b83811015611562576001600160a01b038a166000908152600a60205260409020611460828b61268f565b8154811061147057611470612753565b906000526020600020015483828151811061148d5761148d612753565b602002602001018181525050600860008483815181106114af576114af612753565b602090810291909101810151825281810192909252604090810160009081206001600160a01b038e168252909252908190208151606081019092528054829060ff16600181111561150257611502612460565b600181111561151357611513612460565b81526001820154602082015260029091015460ff161515604090910152825183908390811061154457611544612753565b6020026020010181905250808061155a906127a2565b915050611436565b50818161156f858b61268f565b95509550955050505093509350939050565b60008281526008602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff1660018111156115c9576115c9612460565b60018111156115da576115da612460565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600980845285822086516101608101885281548152958101549486019490945283870154958501959095526003830154606085015260048301546080850152600583015460a0850152600683015460c0850152600783015460e0850152600883015461010085810191909152948301548083161515610120860152969750959294919361014086019304169081111561169e5761169e612460565b60028111156116af576116af612460565b9052509050600281610140015160028111156116cd576116cd612460565b036116dd57600092505050611782565b80610120015180156116f25750602082015115155b801561170057508160400151155b801561177d57506000816101400151600281111561172057611720612460565b14801561173f575060008251600181111561173d5761173d612460565b145b8061177d57506001816101400151600281111561175e5761175e612460565b14801561177d575060018251600181111561177b5761177b612460565b145b925050505b92915050565b611790611d54565b7f000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff66001600160a01b0316826001600160a01b03160361181c5760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f742062652070726564696374696f6e20746f6b656e206164647265604482015261737360f01b6064820152608401610525565b6118306001600160a01b0383163383611b51565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e988260405161186b91815260200190565b60405180910390a25050565b6002546001600160a01b031633146118a15760405162461bcd60e51b815260040161052590612656565b6001600160a01b0381166118f05760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b6044820152606401610525565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e2906020016111b7565b611946611bb9565b6003546001600160a01b0316331461198f5760405162461bcd60e51b815260206004820152600c60248201526b2737ba1037b832b930ba37b960a11b6044820152606401610525565b6007548211156119d85760405162461bcd60e51b8152602060048201526014602482015273149bdd5b9908191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610525565b6000828152600960208190526040909120015460ff1615611a3b5760405162461bcd60e51b815260206004820152601d60248201527f526f756e642068617320616c7265616479206265656e20636c6f7365640000006044820152606401610525565b611a458282611e41565b61096282611f41565b600a6020528160005260406000208181548110611a6a57600080fd5b90600052602060002001600091509150505481565b611a87611d54565b6001600160a01b038116611aec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610525565b611af581611dae565b50565b600260015403611b4a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610525565b6002600155565b6040516001600160a01b038316602482015260448101829052611bb490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120e4565b505050565b600054600160a01b900460ff16156105ae5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610525565b60008181526009602052604081206001015415801590611c36575060008281526009602052604090206002015415155b8015611c52575060008281526009602052604090206001015442115b8015611782575050600090815260096020526040902060020154421090565b6040516001600160a01b0380851660248301528316604482015260648101829052611ca99085906323b872dd60e01b90608401611b7d565b50505050565b600054600160a01b900460ff166105ae5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610525565b611d07611caf565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000546001600160a01b031633146105ae5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610525565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611e06611bb9565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611d373390565b600082815260096020526040902060030154421015611eb25760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201526606d657374616d760cc1b6064820152608401610525565b6000828152600960208190526040909120908101805483919061ff001916610100836002811115611ee557611ee5612460565b021790555060098101805460ff19166001179081905560405184917fd91cafda889a8123e29d543803c1e45746936ddae8d882ec23c5b0e8d394aecd91611f3491610100900460ff16906127e4565b60405180910390a2505050565b600081815260096020526040902060070154158015611f6f5750600081815260096020526040902060080154155b611fb05760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc818d85b18dd5b185d195960721b6044820152606401610525565b6000818152600960205260408120908080806009850154610100900460ff166002811115611fe057611fe0612460565b03612024578360050154925061271060055485600401546120019190612769565b61200b9190612780565b915081846004015461201d91906127bb565b9050612072565b60016009850154610100900460ff16600281111561204457612044612460565b03612065578360060154925061271060055485600401546120019190612769565b5050506004810154600090815b60078401839055600884018190556006805483919060009061209590849061268f565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b6000612139826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121b69092919063ffffffff16565b805190915015611bb4578080602001905181019061215791906127f2565b611bb45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610525565b60606121c584846000856121cd565b949350505050565b60608247101561222e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610525565b600080866001600160a01b0316858760405161224a9190612838565b60006040518083038185875af1925050503d8060008114612287576040519150601f19603f3d011682016040523d82523d6000602084013e61228c565b606091505b509150915061229d878383876122a8565b979650505050505050565b60608315612317578251600003612310576001600160a01b0385163b6123105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610525565b50816121c5565b6121c5838381511561232c5781518083602001fd5b8060405162461bcd60e51b81526004016105259190612854565b6000806040838503121561235957600080fd5b50508035926020909101359150565b80356001600160a01b038116811461237f57600080fd5b919050565b60006020828403121561239657600080fd5b61239f82612368565b9392505050565b600080602083850312156123b957600080fd5b823567ffffffffffffffff808211156123d157600080fd5b818501915085601f8301126123e557600080fd5b8135818111156123f457600080fd5b8660208260051b850101111561240957600080fd5b60209290920196919550909350505050565b60006020828403121561242d57600080fd5b5035919050565b6000806040838503121561244757600080fd5b8235915061245760208401612368565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b6002811061248657612486612460565b9052565b606081016124988286612476565b8360208301528215156040830152949350505050565b6003811061248657612486612460565b6000610160820190508c82528b60208301528a60408301528960608301528860808301528760a08301528660c08301528560e0830152846101008301528315156101208301526125126101408301846124ae565b9c9b505050505050505050505050565b60008060006060848603121561253757600080fd5b61254084612368565b95602085013595506040909401359392505050565b60608082528451828201819052600091906020906080850190828901855b8281101561258f57815184529284019290840190600101612573565b5050508481038286015286518082528783019183019060005b818110156125e15783516125bd848251612476565b808601518487015260409081015115159084015292840192918501916001016125a8565b505080945050505050826040830152949350505050565b6000806040838503121561260b57600080fd5b61261483612368565b946020939093013593505050565b6000806040838503121561263557600080fd5b8235915060208301356003811061264b57600080fd5b809150509250929050565b6020808252600990820152682737ba1030b236b4b760b91b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561178257611782612679565b60208082526014908201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604082015260600190565b6020808252601a908201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604082015260600190565b6020808252602c908201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060408201526b1b5a5b90995d105b5bdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b808202811582820484141761178257611782612679565b60008261279d57634e487b7160e01b600052601260045260246000fd5b500490565b6000600182016127b4576127b4612679565b5060010190565b8181038181111561178257611782612679565b634e487b7160e01b600052604160045260246000fd5b6020810161178282846124ae565b60006020828403121561280457600080fd5b8151801515811461239f57600080fd5b60005b8381101561282f578181015183820152602001612817565b50506000910152565b6000825161284a818460208701612814565b9190910192915050565b6020815260008251806020840152612873816040850160208701612814565b601f01601f1916919091016040019291505056fea2646970667358221220311f8b3321672ab3eebdff49b0d5ee3d88d2bc42211a24cf2a2fc1a296327bf664736f6c63430008110033

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

000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff60000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e30000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000000000064

-----Decoded View---------------
Arg [0] : _token (address): 0xbb9FD9Fa4863C03c574007fF3370787B9cE65ff6
Arg [1] : _adminAddress (address): 0x9Ce5Adaad05949D6E1627bfBE2C9a3e67C9C83E3
Arg [2] : _operatorAddress (address): 0x9Ce5Adaad05949D6E1627bfBE2C9a3e67C9C83E3
Arg [3] : _minBetAmount (uint256): 5000000000000000000000
Arg [4] : _treasuryFee (uint256): 100

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000bb9fd9fa4863c03c574007ff3370787b9ce65ff6
Arg [1] : 0000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e3
Arg [2] : 0000000000000000000000009ce5adaad05949d6e1627bfbe2c9a3e67c9c83e3
Arg [3] : 00000000000000000000000000000000000000000000010f0cf064dd59200000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000064


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.