Contract 0x150B4fD25c7c0c65301e86B599822f2feeCC29E7

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa999f10ec66263591f0fe1f21c5c2d58f8ec4c9d12d8b3b0063781d41942df7dClaim237928132022-01-16 16:08:51325 days 10 hrs ago0x1825e17795db36d3be6bad1efa3343078fe0aee4 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026077230
0xde8ce88b9fd346f254ed53ba94333935ca3319b92d411982edf6dec2a4a2a3b4Bet Bull237379272022-01-15 6:26:22326 days 19 hrs ago0x83629f032ed211e0039494f6e5c5e36586598e3e IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70.001 MATIC0.00095157631
0xed93530a6687086de680802e39f9a69dba22030b5a08e1492ffa7ef39b609058Claim229112592021-12-24 15:44:20348 days 10 hrs ago0xc4a23dbe8d2ba44d0aac32c750caf6a54ea611f1 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.00286991133
0xda4370ebdb0950d08335d2f97a9aa8a8497dd2a3adc44f0b91bb82673ac7c6daClaim225277022021-12-14 21:24:55358 days 5 hrs ago0x0c444d34c3c7d0e6d2534819b2e7d4b25cad170e IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026069730
0xe77f5f0adcbf1c0b495700c0ffc1736c99c58450e570e6bbf83add5af20092a7Claim223839142021-12-11 4:39:42361 days 21 hrs ago0xdd68685d939a5003b2128330f8cf90d65c661be6 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026069730
0xa729db2dc7cde2ff36f39f46945c128c0630b3b8817f3a5db53ac6333ccd44afClaim223839122021-12-11 4:39:38361 days 21 hrs ago0xdd68685d939a5003b2128330f8cf90d65c661be6 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026069730
0xc408316162c0059f48b94ac237efac0046ca5971cc56be39394c1221c2e823e7Claim223839082021-12-11 4:39:30361 days 21 hrs ago0xdd68685d939a5003b2128330f8cf90d65c661be6 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026069730
0xf725fc2a7efb544a2d21e45bd6ae753f75cbfd2f32755132d689f62453d0d530Claim222526102021-12-07 20:19:15365 days 6 hrs ago0x4f0bb3b4f52a15025acaa887837a4d45dad64f91 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026077230
0x032388acb8db04c1cdc5f1523439b2126e00df820053d9a26c544a59b7940539Claim221852572021-12-06 2:15:34367 days 9 mins ago0x5985cfc7e4b1c03aa97e6f74bf317d6f06dd3e20 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026077230
0xa1f3cccd8624bd55a725b53c4e16851e09a90d650e776966f8a5d4c75fcdb273Claim221724162021-12-05 17:55:33367 days 8 hrs ago0x6a9d8b216d3ceb41329762cc5054c45f6827859a IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.00286849233
0xbd062a1843c49567104fad8371fd0cd313f903f630b1467c3dff5b78a800d9a6Genesis Lock Rou...221699332021-12-05 16:16:04367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0017223550
0x3726a8a35df93802d0babd1bed612ed3235e6ecb6cc467b56b6854ba5b9752a7Genesis Start Ro...221697582021-12-05 16:10:02367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0073740550
0x412c9d3ce061a1a3b665d7b224f67716919aac075c803690283b1d88a2f2058eReset221697532021-12-05 16:09:52367 days 10 hrs ago0x45b04f6a1a7ec9678cb208d6dc3a5ce5929e9838 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0007465230
0x0b90b5512ce763bb22da379633b01bf9a3c5e24f6ab098c38b6f716144034a0dExecute Round221697502021-12-05 16:09:46367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.003260250
0xff8430acceabca30c58fb458e78eda5a24bc136304157fbd13968fb0495d2073Execute Round221696092021-12-05 16:04:56367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.003260250
0xa227a980132826efd62e704b3be3062defe6049351de8fcf31e6b2ff77cd86b6Claim221695862021-12-05 16:04:00367 days 10 hrs ago0xdd68685d939a5003b2128330f8cf90d65c661be6 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.00583881101
0x531ee4eb5d40046e3cf00fa5aeab1bef4450a9f1f298360242f6f0f22e753454Execute Round221695272021-12-05 15:58:34367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0129450550
0xc2ee0188baa44d7377a906a4f10407770baf83667ec8a93d6da42545d3b10a28Claim221693902021-12-05 15:53:52367 days 10 hrs ago0x4ec2dcdfb3c165da62dd1367cb42fe7551524984 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026077230
0xb9fa4de5f05524aab84009e3dd8f3f73cdb73feea6bf0931b5553e1f81d58c01Execute Round221693792021-12-05 15:53:30367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0129569550
0xb134fbd30e0430673f5e085b9d275da93867b073987302a5dc3319607bf4862aExecute Round221692852021-12-05 15:48:22367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0150795550
0x2f3b977f696b7836d95d1d877bcdcdeb79b61b6566e1504a6c56fca0ca0ecac0Execute Round221691352021-12-05 15:42:58367 days 10 hrs ago0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0129569550
0x49b9ba4944ecf1dc30a24000e69b4687a3520533968b5d3928a5f00423d3ed3bBet Bear221691212021-12-05 15:42:30367 days 10 hrs ago0x6a9d8b216d3ceb41329762cc5054c45f6827859a IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e73.93 MATIC0.0081976370
0x13d518fd3cbf164a057bc8ff25476b6c388f4062d17ec7a2840442f41673bc02Bet Bear221691192021-12-05 15:42:26367 days 10 hrs ago0xdd68685d939a5003b2128330f8cf90d65c661be6 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70.25 MATIC0.01006567575
0x9df6bdeeabb4eb1474b2cd9f6f93415a8cf4ae089af60874de31fc147029abd4Bet Bull221690642021-12-05 15:40:32367 days 10 hrs ago0x4ec2dcdfb3c165da62dd1367cb42fe7551524984 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e730 MATIC0.0039429330
0xb5200c44d4380116b2753c26cd550cea551a91075f62712051eb4149f85d7fa5Claim221690592021-12-05 15:40:22367 days 10 hrs ago0x4ec2dcdfb3c165da62dd1367cb42fe7551524984 IN  0x150b4fd25c7c0c65301e86b599822f2feecc29e70 MATIC0.0026090130
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xa999f10ec66263591f0fe1f21c5c2d58f8ec4c9d12d8b3b0063781d41942df7d237928132022-01-16 16:08:51325 days 10 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x1825e17795db36d3be6bad1efa3343078fe0aee40.756 MATIC
0xed93530a6687086de680802e39f9a69dba22030b5a08e1492ffa7ef39b609058229112592021-12-24 15:44:20348 days 10 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xc4a23dbe8d2ba44d0aac32c750caf6a54ea611f10.097 MATIC
0xda4370ebdb0950d08335d2f97a9aa8a8497dd2a3adc44f0b91bb82673ac7c6da225277022021-12-14 21:24:55358 days 5 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x0c444d34c3c7d0e6d2534819b2e7d4b25cad170e0.5 MATIC
0xe77f5f0adcbf1c0b495700c0ffc1736c99c58450e570e6bbf83add5af20092a7223839142021-12-11 4:39:42361 days 21 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be60.25 MATIC
0xa729db2dc7cde2ff36f39f46945c128c0630b3b8817f3a5db53ac6333ccd44af223839122021-12-11 4:39:38361 days 21 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be60.25 MATIC
0xc408316162c0059f48b94ac237efac0046ca5971cc56be39394c1221c2e823e7223839082021-12-11 4:39:30361 days 21 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be60.25 MATIC
0xf725fc2a7efb544a2d21e45bd6ae753f75cbfd2f32755132d689f62453d0d530222526102021-12-07 20:19:15365 days 6 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x4f0bb3b4f52a15025acaa887837a4d45dad64f911.867250000000000031 MATIC
0x032388acb8db04c1cdc5f1523439b2126e00df820053d9a26c544a59b7940539221852572021-12-06 2:15:34367 days 9 mins ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x5985cfc7e4b1c03aa97e6f74bf317d6f06dd3e200.0194 MATIC
0xa1f3cccd8624bd55a725b53c4e16851e09a90d650e776966f8a5d4c75fcdb273221724162021-12-05 17:55:33367 days 8 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x6a9d8b216d3ceb41329762cc5054c45f6827859a31.946338655462184873 MATIC
0xc2ee0188baa44d7377a906a4f10407770baf83667ec8a93d6da42545d3b10a28221693902021-12-05 15:53:52367 days 10 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x4ec2dcdfb3c165da62dd1367cb42fe755152498433.1546 MATIC
0xb5200c44d4380116b2753c26cd550cea551a91075f62712051eb4149f85d7fa5221690592021-12-05 15:40:22367 days 10 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x4ec2dcdfb3c165da62dd1367cb42fe755152498433.57655 MATIC
0x9338a741100a773914a848c1408ac0ae0903aa9dbd2f77fb13b3f3d5d158ee32221688182021-12-05 15:32:04367 days 10 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be61.770861344537815126 MATIC
0xbcd6bb89531bf66c2eccde6bd74f8ccab56a10d16a23307676fe1ae98663c521221672932021-12-05 14:33:10367 days 11 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be60.25 MATIC
0x78e0cc62b4adb5c96fd97d9d4026e36ea638601d0a85012583b17e70cc7a3ccb221563912021-12-05 7:17:59367 days 19 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x5985cfc7e4b1c03aa97e6f74bf317d6f06dd3e200.0194 MATIC
0x277e81fbf9abc2ea05f2e08ced6b699d0c100a0bd3d02c099717e65ed4a654b8221315622021-12-04 16:34:24368 days 9 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x1fac7bd5964dd4d1f26a373bf31281faa0e7b26219.4 MATIC
0x84316bf05604f8255e134daab0f0d7cb676f9449d813ee4e10bd3626ca2e24d4221295652021-12-04 15:18:35368 days 11 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x1fac7bd5964dd4d1f26a373bf31281faa0e7b262199.5 MATIC
0x64f48b6bc59600ebcb88a79f6e0a24c4218f44add8e0381fe6de4115f4d2e6f7221240032021-12-04 11:41:08368 days 14 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x1fac7bd5964dd4d1f26a373bf31281faa0e7b262199 MATIC
0x30fb4bc3288c8c638fd57c3e00890ab68ed748cae2130feea156a25c6b6d365e221194222021-12-04 8:43:11368 days 17 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x248cd2628e07b2520e39864c99f9cb67370cfb5c0.03 MATIC
0x8066f5bd5b9439828857808cb6eb67e3e1883d8baaa1c9879da484853f8daf29221166172021-12-04 6:56:54368 days 19 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x6a9d8b216d3ceb41329762cc5054c45f6827859a4.820115842988832885 MATIC
0x119e057de9fd53ef01be49136e58e44c55e122c6dc24cd000ac47db396a54ddf221166162021-12-04 6:56:52368 days 19 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x6a9d8b216d3ceb41329762cc5054c45f6827859a5.4016875 MATIC
0x6776025c95f020fd7743737c182f74d51be2180e98f37b28301b972e19c3ed78221093722021-12-04 2:19:36369 days 5 mins ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be60.964023168597766577 MATIC
0x9c89b55bec1481e9d0988d95f34216e28295094014cb78ffa62da3cf723d54be221050722021-12-03 23:21:52369 days 3 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70xdd68685d939a5003b2128330f8cf90d65c661be61.0003125 MATIC
0xae9bea00bf38f1b1a12de7e9ab6fbf81c0689df9aaa1651dc4dad77eb732da3c221023632021-12-03 21:37:26369 days 4 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x6a9d8b216d3ceb41329762cc5054c45f6827859a0.2425 MATIC
0xb7a39c16c60bcd8ac5b39d77e875d47b192a59e6dbefbf069439f643d80ec0c9220974072021-12-03 18:33:42369 days 7 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x348bfd598e46f9e5204eb449ce3909fe1af80e274 MATIC
0x324a84bed789824f7d02efb767ce02f9b7d49ea19724d39dcd61863f652ff0f1220861582021-12-03 11:33:59369 days 14 hrs ago 0x150b4fd25c7c0c65301e86b599822f2feecc29e70x6a9d8b216d3ceb41329762cc5054c45f6827859a0.21825 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DfynPricePrediction

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : DfynPredictionMarket.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

import "./interfaces/AggregatorV3Interface.sol";

contract DfynPricePrediction is Ownable, Pausable {
    using SafeMath for uint256;

    struct Round {
        uint256 epoch;
        uint256 startTime;
        uint256 lockTime;
        uint256 endTime;
        int256 lockPrice;
        int256 closePrice;
        uint256 totalAmount;
        uint256 bullAmount;
        uint256 bearAmount;
        uint256 rewardBaseCalAmount;
        uint256 rewardAmount;
        bool oracleCalled;
    }

    enum Position {
        Bull,
        Bear
    }

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

    mapping(uint256 => Round) public rounds;
    mapping(uint256 => mapping(address => BetInfo)) public ledger;
    mapping(address => uint256[]) public userRounds;
    uint256 public currentEpoch;
    uint256 public interval;
    uint256 public buffer;
    address public adminAddress;
    address public operatorAddress;
    uint256 public treasuryAmount;
    AggregatorV3Interface internal oracle;
    uint256 public oracleLatestRoundId;

    uint256 public constant TOTAL_RATE = 100; // 100%
    uint256 public rewardRate = 90; // 90%
    uint256 public treasuryRate = 10; // 10%
    uint256 public minBetAmount;
    uint256 public oracleUpdateAllowance; // seconds

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

    event StartRound(uint256 indexed epoch, uint256 time);
    event LockRound(uint256 indexed epoch, uint256 time, int256 price);
    event EndRound(uint256 indexed epoch, uint256 time, int256 price);
    event BetBull(
        address indexed sender,
        uint256 indexed currentEpoch,
        uint256 amount
    );
    event BetBear(
        address indexed sender,
        uint256 indexed currentEpoch,
        uint256 amount
    );
    event Claim(
        address indexed sender,
        uint256 indexed currentEpoch,
        uint256 amount
    );
    event ClaimTreasury(uint256 amount);
    event RatesUpdated(
        uint256 indexed epoch,
        uint256 rewardRate,
        uint256 treasuryRate
    );
    event MinBetAmountUpdated(uint256 indexed epoch, uint256 minBetAmount);
    event RewardsCalculated(
        uint256 indexed epoch,
        uint256 rewardBaseCalAmount,
        uint256 rewardAmount,
        uint256 treasuryAmount
    );
    event Pause(uint256 epoch);
    event Unpause(uint256 epoch);
    event Reset(uint256 epoch);

    constructor(
        AggregatorV3Interface _oracle,
        address _adminAddress,
        address _operatorAddress,
        uint256 _interval,
        uint256 _buffer,
        uint256 _minBetAmount,
        uint256 _oracleUpdateAllowance
    ) public {
        oracle = _oracle;
        adminAddress = _adminAddress;
        operatorAddress = _operatorAddress;
        interval = _interval;
        buffer = _buffer;
        minBetAmount = _minBetAmount;
        oracleUpdateAllowance = _oracleUpdateAllowance;
    }

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

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

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

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

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

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

    /**
     * @dev set interval in seconds
     * callable by admin
     */
    function setInterval(uint256 _interval) external onlyAdmin {
        interval = _interval;
    }

    /**
     * @dev set buffer in seconds
     * callable by admin
     */
    function setBuffer(uint256 _buffer) external onlyAdmin {
        require(_buffer <= interval, "Cannot be more than interval");
        buffer = _buffer;
    }

    /**
     * @dev set Oracle address
     * callable by admin
     */
    function setOracle(address _oracle) external onlyAdmin {
        require(_oracle != address(0), "Cannot be zero address");
        oracle = AggregatorV3Interface(_oracle);
    }

    /**
     * @dev set oracle update allowance
     * callable by admin
     */
    function setOracleUpdateAllowance(uint256 _oracleUpdateAllowance)
        external
        onlyAdmin
    {
        oracleUpdateAllowance = _oracleUpdateAllowance;
    }

    /**
     * @dev set reward rate
     * callable by admin
     */
    function setRewardRate(uint256 _rewardRate) external onlyAdmin {
        require(
            _rewardRate <= TOTAL_RATE,
            "rewardRate cannot be more than 100%"
        );
        rewardRate = _rewardRate;
        treasuryRate = TOTAL_RATE.sub(_rewardRate);

        emit RatesUpdated(currentEpoch, rewardRate, treasuryRate);
    }

    /**
     * @dev set treasury rate
     * callable by admin
     */
    function setTreasuryRate(uint256 _treasuryRate) external onlyAdmin {
        require(
            _treasuryRate <= TOTAL_RATE,
            "treasuryRate cannot be more than 100%"
        );
        rewardRate = TOTAL_RATE.sub(_treasuryRate);
        treasuryRate = _treasuryRate;

        emit RatesUpdated(currentEpoch, rewardRate, treasuryRate);
    }

    /**
     * @dev set minBetAmount
     * callable by admin
     */
    function setMinBetAmount(uint256 _minBetAmount) external onlyAdmin {
        minBetAmount = _minBetAmount;

        emit MinBetAmountUpdated(currentEpoch, minBetAmount);
    }

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

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

    /**
     * @dev Lock genesis round
     */
    function genesisLockRound() external onlyOperator whenNotPaused {
        require(
            genesisStartOnce,
            "Can only run after genesisStartRound is triggered"
        );
        require(!genesisLockOnce, "Can only run genesisLockRound once");
        require(
            block.timestamp <= rounds[currentEpoch].lockTime.add(buffer),
            "Can only lock round within buffer"
        );

        int256 currentPrice = _getPriceFromOracle();
        _safeLockRound(currentEpoch, currentPrice);

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

    /**
     * @dev Start the next round n, lock price for round n-1, end round n-2
     */
    function executeRound() external onlyOperator whenNotPaused {
        require(
            genesisStartOnce && genesisLockOnce,
            "Can only run after genesisStartRound and genesisLockRound is triggered"
        );

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

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

    /**
     * @dev Bet bear position
     */
    function betBear() external payable whenNotPaused notContract {
        require(_bettable(currentEpoch), "Round not bettable");
        require(
            msg.value >= minBetAmount,
            "Bet amount must be greater than minBetAmount"
        );
        require(
            ledger[currentEpoch][msg.sender].amount == 0,
            "Can only bet once per round"
        );

        // Update round data
        uint256 amount = msg.value;
        Round storage round = rounds[currentEpoch];
        round.totalAmount = round.totalAmount.add(amount);
        round.bearAmount = round.bearAmount.add(amount);

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

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

    /**
     * @dev Bet bull position
     */
    function betBull() external payable whenNotPaused notContract {
        require(_bettable(currentEpoch), "Round not bettable");
        require(
            msg.value >= minBetAmount,
            "Bet amount must be greater than minBetAmount"
        );
        require(
            ledger[currentEpoch][msg.sender].amount == 0,
            "Can only bet once per round"
        );

        // Update round data
        uint256 amount = msg.value;
        Round storage round = rounds[currentEpoch];
        round.totalAmount = round.totalAmount.add(amount);
        round.bullAmount = round.bullAmount.add(amount);

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

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

    /**
     * @dev Claim reward
     */
    function claim(uint256 epoch) external notContract {
        require(rounds[epoch].startTime != 0, "Round has not started");
        require(block.timestamp > rounds[epoch].endTime, "Round has not ended");
        require(!ledger[epoch][msg.sender].claimed, "Rewards claimed");

        uint256 reward;
        // Round valid, claim rewards
        if (rounds[epoch].oracleCalled) {
            require(claimable(epoch, msg.sender), "Not eligible for claim");
            Round memory round = rounds[epoch];
            reward = ledger[epoch][msg.sender]
            .amount
            .mul(round.rewardAmount)
            .div(round.rewardBaseCalAmount);
        }
        // Round invalid, refund bet amount
        else {
            require(refundable(epoch, msg.sender), "Not eligible for refund");
            reward = ledger[epoch][msg.sender].amount;
        }

        BetInfo storage betInfo = ledger[epoch][msg.sender];
        betInfo.claimed = true;
        _safeTransferToken(address(msg.sender), reward);

        emit Claim(msg.sender, epoch, reward);
    }

    /**
     * @dev Claim all rewards in treasury
     * callable by admin
     */
    function claimTreasury() external onlyAdmin {
        uint256 currentTreasuryAmount = treasuryAmount;
        treasuryAmount = 0;
        _safeTransferToken(adminAddress, currentTreasuryAmount);

        emit ClaimTreasury(currentTreasuryAmount);
    }

    /**
     * @dev Return round epochs that a user has participated
     */
    function getUserRounds(
        address user,
        uint256 cursor,
        uint256 size
    ) external view returns (uint256[] memory, uint256) {
        uint256 length = size;
        if (length > userRounds[user].length - cursor) {
            length = userRounds[user].length - cursor;
        }

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

        return (values, cursor + length);
    }

    /**
     * @dev called by the admin to pause, triggers stopped state
     */
    function pause() public onlyAdminOrOperator whenNotPaused {
        _pause();

        emit Pause(currentEpoch);
    }

    /**
     * @dev called by the admin to unpause, returns to normal state
     * Reset genesis state. Once paused, the rounds would need to be kickstarted by genesis
     */
    function unpause() public onlyAdmin whenPaused {
        genesisStartOnce = false;
        genesisLockOnce = false;
        _unpause();

        emit Unpause(currentEpoch);
    }

    function reset() public onlyAdmin whenNotPaused {
        pause();
        unpause();

        emit Reset(currentEpoch);
    }

    /**
     * @dev Get the claimable stats of specific epoch and user account
     */
    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 &&
            ((round.closePrice > round.lockPrice &&
                betInfo.position == Position.Bull) ||
                (round.closePrice < round.lockPrice &&
                    betInfo.position == Position.Bear));
    }

    function lastRound() public view returns (Round memory round) {
        return rounds[currentEpoch];
    }

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

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

    function _startRound(uint256 epoch) internal {
        Round storage round = rounds[epoch];
        round.startTime = block.timestamp;
        round.lockTime = block.timestamp.add(interval);
        round.endTime = block.timestamp.add(interval * 2);
        round.epoch = epoch;
        round.totalAmount = 0;

        emit StartRound(epoch, block.timestamp);
    }

    /**
     * @dev Lock round
     */
    function _safeLockRound(uint256 epoch, int256 price) internal {
        require(
            rounds[epoch].startTime != 0,
            "Can only lock round after round has started"
        );
        require(
            block.timestamp >= rounds[epoch].lockTime,
            "Can only lock round after lockTime"
        );
        require(
            block.timestamp <= rounds[epoch].lockTime.add(buffer),
            "Can only lock round within buffer"
        );
        _lockRound(epoch, price);
    }

    function _lockRound(uint256 epoch, int256 price) internal {
        Round storage round = rounds[epoch];
        round.lockPrice = price;

        emit LockRound(epoch, block.timestamp, round.lockPrice);
    }

    /**
     * @dev End round
     */
    function _safeEndRound(uint256 epoch, int256 price) internal {
        require(
            rounds[epoch].lockTime != 0,
            "Can only end round after round has locked"
        );
        require(
            block.timestamp >= rounds[epoch].endTime,
            "Can only end round after endTime"
        );
        require(
            block.timestamp <= rounds[epoch].endTime.add(buffer),
            "Can only end round within buffer"
        );
        _endRound(epoch, price);
    }

    function _endRound(uint256 epoch, int256 price) internal {
        Round storage round = rounds[epoch];
        round.closePrice = price;
        round.oracleCalled = true;

        emit EndRound(epoch, block.timestamp, round.closePrice);
    }

    /**
     * @dev Calculate rewards for round
     */
    function _calculateRewards(uint256 epoch) internal {
        require(
            rewardRate.add(treasuryRate) == TOTAL_RATE,
            "rewardRate and treasuryRate must add up to TOTAL_RATE"
        );
        require(
            rounds[epoch].rewardBaseCalAmount == 0 &&
                rounds[epoch].rewardAmount == 0,
            "Rewards calculated"
        );
        Round storage round = rounds[epoch];
        uint256 rewardBaseCalAmount;
        uint256 rewardAmount;
        uint256 treasuryAmt;
        // Bull wins
        if (round.closePrice > round.lockPrice) {
            rewardBaseCalAmount = round.bullAmount;
            rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
            treasuryAmt = round.totalAmount.mul(treasuryRate).div(TOTAL_RATE);
        }
        // Bear wins
        else if (round.closePrice < round.lockPrice) {
            rewardBaseCalAmount = round.bearAmount;
            rewardAmount = round.totalAmount.mul(rewardRate).div(TOTAL_RATE);
            treasuryAmt = round.totalAmount.mul(treasuryRate).div(TOTAL_RATE);
        }
        // House wins
        else {
            rewardBaseCalAmount = 0;
            rewardAmount = 0;
            treasuryAmt = round.totalAmount;
        }
        round.rewardBaseCalAmount = rewardBaseCalAmount;
        round.rewardAmount = rewardAmount;

        // Add to treasury
        treasuryAmount = treasuryAmount.add(treasuryAmt);

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

    /**
     * @dev Get latest recorded price from oracle
     * If it falls below allowed buffer or has not updated, it would be invalid
     */
    function _getPriceFromOracle() internal returns (int256) {
        uint256 leastAllowedTimestamp = block.timestamp.add(
            oracleUpdateAllowance
        );
        (uint80 roundId, int256 price, , uint256 timestamp, ) = oracle
        .latestRoundData();
        require(
            timestamp <= leastAllowedTimestamp,
            "Oracle update exceeded max timestamp allowance"
        );
        require(
            roundId >= oracleLatestRoundId,
            "Oracle update roundId must be larger than oracleLatestRoundId"
        );
        oracleLatestRoundId = uint256(roundId);
        return price;
    }

    function isRefundable() public view returns (bool) {
        return
            (block.timestamp >= rounds[currentEpoch - 1].endTime.add(buffer)) &&
            (block.timestamp >= rounds[currentEpoch].lockTime.add(buffer)) &&
            !rounds[currentEpoch].oracleCalled;
    }

    function _safeTransferToken(address to, uint256 value) internal {
        (bool success, ) = to.call{gas: 23000, value: value}("");
        require(success, "TransferHelper: CURRENCY_TRANSFER_FAILED");
    }

    function _isContract(address addr) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(addr)
        }
        return size > 0;
    }

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

File 2 of 10 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0;

interface AggregatorV3Interface {
    function decimals() external view returns (uint8);

    function description() external view returns (string memory);

    function version() external view returns (uint256);

    // getRoundData and latestRoundData should both raise "No data present"
    // if they do not have data to report, instead of returning unset values
    // which could be misinterpreted as actual reported values.
    function getRoundData(uint80 _roundId)
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );

    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );
}

File 3 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

File 4 of 10 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

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

File 6 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    using Address for address;

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

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

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

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

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

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

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

File 7 of 10 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 10 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 9 of 10 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./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 () internal {
        _paused = false;
    }

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

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

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

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

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

File 10 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _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 make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract AggregatorV3Interface","name":"_oracle","type":"address"},{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_operatorAddress","type":"address"},{"internalType":"uint256","name":"_interval","type":"uint256"},{"internalType":"uint256","name":"_buffer","type":"uint256"},{"internalType":"uint256","name":"_minBetAmount","type":"uint256"},{"internalType":"uint256","name":"_oracleUpdateAllowance","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"currentEpoch","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":"currentEpoch","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":"currentEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","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":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"}],"name":"LockRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minBetAmount","type":"uint256"}],"name":"MinBetAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"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":"rewardRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryRate","type":"uint256"}],"name":"RatesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"Reset","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"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StartRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"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"},{"inputs":[],"name":"TOTAL_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"betBear","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"betBull","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"buffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","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":"nonpayable","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":[{"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[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRefundable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRound","outputs":[{"components":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"int256","name":"lockPrice","type":"int256"},{"internalType":"int256","name":"closePrice","type":"int256"},{"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"}],"internalType":"struct DfynPricePrediction.Round","name":"round","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"ledger","outputs":[{"internalType":"enum DfynPricePrediction.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":"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":[{"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":[],"name":"reset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rounds","outputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"int256","name":"lockPrice","type":"int256"},{"internalType":"int256","name":"closePrice","type":"int256"},{"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":"_buffer","type":"uint256"}],"name":"setBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_interval","type":"uint256"}],"name":"setInterval","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":"_rewardRate","type":"uint256"}],"name":"setRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryRate","type":"uint256"}],"name":"setTreasuryRate","outputs":[],"stateMutability":"nonpayable","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":"treasuryRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userRounds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052605a600c55600a600d556010805461ffff191690553480156200002657600080fd5b506040516200436938038062004369833981016040819052620000499162000106565b60006200005562000102565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19169055600a80546001600160a01b03199081166001600160a01b03998a161790915560078054821697891697909717909655600880549096169490961693909317909355600555600691909155600e55600f5562000199565b3390565b600080600080600080600060e0888a03121562000121578283fd5b87516200012e8162000180565b6020890151909750620001418162000180565b6040890151909650620001548162000180565b80955050606088015193506080880151925060a0880151915060c0880151905092959891949750929550565b6001600160a01b03811681146200019657600080fd5b50565b6141c080620001a96000396000f3fe6080604052600436106102f05760003560e01c806382bc07e61161018f578063cf2f5039116100e1578063ec3247031161008a578063f7fdec2811610064578063f7fdec281461077c578063fa968eea14610791578063fc6f9468146107a6576102f0565b8063ec32470314610732578063edaafe2014610747578063f2fde38b1461075c576102f0565b8063d9d55eac116100bb578063d9d55eac146106e8578063dd1f7596146106fd578063e4b725161461071d576102f0565b8063cf2f503914610693578063d0bf9c54146106b3578063d826f88f146106d3576102f0565b8063951fd60011610143578063adc7ea371161011d578063adc7ea371461063e578063b29c299b1461065e578063b3ab15fb14610673576102f0565b8063951fd600146105d05780639e447fc6146105fe578063a0c7f71c1461061e576102f0565b80638c65c81f116101745780638c65c81f1461056e5780638da5cb5b146105a6578063947a36fb146105bb576102f0565b806382bc07e6146105375780638456cb5914610559576102f0565b8063605540111161024857806376671808116101fc5780637b3205f5116101d65780637b3205f5146104fa5780637bf412541461050f578063821daba11461052f576102f0565b806376671808146104b05780637adbf973146104c55780637b0a47ee146104e5576102f0565b8063704b6c021161022d578063704b6c021461044c578063715018a61461046c5780637285c58b14610481576102f0565b806360554011146104175780636c1885931461042c576102f0565b80632c1fecfe116102aa5780633f4ba83a116102845780633f4ba83a146103d8578063452fd75a146103ed5780635c975abb14610402576102f0565b80632c1fecfe14610381578063368acb0914610396578063379607f5146103b8576102f0565b80630f74174f116102db5780630f74174f14610314578063127effb21461033f57806322a9008214610361576102f0565b80623bdc74146102f557806288160f1461030c575b600080fd5b34801561030157600080fd5b5061030a6107bb565b005b61030a61087b565b34801561032057600080fd5b50610329610af2565b604051610336919061344e565b60405180910390f35b34801561034b57600080fd5b50610354610b00565b60405161033691906133e5565b34801561036d57600080fd5b5061030a61037c366004613347565b610b1c565b34801561038d57600080fd5b50610329610b72565b3480156103a257600080fd5b506103ab610c0d565b6040516103369190614107565b3480156103c457600080fd5b5061030a6103d3366004613347565b610c13565b3480156103e457600080fd5b5061030a610f9b565b3480156103f957600080fd5b5061030a611095565b34801561040e57600080fd5b506103296111a3565b34801561042357600080fd5b506103ab6111c4565b34801561043857600080fd5b5061030a610447366004613347565b6111ca565b34801561045857600080fd5b5061030a6104673660046132cf565b61125e565b34801561047857600080fd5b5061030a611365565b34801561048d57600080fd5b506104a161049c36600461335f565b611447565b60405161033693929190613459565b3480156104bc57600080fd5b506103ab611476565b3480156104d157600080fd5b5061030a6104e03660046132cf565b61147c565b3480156104f157600080fd5b506103ab611561565b34801561050657600080fd5b5061030a611567565b34801561051b57600080fd5b5061032961052a36600461335f565b611692565b61030a6117eb565b34801561054357600080fd5b5061054c611a52565b6040516103369190614075565b34801561056557600080fd5b5061030a611af9565b34801561057a57600080fd5b5061058e610589366004613347565b611be4565b6040516103369c9b9a99989796959493929190614134565b3480156105b257600080fd5b50610354611c47565b3480156105c757600080fd5b506103ab611c63565b3480156105dc57600080fd5b506105f06105eb366004613314565b611c69565b604051610336929190613406565b34801561060a57600080fd5b5061030a610619366004613347565b611d83565b34801561062a57600080fd5b5061032961063936600461335f565b611e5d565b34801561064a57600080fd5b5061030a610659366004613347565b611ff8565b34801561066a57600080fd5b506103ab61208a565b34801561067f57600080fd5b5061030a61068e3660046132cf565b61208f565b34801561069f57600080fd5b5061030a6106ae366004613347565b612174565b3480156106bf57600080fd5b5061030a6106ce366004613347565b6121ca565b3480156106df57600080fd5b5061030a6122a1565b3480156106f457600080fd5b5061030a612372565b34801561070957600080fd5b506103ab6107183660046132ea565b612535565b34801561072957600080fd5b506103ab612563565b34801561073e57600080fd5b506103ab612569565b34801561075357600080fd5b506103ab61256f565b34801561076857600080fd5b5061030a6107773660046132cf565b612575565b34801561078857600080fd5b506103296126c2565b34801561079d57600080fd5b506103ab6126cb565b3480156107b257600080fd5b506103546126d1565b60075473ffffffffffffffffffffffffffffffffffffffff163314610815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b60405180910390fd5b6009805460009091556007546108419073ffffffffffffffffffffffffffffffffffffffff16826126ed565b7f609175abb7f12481e4f200d1ef4fc834e6caac3d9eadba42d664352f6d0932ca816040516108709190614107565b60405180910390a150565b6108836111a3565b156108ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b6108c333612799565b156108fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613baf565b333214610933576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061347d565b61093e60045461279f565b610974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613be6565b600e543410156109b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613952565b600454600090815260026020908152604080832033845290915290206001015415610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613e5c565b60045460009081526001602052604090206006810154349190610a2a908361280b565b60068201556008810154610a3e908361280b565b60088201556004805460009081526002602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081178255808201899055600385528386208754815492830182559087529490952090940192909255925492519192917f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d90610ae5908790614107565b60405180910390a3505050565b601054610100900460ff1681565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff163314610b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b600555565b6006546004547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016000908152600160205260408120600301549091610bb8919061280b565b4210158015610be75750600654600454600090815260016020526040902060020154610be39161280b565b4210155b8015610c0857506004546000908152600160205260409020600b015460ff16155b905090565b60095481565b610c1c33612799565b15610c53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613baf565b333214610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061347d565b60008181526001602081905260409091200154610cd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613dc8565b6000818152600160205260409020600301544211610d1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139af565b6000818152600260208181526040808420338552909152909120015460ff1615610d75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061403e565b6000818152600160205260408120600b015460ff1615610ea457610d998233611e5d565b610dcf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906137e4565b610dd761320c565b506000828152600160208181526040808420815161018081018352815481528185015481850152600280830154828501526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e0830152600883015461010083015260098301546101208301819052600a8401546101408401819052600b9094015460ff16151561016084015289885290855283872033885290945291909420909201549192610e9c92610e9691612851565b906128a5565b915050610f03565b610eae8233611692565b610ee4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906134eb565b5060008181526002602090815260408083203384529091529020600101545b600082815260026020818152604080842033808652925290922090810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590610f5490836126ed565b823373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf784604051610ae59190614107565b60075473ffffffffffffffffffffffffffffffffffffffff163314610fec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b610ff46111a3565b61102a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906134b4565b601080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000016905561105a6128f1565b7faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab760045460405161108b9190614107565b60405180910390a1565b60085473ffffffffffffffffffffffffffffffffffffffff1633146110e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613d91565b6110ee6111a3565b15611125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b60105460ff1615611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613c7a565b60048054600101908190556111769061298d565b601080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60005474010000000000000000000000000000000000000000900460ff1690565b600f5481565b60075473ffffffffffffffffffffffffffffffffffffffff16331461121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b600e8190556004546040517f82480e97991520549ac4b5d0e1d97edb3bfac2666202923b6903d2a953dc760890611253908490614107565b60405180910390a250565b611266612a18565b73ffffffffffffffffffffffffffffffffffffffff16611284611c47565b73ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613b7a565b73ffffffffffffffffffffffffffffffffffffffff811661131e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613a1d565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61136d612a18565b73ffffffffffffffffffffffffffffffffffffffff1661138b611c47565b73ffffffffffffffffffffffffffffffffffffffff16146113d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613b7a565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6002602081815260009384526040808520909152918352912080546001820154919092015460ff928316921683565b60045481565b60075473ffffffffffffffffffffffffffffffffffffffff1633146114cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b73ffffffffffffffffffffffffffffffffffffffff811661151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613a1d565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600c5481565b60085473ffffffffffffffffffffffffffffffffffffffff1633146115b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613d91565b6115c06111a3565b156115f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b60105460ff1680156116105750601054610100900460ff165b611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613d0e565b6000611650612a1c565b905061165e60045482612b7d565b61166d60016004540382612c76565b61167b600160045403612d6a565b600480546001019081905561168f90612f34565b50565b600061169c61326f565b600084815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152908190208151606081019092528054829060ff1660018111156116e857fe5b60018111156116f357fe5b81526001820154602082015260029091015460ff161515604090910152905061171a61320c565b506000848152600160208181526040928390208351610180810185528154815292810154918301919091526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820154610120820152600a820154610140820152600b9091015460ff1615801561016083018190526117d1575060065460608201516117ce9161280b565b42115b80156117e05750602082015115155b925050505b92915050565b6117f36111a3565b1561182a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b61183333612799565b1561186a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613baf565b3332146118a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061347d565b6118ae60045461279f565b6118e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613be6565b600e54341015611920576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613952565b600454600090815260026020908152604080832033845290915290206001015415611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613e5c565b6004546000908152600160205260409020600681015434919061199a908361280b565b600682015560078101546119ae908361280b565b60078201556004805460009081526002602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681556001808201899055600385528386208754815492830182559087529490952090940192909255925492519192917f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c1290610ae5908790614107565b611a5a61320c565b506004805460009081526001602081815260409283902083516101808101855281548152928101549183019190915260028101549282019290925260038201546060820152918101546080830152600581015460a0830152600681015460c0830152600781015460e083015260088101546101008301526009810154610120830152600a810154610140830152600b015460ff16151561016082015290565b60075473ffffffffffffffffffffffffffffffffffffffff16331480611b36575060085473ffffffffffffffffffffffffffffffffffffffff1633145b611b6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613ae6565b611b746111a3565b15611bab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b611bb3613052565b7f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d60045460405161108b9190614107565b600160208190526000918252604090912080549181015460028201546003830154600484015460058501546006860154600787015460088801546009890154600a8a0154600b909a01549899979896979596949593949293919290919060ff168c565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60055481565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812054606091908390859003811115611cca575073ffffffffffffffffffffffffffffffffffffffff85166000908152600360205260409020548490035b60608167ffffffffffffffff81118015611ce357600080fd5b50604051908082528060200260200182016040528015611d0d578160200160208202803683370190505b50905060005b82811015611d785773ffffffffffffffffffffffffffffffffffffffff881660009081526003602052604090208054888301908110611d4e57fe5b9060005260206000200154828281518110611d6557fe5b6020908102919091010152600101611d13565b509694019450505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314611dd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b6064811115611e0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613dff565b600c819055611e1f6064826130f9565b600d819055506004547f023010bc68e7f4c0be9887f513c570c7a0f5f511b9716abccd42bf3b8943532b600c54600d54604051611253929190614110565b6000611e6761326f565b600084815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152908190208151606081019092528054829060ff166001811115611eb357fe5b6001811115611ebe57fe5b81526001820154602082015260029091015460ff1615156040909101529050611ee561320c565b5060008481526001602081815260409283902083516101808101855281548152928101549183019190915260028101549282019290925260038201546060820152600482015460808201819052600583015460a08301819052600684015460c0840152600784015460e084015260088401546101008401526009840154610120840152600a840154610140840152600b9093015460ff16151561016083015290911415611f97576000925050506117e5565b80610160015180156117e0575080608001518160a00151138015611fc75750600082516001811115611fc557fe5b145b806117e0575080608001518160a001511280156117e05750600182516001811115611fee57fe5b1495945050505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314612049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b600554811115612085576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90614007565b600655565b606481565b60075473ffffffffffffffffffffffffffffffffffffffff1633146120e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b73ffffffffffffffffffffffffffffffffffffffff811661212d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613a1d565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60075473ffffffffffffffffffffffffffffffffffffffff1633146121c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b600f55565b60075473ffffffffffffffffffffffffffffffffffffffff16331461221b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b6064811115612256576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613e93565b6122616064826130f9565b600c819055600d82905560045460405190917f023010bc68e7f4c0be9887f513c570c7a0f5f511b9716abccd42bf3b8943532b9161125391908590614110565b60075473ffffffffffffffffffffffffffffffffffffffff1633146122f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613cd7565b6122fa6111a3565b15612331576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b612339611af9565b612341610f9b565b7f01c3cbb0d62726ab09d163873ebf9aed99dd8dc08e57bc938f458132fd178cf660045460405161108b9190614107565b60085473ffffffffffffffffffffffffffffffffffffffff1633146123c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613d91565b6123cb6111a3565b15612402576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b60105460ff1661243e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061357f565b601054610100900460ff1615612480576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613887565b6006546004546000908152600160205260409020600201546124a19161280b565b4211156124da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613787565b60006124e4612a1c565b90506124f260045482612b7d565b60048054600101908190556125069061298d565b50601080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b6003602052816000526040600020818154811061254e57fe5b90600052602060002001600091509150505481565b600d5481565b600b5481565b60065481565b61257d612a18565b73ffffffffffffffffffffffffffffffffffffffff1661259b611c47565b73ffffffffffffffffffffffffffffffffffffffff16146125e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613b7a565b73ffffffffffffffffffffffffffffffffffffffff8116612635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906135dc565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60105460ff1681565b600e5481565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b60008273ffffffffffffffffffffffffffffffffffffffff166159d883604051612716906133e2565b600060405180830381858888f193505050503d8060008114612754576040519150601f19603f3d011682016040523d82523d6000602084013e612759565b606091505b5050905080612794576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613ef0565b505050565b3b151590565b600081815260016020819052604082200154158015906127cf575060008281526001602052604090206002015415155b80156127ec57506000828152600160208190526040909120015442115b80156117e5575050600090815260016020526040902060020154421090565b60008282018381101561284a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613750565b9392505050565b600082612860575060006117e5565b8282028284828161286d57fe5b041461284a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613b1d565b60008082116128e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906138e4565b8183816128e957fe5b049392505050565b6128f96111a3565b61292f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906134b4565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612980612a18565b60405161108b91906133e5565b60008181526001602081905260409091204291810182905560055490916129b39161280b565b6002808301919091556005546129cb9142910261280b565b60038201558181556000600682015560405182907f0e5543feb86a4cd302f2b88b26c42be2d1673013a34e1f98bd6d524dd3b4ab4190612a0c904290614107565b60405180910390a25050565b3390565b600080612a34600f544261280b90919063ffffffff16565b90506000806000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b158015612aa357600080fd5b505afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb919061338b565b509350509250925083811115612b1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613faa565b600b548369ffffffffffffffffffff161015612b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613696565b5069ffffffffffffffffffff909116600b5591505090565b60008281526001602081905260409091200154612bc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613522565b600082815260016020526040902060020154421015612c11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613f4d565b600654600083815260016020526040902060020154612c2f9161280b565b421115612c68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613787565b612c72828261313b565b5050565b600082815260016020526040902060020154612cbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613c1d565b600082815260016020526040902060030154421015612d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061381b565b600654600083815260016020526040902060030154612d279161280b565b421115612d60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613ab1565b612c728282613192565b6064612d83600d54600c5461280b90919063ffffffff16565b14612dba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613a54565b600081815260016020526040902060090154158015612de857506000818152600160205260409020600a0154155b612e1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061391b565b600081815260016020526040812060048101546005820154919291829182911315612e8f5783600701549250612e686064610e96600c54876006015461285190919063ffffffff16565b9150612e886064610e96600d54876006015461285190919063ffffffff16565b9050612ed2565b836004015484600501541215612ec45783600801549250612e686064610e96600c54876006015461285190919063ffffffff16565b505050600681015460009081905b6009808501849055600a850183905554612eec908261280b565b60095560405185907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d90612f259086908690869061411e565b60405180910390a25050505050565b60105460ff16612f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c9061357f565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8101600090815260016020526040902060030154612fdb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613639565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8101600090815260016020526040902060030154421015613049576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906136f3565b61168f8161298d565b61305a6111a3565b15613091576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c906139e6565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612980612a18565b600082821115613135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90613850565b50900390565b6000828152600160205260409081902060048101839055905183907f482e76a65b448a42deef26e99e58fb20c85e26f075defff8df6aa80459b39006906131859042908690614110565b60405180910390a2505050565b60008281526001602081905260409182902060058101849055600b810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155905183907fb6ff1fe915db84788cbbbc017f0d2bef9485fad9fd0bd8ce9340fde0d8410dd8906131859042908690614110565b60405180610180016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6040805160608101909152806000815260006020820181905260409091015290565b803573ffffffffffffffffffffffffffffffffffffffff811681146117e557600080fd5b805169ffffffffffffffffffff811681146117e557600080fd5b6000602082840312156132e0578081fd5b61284a8383613291565b600080604083850312156132fc578081fd5b6133068484613291565b946020939093013593505050565b600080600060608486031215613328578081fd5b6133328585613291565b95602085013595506040909401359392505050565b600060208284031215613358578081fd5b5035919050565b60008060408385031215613371578182fd5b823591506133828460208501613291565b90509250929050565b600080600080600060a086880312156133a2578081fd5b6133ac87876132b5565b94506020860151935060408601519250606086015191506133d087608088016132b5565b90509295509295909350565b15159052565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b604080825283519082018190526000906020906060840190828701845b8281101561343f57815184529284019290840190600101613423565b50505092019290925292915050565b901515815260200190565b606081016002851061346757fe5b9381526020810192909252151560409091015290565b6020808252601a908201527f70726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604082015260600190565b60208082526014908201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604082015260600190565b60208082526017908201527f4e6f7420656c696769626c6520666f7220726566756e64000000000000000000604082015260600190565b6020808252602b908201527f43616e206f6e6c79206c6f636b20726f756e6420616674657220726f756e642060408201527f6861732073746172746564000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260408201527f6f756e6420697320747269676765726564000000000000000000000000000000606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f43616e206f6e6c7920737461727420726f756e6420616674657220726f756e6460408201527f206e2d322068617320656e646564000000000000000000000000000000000000606082015260800190565b6020808252603d908201527f4f7261636c652075706461746520726f756e644964206d757374206265206c6160408201527f72676572207468616e206f7261636c654c6174657374526f756e644964000000606082015260800190565b60208082526030908201527f43616e206f6e6c79207374617274206e657720726f756e64206166746572207260408201527f6f756e64206e2d3220656e6454696d6500000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f43616e206f6e6c79206c6f636b20726f756e642077697468696e20627566666560408201527f7200000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f4e6f7420656c696769626c6520666f7220636c61696d00000000000000000000604082015260600190565b6020808252818101527f43616e206f6e6c7920656e6420726f756e6420616674657220656e6454696d65604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526022908201527f43616e206f6e6c792072756e2067656e657369734c6f636b526f756e64206f6e60408201527f6365000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526012908201527f526577617264732063616c63756c617465640000000000000000000000000000604082015260600190565b6020808252602c908201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060408201527f6d696e426574416d6f756e740000000000000000000000000000000000000000606082015260800190565b60208082526013908201527f526f756e6420686173206e6f7420656e64656400000000000000000000000000604082015260600190565b60208082526010908201527f5061757361626c653a2070617573656400000000000000000000000000000000604082015260600190565b60208082526016908201527f43616e6e6f74206265207a65726f206164647265737300000000000000000000604082015260600190565b60208082526035908201527f7265776172645261746520616e6420747265617375727952617465206d75737460408201527f2061646420757020746f20544f54414c5f524154450000000000000000000000606082015260800190565b6020808252818101527f43616e206f6e6c7920656e6420726f756e642077697468696e20627566666572604082015260600190565b60208082526016908201527f61646d696e207c206f70657261746f723a207775743f00000000000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526014908201527f636f6e7472616374206e6f7420616c6c6f776564000000000000000000000000604082015260600190565b60208082526012908201527f526f756e64206e6f74206265747461626c650000000000000000000000000000604082015260600190565b60208082526029908201527f43616e206f6e6c7920656e6420726f756e6420616674657220726f756e64206860408201527f6173206c6f636b65640000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f43616e206f6e6c792072756e2067656e657369735374617274526f756e64206f60408201527f6e63650000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600b908201527f61646d696e3a207775743f000000000000000000000000000000000000000000604082015260600190565b60208082526046908201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260408201527f6f756e6420616e642067656e657369734c6f636b526f756e642069732074726960608201527f6767657265640000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252600e908201527f6f70657261746f723a207775743f000000000000000000000000000000000000604082015260600190565b60208082526015908201527f526f756e6420686173206e6f7420737461727465640000000000000000000000604082015260600190565b60208082526023908201527f726577617264526174652063616e6e6f74206265206d6f7265207468616e203160408201527f3030250000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f43616e206f6e6c7920626574206f6e63652070657220726f756e640000000000604082015260600190565b60208082526025908201527f7472656173757279526174652063616e6e6f74206265206d6f7265207468616e60408201527f2031303025000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f5472616e7366657248656c7065723a2043555252454e43595f5452414e53464560408201527f525f4641494c4544000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f43616e206f6e6c79206c6f636b20726f756e64206166746572206c6f636b546960408201527f6d65000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f4f7261636c6520757064617465206578636565646564206d61782074696d657360408201527f74616d7020616c6c6f77616e6365000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f43616e6e6f74206265206d6f7265207468616e20696e74657276616c00000000604082015260600190565b6020808252600f908201527f5265776172647320636c61696d65640000000000000000000000000000000000604082015260600190565b600061018082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100808401518184015250610120808401518184015250610140808401518184015250610160808401516140ff828501826133dc565b505092915050565b90815260200190565b918252602082015260400190565b9283526020830191909152604082015260600190565b9b8c5260208c019a909a5260408b019890985260608a0196909652608089019490945260a088019290925260c087015260e08601526101008501526101208401526101408301521515610160820152610180019056fea26469706673582212209a5a2c6e6ef15c933537f72933cb17c77841b450c3ff1fc4dbd0167fe301b1f364736f6c634300060c0033000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de000000000000000000000000045b04f6a1a7ec9678cb208d6dc3a5ce5929e98380000000000000000000000003a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f0000000000000000000000000000000000000000000000000000000000000384000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000014

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

000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de000000000000000000000000045b04f6a1a7ec9678cb208d6dc3a5ce5929e98380000000000000000000000003a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f0000000000000000000000000000000000000000000000000000000000000384000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000014

-----Decoded View---------------
Arg [0] : _oracle (address): 0xab594600376ec9fd91f8e885dadf0ce036862de0
Arg [1] : _adminAddress (address): 0x45b04f6a1a7ec9678cb208d6dc3a5ce5929e9838
Arg [2] : _operatorAddress (address): 0x3a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f
Arg [3] : _interval (uint256): 900
Arg [4] : _buffer (uint256): 60
Arg [5] : _minBetAmount (uint256): 10000000000000000
Arg [6] : _oracleUpdateAllowance (uint256): 20

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0
Arg [1] : 00000000000000000000000045b04f6a1a7ec9678cb208d6dc3a5ce5929e9838
Arg [2] : 0000000000000000000000003a2d4403cd065127bbfbe6ca2c49f1dfb051dc8f
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000384
Arg [4] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [5] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000014


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.