Donau Testnet

Contract

0x8DCa862cBCFc27F4e85Ea9Dd08A673497CAD201b
Source Code Source Code

Overview

BTT Balance

Bittorent Chain LogoBittorent Chain LogoBittorent Chain Logo0 BTT

More Info

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Amount
Execute Round371999502024-05-09 15:04:36639 days ago1715267076IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371999462024-05-09 15:04:28639 days ago1715267068IN
0x8DCa862c...97CAD201b
1 wei1,897.0479,000,000
Execute Round371998812024-05-09 15:02:14639 days ago1715266934IN
0x8DCa862c...97CAD201b
0 BTT2,681.8749,000,000
Update Pyth Orac...371998772024-05-09 15:02:06639 days ago1715266926IN
0x8DCa862c...97CAD201b
1 wei1,896.4539,000,000
Execute Round371998132024-05-09 14:59:54639 days ago1715266794IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371998092024-05-09 14:59:46639 days ago1715266786IN
0x8DCa862c...97CAD201b
1 wei1,897.0749,000,000
Execute Round371997452024-05-09 14:57:34639 days ago1715266654IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371997432024-05-09 14:57:26639 days ago1715266646IN
0x8DCa862c...97CAD201b
1 wei1,896.8589,000,000
Execute Round371996792024-05-09 14:55:14639 days ago1715266514IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371996752024-05-09 14:55:06639 days ago1715266506IN
0x8DCa862c...97CAD201b
1 wei1,896.3729,000,000
Execute Round371996132024-05-09 14:52:58639 days ago1715266378IN
0x8DCa862c...97CAD201b
0 BTT2,681.8749,000,000
Update Pyth Orac...371996092024-05-09 14:52:50639 days ago1715266370IN
0x8DCa862c...97CAD201b
1 wei1,896.9669,000,000
Execute Round371995432024-05-09 14:50:34639 days ago1715266234IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371995402024-05-09 14:50:28639 days ago1715266228IN
0x8DCa862c...97CAD201b
1 wei1,897.1289,000,000
Execute Round371994762024-05-09 14:48:16639 days ago1715266096IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371994732024-05-09 14:48:10639 days ago1715266090IN
0x8DCa862c...97CAD201b
1 wei1,896.6159,000,000
Execute Round371994072024-05-09 14:45:54639 days ago1715265954IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371994032024-05-09 14:45:46639 days ago1715265946IN
0x8DCa862c...97CAD201b
1 wei1,896.7779,000,000
Execute Round371993302024-05-09 14:43:16639 days ago1715265796IN
0x8DCa862c...97CAD201b
0 BTT2,681.8749,000,000
Update Pyth Orac...371993262024-05-09 14:43:08639 days ago1715265788IN
0x8DCa862c...97CAD201b
1 wei1,896.2649,000,000
Execute Round371992612024-05-09 14:40:54639 days ago1715265654IN
0x8DCa862c...97CAD201b
0 BTT2,681.8749,000,000
Update Pyth Orac...371992582024-05-09 14:40:48639 days ago1715265648IN
0x8DCa862c...97CAD201b
1 wei1,896.5079,000,000
Execute Round371991932024-05-09 14:38:34639 days ago1715265514IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
Update Pyth Orac...371991902024-05-09 14:38:28639 days ago1715265508IN
0x8DCa862c...97CAD201b
1 wei1,897.299,000,000
Execute Round371991252024-05-09 14:36:14639 days ago1715265374IN
0x8DCa862c...97CAD201b
0 BTT2,679.7329,000,000
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Amount
371999502024-05-09 15:04:36639 days ago1715267076
0x8DCa862c...97CAD201b
0 BTT
371999462024-05-09 15:04:28639 days ago1715267068
0x8DCa862c...97CAD201b
1 wei
371999462024-05-09 15:04:28639 days ago1715267068
0x8DCa862c...97CAD201b
0 BTT
371998812024-05-09 15:02:14639 days ago1715266934
0x8DCa862c...97CAD201b
0 BTT
371998772024-05-09 15:02:06639 days ago1715266926
0x8DCa862c...97CAD201b
1 wei
371998772024-05-09 15:02:06639 days ago1715266926
0x8DCa862c...97CAD201b
0 BTT
371998132024-05-09 14:59:54639 days ago1715266794
0x8DCa862c...97CAD201b
0 BTT
371998092024-05-09 14:59:46639 days ago1715266786
0x8DCa862c...97CAD201b
1 wei
371998092024-05-09 14:59:46639 days ago1715266786
0x8DCa862c...97CAD201b
0 BTT
371997452024-05-09 14:57:34639 days ago1715266654
0x8DCa862c...97CAD201b
0 BTT
371997432024-05-09 14:57:26639 days ago1715266646
0x8DCa862c...97CAD201b
1 wei
371997432024-05-09 14:57:26639 days ago1715266646
0x8DCa862c...97CAD201b
0 BTT
371996792024-05-09 14:55:14639 days ago1715266514
0x8DCa862c...97CAD201b
0 BTT
371996752024-05-09 14:55:06639 days ago1715266506
0x8DCa862c...97CAD201b
1 wei
371996752024-05-09 14:55:06639 days ago1715266506
0x8DCa862c...97CAD201b
0 BTT
371996132024-05-09 14:52:58639 days ago1715266378
0x8DCa862c...97CAD201b
0 BTT
371996092024-05-09 14:52:50639 days ago1715266370
0x8DCa862c...97CAD201b
1 wei
371996092024-05-09 14:52:50639 days ago1715266370
0x8DCa862c...97CAD201b
0 BTT
371995432024-05-09 14:50:34639 days ago1715266234
0x8DCa862c...97CAD201b
0 BTT
371995402024-05-09 14:50:28639 days ago1715266228
0x8DCa862c...97CAD201b
1 wei
371995402024-05-09 14:50:28639 days ago1715266228
0x8DCa862c...97CAD201b
0 BTT
371994762024-05-09 14:48:16639 days ago1715266096
0x8DCa862c...97CAD201b
0 BTT
371994732024-05-09 14:48:10639 days ago1715266090
0x8DCa862c...97CAD201b
1 wei
371994732024-05-09 14:48:10639 days ago1715266090
0x8DCa862c...97CAD201b
0 BTT
371994072024-05-09 14:45:54639 days ago1715265954
0x8DCa862c...97CAD201b
0 BTT
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GamesFiPrediction

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
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";
import {IPyth}  from "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
import {PythStructs} from "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";

/**
 * @title GamesFiPrediction
 */
contract GamesFiPrediction is Ownable, Pausable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IERC20 public immutable token; // Prediction token
	
	IPyth public oracle;
	bytes32 public priceId;

	
    bool public genesisLockOnce = false;
    bool public genesisStartOnce = false;

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

    uint256 public intervalSeconds; // interval in seconds between two prediction rounds

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

    uint256 public currentEpoch; // current epoch for prediction round

    uint256 public oracleLatestRoundId; // converted from uint80 (Chainlink)
    uint256 public oracleUpdateAllowance; // seconds

    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
    }

    struct Round {
        uint256 epoch;
        uint256 startTimestamp;
        uint256 lockTimestamp;
        uint256 closeTimestamp;
        int256 lockPrice;
        int256 closePrice;
        uint256 lockOracleId;
        uint256 closeOracleId;
        uint256 totalAmount;
        uint256 bullAmount;
        uint256 bearAmount;
        uint256 rewardBaseCalAmount;
        uint256 rewardAmount;
        bool oracleCalled;
    }

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

    event BetBear(address indexed sender, uint256 indexed epoch, uint256 amount);
    event BetBull(address indexed sender, uint256 indexed epoch, uint256 amount);
    event Claim(address indexed sender, uint256 indexed epoch, uint256 amount);
    event EndRound(uint256 indexed epoch, uint256 indexed roundId, int256 price);
    event LockRound(uint256 indexed epoch, uint256 indexed roundId, int256 price);

    event NewAdminAddress(address admin);
    event NewIntervalSeconds(uint256 intervalSeconds);
    event NewMinBetAmount(uint256 indexed epoch, uint256 minBetAmount);
    event NewTreasuryFee(uint256 indexed epoch, uint256 treasuryFee);
    event NewOperatorAddress(address operator);
    event NewOracle(address oracle);
	event NewPriceId(bytes32 priceId);
    event NewOracleUpdateAllowance(uint256 oracleUpdateAllowance);

    event Pause(uint256 indexed epoch);
    event RewardsCalculated(
        uint256 indexed epoch,
        uint256 rewardBaseCalAmount,
        uint256 rewardAmount,
        uint256 treasuryAmount
    );

    event StartRound(uint256 indexed epoch);
    event TokenRecovery(address indexed token, uint256 amount);
    event TreasuryClaim(uint256 amount);
    event Unpause(uint256 indexed epoch);

    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 _oracleAddress: oracle address
     * @param _adminAddress: admin address
     * @param _operatorAddress: operator address
     * @param _intervalSeconds: number of time within an interval
     * @param _minBetAmount: minimum bet amounts (in wei)
     * @param _oracleUpdateAllowance: oracle update allowance
     * @param _treasuryFee: treasury fee (1000 = 10%)
     * @param _priceId: price id from oracle
     */
    constructor(
        IERC20 _token,
        address _oracleAddress,
        address _adminAddress,
        address _operatorAddress,
        uint256 _intervalSeconds,
        uint256 _minBetAmount,
        uint256 _oracleUpdateAllowance,
        uint256 _treasuryFee,
		bytes32 _priceId
    ) {
        require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high");

        token = _token;
        oracle = IPyth(_oracleAddress);
        adminAddress = _adminAddress;
        operatorAddress = _operatorAddress;
        intervalSeconds = _intervalSeconds;
        minBetAmount = _minBetAmount;
        oracleUpdateAllowance = _oracleUpdateAllowance;
        treasuryFee = _treasuryFee;
		priceId = _priceId;
    }

	
	/**
	 * @notice Fallback function to receive Ether
	 */
	receive() external payable {}

	/**
	 * @notice Fallback function to receive Ether so we can use for pyth
	 */
	fallback() external payable {}
    /**
     * @notice Bet bear position
     * @param epoch: epoch
     */
    function betBear(uint256 epoch, uint256 _amount) external whenNotPaused nonReentrant notContract {
        require(epoch == currentEpoch, "Bet is too early/late");
        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 {
        require(epoch == currentEpoch, "Bet is too early/late");
        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]].oracleCalled) {
                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;
            }
            // Round invalid, refund bet amount
            else {
                require(refundable(epochs[i], msg.sender), "Not eligible for refund");
                addedReward = ledger[epochs[i]][msg.sender].amount;
            }

            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 Start the next round n, lock price for round n-1, end round n-2
     * @dev Callable by operator
     */
    function executeRound() payable external whenNotPaused onlyOperator {
        require(
            genesisStartOnce && genesisLockOnce,
            "Can only run after genesisStartRound and genesisLockRound is triggered"
        );

        (uint80 currentRoundId, int256 currentPrice) = getPriceFromOracle();

        oracleLatestRoundId = uint256(currentRoundId);

        // CurrentEpoch refers to previous round (n-1)
        _safeLockRound(currentEpoch, currentRoundId, currentPrice);
        _safeEndRound(currentEpoch - 1, currentRoundId, currentPrice);
        _calculateRewards(currentEpoch - 1);

        // Increment currentEpoch to current round (n)
        currentEpoch = currentEpoch + 1;
        _safeStartRound(currentEpoch);
    }

    /**
     * @notice Lock genesis round
     * @dev Callable by operator
     */
    function genesisLockRound() external whenNotPaused onlyOperator {
        require(genesisStartOnce, "Can only run after genesisStartRound is triggered");
        require(!genesisLockOnce, "Can only run genesisLockRound once");

        (uint80 currentRoundId, int256 currentPrice) = getPriceFromOracle();

        oracleLatestRoundId = uint256(currentRoundId);

        _safeLockRound(currentEpoch, currentRoundId, currentPrice);

        currentEpoch = currentEpoch + 1;
        _startRound(currentEpoch);
        genesisLockOnce = true;
    }

    /**
     * @notice Start genesis round
     * @dev Callable by admin or operator
     */
    function genesisStartRound() external whenNotPaused onlyOperator {
        require(!genesisStartOnce, "Can only run genesisStartRound once");

        currentEpoch = currentEpoch + 1;
        _startRound(currentEpoch);
        genesisStartOnce = true;
    }

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

        emit Pause(currentEpoch);
    }

    /**
     * @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 {
        genesisStartOnce = false;
        genesisLockOnce = false;
        _unpause();

        emit Unpause(currentEpoch);
    }

    /**
     * @notice Set buffer and interval (in seconds)
     * @dev Callable by admin
     */
    function setIntervalSeconds( uint256 _intervalSeconds)
        external
        whenPaused
        onlyAdmin
    {
        intervalSeconds = _intervalSeconds;

        emit NewIntervalSeconds(_intervalSeconds);
    }

    /**
     * @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(currentEpoch, 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 Oracle address
     * @dev Callable by admin
     */
    function setOracle(address _oracle) external whenPaused onlyAdmin {
        require(_oracle != address(0), "Cannot be zero address");
        oracleLatestRoundId = 0;
        oracle = IPyth(_oracle);
		
        emit NewOracle(_oracle);
    }

    /**
     * @notice Set oracle update allowance
     * @dev Callable by admin
     */
    function setOracleUpdateAllowance(uint256 _oracleUpdateAllowance) external whenPaused onlyAdmin {
        oracleUpdateAllowance = _oracleUpdateAllowance;

        emit NewOracleUpdateAllowance(_oracleUpdateAllowance);
    }

    /**
     * @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(currentEpoch, 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.lockPrice == round.closePrice) {
            return false;
        }
        return
            round.oracleCalled &&
            betInfo.amount != 0 &&
            !betInfo.claimed &&
            ((round.closePrice > round.lockPrice && betInfo.position == Position.Bull) ||
                (round.closePrice < round.lockPrice && betInfo.position == Position.Bear));
    }

    /**
     * @notice Get the refundable stats of specific epoch and user account
     * @param epoch: epoch
     * @param user: user address
     */
    function refundable(uint256 epoch, address user) public view returns (bool) {
        BetInfo memory betInfo = ledger[epoch][user];
        Round memory round = rounds[epoch];
        return
            !round.oracleCalled &&
            !betInfo.claimed &&
            block.timestamp > round.closeTimestamp &&
            betInfo.amount != 0;
    }

    /**
     * @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
        if (round.closePrice > round.lockPrice) {
            rewardBaseCalAmount = round.bullAmount;
            treasuryAmt = (round.totalAmount * treasuryFee) / 10000;
            rewardAmount = round.totalAmount - treasuryAmt;
        }
        // Bear wins
        else if (round.closePrice < round.lockPrice) {
            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 roundId: roundId
     * @param price: price of the round
     */
    function _safeEndRound(
        uint256 epoch,
        uint256 roundId,
        int256 price
    ) internal {
        require(rounds[epoch].lockTimestamp != 0, "Can only end round after round has locked");
        require(block.timestamp >= rounds[epoch].closeTimestamp, "Can only end round after closeTimestamp");
        Round storage round = rounds[epoch];
        round.closePrice = price;
        round.closeOracleId = roundId;
        round.oracleCalled = true;

        emit EndRound(epoch, roundId, round.closePrice);
    }

    /**
     * @notice Lock round
     * @param epoch: epoch
     * @param roundId: roundId
     * @param price: price of the round
     */
    function _safeLockRound(
        uint256 epoch,
        uint256 roundId,
        int256 price
    ) internal {
        require(rounds[epoch].startTimestamp != 0, "Can only lock round after round has started");
        require(block.timestamp >= rounds[epoch].lockTimestamp, "Can only lock round after lockTimestamp");
        Round storage round = rounds[epoch];
        round.closeTimestamp = block.timestamp + intervalSeconds;
        round.lockPrice = price;
        round.lockOracleId = roundId;

        emit LockRound(epoch, roundId, round.lockPrice);
    }

    /**
     * @notice Start round
     * Previous round n-2 must end
     * @param epoch: epoch
     */
    function _safeStartRound(uint256 epoch) internal {
        require(genesisStartOnce, "Can only run after genesisStartRound is triggered");
        require(rounds[epoch - 2].closeTimestamp != 0, "Can only start round after round n-2 has ended");
        require(
            block.timestamp >= rounds[epoch - 2].closeTimestamp,
            "Can only start new round after round n-2 closeTimestamp"
        );
        _startRound(epoch);
    }

    /**
     * @notice Start round
     * Previous round n-2 must end
     * @param epoch: epoch
     */
    function _startRound(uint256 epoch) internal {
        Round storage round = rounds[epoch];
        round.startTimestamp = block.timestamp;
        round.lockTimestamp = block.timestamp + intervalSeconds;
        round.closeTimestamp = block.timestamp + (2 * intervalSeconds);
        round.epoch = epoch;
        round.totalAmount = 0;

        emit StartRound(epoch);
    }

    /**
     * @notice Determine if a round is valid for receiving bets
     * Round must have started and 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;
    }
	
	function updatePythOracle(bytes[] calldata priceUpdateData) external payable onlyAdminOrOperator  {
		// Update the on-chain Pyth price(s)
		uint fee = oracle.getUpdateFee(priceUpdateData);
		oracle.updatePriceFeeds{ value: fee }(priceUpdateData);
	}
    /**
     * @notice Get latest recorded price from oracle
     * If it falls below allowed buffer or has not updated, it would be invalid.
     */
    function getPriceFromOracle( ) public view returns (uint80, int256) {
        uint256 leastAllowedTimestamp = block.timestamp + oracleUpdateAllowance;

		// Get price from pyth
		PythStructs.Price memory priceObject = oracle.getPriceUnsafe(priceId);
		int256 price = int256(priceObject.price);
		uint256 timestamp = priceObject.publishTime;
		uint80 roundId = uint80(priceObject.publishTime);
		require(timestamp <= leastAllowedTimestamp, "Oracle update exceeded max timestamp allowance");
        require(
            uint256(roundId) > oracleLatestRoundId,
            "Oracle update roundId must be larger than oracleLatestRoundId"
        );
        return (roundId, price);
    }

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

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

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./PythStructs.sol";
import "./IPythEvents.sol";

/// @title Consume prices from the Pyth Network (https://pyth.network/).
/// @dev Please refer to the guidance at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how to consume prices safely.
/// @author Pyth Data Association
interface IPyth is IPythEvents {
    /// @notice Returns the period (in seconds) that a price feed is considered valid since its publish time
    function getValidTimePeriod() external view returns (uint validTimePeriod);

    /// @notice Returns the price and confidence interval.
    /// @dev Reverts if the price has not been updated within the last `getValidTimePeriod()` seconds.
    /// @param id The Pyth Price Feed ID of which to fetch the price and confidence interval.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPrice(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price and confidence interval.
    /// @dev Reverts if the EMA price is not available.
    /// @param id The Pyth Price Feed ID of which to fetch the EMA price and confidence interval.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPrice(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the price of a price feed without any sanity checks.
    /// @dev This function returns the most recent price update in this contract without any recency checks.
    /// This function is unsafe as the returned price update may be arbitrarily far in the past.
    ///
    /// Users of this function should check the `publishTime` in the price to ensure that the returned price is
    /// sufficiently recent for their application. If you are considering using this function, it may be
    /// safer / easier to use either `getPrice` or `getPriceNoOlderThan`.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPriceUnsafe(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the price that is no older than `age` seconds of the current time.
    /// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in
    /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
    /// recently.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPriceNoOlderThan(
        bytes32 id,
        uint age
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.
    /// @dev This function returns the same price as `getEmaPrice` in the case where the price is available.
    /// However, if the price is not recent this function returns the latest available price.
    ///
    /// The returned price can be from arbitrarily far in the past; this function makes no guarantees that
    /// the returned price is recent or useful for any particular application.
    ///
    /// Users of this function should check the `publishTime` in the price to ensure that the returned price is
    /// sufficiently recent for their application. If you are considering using this function, it may be
    /// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPriceUnsafe(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds
    /// of the current time.
    /// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in
    /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
    /// recently.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPriceNoOlderThan(
        bytes32 id,
        uint age
    ) external view returns (PythStructs.Price memory price);

    /// @notice Update price feeds with given update messages.
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    /// Prices will be updated if they are more recent than the current stored prices.
    /// The call will succeed even if the update is not the most recent.
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid.
    /// @param updateData Array of price update data.
    function updatePriceFeeds(bytes[] calldata updateData) external payable;

    /// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is
    /// necessary if the current on-chain publishTime is older than the given publishTime. It relies solely on the
    /// given `publishTimes` for the price feeds and does not read the actual price update publish time within `updateData`.
    ///
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    ///
    /// `priceIds` and `publishTimes` are two arrays with the same size that correspond to senders known publishTime
    /// of each priceId when calling this method. If all of price feeds within `priceIds` have updated and have
    /// a newer or equal publish time than the given publish time, it will reject the transaction to save gas.
    /// Otherwise, it calls updatePriceFeeds method to update the prices.
    ///
    /// @dev Reverts if update is not needed or the transferred fee is not sufficient or the updateData is invalid.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param publishTimes Array of publishTimes. `publishTimes[i]` corresponds to known `publishTime` of `priceIds[i]`
    function updatePriceFeedsIfNecessary(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64[] calldata publishTimes
    ) external payable;

    /// @notice Returns the required fee to update an array of price updates.
    /// @param updateData Array of price update data.
    /// @return feeAmount The required fee in Wei.
    function getUpdateFee(
        bytes[] calldata updateData
    ) external view returns (uint feeAmount);

    /// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published
    /// within `minPublishTime` and `maxPublishTime`.
    ///
    /// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;
    /// otherwise, please consider using `updatePriceFeeds`. This method may store the price updates on-chain, if they
    /// are more recent than the current stored prices.
    ///
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    ///
    ///
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
    /// no update for any of the given `priceIds` within the given time range.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
    /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
    /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
    function parsePriceFeedUpdates(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64 minPublishTime,
        uint64 maxPublishTime
    ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);

    /// @notice Similar to `parsePriceFeedUpdates` but ensures the updates returned are
    /// the first updates published in minPublishTime. That is, if there are multiple updates for a given timestamp,
    /// this method will return the first update. This method may store the price updates on-chain, if they
    /// are more recent than the current stored prices.
    ///
    ///
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
    /// no update for any of the given `priceIds` within the given time range and uniqueness condition.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
    /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
    /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
    function parsePriceFeedUpdatesUnique(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64 minPublishTime,
        uint64 maxPublishTime
    ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
}

File 11 of 12 : IPythEvents.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @title IPythEvents contains the events that Pyth contract emits.
/// @dev This interface can be used for listening to the updates for off-chain and testing purposes.
interface IPythEvents {
    /// @dev Emitted when the price feed with `id` has received a fresh update.
    /// @param id The Pyth Price Feed ID.
    /// @param publishTime Publish time of the given price update.
    /// @param price Price of the given price update.
    /// @param conf Confidence interval of the given price update.
    event PriceFeedUpdate(
        bytes32 indexed id,
        uint64 publishTime,
        int64 price,
        uint64 conf
    );
}

File 12 of 12 : PythStructs.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

contract PythStructs {
    // A price with a degree of uncertainty, represented as a price +- a confidence interval.
    //
    // The confidence interval roughly corresponds to the standard error of a normal distribution.
    // Both the price and confidence are stored in a fixed-point numeric representation,
    // `x * (10^expo)`, where `expo` is the exponent.
    //
    // Please refer to the documentation at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how
    // to how this price safely.
    struct Price {
        // Price
        int64 price;
        // Confidence interval around the price
        uint64 conf;
        // Price exponent
        int32 expo;
        // Unix timestamp describing when the price was published
        uint publishTime;
    }

    // PriceFeed represents a current aggregate price from pyth publisher feeds.
    struct PriceFeed {
        // The price ID.
        bytes32 id;
        // Latest available price
        Price price;
        // Latest available exponentially-weighted moving average price
        Price emaPrice;
    }
}

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

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_oracleAddress","type":"address"},{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_operatorAddress","type":"address"},{"internalType":"uint256","name":"_intervalSeconds","type":"uint256"},{"internalType":"uint256","name":"_minBetAmount","type":"uint256"},{"internalType":"uint256","name":"_oracleUpdateAllowance","type":"uint256"},{"internalType":"uint256","name":"_treasuryFee","type":"uint256"},{"internalType":"bytes32","name":"_priceId","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","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":"epoch","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":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"}],"name":"EndRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"}],"name":"LockRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"NewAdminAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"intervalSeconds","type":"uint256"}],"name":"NewIntervalSeconds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","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":false,"internalType":"address","name":"oracle","type":"address"}],"name":"NewOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oracleUpdateAllowance","type":"uint256"}],"name":"NewOracleUpdateAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"priceId","type":"bytes32"}],"name":"NewPriceId","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","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":"epoch","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":"epoch","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":"epoch","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":"epoch","type":"uint256"}],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"stateMutability":"payable","type":"fallback"},{"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":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executeRound","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"genesisLockOnce","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisLockRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesisStartOnce","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisStartRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPriceFromOracle","outputs":[{"internalType":"uint80","name":"","type":"uint80"},{"internalType":"int256","name":"","type":"int256"}],"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 GamesFiPrediction.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"internalType":"struct GamesFiPrediction.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":[],"name":"intervalSeconds","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 GamesFiPrediction.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":"oracle","outputs":[{"internalType":"contract IPyth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleLatestRoundId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleUpdateAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"refundable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"int256","name":"lockPrice","type":"int256"},{"internalType":"int256","name":"closePrice","type":"int256"},{"internalType":"uint256","name":"lockOracleId","type":"uint256"},{"internalType":"uint256","name":"closeOracleId","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":"oracleCalled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_intervalSeconds","type":"uint256"}],"name":"setIntervalSeconds","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":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_oracleUpdateAllowance","type":"uint256"}],"name":"setOracleUpdateAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryFee","type":"uint256"}],"name":"setTreasuryFee","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":"bytes[]","name":"priceUpdateData","type":"bytes[]"}],"name":"updatePythOracle","outputs":[],"stateMutability":"payable","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"},{"stateMutability":"payable","type":"receive"}]

60a06040526004805461ffff191690553480156200001c57600080fd5b5060405162003b0238038062003b028339810160408190526200003f916200018e565b6200004a3362000125565b6000805460ff60a01b19169055600180556103e8821115620000b25760405162461bcd60e51b815260206004820152601560248201527f54726561737572792066656520746f6f20686967680000000000000000000000604482015260640160405180910390fd5b6001600160a01b0398891660805260028054988a166001600160a01b0319998a1617905560048054978a16620100000262010000600160b01b03199098169790971790965560058054959098169490961693909317909555600655600793909355600c9290925560085560035562000229565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200018b57600080fd5b50565b60008060008060008060008060006101208a8c031215620001ae57600080fd5b8951620001bb8162000175565b60208b0151909950620001ce8162000175565b60408b0151909850620001e18162000175565b60608b0151909750620001f48162000175565b8096505060808a0151945060a08a0151935060c08a0151925060e08a015191506101008a015190509295985092959850929598565b60805161389a62000268600039600081816108910152818161093401528181610b1c01528181610f15015281816117350152612201015261389a6000f3fe60806040526004361061025d5760003560e01c80637b3205f511610143578063b3ab15fb116100bb578063f2b3c80911610077578063f2b3c80914610814578063f2fde38b1461082a578063f7fdec281461084a578063fa968eea14610869578063fc0c546a1461087f578063fc6f9468146108b357005b8063b3ab15fb14610773578063cc32d17614610793578063cf2f5039146107a9578063d9d55eac146107c9578063dd1f7596146107de578063ec324703146107fe57005b80638c65c81f1161010a5780638c65c81f146105d15780638da5cb5b146106c6578063951fd600146106e4578063a0c7f71c14610713578063ae5a7e6614610733578063b29a81401461075357005b80637b3205f51461055e5780637bf41254146105665780637d1cd04f146105865780637dc0d1d01461059c5780638456cb59146105bc57005b806346f94149116101d6578063704b6c021161019d578063704b6c0214610478578063715018a6146104985780637285c58b146104ad578063766718081461050857806377e741c71461051e5780637adbf9731461053e57005b806346f94149146103f05780635c975abb1461040357806360554011146104225780636ba4c138146104385780636c1885931461045857005b806331189334116102255780633118933414610346578063368acb091461035c57806338f5a491146103725780633923e1b4146103a65780633f4ba83a146103c6578063452fd75a146103db57005b80623bdc74146102665780630e89e5a41461027b5780630f74174f1461029b578063127effb2146102ca578063273867d41461030257005b3661026457005b005b34801561027257600080fd5b506102646108d9565b34801561028757600080fd5b50610264610296366004613147565b6109a2565b3480156102a757600080fd5b506004546102b59060ff1681565b60405190151581526020015b60405180910390f35b3480156102d657600080fd5b506005546102ea906001600160a01b031681565b6040516001600160a01b0390911681526020016102c1565b34801561030e57600080fd5b5061033861031d366004613185565b6001600160a01b03166000908152600f602052604090205490565b6040519081526020016102c1565b34801561035257600080fd5b5061033860035481565b34801561036857600080fd5b5061033860095481565b34801561037e57600080fd5b50610387610c0a565b604080516001600160501b0390931683526020830191909152016102c1565b3480156103b257600080fd5b506102646103c1366004613147565b610d9b565b3480156103d257600080fd5b50610264610fec565b3480156103e757600080fd5b5061026461107a565b6102646103fe3660046131f3565b61113d565b34801561040f57600080fd5b50600054600160a01b900460ff166102b5565b34801561042e57600080fd5b50610338600c5481565b34801561044457600080fd5b506102646104533660046131f3565b611262565b34801561046457600080fd5b50610264610473366004613235565b611766565b34801561048457600080fd5b50610264610493366004613185565b611825565b3480156104a457600080fd5b506102646118b2565b3480156104b957600080fd5b506104f96104c836600461324e565b600d60209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b6040516102c1939291906132b2565b34801561051457600080fd5b50610338600a5481565b34801561052a57600080fd5b50610264610539366004613235565b6118c4565b34801561054a57600080fd5b50610264610559366004613185565b61197e565b610264611a2f565b34801561057257600080fd5b506102b561058136600461324e565b611b85565b34801561059257600080fd5b5061033860065481565b3480156105a857600080fd5b506002546102ea906001600160a01b031681565b3480156105c857600080fd5b50610264611ce8565b3480156105dd57600080fd5b5061065c6105ec366004613235565b600e60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b8c0154600c8d0154600d909d01549b9c9a9b999a98999798969795969495939492939192909160ff168e565b604080519e8f5260208f019d909d529b8d019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015261012086015261014085015261016084015261018083015215156101a08201526101c0016102c1565b3480156106d257600080fd5b506000546001600160a01b03166102ea565b3480156106f057600080fd5b506107046106ff3660046132d6565b611d6b565b6040516102c193929190613309565b34801561071f57600080fd5b506102b561072e36600461324e565b611fc2565b34801561073f57600080fd5b5061026461074e366004613235565b61218a565b34801561075f57600080fd5b5061026461076e3660046133ac565b6121f7565b34801561077f57600080fd5b5061026461078e366004613185565b6122e6565b34801561079f57600080fd5b5061033860085481565b3480156107b557600080fd5b506102646107c4366004613235565b61238a565b3480156107d557600080fd5b506102646123f7565b3480156107ea57600080fd5b506103386107f93660046133ac565b612510565b34801561080a57600080fd5b50610338600b5481565b34801561082057600080fd5b506103386103e881565b34801561083657600080fd5b50610264610845366004613185565b612541565b34801561085657600080fd5b506004546102b590610100900460ff1681565b34801561087557600080fd5b5061033860075481565b34801561088b57600080fd5b506102ea7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108bf57600080fd5b506004546102ea906201000090046001600160a01b031681565b6108e16125ba565b6004546201000090046001600160a01b0316331461091a5760405162461bcd60e51b8152600401610911906133d6565b60405180910390fd5b600980546000909155600454610963906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116916201000090041683612613565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a1506109a060018055565b565b6109aa61267b565b6109b26125ba565b333b156109d15760405162461bcd60e51b8152600401610911906133f9565b3332146109f05760405162461bcd60e51b815260040161091190613427565b600a548214610a395760405162461bcd60e51b815260206004820152601560248201527442657420697320746f6f206561726c792f6c61746560581b6044820152606401610911565b610a42826126c8565b610a835760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610911565b600754811015610aa55760405162461bcd60e51b81526004016109119061345e565b6000828152600d6020908152604080832033845290915290206001015415610b0f5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610911565b610b446001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084612733565b6000828152600e602052604090206008810154829190610b659083906134c0565b6008820155600a810154610b7a9083906134c0565b600a8201556000848152600d6020908152604080832033808552908352818420805460ff191660019081178255808201889055600f855283862080549182018155865294849020909401889055905185815287927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d91015b60405180910390a3505050610c0660018055565b5050565b6000806000600c5442610c1d91906134c0565b6002546003546040516396834ad360e01b81529293506000926001600160a01b03909216916396834ad391610c589160040190815260200190565b608060405180830381865afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190613513565b8051606082015191925060070b908084811115610d0f5760405162461bcd60e51b815260206004820152602e60248201527f4f7261636c6520757064617465206578636565646564206d61782074696d657360448201526d74616d7020616c6c6f77616e636560901b6064820152608401610911565b600b54816001600160501b031611610d8f5760405162461bcd60e51b815260206004820152603d60248201527f4f7261636c652075706461746520726f756e644964206d757374206265206c6160448201527f72676572207468616e206f7261636c654c6174657374526f756e6449640000006064820152608401610911565b96919550909350505050565b610da361267b565b610dab6125ba565b333b15610dca5760405162461bcd60e51b8152600401610911906133f9565b333214610de95760405162461bcd60e51b815260040161091190613427565b600a548214610e325760405162461bcd60e51b815260206004820152601560248201527442657420697320746f6f206561726c792f6c61746560581b6044820152606401610911565b610e3b826126c8565b610e7c5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610911565b600754811015610e9e5760405162461bcd60e51b81526004016109119061345e565b6000828152600d6020908152604080832033845290915290206001015415610f085760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610911565b610f3d6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084612733565b6000828152600e602052604090206008810154829190610f5e9083906134c0565b60088201556009810154610f739083906134c0565b60098201556000848152600d6020908152604080832033808552908352818420805460ff191681556001808201889055600f855283862080549182018155865294849020909401889055905185815287927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c129101610bf2565b610ff4612771565b6004546201000090046001600160a01b031633148061101d57506005546001600160a01b031633145b6110395760405162461bcd60e51b8152600401610911906135a3565b6004805461ffff1916905561104c6127c1565b600a546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b61108261267b565b6005546001600160a01b031633146110ac5760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff16156111105760405162461bcd60e51b815260206004820152602360248201527f43616e206f6e6c792072756e2067656e657369735374617274526f756e64206f6044820152626e636560e81b6064820152608401610911565b600a5461111e9060016134c0565b600a81905561112c90612816565b6004805461ff001916610100179055565b6004546201000090046001600160a01b031633148061116657506005546001600160a01b031633145b6111825760405162461bcd60e51b8152600401610911906135a3565b60025460405163d47eed4560e01b81526000916001600160a01b03169063d47eed45906111b5908690869060040161361e565b602060405180830381865afa1580156111d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f691906136ba565b600254604051631df3cbc560e31b81529192506001600160a01b03169063ef9e5e2890839061122b908790879060040161361e565b6000604051808303818588803b15801561124457600080fd5b505af1158015611258573d6000803e3d6000fd5b5050505050505050565b61126a6125ba565b333b156112895760405162461bcd60e51b8152600401610911906133f9565b3332146112a85760405162461bcd60e51b815260040161091190613427565b6000805b8281101561172157600e60008585848181106112ca576112ca6136d3565b9050602002013581526020019081526020016000206001015460000361132a5760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081a185cc81b9bdd081cdd185c9d1959605a1b6044820152606401610911565b600e6000858584818110611340576113406136d3565b90506020020135815260200190815260200160002060030154421161139d5760405162461bcd60e51b8152602060048201526013602482015272149bdd5b99081a185cc81b9bdd08195b991959606a1b6044820152606401610911565b6000600e60008686858181106113b5576113b56136d3565b60209081029290920135835250810191909152604001600020600d015460ff1615611593576113fc8585848181106113ef576113ef6136d3565b9050602002013533611fc2565b6114415760405162461bcd60e51b81526020600482015260166024820152754e6f7420656c696769626c6520666f7220636c61696d60501b6044820152606401610911565b6000600e6000878786818110611459576114596136d3565b905060200201358152602001908152602001600020604051806101c001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b8201548152602001600c8201548152602001600d820160009054906101000a900460ff1615151515815250509050806101600151816101800151600d600089898881811061153b5761153b6136d3565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b031681526020019081526020016000206001015461158191906136e9565b61158b9190613700565b915050611656565b6115b58585848181106115a8576115a86136d3565b9050602002013533611b85565b6116015760405162461bcd60e51b815260206004820152601760248201527f4e6f7420656c696769626c6520666f7220726566756e640000000000000000006044820152606401610911565b600d6000868685818110611617576116176136d3565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b031681526020019081526020016000206001015490505b6001600d600087878681811061166e5761166e6136d3565b6020908102929092013583525081810192909252604090810160009081203382529092529020600201805460ff19169115159190911790556116b081846134c0565b92508484838181106116c4576116c46136d3565b90506020020135336001600160a01b03167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161170691815260200190565b60405180910390a3508061171981613722565b9150506112ac565b50801561175c5761175c6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383612613565b50610c0660018055565b61176e612771565b6004546201000090046001600160a01b0316331461179e5760405162461bcd60e51b8152600401610911906133d6565b806000036117e65760405162461bcd60e51b815260206004820152601560248201527404d757374206265207375706572696f7220746f203605c1b6044820152606401610911565b6007819055600a546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b61182d612894565b6001600160a01b0381166118535760405162461bcd60e51b81526004016109119061373b565b6004805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b6118ba612894565b6109a060006128ee565b6118cc612771565b6004546201000090046001600160a01b031633146118fc5760405162461bcd60e51b8152600401610911906133d6565b6103e88111156119465760405162461bcd60e51b81526020600482015260156024820152740a8e4cac2e6eae4f240cccaca40e8dede40d0d2ced605b1b6044820152606401610911565b6008819055600a546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a8579060200161181a565b611986612771565b6004546201000090046001600160a01b031633146119b65760405162461bcd60e51b8152600401610911906133d6565b6001600160a01b0381166119dc5760405162461bcd60e51b81526004016109119061373b565b6000600b55600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e906020016118a7565b611a3761267b565b6005546001600160a01b03163314611a615760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff168015611a7a575060045460ff165b611afb5760405162461bcd60e51b815260206004820152604660248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e6420616e642067656e657369734c6f636b526f756e642069732074726960648201526519d9d95c995960d21b608482015260a401610911565b600080611b06610c0a565b91509150816001600160501b0316600b81905550611b30600a54836001600160501b03168361293e565b611b526001600a54611b42919061376b565b836001600160501b031683612a8f565b611b696001600a54611b64919061376b565b612bd4565b600a54611b779060016134c0565b600a819055610c0690612d52565b6000828152600d602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff166001811115611bcd57611bcd61327a565b6001811115611bde57611bde61327a565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600e835284902084516101c08101865281548152938101549284019290925293810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820154610120820152600a820154610140820152600b820154610160820152600c820154610180820152600d909101549091161580156101a083018190529293509091611cbf57508160400151155b8015611cce5750806060015142115b8015611cdd5750602082015115155b925050505b92915050565b611cf061267b565b6004546201000090046001600160a01b0316331480611d1957506005546001600160a01b031633145b611d355760405162461bcd60e51b8152600401610911906135a3565b611d3d612e9f565b600a546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6001600160a01b0383166000908152600f602052604081205460609182918490611d9690879061376b565b811115611dc4576001600160a01b0387166000908152600f6020526040902054611dc190879061376b565b90505b60008167ffffffffffffffff811115611ddf57611ddf6134d3565b604051908082528060200260200182016040528015611e08578160200160208202803683370190505b50905060008267ffffffffffffffff811115611e2657611e266134d3565b604051908082528060200260200182016040528015611e7157816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611e445790505b50905060005b83811015611fa3576001600160a01b038a166000908152600f60205260409020611ea1828b6134c0565b81548110611eb157611eb16136d3565b9060005260206000200154838281518110611ece57611ece6136d3565b602002602001018181525050600d6000848381518110611ef057611ef06136d3565b602090810291909101810151825281810192909252604090810160009081206001600160a01b038e168252909252908190208151606081019092528054829060ff166001811115611f4357611f4361327a565b6001811115611f5457611f5461327a565b81526001820154602082015260029091015460ff1615156040909101528251839083908110611f8557611f856136d3565b60200260200101819052508080611f9b90613722565b915050611e77565b508181611fb0858b6134c0565b95509550955050505093509350939050565b6000828152600d602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff16600181111561200a5761200a61327a565b600181111561201b5761201b61327a565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600e835284902084516101c081018652815481529381015492840192909252938101549282019290925260038201546060820152600482015460808201819052600583015460a08301819052600684015460c0840152600784015460e084015260088401546101008401526009840154610120840152600a840154610140840152600b840154610160840152600c840154610180840152600d9093015490931615156101a0820152929350900361210057600092505050611ce2565b806101a0015180156121155750602082015115155b801561212357508160400151155b8015611cdd575080608001518160a0015113801561215357506000825160018111156121515761215161327a565b145b80611cdd575080608001518160a00151128015611cdd57506001825160018111156121805761218061327a565b1495945050505050565b612192612771565b6004546201000090046001600160a01b031633146121c25760405162461bcd60e51b8152600401610911906133d6565b60068190556040518181527fb845395bee842702cd4e6d4e850eef63e8b2a768a28a0a86d59a2e326f63325e906020016118a7565b6121ff612894565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361228b5760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f742062652070726564696374696f6e20746f6b656e206164647265604482015261737360f01b6064820152608401610911565b61229f6001600160a01b0383163383612613565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e98826040516122da91815260200190565b60405180910390a25050565b6004546201000090046001600160a01b031633146123165760405162461bcd60e51b8152600401610911906133d6565b6001600160a01b03811661233c5760405162461bcd60e51b81526004016109119061373b565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e2906020016118a7565b612392612771565b6004546201000090046001600160a01b031633146123c25760405162461bcd60e51b8152600401610911906133d6565b600c8190556040518181527f93ccaceac092ffb842c46b8718667a13a80e9058dcd0bd403d0b47215b30da07906020016118a7565b6123ff61267b565b6005546001600160a01b031633146124295760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff166124505760405162461bcd60e51b81526004016109119061377e565b60045460ff16156124ae5760405162461bcd60e51b815260206004820152602260248201527f43616e206f6e6c792072756e2067656e657369734c6f636b526f756e64206f6e604482015261636560f01b6064820152608401610911565b6000806124b9610c0a565b91509150816001600160501b0316600b819055506124e3600a54836001600160501b03168361293e565b600a546124f19060016134c0565b600a8190556124ff90612816565b50506004805460ff19166001179055565b600f602052816000526040600020818154811061252c57600080fd5b90600052602060002001600091509150505481565b612549612894565b6001600160a01b0381166125ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610911565b6125b7816128ee565b50565b60026001540361260c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610911565b6002600155565b6040516001600160a01b03831660248201526044810182905261267690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612ee2565b505050565b600054600160a01b900460ff16156109a05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610911565b6000818152600e6020526040812060010154158015906126f857506000828152600e602052604090206002015415155b801561271457506000828152600e602052604090206001015442115b8015611ce25750506000908152600e6020526040902060020154421090565b6040516001600160a01b038085166024830152831660448201526064810182905261276b9085906323b872dd60e01b9060840161263f565b50505050565b600054600160a01b900460ff166109a05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610911565b6127c9612771565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000818152600e602052604090204260018201819055600654612838916134c0565b60028083019190915560065461284d916136e9565b61285790426134c0565b600382015581815560006008820181905560405183917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b45291a25050565b6000546001600160a01b031633146109a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610911565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000838152600e602052604081206001015490036129b25760405162461bcd60e51b815260206004820152602b60248201527f43616e206f6e6c79206c6f636b20726f756e6420616674657220726f756e642060448201526a1a185cc81cdd185c9d195960aa1b6064820152608401610911565b6000838152600e6020526040902060020154421015612a235760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c79206c6f636b20726f756e64206166746572206c6f636b546960448201526606d657374616d760cc1b6064820152608401610911565b6000838152600e60205260409020600654612a3e90426134c0565b60038201556004810182905560068101839055604051828152839085907f482e76a65b448a42deef26e99e58fb20c85e26f075defff8df6aa80459b39006906020015b60405180910390a350505050565b6000838152600e60205260408120600201549003612b015760405162461bcd60e51b815260206004820152602960248201527f43616e206f6e6c7920656e6420726f756e6420616674657220726f756e642068604482015268185cc81b1bd8dad95960ba1b6064820152608401610911565b6000838152600e6020526040902060030154421015612b725760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201526606d657374616d760cc1b6064820152608401610911565b6000838152600e6020526040908190206005810183905560078101849055600d8101805460ff191660011790559051839085907fb6ff1fe915db84788cbbbc017f0d2bef9485fad9fd0bd8ce9340fde0d8410dd890612a819086815260200190565b6000818152600e60205260409020600b0154158015612c0257506000818152600e60205260409020600c0154155b612c435760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc818d85b18dd5b185d195960721b6044820152606401610911565b6000818152600e6020526040812060048101546005820154919291829182911315612ca757836009015492506127106008548560080154612c8491906136e9565b612c8e9190613700565b9150818460080154612ca0919061376b565b9050612ce0565b836004015484600501541215612cd35783600a015492506127106008548560080154612c8491906136e9565b5050506008810154600090815b600b8401839055600c840181905560098054839190600090612d039084906134c0565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b600454610100900460ff16612d795760405162461bcd60e51b81526004016109119061377e565b600e6000612d8860028461376b565b815260200190815260200160002060030154600003612e005760405162461bcd60e51b815260206004820152602e60248201527f43616e206f6e6c7920737461727420726f756e6420616674657220726f756e6460448201526d081b8b4c881a185cc8195b99195960921b6064820152608401610911565b600e6000612e0f60028461376b565b815260200190815260200160002060030154421015612e965760405162461bcd60e51b815260206004820152603760248201527f43616e206f6e6c79207374617274206e657720726f756e64206166746572207260448201527f6f756e64206e2d3220636c6f736554696d657374616d700000000000000000006064820152608401610911565b6125b781612816565b612ea761267b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586127f93390565b6000612f37826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612fb79092919063ffffffff16565b9050805160001480612f58575080806020019051810190612f5891906137cf565b6126765760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610911565b6060612fc68484600085612fce565b949350505050565b60608247101561302f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610911565b600080866001600160a01b0316858760405161304b9190613815565b60006040518083038185875af1925050503d8060008114613088576040519150601f19603f3d011682016040523d82523d6000602084013e61308d565b606091505b509150915061309e878383876130a9565b979650505050505050565b60608315613118578251600003613111576001600160a01b0385163b6131115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610911565b5081612fc6565b612fc6838381511561312d5781518083602001fd5b8060405162461bcd60e51b81526004016109119190613831565b6000806040838503121561315a57600080fd5b50508035926020909101359150565b80356001600160a01b038116811461318057600080fd5b919050565b60006020828403121561319757600080fd5b6131a082613169565b9392505050565b60008083601f8401126131b957600080fd5b50813567ffffffffffffffff8111156131d157600080fd5b6020830191508360208260051b85010111156131ec57600080fd5b9250929050565b6000806020838503121561320657600080fd5b823567ffffffffffffffff81111561321d57600080fd5b613229858286016131a7565b90969095509350505050565b60006020828403121561324757600080fd5b5035919050565b6000806040838503121561326157600080fd5b8235915061327160208401613169565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b600281106132ae57634e487b7160e01b600052602160045260246000fd5b9052565b606081016132c08286613290565b8360208301528215156040830152949350505050565b6000806000606084860312156132eb57600080fd5b6132f484613169565b95602085013595506040909401359392505050565b60608082528451828201819052600091906020906080850190828901855b8281101561334357815184529284019290840190600101613327565b5050508481038286015286518082528783019183019060005b81811015613395578351613371848251613290565b8086015184870152604090810151151590840152928401929185019160010161335c565b505080945050505050826040830152949350505050565b600080604083850312156133bf57600080fd5b6133c883613169565b946020939093013593505050565b6020808252600990820152682737ba1030b236b4b760b91b604082015260600190565b60208082526014908201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604082015260600190565b6020808252601a908201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604082015260600190565b6020808252602c908201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060408201526b1b5a5b90995d105b5bdd5b9d60a21b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115611ce257611ce26134aa565b634e487b7160e01b600052604160045260246000fd5b805167ffffffffffffffff8116811461318057600080fd5b8051600381900b811461318057600080fd5b60006080828403121561352557600080fd5b6040516080810181811067ffffffffffffffff8211171561355657634e487b7160e01b600052604160045260246000fd5b6040528251600781900b811461356b57600080fd5b8152613579602084016134e9565b602082015261358a60408401613501565b6040820152606083015160608201528091505092915050565b6020808252601290820152712737ba1037b832b930ba37b917b0b236b4b760711b604082015260600190565b6020808252600c908201526b2737ba1037b832b930ba37b960a11b604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040600585901b8401810190840186845b878110156136ad57868403603f190183528135368a9003601e1901811261366357600080fd5b8901858101903567ffffffffffffffff81111561367f57600080fd5b80360382131561368e57600080fd5b6136998682846135f5565b95505050918401919084019060010161363d565b5091979650505050505050565b6000602082840312156136cc57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417611ce257611ce26134aa565b60008261371d57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201613734576137346134aa565b5060010190565b60208082526016908201527543616e6e6f74206265207a65726f206164647265737360501b604082015260600190565b81810381811115611ce257611ce26134aa565b60208082526031908201527f43616e206f6e6c792072756e2061667465722067656e657369735374617274526040820152701bdd5b99081a5cc81d1c9a59d9d95c9959607a1b606082015260800190565b6000602082840312156137e157600080fd5b815180151581146131a057600080fd5b60005b8381101561380c5781810151838201526020016137f4565b50506000910152565b600082516138278184602087016137f1565b9190910192915050565b60208152600082518060208401526138508160408501602087016137f1565b601f01601f1916919091016040019291505056fea2646970667358221220de67b57a72e825dec030d54d8a2c7e31a1b0dab0253cc5bb17c4a8c1d539a4d064736f6c63430008120033000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc8000000000000000000000000a2aa501b19aff244d90cc15a4cf739d2725b57290000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe2050000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe20500000000000000000000000000000000000000000000000000000000000000780000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000c8e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43

Deployed Bytecode

0x60806040526004361061025d5760003560e01c80637b3205f511610143578063b3ab15fb116100bb578063f2b3c80911610077578063f2b3c80914610814578063f2fde38b1461082a578063f7fdec281461084a578063fa968eea14610869578063fc0c546a1461087f578063fc6f9468146108b357005b8063b3ab15fb14610773578063cc32d17614610793578063cf2f5039146107a9578063d9d55eac146107c9578063dd1f7596146107de578063ec324703146107fe57005b80638c65c81f1161010a5780638c65c81f146105d15780638da5cb5b146106c6578063951fd600146106e4578063a0c7f71c14610713578063ae5a7e6614610733578063b29a81401461075357005b80637b3205f51461055e5780637bf41254146105665780637d1cd04f146105865780637dc0d1d01461059c5780638456cb59146105bc57005b806346f94149116101d6578063704b6c021161019d578063704b6c0214610478578063715018a6146104985780637285c58b146104ad578063766718081461050857806377e741c71461051e5780637adbf9731461053e57005b806346f94149146103f05780635c975abb1461040357806360554011146104225780636ba4c138146104385780636c1885931461045857005b806331189334116102255780633118933414610346578063368acb091461035c57806338f5a491146103725780633923e1b4146103a65780633f4ba83a146103c6578063452fd75a146103db57005b80623bdc74146102665780630e89e5a41461027b5780630f74174f1461029b578063127effb2146102ca578063273867d41461030257005b3661026457005b005b34801561027257600080fd5b506102646108d9565b34801561028757600080fd5b50610264610296366004613147565b6109a2565b3480156102a757600080fd5b506004546102b59060ff1681565b60405190151581526020015b60405180910390f35b3480156102d657600080fd5b506005546102ea906001600160a01b031681565b6040516001600160a01b0390911681526020016102c1565b34801561030e57600080fd5b5061033861031d366004613185565b6001600160a01b03166000908152600f602052604090205490565b6040519081526020016102c1565b34801561035257600080fd5b5061033860035481565b34801561036857600080fd5b5061033860095481565b34801561037e57600080fd5b50610387610c0a565b604080516001600160501b0390931683526020830191909152016102c1565b3480156103b257600080fd5b506102646103c1366004613147565b610d9b565b3480156103d257600080fd5b50610264610fec565b3480156103e757600080fd5b5061026461107a565b6102646103fe3660046131f3565b61113d565b34801561040f57600080fd5b50600054600160a01b900460ff166102b5565b34801561042e57600080fd5b50610338600c5481565b34801561044457600080fd5b506102646104533660046131f3565b611262565b34801561046457600080fd5b50610264610473366004613235565b611766565b34801561048457600080fd5b50610264610493366004613185565b611825565b3480156104a457600080fd5b506102646118b2565b3480156104b957600080fd5b506104f96104c836600461324e565b600d60209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b6040516102c1939291906132b2565b34801561051457600080fd5b50610338600a5481565b34801561052a57600080fd5b50610264610539366004613235565b6118c4565b34801561054a57600080fd5b50610264610559366004613185565b61197e565b610264611a2f565b34801561057257600080fd5b506102b561058136600461324e565b611b85565b34801561059257600080fd5b5061033860065481565b3480156105a857600080fd5b506002546102ea906001600160a01b031681565b3480156105c857600080fd5b50610264611ce8565b3480156105dd57600080fd5b5061065c6105ec366004613235565b600e60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b8c0154600c8d0154600d909d01549b9c9a9b999a98999798969795969495939492939192909160ff168e565b604080519e8f5260208f019d909d529b8d019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015261012086015261014085015261016084015261018083015215156101a08201526101c0016102c1565b3480156106d257600080fd5b506000546001600160a01b03166102ea565b3480156106f057600080fd5b506107046106ff3660046132d6565b611d6b565b6040516102c193929190613309565b34801561071f57600080fd5b506102b561072e36600461324e565b611fc2565b34801561073f57600080fd5b5061026461074e366004613235565b61218a565b34801561075f57600080fd5b5061026461076e3660046133ac565b6121f7565b34801561077f57600080fd5b5061026461078e366004613185565b6122e6565b34801561079f57600080fd5b5061033860085481565b3480156107b557600080fd5b506102646107c4366004613235565b61238a565b3480156107d557600080fd5b506102646123f7565b3480156107ea57600080fd5b506103386107f93660046133ac565b612510565b34801561080a57600080fd5b50610338600b5481565b34801561082057600080fd5b506103386103e881565b34801561083657600080fd5b50610264610845366004613185565b612541565b34801561085657600080fd5b506004546102b590610100900460ff1681565b34801561087557600080fd5b5061033860075481565b34801561088b57600080fd5b506102ea7f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc881565b3480156108bf57600080fd5b506004546102ea906201000090046001600160a01b031681565b6108e16125ba565b6004546201000090046001600160a01b0316331461091a5760405162461bcd60e51b8152600401610911906133d6565b60405180910390fd5b600980546000909155600454610963906001600160a01b037f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc88116916201000090041683612613565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a1506109a060018055565b565b6109aa61267b565b6109b26125ba565b333b156109d15760405162461bcd60e51b8152600401610911906133f9565b3332146109f05760405162461bcd60e51b815260040161091190613427565b600a548214610a395760405162461bcd60e51b815260206004820152601560248201527442657420697320746f6f206561726c792f6c61746560581b6044820152606401610911565b610a42826126c8565b610a835760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610911565b600754811015610aa55760405162461bcd60e51b81526004016109119061345e565b6000828152600d6020908152604080832033845290915290206001015415610b0f5760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610911565b610b446001600160a01b037f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc816333084612733565b6000828152600e602052604090206008810154829190610b659083906134c0565b6008820155600a810154610b7a9083906134c0565b600a8201556000848152600d6020908152604080832033808552908352818420805460ff191660019081178255808201889055600f855283862080549182018155865294849020909401889055905185815287927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d91015b60405180910390a3505050610c0660018055565b5050565b6000806000600c5442610c1d91906134c0565b6002546003546040516396834ad360e01b81529293506000926001600160a01b03909216916396834ad391610c589160040190815260200190565b608060405180830381865afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190613513565b8051606082015191925060070b908084811115610d0f5760405162461bcd60e51b815260206004820152602e60248201527f4f7261636c6520757064617465206578636565646564206d61782074696d657360448201526d74616d7020616c6c6f77616e636560901b6064820152608401610911565b600b54816001600160501b031611610d8f5760405162461bcd60e51b815260206004820152603d60248201527f4f7261636c652075706461746520726f756e644964206d757374206265206c6160448201527f72676572207468616e206f7261636c654c6174657374526f756e6449640000006064820152608401610911565b96919550909350505050565b610da361267b565b610dab6125ba565b333b15610dca5760405162461bcd60e51b8152600401610911906133f9565b333214610de95760405162461bcd60e51b815260040161091190613427565b600a548214610e325760405162461bcd60e51b815260206004820152601560248201527442657420697320746f6f206561726c792f6c61746560581b6044820152606401610911565b610e3b826126c8565b610e7c5760405162461bcd60e51b8152602060048201526012602482015271526f756e64206e6f74206265747461626c6560701b6044820152606401610911565b600754811015610e9e5760405162461bcd60e51b81526004016109119061345e565b6000828152600d6020908152604080832033845290915290206001015415610f085760405162461bcd60e51b815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e6400000000006044820152606401610911565b610f3d6001600160a01b037f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc816333084612733565b6000828152600e602052604090206008810154829190610f5e9083906134c0565b60088201556009810154610f739083906134c0565b60098201556000848152600d6020908152604080832033808552908352818420805460ff191681556001808201889055600f855283862080549182018155865294849020909401889055905185815287927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c129101610bf2565b610ff4612771565b6004546201000090046001600160a01b031633148061101d57506005546001600160a01b031633145b6110395760405162461bcd60e51b8152600401610911906135a3565b6004805461ffff1916905561104c6127c1565b600a546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b61108261267b565b6005546001600160a01b031633146110ac5760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff16156111105760405162461bcd60e51b815260206004820152602360248201527f43616e206f6e6c792072756e2067656e657369735374617274526f756e64206f6044820152626e636560e81b6064820152608401610911565b600a5461111e9060016134c0565b600a81905561112c90612816565b6004805461ff001916610100179055565b6004546201000090046001600160a01b031633148061116657506005546001600160a01b031633145b6111825760405162461bcd60e51b8152600401610911906135a3565b60025460405163d47eed4560e01b81526000916001600160a01b03169063d47eed45906111b5908690869060040161361e565b602060405180830381865afa1580156111d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f691906136ba565b600254604051631df3cbc560e31b81529192506001600160a01b03169063ef9e5e2890839061122b908790879060040161361e565b6000604051808303818588803b15801561124457600080fd5b505af1158015611258573d6000803e3d6000fd5b5050505050505050565b61126a6125ba565b333b156112895760405162461bcd60e51b8152600401610911906133f9565b3332146112a85760405162461bcd60e51b815260040161091190613427565b6000805b8281101561172157600e60008585848181106112ca576112ca6136d3565b9050602002013581526020019081526020016000206001015460000361132a5760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081a185cc81b9bdd081cdd185c9d1959605a1b6044820152606401610911565b600e6000858584818110611340576113406136d3565b90506020020135815260200190815260200160002060030154421161139d5760405162461bcd60e51b8152602060048201526013602482015272149bdd5b99081a185cc81b9bdd08195b991959606a1b6044820152606401610911565b6000600e60008686858181106113b5576113b56136d3565b60209081029290920135835250810191909152604001600020600d015460ff1615611593576113fc8585848181106113ef576113ef6136d3565b9050602002013533611fc2565b6114415760405162461bcd60e51b81526020600482015260166024820152754e6f7420656c696769626c6520666f7220636c61696d60501b6044820152606401610911565b6000600e6000878786818110611459576114596136d3565b905060200201358152602001908152602001600020604051806101c001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a8201548152602001600b8201548152602001600c8201548152602001600d820160009054906101000a900460ff1615151515815250509050806101600151816101800151600d600089898881811061153b5761153b6136d3565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b031681526020019081526020016000206001015461158191906136e9565b61158b9190613700565b915050611656565b6115b58585848181106115a8576115a86136d3565b9050602002013533611b85565b6116015760405162461bcd60e51b815260206004820152601760248201527f4e6f7420656c696769626c6520666f7220726566756e640000000000000000006044820152606401610911565b600d6000868685818110611617576116176136d3565b9050602002013581526020019081526020016000206000336001600160a01b03166001600160a01b031681526020019081526020016000206001015490505b6001600d600087878681811061166e5761166e6136d3565b6020908102929092013583525081810192909252604090810160009081203382529092529020600201805460ff19169115159190911790556116b081846134c0565b92508484838181106116c4576116c46136d3565b90506020020135336001600160a01b03167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161170691815260200190565b60405180910390a3508061171981613722565b9150506112ac565b50801561175c5761175c6001600160a01b037f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc8163383612613565b50610c0660018055565b61176e612771565b6004546201000090046001600160a01b0316331461179e5760405162461bcd60e51b8152600401610911906133d6565b806000036117e65760405162461bcd60e51b815260206004820152601560248201527404d757374206265207375706572696f7220746f203605c1b6044820152606401610911565b6007819055600a546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b61182d612894565b6001600160a01b0381166118535760405162461bcd60e51b81526004016109119061373b565b6004805462010000600160b01b031916620100006001600160a01b038416908102919091179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b6118ba612894565b6109a060006128ee565b6118cc612771565b6004546201000090046001600160a01b031633146118fc5760405162461bcd60e51b8152600401610911906133d6565b6103e88111156119465760405162461bcd60e51b81526020600482015260156024820152740a8e4cac2e6eae4f240cccaca40e8dede40d0d2ced605b1b6044820152606401610911565b6008819055600a546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a8579060200161181a565b611986612771565b6004546201000090046001600160a01b031633146119b65760405162461bcd60e51b8152600401610911906133d6565b6001600160a01b0381166119dc5760405162461bcd60e51b81526004016109119061373b565b6000600b55600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e906020016118a7565b611a3761267b565b6005546001600160a01b03163314611a615760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff168015611a7a575060045460ff165b611afb5760405162461bcd60e51b815260206004820152604660248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e6420616e642067656e657369734c6f636b526f756e642069732074726960648201526519d9d95c995960d21b608482015260a401610911565b600080611b06610c0a565b91509150816001600160501b0316600b81905550611b30600a54836001600160501b03168361293e565b611b526001600a54611b42919061376b565b836001600160501b031683612a8f565b611b696001600a54611b64919061376b565b612bd4565b600a54611b779060016134c0565b600a819055610c0690612d52565b6000828152600d602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff166001811115611bcd57611bcd61327a565b6001811115611bde57611bde61327a565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600e835284902084516101c08101865281548152938101549284019290925293810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820154610120820152600a820154610140820152600b820154610160820152600c820154610180820152600d909101549091161580156101a083018190529293509091611cbf57508160400151155b8015611cce5750806060015142115b8015611cdd5750602082015115155b925050505b92915050565b611cf061267b565b6004546201000090046001600160a01b0316331480611d1957506005546001600160a01b031633145b611d355760405162461bcd60e51b8152600401610911906135a3565b611d3d612e9f565b600a546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6001600160a01b0383166000908152600f602052604081205460609182918490611d9690879061376b565b811115611dc4576001600160a01b0387166000908152600f6020526040902054611dc190879061376b565b90505b60008167ffffffffffffffff811115611ddf57611ddf6134d3565b604051908082528060200260200182016040528015611e08578160200160208202803683370190505b50905060008267ffffffffffffffff811115611e2657611e266134d3565b604051908082528060200260200182016040528015611e7157816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611e445790505b50905060005b83811015611fa3576001600160a01b038a166000908152600f60205260409020611ea1828b6134c0565b81548110611eb157611eb16136d3565b9060005260206000200154838281518110611ece57611ece6136d3565b602002602001018181525050600d6000848381518110611ef057611ef06136d3565b602090810291909101810151825281810192909252604090810160009081206001600160a01b038e168252909252908190208151606081019092528054829060ff166001811115611f4357611f4361327a565b6001811115611f5457611f5461327a565b81526001820154602082015260029091015460ff1615156040909101528251839083908110611f8557611f856136d3565b60200260200101819052508080611f9b90613722565b915050611e77565b508181611fb0858b6134c0565b95509550955050505093509350939050565b6000828152600d602090815260408083206001600160a01b0385168452909152808220815160608101909252805483929190829060ff16600181111561200a5761200a61327a565b600181111561201b5761201b61327a565b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600e835284902084516101c081018652815481529381015492840192909252938101549282019290925260038201546060820152600482015460808201819052600583015460a08301819052600684015460c0840152600784015460e084015260088401546101008401526009840154610120840152600a840154610140840152600b840154610160840152600c840154610180840152600d9093015490931615156101a0820152929350900361210057600092505050611ce2565b806101a0015180156121155750602082015115155b801561212357508160400151155b8015611cdd575080608001518160a0015113801561215357506000825160018111156121515761215161327a565b145b80611cdd575080608001518160a00151128015611cdd57506001825160018111156121805761218061327a565b1495945050505050565b612192612771565b6004546201000090046001600160a01b031633146121c25760405162461bcd60e51b8152600401610911906133d6565b60068190556040518181527fb845395bee842702cd4e6d4e850eef63e8b2a768a28a0a86d59a2e326f63325e906020016118a7565b6121ff612894565b7f000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc86001600160a01b0316826001600160a01b03160361228b5760405162461bcd60e51b815260206004820152602260248201527f43616e6e6f742062652070726564696374696f6e20746f6b656e206164647265604482015261737360f01b6064820152608401610911565b61229f6001600160a01b0383163383612613565b816001600160a01b03167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e98826040516122da91815260200190565b60405180910390a25050565b6004546201000090046001600160a01b031633146123165760405162461bcd60e51b8152600401610911906133d6565b6001600160a01b03811661233c5760405162461bcd60e51b81526004016109119061373b565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e2906020016118a7565b612392612771565b6004546201000090046001600160a01b031633146123c25760405162461bcd60e51b8152600401610911906133d6565b600c8190556040518181527f93ccaceac092ffb842c46b8718667a13a80e9058dcd0bd403d0b47215b30da07906020016118a7565b6123ff61267b565b6005546001600160a01b031633146124295760405162461bcd60e51b8152600401610911906135cf565b600454610100900460ff166124505760405162461bcd60e51b81526004016109119061377e565b60045460ff16156124ae5760405162461bcd60e51b815260206004820152602260248201527f43616e206f6e6c792072756e2067656e657369734c6f636b526f756e64206f6e604482015261636560f01b6064820152608401610911565b6000806124b9610c0a565b91509150816001600160501b0316600b819055506124e3600a54836001600160501b03168361293e565b600a546124f19060016134c0565b600a8190556124ff90612816565b50506004805460ff19166001179055565b600f602052816000526040600020818154811061252c57600080fd5b90600052602060002001600091509150505481565b612549612894565b6001600160a01b0381166125ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610911565b6125b7816128ee565b50565b60026001540361260c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610911565b6002600155565b6040516001600160a01b03831660248201526044810182905261267690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612ee2565b505050565b600054600160a01b900460ff16156109a05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610911565b6000818152600e6020526040812060010154158015906126f857506000828152600e602052604090206002015415155b801561271457506000828152600e602052604090206001015442115b8015611ce25750506000908152600e6020526040902060020154421090565b6040516001600160a01b038085166024830152831660448201526064810182905261276b9085906323b872dd60e01b9060840161263f565b50505050565b600054600160a01b900460ff166109a05760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610911565b6127c9612771565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000818152600e602052604090204260018201819055600654612838916134c0565b60028083019190915560065461284d916136e9565b61285790426134c0565b600382015581815560006008820181905560405183917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b45291a25050565b6000546001600160a01b031633146109a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610911565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000838152600e602052604081206001015490036129b25760405162461bcd60e51b815260206004820152602b60248201527f43616e206f6e6c79206c6f636b20726f756e6420616674657220726f756e642060448201526a1a185cc81cdd185c9d195960aa1b6064820152608401610911565b6000838152600e6020526040902060020154421015612a235760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c79206c6f636b20726f756e64206166746572206c6f636b546960448201526606d657374616d760cc1b6064820152608401610911565b6000838152600e60205260409020600654612a3e90426134c0565b60038201556004810182905560068101839055604051828152839085907f482e76a65b448a42deef26e99e58fb20c85e26f075defff8df6aa80459b39006906020015b60405180910390a350505050565b6000838152600e60205260408120600201549003612b015760405162461bcd60e51b815260206004820152602960248201527f43616e206f6e6c7920656e6420726f756e6420616674657220726f756e642068604482015268185cc81b1bd8dad95960ba1b6064820152608401610911565b6000838152600e6020526040902060030154421015612b725760405162461bcd60e51b815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201526606d657374616d760cc1b6064820152608401610911565b6000838152600e6020526040908190206005810183905560078101849055600d8101805460ff191660011790559051839085907fb6ff1fe915db84788cbbbc017f0d2bef9485fad9fd0bd8ce9340fde0d8410dd890612a819086815260200190565b6000818152600e60205260409020600b0154158015612c0257506000818152600e60205260409020600c0154155b612c435760405162461bcd60e51b815260206004820152601260248201527114995dd85c991cc818d85b18dd5b185d195960721b6044820152606401610911565b6000818152600e6020526040812060048101546005820154919291829182911315612ca757836009015492506127106008548560080154612c8491906136e9565b612c8e9190613700565b9150818460080154612ca0919061376b565b9050612ce0565b836004015484600501541215612cd35783600a015492506127106008548560080154612c8491906136e9565b5050506008810154600090815b600b8401839055600c840181905560098054839190600090612d039084906134c0565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b600454610100900460ff16612d795760405162461bcd60e51b81526004016109119061377e565b600e6000612d8860028461376b565b815260200190815260200160002060030154600003612e005760405162461bcd60e51b815260206004820152602e60248201527f43616e206f6e6c7920737461727420726f756e6420616674657220726f756e6460448201526d081b8b4c881a185cc8195b99195960921b6064820152608401610911565b600e6000612e0f60028461376b565b815260200190815260200160002060030154421015612e965760405162461bcd60e51b815260206004820152603760248201527f43616e206f6e6c79207374617274206e657720726f756e64206166746572207260448201527f6f756e64206e2d3220636c6f736554696d657374616d700000000000000000006064820152608401610911565b6125b781612816565b612ea761267b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586127f93390565b6000612f37826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612fb79092919063ffffffff16565b9050805160001480612f58575080806020019051810190612f5891906137cf565b6126765760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610911565b6060612fc68484600085612fce565b949350505050565b60608247101561302f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610911565b600080866001600160a01b0316858760405161304b9190613815565b60006040518083038185875af1925050503d8060008114613088576040519150601f19603f3d011682016040523d82523d6000602084013e61308d565b606091505b509150915061309e878383876130a9565b979650505050505050565b60608315613118578251600003613111576001600160a01b0385163b6131115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610911565b5081612fc6565b612fc6838381511561312d5781518083602001fd5b8060405162461bcd60e51b81526004016109119190613831565b6000806040838503121561315a57600080fd5b50508035926020909101359150565b80356001600160a01b038116811461318057600080fd5b919050565b60006020828403121561319757600080fd5b6131a082613169565b9392505050565b60008083601f8401126131b957600080fd5b50813567ffffffffffffffff8111156131d157600080fd5b6020830191508360208260051b85010111156131ec57600080fd5b9250929050565b6000806020838503121561320657600080fd5b823567ffffffffffffffff81111561321d57600080fd5b613229858286016131a7565b90969095509350505050565b60006020828403121561324757600080fd5b5035919050565b6000806040838503121561326157600080fd5b8235915061327160208401613169565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b600281106132ae57634e487b7160e01b600052602160045260246000fd5b9052565b606081016132c08286613290565b8360208301528215156040830152949350505050565b6000806000606084860312156132eb57600080fd5b6132f484613169565b95602085013595506040909401359392505050565b60608082528451828201819052600091906020906080850190828901855b8281101561334357815184529284019290840190600101613327565b5050508481038286015286518082528783019183019060005b81811015613395578351613371848251613290565b8086015184870152604090810151151590840152928401929185019160010161335c565b505080945050505050826040830152949350505050565b600080604083850312156133bf57600080fd5b6133c883613169565b946020939093013593505050565b6020808252600990820152682737ba1030b236b4b760b91b604082015260600190565b60208082526014908201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604082015260600190565b6020808252601a908201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604082015260600190565b6020808252602c908201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060408201526b1b5a5b90995d105b5bdd5b9d60a21b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115611ce257611ce26134aa565b634e487b7160e01b600052604160045260246000fd5b805167ffffffffffffffff8116811461318057600080fd5b8051600381900b811461318057600080fd5b60006080828403121561352557600080fd5b6040516080810181811067ffffffffffffffff8211171561355657634e487b7160e01b600052604160045260246000fd5b6040528251600781900b811461356b57600080fd5b8152613579602084016134e9565b602082015261358a60408401613501565b6040820152606083015160608201528091505092915050565b6020808252601290820152712737ba1037b832b930ba37b917b0b236b4b760711b604082015260600190565b6020808252600c908201526b2737ba1037b832b930ba37b960a11b604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040600585901b8401810190840186845b878110156136ad57868403603f190183528135368a9003601e1901811261366357600080fd5b8901858101903567ffffffffffffffff81111561367f57600080fd5b80360382131561368e57600080fd5b6136998682846135f5565b95505050918401919084019060010161363d565b5091979650505050505050565b6000602082840312156136cc57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417611ce257611ce26134aa565b60008261371d57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201613734576137346134aa565b5060010190565b60208082526016908201527543616e6e6f74206265207a65726f206164647265737360501b604082015260600190565b81810381811115611ce257611ce26134aa565b60208082526031908201527f43616e206f6e6c792072756e2061667465722067656e657369735374617274526040820152701bdd5b99081a5cc81d1c9a59d9d95c9959607a1b606082015260800190565b6000602082840312156137e157600080fd5b815180151581146131a057600080fd5b60005b8381101561380c5781810151838201526020016137f4565b50506000910152565b600082516138278184602087016137f1565b9190910192915050565b60208152600082518060208401526138508160408501602087016137f1565b601f01601f1916919091016040019291505056fea2646970667358221220de67b57a72e825dec030d54d8a2c7e31a1b0dab0253cc5bb17c4a8c1d539a4d064736f6c63430008120033

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

000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc8000000000000000000000000a2aa501b19aff244d90cc15a4cf739d2725b57290000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe2050000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe20500000000000000000000000000000000000000000000000000000000000000780000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000c8e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43

-----Decoded View---------------
Arg [0] : _token (address): 0xC078cB6cC9B962f25482DA5D7D18d3cF849CAFc8
Arg [1] : _oracleAddress (address): 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Arg [2] : _adminAddress (address): 0x0175CA8a5f3009f153d5E8d9121dd5bad6fBE205
Arg [3] : _operatorAddress (address): 0x0175CA8a5f3009f153d5E8d9121dd5bad6fBE205
Arg [4] : _intervalSeconds (uint256): 120
Arg [5] : _minBetAmount (uint256): 1000000000000000000
Arg [6] : _oracleUpdateAllowance (uint256): 60
Arg [7] : _treasuryFee (uint256): 200
Arg [8] : _priceId (bytes32): 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000c078cb6cc9b962f25482da5d7d18d3cf849cafc8
Arg [1] : 000000000000000000000000a2aa501b19aff244d90cc15a4cf739d2725b5729
Arg [2] : 0000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe205
Arg [3] : 0000000000000000000000000175ca8a5f3009f153d5e8d9121dd5bad6fbe205
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000078
Arg [5] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [7] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [8] : e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43


Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x8DCa862cBCFc27F4e85Ea9Dd08A673497CAD201b
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.