Contract 0xb5E249eC976BC4f560137f81ce0610A3F885195d

Contract Overview

Balance:
0 ETH
Txn Hash Method
Block
From
To
Value
0xb49800bd4eeaf4bc776a74945fc36ef57ea7ad2099e04564d4d82f6fbbc5e6f40x60806040146475172023-09-14 20:25:0215 days 18 hrs ago0xd866b2332d4383c1bf719732177e2d9109c99dbc IN  Create: TherundownConsumerVerifier0 ETH0.0000000506560.00001
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TherundownConsumerVerifier

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : TherundownConsumerVerifier.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

// internal
import "../../utils/proxy/solidity-0.8.0/ProxyOwned.sol";
import "../../utils/proxy/solidity-0.8.0/ProxyPausable.sol";

// interface
import "../../interfaces/ITherundownConsumer.sol";
import "../../interfaces/IGamesOddsObtainer.sol";
import "../../interfaces/ISportPositionalMarketManager.sol";
import "../../interfaces/IGamesPlayerProps.sol";

/// @title Verifier of data which are coming from CL and stored into TherundownConsumer.sol
/// @author gruja
contract TherundownConsumerVerifier is Initializable, ProxyOwned, ProxyPausable {
    uint private constant ONE_PERCENT = 1e16;
    uint private constant ONE = 1e18;
    uint public constant CANCELLED = 0;
    uint public constant HOME_WIN = 1;
    uint public constant AWAY_WIN = 2;
    uint public constant RESULT_DRAW = 3;

    ITherundownConsumer public consumer;
    mapping(bytes32 => bool) public invalidName;
    mapping(bytes32 => bool) public supportedMarketType;
    uint public defaultOddsThreshold;
    mapping(uint => uint) public oddsThresholdForSport;

    uint256[] public defaultBookmakerIds;
    mapping(uint256 => uint256[]) public sportIdToBookmakerIds;
    IGamesOddsObtainer public obtainer;
    ISportPositionalMarketManager public sportsManager;
    mapping(address => bool) public whitelistedAddresses;

    uint public minOddsForCheckingThresholdDefault;
    mapping(uint => uint) public minOddsForCheckingThresholdPerSport;

    IGamesPlayerProps public playerProps;
    uint256[] public defaultPlayerPropsBookmakerIds;
    mapping(uint256 => uint256[]) public sportIdForPlayerPropsToBookmakerIds;

    /* ========== CONSTRUCTOR ========== */

    function initialize(
        address _owner,
        address _consumer,
        string[] memory _invalidNames,
        string[] memory _supportedMarketTypes,
        uint _defaultOddsThreshold
    ) external initializer {
        setOwner(_owner);
        consumer = ITherundownConsumer(_consumer);
        _setInvalidNames(_invalidNames, true);
        _setSupportedMarketTypes(_supportedMarketTypes, true);
        defaultOddsThreshold = _defaultOddsThreshold;
    }

    /* ========== VIEW FUNCTIONS ========== */

    /// @notice view function which returns names of teams/fighters are invalid
    /// @param _teamA team A in string (Example: Liverpool)
    /// @param _teamB team B in string (Example: Arsenal)
    /// @return bool is names invalid (true -> invalid, false -> valid)
    function isInvalidNames(string memory _teamA, string memory _teamB) external view returns (bool) {
        return
            keccak256(abi.encodePacked(_teamA)) == keccak256(abi.encodePacked(_teamB)) ||
            invalidName[keccak256(abi.encodePacked(_teamA))] ||
            invalidName[keccak256(abi.encodePacked(_teamB))];
    }

    /// @notice view function which returns if names are the same
    /// @param _teamA team A in string (Example: Liverpool)
    /// @param _teamB team B in string (Example: Arsenal)
    /// @return bool is names are the same
    function areTeamsEqual(string memory _teamA, string memory _teamB) external pure returns (bool) {
        return keccak256(abi.encodePacked(_teamA)) == keccak256(abi.encodePacked(_teamB));
    }

    /// @notice view function which returns if market type is supported, checks are done in a wrapper contract
    /// @param _market type of market (create or resolve)
    /// @return bool supported or not
    function isSupportedMarketType(string memory _market) external view returns (bool) {
        return supportedMarketType[keccak256(abi.encodePacked(_market))];
    }

    /// @notice view function which returns if odds are inside of the threshold
    /// @param _sportId sport id for which we get threshold
    /// @param _currentOddsArray current odds on a contract as array
    /// @param _newOddsArray new odds on a contract as array
    /// @param _isTwoPositionalSport is sport two positional
    /// @return bool true if odds are less then threshold false if above
    function areOddsArrayInThreshold(
        uint _sportId,
        uint[] memory _currentOddsArray,
        uint[] memory _newOddsArray,
        bool _isTwoPositionalSport
    ) external view returns (bool) {
        return
            areOddsInThreshold(_sportId, _currentOddsArray[0], _newOddsArray[0]) &&
            areOddsInThreshold(_sportId, _currentOddsArray[1], _newOddsArray[1]) &&
            (_isTwoPositionalSport || areOddsInThreshold(_sportId, _currentOddsArray[2], _newOddsArray[2]));
    }

    /// @notice view function which returns if odds are inside of the threshold
    /// @param _sportId sport id for which we get threshold
    /// @param _currentOdds current single odds on a contract
    /// @param _newOdds new single odds on a contract
    /// @return bool true if odds are less then threshold false if above
    function areOddsInThreshold(
        uint _sportId,
        uint _currentOdds,
        uint _newOdds
    ) public view returns (bool) {
        uint threshold = oddsThresholdForSport[_sportId] == 0 ? defaultOddsThreshold : oddsThresholdForSport[_sportId];
        uint minOdds = minOddsForCheckingThresholdPerSport[_sportId] == 0
            ? minOddsForCheckingThresholdDefault
            : minOddsForCheckingThresholdPerSport[_sportId];

        // Check if both _currentOdds and _newOdds are below X% (example 10%) if minOdds is set
        if (minOdds > 0 && _currentOdds < minOdds * ONE_PERCENT && _newOdds < minOdds * ONE_PERCENT) {
            return true;
        }

        // new odds appear or it is equal
        if (_currentOdds == 0 || _currentOdds == _newOdds) {
            return true;
        }

        // if current odds is GT new one
        if (_newOdds > _currentOdds) {
            return !(((ONE * _newOdds) / _currentOdds) > (ONE + (threshold * ONE_PERCENT)));
        }
        return !(ONE - ((_newOdds * ONE) / _currentOdds) > (threshold * ONE_PERCENT));
    }

    /// @notice view function which if odds are valid or not
    /// @param _isTwoPositionalSport if two positional sport dont look at draw odds
    /// @param _homeOdds odd for home win
    /// @param _awayOdds odd for away win
    /// @param _drawOdds odd for draw win
    /// @return bool true - valid, fasle - invalid
    function areOddsValid(
        bool _isTwoPositionalSport,
        int24 _homeOdds,
        int24 _awayOdds,
        int24 _drawOdds
    ) external view returns (bool) {
        return _areOddsValid(_isTwoPositionalSport, _homeOdds, _awayOdds, _drawOdds);
    }

    function areSpreadOddsValid(
        int16 spreadHome,
        int24 spreadHomeOdds,
        int16 spreadAway,
        int24 spreadAwayOdds
    ) external view returns (bool) {
        return
            spreadHome == spreadAway * -1 &&
            spreadHome != 0 &&
            spreadAway != 0 &&
            spreadHomeOdds != 0 &&
            spreadAwayOdds != 0;
    }

    function areTotalOddsValid(
        uint24 totalOver,
        int24 totalOverOdds,
        uint24 totalUnder,
        int24 totalUnderOdds
    ) external pure returns (bool) {
        return totalOver == totalUnder && totalOver > 0 && totalUnder > 0 && totalOverOdds != 0 && totalUnderOdds != 0;
    }

    function areOddsAndLinesValidForPlayer(
        uint16 _line,
        int24 _overOdds,
        int24 _underOdds
    ) external pure returns (bool) {
        return _line > 0 && _overOdds != 0 && _underOdds != 0;
    }

    /// @notice view function which returns if outcome of a game is valid
    /// @param _isTwoPositionalSport if two positional sport  draw now vallid
    /// @param _outcome home - 1, away - 2, draw - 3 (if not two positional), and cancel - 0 are valid outomes
    /// @return bool true - valid, fasle - invalid
    function isValidOutcomeForGame(bool _isTwoPositionalSport, uint _outcome) external view returns (bool) {
        return _isValidOutcomeForGame(_isTwoPositionalSport, _outcome);
    }

    /// @notice view function which returns if outcome is good with a score
    /// @param _outcome home - 1, away - 2, draw - 3 (if not two positional), and cancel - 0 are valid outomes
    /// @param _homeScore home team has scored in points
    /// @param _awayScore away team has scored in points
    /// @return bool true - valid, fasle - invalid
    function isValidOutcomeWithResult(
        uint _outcome,
        uint _homeScore,
        uint _awayScore
    ) external pure returns (bool) {
        return _isValidOutcomeWithResult(_outcome, _homeScore, _awayScore);
    }

    /// @notice calculate normalized odds based on american odds
    /// @param _americanOdds american odds in array of 3 [home,away,draw]
    /// @return uint[] array of normalized odds
    function calculateAndNormalizeOdds(int[] memory _americanOdds) external pure returns (uint[] memory) {
        return _calculateAndNormalizeOdds(_americanOdds);
    }

    /// @notice view function which returns odds in a batch of games
    /// @param _gameIds game ids for which games is looking
    /// @return odds odds array
    function getOddsForGames(bytes32[] memory _gameIds) public view returns (int24[] memory odds) {
        odds = new int24[](3 * _gameIds.length);
        for (uint i = 0; i < _gameIds.length; i++) {
            (int24 home, int24 away, int24 draw, , , , ) = obtainer.getOddsForGame(_gameIds[i]);
            odds[i * 3 + 0] = home; // 0 3 6 ...
            odds[i * 3 + 1] = away; // 1 4 7 ...
            odds[i * 3 + 2] = draw; // 2 5 8 ...
        }
    }

    /// @notice view function which returns all spread and total properties
    /// @param _gameIds game ids for which games is looking
    function getAllPropertiesForGivenGames(bytes32[] memory _gameIds)
        external
        view
        returns (
            int24[] memory oddsMain,
            int16[] memory linesSpread,
            uint24[] memory linesTotal,
            int24[] memory oddsSpreadTotals
        )
    {
        return (
            getOddsForGames(_gameIds),
            getSpreadLinesForGames(_gameIds),
            getTotalLinesForGames(_gameIds),
            getSpreadTotalsOddsForGames(_gameIds)
        );
    }

    /// @notice view function which returns odds in a batch of games
    /// @param _gameIds game ids for which games is looking
    /// @return lines odds array
    function getSpreadLinesForGames(bytes32[] memory _gameIds) public view returns (int16[] memory lines) {
        lines = new int16[](2 * _gameIds.length);
        for (uint i = 0; i < _gameIds.length; i++) {
            (int16 spreadHome, int16 spreadAway, , ) = obtainer.getLinesForGame(_gameIds[i]);
            lines[i * 2 + 0] = spreadHome; // 0 2 4 ...
            lines[i * 2 + 1] = spreadAway; // 1 3 5 ...
        }
    }

    /// @notice view function which returns odds in a batch of games
    /// @param _gameIds game ids for which games is looking
    /// @return lines odds array
    function getTotalLinesForGames(bytes32[] memory _gameIds) public view returns (uint24[] memory lines) {
        lines = new uint24[](2 * _gameIds.length);
        for (uint i = 0; i < _gameIds.length; i++) {
            (, , uint24 totalOver, uint24 totalUnder) = obtainer.getLinesForGame(_gameIds[i]);
            lines[i * 2 + 0] = totalOver; // 0 2 4 ...
            lines[i * 2 + 1] = totalUnder; // 1 3 5 ...
        }
    }

    /// @notice view function which returns odds and lnes for player props
    /// @param _gameIds game ids for which games is looking
    /// @param _playerIds player ids
    /// @param _optionIds option ids such as points etc
    /// @return odds odds array
    /// @return lines line array
    /// @return invalidOddsArray invalid odds for market
    function getPlayerPropForOption(
        bytes32[] memory _gameIds,
        bytes32[] memory _playerIds,
        uint8[] memory _optionIds
    )
        public
        view
        returns (
            int24[] memory odds,
            uint16[] memory lines,
            bool[] memory invalidOddsArray,
            bool[] memory pausedByInvalidOddsMainArray,
            bool[] memory pausedByCircuitBreakerMainArray
        )
    {
        odds = new int24[](2 * _gameIds.length);
        lines = new uint16[](_gameIds.length);
        invalidOddsArray = new bool[](_gameIds.length);
        pausedByInvalidOddsMainArray = new bool[](_gameIds.length);
        pausedByCircuitBreakerMainArray = new bool[](_gameIds.length);
        for (uint i = 0; i < _gameIds.length; i++) {
            address marketAddress = consumer.marketPerGameId(_gameIds[i]);
            (uint16 line, int24 overOdds, int24 underOdds, bool invalidOdds) = playerProps.getPlayerPropForOption(
                _gameIds[i],
                _playerIds[i],
                _optionIds[i]
            );
            lines[i] = line;
            invalidOddsArray[i] = invalidOdds;
            pausedByInvalidOddsMainArray[i] = playerProps.pausedByInvalidOddsOnMain(marketAddress);
            pausedByCircuitBreakerMainArray[i] = playerProps.pausedByCircuitBreakerOnMain(marketAddress);
            odds[i * 2 + 0] = overOdds; // 0 2 4 ...
            odds[i * 2 + 1] = underOdds; // 1 3 5 ...
        }
    }

    /// @notice view function which returns odds in a batch of games
    /// @param _gameIds game ids for which games is looking
    /// @return odds odds array
    function getSpreadTotalsOddsForGames(bytes32[] memory _gameIds) public view returns (int24[] memory odds) {
        odds = new int24[](4 * _gameIds.length);
        for (uint i = 0; i < _gameIds.length; i++) {
            (, , , int24 spreadHomeOdds, int24 spreadAwayOdds, int24 totalOverOdds, int24 totalUnderOdds) = obtainer
                .getOddsForGame(_gameIds[i]);
            odds[i * 4 + 0] = spreadHomeOdds; // 0 4 8 ...
            odds[i * 4 + 1] = spreadAwayOdds; // 1 5 9 ...
            odds[i * 4 + 2] = totalOverOdds; // 2 6 10 ...
            odds[i * 4 + 3] = totalUnderOdds; // 2 7 11 ...
        }
    }

    /* ========== INTERNALS ========== */

    function _calculateAndNormalizeOdds(int[] memory _americanOdds) internal pure returns (uint[] memory) {
        uint[] memory normalizedOdds = new uint[](_americanOdds.length);
        uint totalOdds;
        for (uint i = 0; i < _americanOdds.length; i++) {
            uint calculationOdds;
            if (_americanOdds[i] == 0) {
                normalizedOdds[i] = 0;
            } else if (_americanOdds[i] > 0) {
                calculationOdds = uint(_americanOdds[i]);
                normalizedOdds[i] = ((10000 * 1e18) / (calculationOdds + 10000)) * 100;
            } else if (_americanOdds[i] < 0) {
                calculationOdds = uint(-_americanOdds[i]);
                normalizedOdds[i] = ((calculationOdds * 1e18) / (calculationOdds + 10000)) * 100;
            }
            totalOdds += normalizedOdds[i];
        }
        for (uint i = 0; i < normalizedOdds.length; i++) {
            if (totalOdds == 0) {
                normalizedOdds[i] = 0;
            } else {
                normalizedOdds[i] = (1e18 * normalizedOdds[i]) / totalOdds;
            }
        }
        return normalizedOdds;
    }

    function _areOddsValid(
        bool _isTwoPositionalSport,
        int24 _homeOdds,
        int24 _awayOdds,
        int24 _drawOdds
    ) internal pure returns (bool) {
        if (_isTwoPositionalSport) {
            return _awayOdds != 0 && _homeOdds != 0;
        } else {
            return _awayOdds != 0 && _homeOdds != 0 && _drawOdds != 0;
        }
    }

    function _isValidOutcomeForGame(bool _isTwoPositionalSport, uint _outcome) internal pure returns (bool) {
        if (_isTwoPositionalSport) {
            return _outcome == HOME_WIN || _outcome == AWAY_WIN || _outcome == CANCELLED;
        }
        return _outcome == HOME_WIN || _outcome == AWAY_WIN || _outcome == RESULT_DRAW || _outcome == CANCELLED;
    }

    function _isValidOutcomeWithResult(
        uint _outcome,
        uint _homeScore,
        uint _awayScore
    ) internal pure returns (bool) {
        if (_outcome == CANCELLED) {
            return _awayScore == CANCELLED && _homeScore == CANCELLED;
        } else if (_outcome == HOME_WIN) {
            return _homeScore > _awayScore;
        } else if (_outcome == AWAY_WIN) {
            return _homeScore < _awayScore;
        } else {
            return _homeScore == _awayScore;
        }
    }

    function _setInvalidNames(string[] memory _invalidNames, bool _isInvalid) internal {
        for (uint256 index = 0; index < _invalidNames.length; index++) {
            // only if current flag is different, if same skip it
            if (invalidName[keccak256(abi.encodePacked(_invalidNames[index]))] != _isInvalid) {
                invalidName[keccak256(abi.encodePacked(_invalidNames[index]))] = _isInvalid;
                emit SetInvalidName(keccak256(abi.encodePacked(_invalidNames[index])), _isInvalid);
            }
        }
    }

    function _setSupportedMarketTypes(string[] memory _supportedMarketTypes, bool _isSupported) internal {
        for (uint256 index = 0; index < _supportedMarketTypes.length; index++) {
            // only if current flag is different, if same skip it
            if (supportedMarketType[keccak256(abi.encodePacked(_supportedMarketTypes[index]))] != _isSupported) {
                supportedMarketType[keccak256(abi.encodePacked(_supportedMarketTypes[index]))] = _isSupported;
                emit SetSupportedMarketType(keccak256(abi.encodePacked(_supportedMarketTypes[index])), _isSupported);
            }
        }
    }

    /// @notice view function which returns all props needed for game
    /// @param _sportId sportid
    /// @param _date date for sport
    /// @return _isSportOnADate have sport on date true/false
    /// @return _twoPositional is two positional sport true/false
    /// @return _gameIds game Ids for that date/sport
    function getSportProperties(uint _sportId, uint _date)
        external
        view
        returns (
            bool _isSportOnADate,
            bool _twoPositional,
            bytes32[] memory _gameIds,
            bool _supportPlayerProps
        )
    {
        return (
            consumer.isSportOnADate(_date, _sportId),
            consumer.isSportTwoPositionsSport(_sportId),
            consumer.getGamesPerDatePerSport(_sportId, _date),
            playerProps.doesSportSupportPlayerProps(_sportId)
        );
    }

    /// @notice view function which returns all props needed for game
    /// @param _gameIds game id on contract
    /// @return _market address
    /// @return _marketResolved resolved true/false
    /// @return _marketCanceled canceled true/false
    /// @return _invalidOdds invalid odds true/false
    /// @return _isPausedByCanceledStatus is game paused by cancel status true/false
    /// @return _isMarketPaused is market paused
    function getGameProperties(bytes32 _gameIds)
        external
        view
        returns (
            address _market,
            bool _marketResolved,
            bool _marketCanceled,
            bool _invalidOdds,
            bool _isPausedByCanceledStatus,
            bool _isMarketPaused
        )
    {
        address marketAddress = consumer.marketPerGameId(_gameIds);
        return (
            marketAddress,
            consumer.marketResolved(marketAddress),
            consumer.marketCanceled(marketAddress),
            obtainer.invalidOdds(marketAddress),
            consumer.isPausedByCanceledStatus(marketAddress),
            marketAddress != address(0) ? sportsManager.isMarketPaused(marketAddress) : false
        );
    }

    function getAllGameProperties(bytes32[] memory _gameIds)
        external
        view
        returns (
            address[] memory _markets,
            bool[] memory _marketResolved,
            bool[] memory _marketCanceled,
            bool[] memory _invalidOdds,
            bool[] memory _isPausedByCanceledStatus,
            bool[] memory _isMarketPaused,
            uint[] memory _startTime
        )
    {
        uint256 arrayLength = _gameIds.length;
        _markets = new address[](arrayLength);
        _marketResolved = new bool[](arrayLength);
        _marketCanceled = new bool[](arrayLength);
        _invalidOdds = new bool[](arrayLength);
        _isPausedByCanceledStatus = new bool[](arrayLength);
        _isMarketPaused = new bool[](arrayLength);
        _startTime = new uint[](arrayLength);

        for (uint256 i = 0; i < arrayLength; i++) {
            address marketAddress = consumer.marketPerGameId(_gameIds[i]);
            _markets[i] = marketAddress;
            _marketResolved[i] = consumer.marketResolved(marketAddress);
            _marketCanceled[i] = consumer.marketCanceled(marketAddress);
            _invalidOdds[i] = obtainer.invalidOdds(marketAddress);
            _isPausedByCanceledStatus[i] = consumer.isPausedByCanceledStatus(marketAddress);
            _isMarketPaused[i] = marketAddress != address(0) ? sportsManager.isMarketPaused(marketAddress) : false;
            _startTime[i] = consumer.getGameStartTime(_gameIds[i]);
        }

        return (
            _markets,
            _marketResolved,
            _marketCanceled,
            _invalidOdds,
            _isPausedByCanceledStatus,
            _isMarketPaused,
            _startTime
        );
    }

    function areInvalidOdds(bytes32 _gameIds) external view returns (bool _invalidOdds) {
        return obtainer.invalidOdds(consumer.marketPerGameId(_gameIds));
    }

    /// @notice getting bookmaker by sports id
    /// @param _sportId id of a sport for fetching
    function getBookmakerIdsBySportId(uint256 _sportId) external view returns (uint256[] memory) {
        return sportIdToBookmakerIds[_sportId].length > 0 ? sportIdToBookmakerIds[_sportId] : defaultBookmakerIds;
    }

    /// @notice getting bookmaker by sports id for playerProps
    /// @param _sportId id of a sport for fetching
    function getBookmakerIdsBySportIdForPlayerProps(uint256 _sportId) external view returns (uint256[] memory) {
        return
            sportIdForPlayerPropsToBookmakerIds[_sportId].length > 0
                ? sportIdForPlayerPropsToBookmakerIds[_sportId]
                : defaultPlayerPropsBookmakerIds;
    }

    /// @notice return string array from bytes32 array
    /// @param _ids bytes32 array of game ids
    function getStringIDsFromBytesArrayIDs(bytes32[] memory _ids) external view returns (string[] memory _gameIds) {
        if (_ids.length > 0) {
            _gameIds = new string[](_ids.length);
        }
        for (uint i = 0; i < _ids.length; i++) {
            _gameIds[i] = string(abi.encodePacked(_ids[i]));
        }
    }

    function convertUintToString(uint8[] memory _numbers) public pure returns (string[] memory strings) {
        strings = new string[](_numbers.length);

        for (uint256 i = 0; i < _numbers.length; i++) {
            strings[i] = _uintToString(_numbers[i]);
        }
    }

    function _uintToString(uint8 num) internal pure returns (string memory) {
        if (num == 0) {
            return "0";
        }

        uint8 tempNum = num;
        uint8 digits;

        while (tempNum != 0) {
            digits++;
            tempNum /= 10;
        }

        bytes memory buffer = new bytes(digits);

        while (num != 0) {
            digits--;
            buffer[digits] = bytes1(uint8(48 + (num % 10))); // Convert to ASCII
            num /= 10;
        }

        return string(buffer);
    }

    /* ========== CONTRACT MANAGEMENT ========== */

    /// @notice sets consumer address
    /// @param _consumer consumer address
    function setConsumerAddress(address _consumer) external onlyOwner {
        require(_consumer != address(0), "Invalid address");
        consumer = ITherundownConsumer(_consumer);
        emit NewConsumerAddress(_consumer);
    }

    /// @notice sets manager address
    /// @param _manager address
    function setSportsManager(address _manager) external onlyOwner {
        require(_manager != address(0), "Invalid address");
        sportsManager = ISportPositionalMarketManager(_manager);
        emit NewSportsManagerAddress(_manager);
    }

    /// @notice sets invalid names
    /// @param _invalidNames invalid names as array of strings
    /// @param _isInvalid true/false (invalid or not)
    function setInvalidNames(string[] memory _invalidNames, bool _isInvalid) external onlyOwner {
        require(_invalidNames.length > 0, "Invalid input");
        _setInvalidNames(_invalidNames, _isInvalid);
    }

    /// @notice sets supported market types
    /// @param _supportedMarketTypes supported types as array of strings
    /// @param _isSupported true/false (invalid or not)
    function setSupportedMarketTypes(string[] memory _supportedMarketTypes, bool _isSupported) external onlyOwner {
        require(_supportedMarketTypes.length > 0, "Invalid input");
        _setSupportedMarketTypes(_supportedMarketTypes, _isSupported);
    }

    /// @notice setting default odds threshold
    /// @param _defaultOddsThreshold default odds threshold
    function setDefaultOddsThreshold(uint _defaultOddsThreshold) external onlyOwner {
        require(_defaultOddsThreshold > 0, "Must be more then ZERO");
        defaultOddsThreshold = _defaultOddsThreshold;
        emit NewDefaultOddsThreshold(_defaultOddsThreshold);
    }

    /// @notice setting custom odds threshold for sport
    /// @param _sportId sport id
    /// @param _oddsThresholdForSport custom odds threshold which will be by sport
    function setCustomOddsThresholdForSport(uint _sportId, uint _oddsThresholdForSport) external onlyOwner {
        require(defaultOddsThreshold != _oddsThresholdForSport, "Same value as default value");
        require(_oddsThresholdForSport > 0, "Must be more then ZERO");
        require(consumer.supportedSport(_sportId), "SportId is not supported");
        require(oddsThresholdForSport[_sportId] != _oddsThresholdForSport, "Same value as before");
        oddsThresholdForSport[_sportId] = _oddsThresholdForSport;
        emit NewCustomOddsThresholdForSport(_sportId, _oddsThresholdForSport);
    }

    /// @notice setting default bookmakers
    /// @param _defaultBookmakerIds array of bookmaker ids
    function setDefaultBookmakerIds(uint256[] memory _defaultBookmakerIds) external onlyOwner {
        defaultBookmakerIds = _defaultBookmakerIds;
        emit NewDefaultBookmakerIds(_defaultBookmakerIds);
    }

    /// @notice setting bookmaker by sports id
    /// @param _sportId id of a sport
    /// @param _bookmakerIds array of bookmakers
    function setBookmakerIdsBySportId(uint256 _sportId, uint256[] memory _bookmakerIds) external {
        require(
            msg.sender == owner || whitelistedAddresses[msg.sender],
            "Only owner or whitelisted address may perform this action"
        );
        require(consumer.supportedSport(_sportId), "SportId is not supported");
        sportIdToBookmakerIds[_sportId] = _bookmakerIds;
        emit NewBookmakerIdsBySportId(_sportId, _bookmakerIds);
    }

    /// @notice setting default bookmakers for player props
    /// @param _defaultPlayerPropsBookmakerIds array of bookmaker ids
    function setDefaultBookmakerIdsForPlayerProps(uint256[] memory _defaultPlayerPropsBookmakerIds) external onlyOwner {
        defaultPlayerPropsBookmakerIds = _defaultPlayerPropsBookmakerIds;
        emit NewDefaultBookmakerIdsForPlayerProps(_defaultPlayerPropsBookmakerIds);
    }

    /// @notice setting bookmaker by sports id for playerProps
    /// @param _sportId id of a sport
    /// @param _bookmakerIds array of bookmakers
    function setBookmakerIdsBySportIdForPlayerProps(uint256 _sportId, uint256[] memory _bookmakerIds) external {
        require(msg.sender == owner || whitelistedAddresses[msg.sender], "Only owner or whitelisted address");
        require(
            consumer.supportedSport(_sportId) && playerProps.doesSportSupportPlayerProps(_sportId),
            "SportId is not supported"
        );
        sportIdForPlayerPropsToBookmakerIds[_sportId] = _bookmakerIds;
        emit NewBookmakerIdsBySportIdForPlayerProps(_sportId, _bookmakerIds);
    }

    /// @notice sets the PlayerProps contract address, which only owner can execute
    /// @param _playerProps address of a player props contract
    function setPlayerPropsAddress(address _playerProps) external onlyOwner {
        require(_playerProps != address(0), "Invalid address");
        playerProps = IGamesPlayerProps(_playerProps);
        emit NewPlayerPropsAddress(_playerProps);
    }

    /// @notice sets obtainer
    /// @param _obtainer obtainer address
    function setObtainer(address _obtainer) external onlyOwner {
        obtainer = IGamesOddsObtainer(_obtainer);
        emit NewObtainerAddress(_obtainer);
    }

    /// @notice setWhitelistedAddresses enables whitelist addresses of given array
    /// @param _whitelistedAddresses array of whitelisted addresses
    /// @param _flag adding or removing from whitelist (true: add, false: remove)
    function setWhitelistedAddresses(address[] calldata _whitelistedAddresses, bool _flag) external onlyOwner {
        require(_whitelistedAddresses.length > 0, "Whitelisted addresses cannot be empty");
        for (uint256 index = 0; index < _whitelistedAddresses.length; index++) {
            // only if current flag is different, if same skip it
            if (whitelistedAddresses[_whitelistedAddresses[index]] != _flag) {
                whitelistedAddresses[_whitelistedAddresses[index]] = _flag;
                emit AddedIntoWhitelist(_whitelistedAddresses[index], _flag);
            }
        }
    }

    /// @notice setting min percentage for checking threshold
    /// @param _minOddsForCheckingThresholdDefault min percentage which threshold for odds are checked
    function setMinOddsForCheckingThresholdDefault(uint _minOddsForCheckingThresholdDefault) external onlyOwner {
        minOddsForCheckingThresholdDefault = _minOddsForCheckingThresholdDefault;
        emit NewMinOddsForCheckingThresholdDefault(_minOddsForCheckingThresholdDefault);
    }

    /// @notice setting custom min odds checking for threshold
    /// @param _sportId sport id
    /// @param _minOddsForCheckingThresholdPerSport custom custom min odds checking for threshold
    function setMinOddsForCheckingThresholdPerSport(uint _sportId, uint _minOddsForCheckingThresholdPerSport)
        external
        onlyOwner
    {
        minOddsForCheckingThresholdPerSport[_sportId] = _minOddsForCheckingThresholdPerSport;
        emit NewMinOddsForCheckingThresholdPerSport(_sportId, _minOddsForCheckingThresholdPerSport);
    }

    /* ========== EVENTS ========== */
    event NewConsumerAddress(address _consumer);
    event SetInvalidName(bytes32 _invalidName, bool _isInvalid);
    event SetSupportedMarketType(bytes32 _supportedMarketType, bool _isSupported);
    event NewDefaultOddsThreshold(uint _defaultOddsThreshold);
    event NewCustomOddsThresholdForSport(uint _sportId, uint _oddsThresholdForSport);
    event NewBookmakerIdsBySportId(uint256 _sportId, uint256[] _ids);
    event NewDefaultBookmakerIds(uint256[] _ids);
    event NewObtainerAddress(address _obtainer);
    event NewSportsManagerAddress(address _manager);
    event AddedIntoWhitelist(address _whitelistAddress, bool _flag);
    event NewMinOddsForCheckingThresholdDefault(uint _minOddsChecking);
    event NewMinOddsForCheckingThresholdPerSport(uint256 _sportId, uint _minOddsChecking);
    event NewBookmakerIdsBySportIdForPlayerProps(uint256 _sportId, uint256[] _ids);
    event NewDefaultBookmakerIdsForPlayerProps(uint256[] _ids);
    event NewPlayerPropsAddress(address _playerProps);
}

File 2 of 16 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @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.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _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());
    }
    uint256[49] private __gap;
}

File 3 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 4 of 16 : ProxyOwned.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// Clone of syntetix contract without constructor
contract ProxyOwned {
    address public owner;
    address public nominatedOwner;
    bool private _initialized;
    bool private _transferredAtInit;

    function setOwner(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        require(!_initialized, "Already initialized, use nominateNewOwner");
        _initialized = true;
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    function transferOwnershipAtInit(address proxyAddress) external onlyOwner {
        require(proxyAddress != address(0), "Invalid address");
        require(!_transferredAtInit, "Already transferred");
        owner = proxyAddress;
        _transferredAtInit = true;
        emit OwnerChanged(owner, proxyAddress);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

File 5 of 16 : ProxyPausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// Inheritance
import "./ProxyOwned.sol";

// Clone of syntetix contract without constructor

contract ProxyPausable is ProxyOwned {
    uint public lastPauseTime;
    bool public paused;

    

    /**
     * @notice Change the paused state of the contract
     * @dev Only the contract owner may call this.
     */
    function setPaused(bool _paused) external onlyOwner {
        // Ensure we're actually changing the state before we do anything
        if (_paused == paused) {
            return;
        }

        // Set our paused state.
        paused = _paused;

        // If applicable, set the last pause time.
        if (paused) {
            lastPauseTime = block.timestamp;
        }

        // Let everyone know that our pause state has changed.
        emit PauseChanged(paused);
    }

    event PauseChanged(bool isPaused);

    modifier notPaused {
        require(!paused, "This action cannot be performed while the contract is paused");
        _;
    }
}

File 6 of 16 : ITherundownConsumer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ITherundownConsumer {
    struct GameCreate {
        bytes32 gameId;
        uint256 startTime;
        int24 homeOdds;
        int24 awayOdds;
        int24 drawOdds;
        string homeTeam;
        string awayTeam;
    }

    // view functions
    function supportedSport(uint _sportId) external view returns (bool);

    function gameOnADate(bytes32 _gameId) external view returns (uint);

    function isGameResolvedOrCanceled(bytes32 _gameId) external view returns (bool);

    function getNormalizedOddsForMarket(address _market) external view returns (uint[] memory);

    function getGamesPerDatePerSport(uint _sportId, uint _date) external view returns (bytes32[] memory);

    function getGamePropsForOdds(address _market)
        external
        view
        returns (
            uint,
            uint,
            bytes32
        );

    function gameIdPerMarket(address _market) external view returns (bytes32);

    function getGameCreatedById(bytes32 _gameId) external view returns (GameCreate memory);

    function isChildMarket(address _market) external view returns (bool);

    function gameFulfilledCreated(bytes32 _gameId) external view returns (bool);

    // write functions
    function fulfillGamesCreated(
        bytes32 _requestId,
        bytes[] memory _games,
        uint _sportsId,
        uint _date
    ) external;

    function fulfillGamesResolved(
        bytes32 _requestId,
        bytes[] memory _games,
        uint _sportsId
    ) external;

    function fulfillGamesOdds(bytes32 _requestId, bytes[] memory _games) external;

    function setPausedByCanceledStatus(address _market, bool _flag) external;

    function setGameIdPerChildMarket(bytes32 _gameId, address _child) external;

    function pauseOrUnpauseMarket(address _market, bool _pause) external;

    function pauseOrUnpauseMarketForPlayerProps(
        address _market,
        bool _pause,
        bool _invalidOdds,
        bool _circuitBreakerMain
    ) external;

    function setChildMarkets(
        bytes32 _gameId,
        address _main,
        address _child,
        bool _isSpread,
        int16 _spreadHome,
        uint24 _totalOver
    ) external;

    function resolveMarketManually(
        address _market,
        uint _outcome,
        uint8 _homeScore,
        uint8 _awayScore,
        bool _usebackupOdds
    ) external;

    function getOddsForGame(bytes32 _gameId)
        external
        view
        returns (
            int24,
            int24,
            int24
        );

    function sportsIdPerGame(bytes32 _gameId) external view returns (uint);

    function getGameStartTime(bytes32 _gameId) external view returns (uint256);

    function marketPerGameId(bytes32 _gameId) external view returns (address);

    function marketResolved(address _market) external view returns (bool);

    function marketCanceled(address _market) external view returns (bool);

    function invalidOdds(address _market) external view returns (bool);

    function isPausedByCanceledStatus(address _market) external view returns (bool);

    function isSportOnADate(uint _date, uint _sportId) external view returns (bool);

    function isSportTwoPositionsSport(uint _sportsId) external view returns (bool);
}

File 7 of 16 : IGamesOddsObtainer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IGamesOddsObtainer {
    struct GameOdds {
        bytes32 gameId;
        int24 homeOdds;
        int24 awayOdds;
        int24 drawOdds;
        int16 spreadHome;
        int24 spreadHomeOdds;
        int16 spreadAway;
        int24 spreadAwayOdds;
        uint24 totalOver;
        int24 totalOverOdds;
        uint24 totalUnder;
        int24 totalUnderOdds;
    }

    // view

    function getActiveChildMarketsFromParent(address _parent) external view returns (address, address);

    function getSpreadTotalsChildMarketsFromParent(address _parent)
        external
        view
        returns (
            uint numOfSpreadMarkets,
            address[] memory spreadMarkets,
            uint numOfTotalsMarkets,
            address[] memory totalMarkets
        );

    function areOddsValid(bytes32 _gameId, bool _useBackup) external view returns (bool);

    function invalidOdds(address _market) external view returns (bool);

    function getNormalizedOdds(bytes32 _gameId) external view returns (uint[] memory);

    function getNormalizedOddsForMarket(address _market) external view returns (uint[] memory);

    function getOddsForGames(bytes32[] memory _gameIds) external view returns (int24[] memory odds);

    function mainMarketChildMarketIndex(address _main, uint _index) external view returns (address);

    function numberOfChildMarkets(address _main) external view returns (uint);

    function mainMarketSpreadChildMarket(address _main, int16 _spread) external view returns (address);

    function mainMarketTotalChildMarket(address _main, uint24 _total) external view returns (address);

    function childMarketMainMarket(address _market) external view returns (address);

    function currentActiveTotalChildMarket(address _main) external view returns (address);

    function currentActiveSpreadChildMarket(address _main) external view returns (address);

    function isSpreadChildMarket(address _child) external view returns (bool);

    function childMarketCreated(address _child) external view returns (bool);

    function getOddsForGame(bytes32 _gameId)
        external
        view
        returns (
            int24,
            int24,
            int24,
            int24,
            int24,
            int24,
            int24
        );

    function getLinesForGame(bytes32 _gameId)
        external
        view
        returns (
            int16,
            int16,
            uint24,
            uint24
        );

    // executable

    function obtainOdds(
        bytes32 requestId,
        GameOdds memory _game,
        uint _sportId
    ) external;

    function setFirstOdds(
        bytes32 _gameId,
        int24 _homeOdds,
        int24 _awayOdds,
        int24 _drawOdds
    ) external;

    function setFirstNormalizedOdds(bytes32 _gameId, address _market) external;

    function setBackupOddsAsMainOddsForGame(bytes32 _gameId) external;

    function pauseUnpauseChildMarkets(address _main, bool _flag) external;

    function pauseUnpauseCurrentActiveChildMarket(
        bytes32 _gameId,
        address _main,
        bool _flag
    ) external;

    function resolveChildMarkets(
        address _market,
        uint _outcome,
        uint8 _homeScore,
        uint8 _awayScore
    ) external;

    function setChildMarketGameId(bytes32 gameId, address market) external;
}

File 8 of 16 : ISportPositionalMarketManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/ISportPositionalMarket.sol";

interface ISportPositionalMarketManager {
    /* ========== VIEWS / VARIABLES ========== */

    function marketCreationEnabled() external view returns (bool);

    function totalDeposited() external view returns (uint);

    function numActiveMarkets() external view returns (uint);

    function activeMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function numMaturedMarkets() external view returns (uint);

    function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function isActiveMarket(address candidate) external view returns (bool);

    function isDoubleChanceMarket(address candidate) external view returns (bool);

    function isDoubleChanceSupported() external view returns (bool);

    function isKnownMarket(address candidate) external view returns (bool);

    function getActiveMarketAddress(uint _index) external view returns (address);

    function transformCollateral(uint value) external view returns (uint);

    function reverseTransformCollateral(uint value) external view returns (uint);

    function isMarketPaused(address _market) external view returns (bool);

    function expiryDuration() external view returns (uint);

    function isWhitelistedAddress(address _address) external view returns (bool);

    function getOddsObtainer() external view returns (address obtainer);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function createMarket(
        bytes32 gameId,
        string memory gameLabel,
        uint maturity,
        uint initialMint, // initial sUSD to mint options for,
        uint positionCount,
        uint[] memory tags,
        bool isChild,
        address parentMarket
    ) external returns (ISportPositionalMarket);

    function setMarketPaused(address _market, bool _paused) external;

    function updateDatesForMarket(address _market, uint256 _newStartTime) external;

    function resolveMarket(address market, uint outcome) external;

    function expireMarkets(address[] calldata market) external;

    function transferSusdTo(
        address sender,
        address receiver,
        uint amount
    ) external;

    function queryMintsAndMaturityStatusForPlayerProps(address[] memory _playerPropsMarkets)
        external
        view
        returns (
            bool[] memory _hasAnyMintsArray,
            bool[] memory _isMaturedArray,
            bool[] memory _isResolvedArray
        );
}

File 9 of 16 : IGamesPlayerProps.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IGamesPlayerProps {
    struct PlayerProps {
        bytes32 gameId;
        bytes32 playerId;
        uint8 option;
        string playerName;
        uint16 line;
        int24 overOdds;
        int24 underOdds;
    }

    struct PlayerPropsResolver {
        bytes32 gameId;
        bytes32 playerId;
        uint8 option;
        uint16 score;
        uint8 statusId;
    }

    function obtainPlayerProps(PlayerProps memory _player, uint _sportId) external;

    function resolvePlayerProps(PlayerPropsResolver memory _result) external;

    function cancelMarketFromManager(address _market) external;

    function pauseAllPlayerPropsMarketForMain(
        address _main,
        bool _flag,
        bool _invalidOddsOnMain,
        bool _circuitBreakerMain
    ) external;

    function createFulfilledForPlayerProps(
        bytes32 gameId,
        bytes32 playerId,
        uint8 option
    ) external view returns (bool);

    function cancelPlayerPropsMarketForMain(address _main) external;

    function getNormalizedOddsForMarket(address _market) external view returns (uint[] memory);

    function mainMarketChildMarketIndex(address _main, uint _index) external view returns (address);

    function numberOfChildMarkets(address _main) external view returns (uint);

    function doesSportSupportPlayerProps(uint _sportId) external view returns (bool);

    function pausedByInvalidOddsOnMain(address _main) external view returns (bool);

    function pausedByCircuitBreakerOnMain(address _main) external view returns (bool);

    function getAllOptionsWithPlayersForGameId(bytes32 _gameId)
        external
        view
        returns (
            bytes32[] memory _playerIds,
            uint8[] memory _options,
            bool[] memory _isResolved,
            address[][] memory _childMarketsPerOption
        );

    function getPlayerPropsDataForMarket(address _market)
        external
        view
        returns (
            address,
            bytes32,
            bytes32,
            uint8
        );

    function getPlayerPropForOption(
        bytes32 gameId,
        bytes32 playerId,
        uint8 option
    )
        external
        view
        returns (
            uint16,
            int24,
            int24,
            bool
        );

    function fulfillPlayerPropsCLResolved(bytes[] memory _playerProps) external;
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 11 of 16 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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;
        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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 16 : ISportPositionalMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarketManager.sol";
import "../interfaces/IPosition.sol";
import "../interfaces/IPriceFeed.sol";

interface ISportPositionalMarket {
    /* ========== TYPES ========== */

    enum Phase {
        Trading,
        Maturity,
        Expiry
    }
    enum Side {
        Cancelled,
        Home,
        Away,
        Draw
    }

    /* ========== VIEWS / VARIABLES ========== */

    function getOptions()
        external
        view
        returns (
            IPosition home,
            IPosition away,
            IPosition draw
        );

    function times() external view returns (uint maturity, uint destruction);

    function initialMint() external view returns (uint);

    function getGameDetails() external view returns (bytes32 gameId, string memory gameLabel);

    function getGameId() external view returns (bytes32);

    function deposited() external view returns (uint);

    function optionsCount() external view returns (uint);

    function creator() external view returns (address);

    function resolved() external view returns (bool);

    function cancelled() external view returns (bool);

    function paused() external view returns (bool);

    function phase() external view returns (Phase);

    function canResolve() external view returns (bool);

    function result() external view returns (Side);

    function isChild() external view returns (bool);

    function tags(uint idx) external view returns (uint);

    function getTags() external view returns (uint tag1, uint tag2);

    function getTagsLength() external view returns (uint tagsLength);

    function getParentMarketPositions() external view returns (IPosition position1, IPosition position2);

    function getStampedOdds()
        external
        view
        returns (
            uint,
            uint,
            uint
        );

    function balancesOf(address account)
        external
        view
        returns (
            uint home,
            uint away,
            uint draw
        );

    function totalSupplies()
        external
        view
        returns (
            uint home,
            uint away,
            uint draw
        );

    function isDoubleChance() external view returns (bool);

    function parentMarket() external view returns (ISportPositionalMarket);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function setPaused(bool _paused) external;

    function updateDates(uint256 _maturity, uint256 _expiry) external;

    function mint(uint value) external;

    function exerciseOptions() external;

    function restoreInvalidOdds(
        uint _homeOdds,
        uint _awayOdds,
        uint _drawOdds
    ) external;
}

File 13 of 16 : IPositionalMarketManager.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarket.sol";

interface IPositionalMarketManager {
    /* ========== VIEWS / VARIABLES ========== */

    function durations() external view returns (uint expiryDuration, uint maxTimeToMaturity);

    function capitalRequirement() external view returns (uint);

    function marketCreationEnabled() external view returns (bool);

    function onlyAMMMintingAndBurning() external view returns (bool);

    function transformCollateral(uint value) external view returns (uint);

    function reverseTransformCollateral(uint value) external view returns (uint);

    function totalDeposited() external view returns (uint);

    function numActiveMarkets() external view returns (uint);

    function activeMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function numMaturedMarkets() external view returns (uint);

    function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory);

    function isActiveMarket(address candidate) external view returns (bool);

    function isKnownMarket(address candidate) external view returns (bool);

    function getThalesAMM() external view returns (address);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function createMarket(
        bytes32 oracleKey,
        uint strikePrice,
        uint maturity,
        uint initialMint // initial sUSD to mint options for,
    ) external returns (IPositionalMarket);

    function resolveMarket(address market) external;

    function expireMarkets(address[] calldata market) external;

    function transferSusdTo(
        address sender,
        address receiver,
        uint amount
    ) external;
}

File 14 of 16 : IPosition.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "./IPositionalMarket.sol";

interface IPosition {
    /* ========== VIEWS / VARIABLES ========== */

    function getBalanceOf(address account) external view returns (uint);

    function getTotalSupply() external view returns (uint);

    function exerciseWithAmount(address claimant, uint amount) external;
}

File 15 of 16 : IPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

interface IPriceFeed {
    // Structs
    struct RateAndUpdatedTime {
        uint216 rate;
        uint40 time;
    }

    // Mutative functions
    function addAggregator(bytes32 currencyKey, address aggregatorAddress) external;

    function removeAggregator(bytes32 currencyKey) external;

    // Views

    function rateForCurrency(bytes32 currencyKey) external view returns (uint);

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);

    function getRates() external view returns (uint[] memory);

    function getCurrencies() external view returns (bytes32[] memory);
}

File 16 of 16 : IPositionalMarket.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

import "../interfaces/IPositionalMarketManager.sol";
import "../interfaces/IPosition.sol";
import "../interfaces/IPriceFeed.sol";

interface IPositionalMarket {
    /* ========== TYPES ========== */

    enum Phase {
        Trading,
        Maturity,
        Expiry
    }
    enum Side {
        Up,
        Down
    }

    /* ========== VIEWS / VARIABLES ========== */

    function getOptions() external view returns (IPosition up, IPosition down);

    function times() external view returns (uint maturity, uint destructino);

    function getOracleDetails()
        external
        view
        returns (
            bytes32 key,
            uint strikePrice,
            uint finalPrice
        );

    function fees() external view returns (uint poolFee, uint creatorFee);

    function deposited() external view returns (uint);

    function creator() external view returns (address);

    function resolved() external view returns (bool);

    function phase() external view returns (Phase);

    function oraclePrice() external view returns (uint);

    function oraclePriceAndTimestamp() external view returns (uint price, uint updatedAt);

    function canResolve() external view returns (bool);

    function result() external view returns (Side);

    function balancesOf(address account) external view returns (uint up, uint down);

    function totalSupplies() external view returns (uint up, uint down);

    function getMaximumBurnable(address account) external view returns (uint amount);

    /* ========== MUTATIVE FUNCTIONS ========== */

    function mint(uint value) external;

    function exerciseOptions() external returns (uint);

    function burnOptions(uint amount) external;

    function burnOptionsMaximum() external;
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_whitelistAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"_flag","type":"bool"}],"name":"AddedIntoWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"NewBookmakerIdsBySportId","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"NewBookmakerIdsBySportIdForPlayerProps","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_consumer","type":"address"}],"name":"NewConsumerAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_oddsThresholdForSport","type":"uint256"}],"name":"NewCustomOddsThresholdForSport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"NewDefaultBookmakerIds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"NewDefaultBookmakerIdsForPlayerProps","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"NewDefaultOddsThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_minOddsChecking","type":"uint256"}],"name":"NewMinOddsForCheckingThresholdDefault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_minOddsChecking","type":"uint256"}],"name":"NewMinOddsForCheckingThresholdPerSport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_obtainer","type":"address"}],"name":"NewObtainerAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_playerProps","type":"address"}],"name":"NewPlayerPropsAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_manager","type":"address"}],"name":"NewSportsManagerAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_invalidName","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"_isInvalid","type":"bool"}],"name":"SetInvalidName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_supportedMarketType","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"SetSupportedMarketType","type":"event"},{"inputs":[],"name":"AWAY_WIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CANCELLED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOME_WIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESULT_DRAW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameIds","type":"bytes32"}],"name":"areInvalidOdds","outputs":[{"internalType":"bool","name":"_invalidOdds","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_line","type":"uint16"},{"internalType":"int24","name":"_overOdds","type":"int24"},{"internalType":"int24","name":"_underOdds","type":"int24"}],"name":"areOddsAndLinesValidForPlayer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256[]","name":"_currentOddsArray","type":"uint256[]"},{"internalType":"uint256[]","name":"_newOddsArray","type":"uint256[]"},{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"}],"name":"areOddsArrayInThreshold","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_currentOdds","type":"uint256"},{"internalType":"uint256","name":"_newOdds","type":"uint256"}],"name":"areOddsInThreshold","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"},{"internalType":"int24","name":"_homeOdds","type":"int24"},{"internalType":"int24","name":"_awayOdds","type":"int24"},{"internalType":"int24","name":"_drawOdds","type":"int24"}],"name":"areOddsValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int16","name":"spreadHome","type":"int16"},{"internalType":"int24","name":"spreadHomeOdds","type":"int24"},{"internalType":"int16","name":"spreadAway","type":"int16"},{"internalType":"int24","name":"spreadAwayOdds","type":"int24"}],"name":"areSpreadOddsValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_teamA","type":"string"},{"internalType":"string","name":"_teamB","type":"string"}],"name":"areTeamsEqual","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint24","name":"totalOver","type":"uint24"},{"internalType":"int24","name":"totalOverOdds","type":"int24"},{"internalType":"uint24","name":"totalUnder","type":"uint24"},{"internalType":"int24","name":"totalUnderOdds","type":"int24"}],"name":"areTotalOddsValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"int256[]","name":"_americanOdds","type":"int256[]"}],"name":"calculateAndNormalizeOdds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"consumer","outputs":[{"internalType":"contract ITherundownConsumer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"_numbers","type":"uint8[]"}],"name":"convertUintToString","outputs":[{"internalType":"string[]","name":"strings","type":"string[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultBookmakerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultOddsThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultPlayerPropsBookmakerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getAllGameProperties","outputs":[{"internalType":"address[]","name":"_markets","type":"address[]"},{"internalType":"bool[]","name":"_marketResolved","type":"bool[]"},{"internalType":"bool[]","name":"_marketCanceled","type":"bool[]"},{"internalType":"bool[]","name":"_invalidOdds","type":"bool[]"},{"internalType":"bool[]","name":"_isPausedByCanceledStatus","type":"bool[]"},{"internalType":"bool[]","name":"_isMarketPaused","type":"bool[]"},{"internalType":"uint256[]","name":"_startTime","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getAllPropertiesForGivenGames","outputs":[{"internalType":"int24[]","name":"oddsMain","type":"int24[]"},{"internalType":"int16[]","name":"linesSpread","type":"int16[]"},{"internalType":"uint24[]","name":"linesTotal","type":"uint24[]"},{"internalType":"int24[]","name":"oddsSpreadTotals","type":"int24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"}],"name":"getBookmakerIdsBySportId","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"}],"name":"getBookmakerIdsBySportIdForPlayerProps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameIds","type":"bytes32"}],"name":"getGameProperties","outputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"bool","name":"_marketResolved","type":"bool"},{"internalType":"bool","name":"_marketCanceled","type":"bool"},{"internalType":"bool","name":"_invalidOdds","type":"bool"},{"internalType":"bool","name":"_isPausedByCanceledStatus","type":"bool"},{"internalType":"bool","name":"_isMarketPaused","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getOddsForGames","outputs":[{"internalType":"int24[]","name":"odds","type":"int24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_playerIds","type":"bytes32[]"},{"internalType":"uint8[]","name":"_optionIds","type":"uint8[]"}],"name":"getPlayerPropForOption","outputs":[{"internalType":"int24[]","name":"odds","type":"int24[]"},{"internalType":"uint16[]","name":"lines","type":"uint16[]"},{"internalType":"bool[]","name":"invalidOddsArray","type":"bool[]"},{"internalType":"bool[]","name":"pausedByInvalidOddsMainArray","type":"bool[]"},{"internalType":"bool[]","name":"pausedByCircuitBreakerMainArray","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_date","type":"uint256"}],"name":"getSportProperties","outputs":[{"internalType":"bool","name":"_isSportOnADate","type":"bool"},{"internalType":"bool","name":"_twoPositional","type":"bool"},{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"},{"internalType":"bool","name":"_supportPlayerProps","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getSpreadLinesForGames","outputs":[{"internalType":"int16[]","name":"lines","type":"int16[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getSpreadTotalsOddsForGames","outputs":[{"internalType":"int24[]","name":"odds","type":"int24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_ids","type":"bytes32[]"}],"name":"getStringIDsFromBytesArrayIDs","outputs":[{"internalType":"string[]","name":"_gameIds","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"getTotalLinesForGames","outputs":[{"internalType":"uint24[]","name":"lines","type":"uint24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_consumer","type":"address"},{"internalType":"string[]","name":"_invalidNames","type":"string[]"},{"internalType":"string[]","name":"_supportedMarketTypes","type":"string[]"},{"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"invalidName","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_teamA","type":"string"},{"internalType":"string","name":"_teamB","type":"string"}],"name":"isInvalidNames","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_market","type":"string"}],"name":"isSupportedMarketType","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTwoPositionalSport","type":"bool"},{"internalType":"uint256","name":"_outcome","type":"uint256"}],"name":"isValidOutcomeForGame","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_outcome","type":"uint256"},{"internalType":"uint256","name":"_homeScore","type":"uint256"},{"internalType":"uint256","name":"_awayScore","type":"uint256"}],"name":"isValidOutcomeWithResult","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minOddsForCheckingThresholdDefault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"minOddsForCheckingThresholdPerSport","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"obtainer","outputs":[{"internalType":"contract IGamesOddsObtainer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oddsThresholdForSport","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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"playerProps","outputs":[{"internalType":"contract IGamesPlayerProps","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256[]","name":"_bookmakerIds","type":"uint256[]"}],"name":"setBookmakerIdsBySportId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256[]","name":"_bookmakerIds","type":"uint256[]"}],"name":"setBookmakerIdsBySportIdForPlayerProps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_consumer","type":"address"}],"name":"setConsumerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_oddsThresholdForSport","type":"uint256"}],"name":"setCustomOddsThresholdForSport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_defaultBookmakerIds","type":"uint256[]"}],"name":"setDefaultBookmakerIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_defaultPlayerPropsBookmakerIds","type":"uint256[]"}],"name":"setDefaultBookmakerIdsForPlayerProps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultOddsThreshold","type":"uint256"}],"name":"setDefaultOddsThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"_invalidNames","type":"string[]"},{"internalType":"bool","name":"_isInvalid","type":"bool"}],"name":"setInvalidNames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minOddsForCheckingThresholdDefault","type":"uint256"}],"name":"setMinOddsForCheckingThresholdDefault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_minOddsForCheckingThresholdPerSport","type":"uint256"}],"name":"setMinOddsForCheckingThresholdPerSport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_obtainer","type":"address"}],"name":"setObtainer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_playerProps","type":"address"}],"name":"setPlayerPropsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"setSportsManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"_supportedMarketTypes","type":"string[]"},{"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"setSupportedMarketTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_whitelistedAddresses","type":"address[]"},{"internalType":"bool","name":"_flag","type":"bool"}],"name":"setWhitelistedAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"sportIdForPlayerPropsToBookmakerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"sportIdToBookmakerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sportsManager","outputs":[{"internalType":"contract ISportPositionalMarketManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"supportedMarketType","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddress","type":"address"}],"name":"transferOwnershipAtInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50615aae80620000216000396000f3fe608060405234801561001057600080fd5b50600436106104125760003560e01c8063730d6250116102205780639c74a76e11610130578063c3b83f5f116100b8578063df2ba25011610087578063df2ba250146109e7578063df5a00ae146109fa578063efe2c8a414610a0d578063f595901b14610a20578063f7a679b914610a3357600080fd5b8063c3b83f5f1461098e578063c8bbcd96146109a1578063d06c1467146109b4578063da5b82d2146109d457600080fd5b8063ae71dcdf116100ff578063ae71dcdf1461093f578063af765c9714610947578063b216d97414610950578063b4fd729614610963578063c128f77b1461097b57600080fd5b80639c74a76e146108f3578063a1380dcf14610906578063aaae1cb514610919578063abc7b9881461092c57600080fd5b8063879c0c5e116101b357806397dc205d1161018257806397dc205d1461089457806398350f9a146108a757806399d9f2b9146108ba5780639a066f5d146108cd5780639ab21a77146108e057600080fd5b8063879c0c5e1461084c5780638da5cb5b1461085f57806391b4ded9146108785780639265a4e61461088157600080fd5b80637f56efb1116101ef5780637f56efb1146107e65780637f70290b146108065780637fabe16b1461082657806380be63551461083957600080fd5b8063730d625014610785578063760ec8df1461079857806377874ce2146107bb57806379ba5097146107de57600080fd5b806338d30ea711610326578063519822f6116102ae5780635d0fde6c1161027d5780635d0fde6c146107095780635d7412fd1461071c5780635d7fb8e21461072f57806365c235921461074257806369b4840e1461076557600080fd5b8063519822f6146106c357806353a47bb7146106d65780635c2b764a146106e95780635c975abb146106fc57600080fd5b806346e38c28116102f557806346e38c281461065057806348cd0f67146106705780634b15c92014610694578063500b218c1461069d578063503005ba146106b057600080fd5b806338d30ea7146105ff5780633d011ac91461061257806342fa646a14610635578063459c0bd01461064857600080fd5b80631627540c116103a957806321f5908e1161037857806321f5908e146105675780632c95f596146105bb5780632f893de7146105ce5780632fff7020146105e1578063300a0298146105f757600080fd5b80631627540c146104fb578063165464621461050e57806316c38b3c14610534578063199b49591461054757600080fd5b80630ae8a262116103e55780630ae8a2621461048a5780630fb2e042146104aa57806310063fdc146104bd57806313af4035146104e857600080fd5b806301fe9c881461041757806303727eb91461042c5780630691dc171461045457806306c933d814610467575b600080fd5b61042a610425366004614c53565b610a46565b005b61043f61043a3660046152ed565b610a9c565b60405190151581526020015b60405180910390f35b61042a610462366004614c53565b610ab3565b61043f610475366004614b0e565b600c6020526000908152604090205460ff1681565b61049d610498366004614c53565b610afe565b60405161044b9190615616565b61042a6104b8366004615221565b610bff565b600b546104d0906001600160a01b031681565b6040516001600160a01b03909116815260200161044b565b61042a6104f6366004614b0e565b610d9d565b61042a610509366004614b0e565b610ed1565b61052161051c366004614c53565b610f27565b60405161044b9796959493929190615437565b61042a610542366004614ea1565b6116fd565b61055a610555366004614c53565b611773565b60405161044b9190615514565b61057a610575366004614f5f565b6119f2565b604080516001600160a01b039097168752941515602087015292151593850193909352151560608401529015156080830152151560a082015260c00161044b565b61055a6105c9366004614c53565b611d32565b61042a6105dc366004614bd3565b611f55565b6105e9600181565b60405190815260200161044b565b6105e9600281565b6105e961060d366004614f5f565b612116565b61043f610620366004614f5f565b60046020526000908152604090205460ff1681565b61043f61064336600461525b565b612137565b6105e9600381565b61066361065e366004614f5f565b612250565b60405161044b91906156a2565b61068361067e366004614d17565b6122d2565b60405161044b95949392919061557f565b6105e960065481565b61043f6106ab366004614f5f565b6128f7565b61042a6106be366004614e20565b612a06565b61042a6106d1366004614e20565b612a5d565b6001546104d0906001600160a01b031681565b6105e96106f73660046152cc565b612ab0565b60035461043f9060ff1681565b61043f610717366004615137565b612ae1565b600a546104d0906001600160a01b031681565b600f546104d0906001600160a01b031681565b6107556107503660046152cc565b612b0d565b60405161044b94939291906156b5565b6105e9610773366004614f5f565b600e6020526000908152604090205481565b61042a610793366004614b0e565b612d35565b6107ab6107a6366004614c53565b612d8b565b60405161044b9493929190615527565b61043f6107c9366004614f5f565b60056020526000908152604090205460ff1681565b61042a612dc4565b6107f96107f4366004614c53565b612ec1565b60405161044b919061568f565b610819610814366004614c53565b613095565b60405161044b9190615501565b61043f6108343660046150d7565b613267565b61042a610847366004614b0e565b6132c0565b61043f61085a366004614f34565b61333c565b6000546104d0906201000090046001600160a01b031681565b6105e960025481565b61042a61088f3660046152cc565b613348565b61043f6108a23660046150d7565b613398565b61042a6108b53660046152cc565b613479565b6106636108c8366004614f5f565b613655565b61042a6108db366004614b0e565b6136d4565b61042a6108ee366004614f5f565b613750565b61043f6109013660046151c9565b6137d6565b6105e96109143660046152cc565b61382b565b61042a610927366004614f5f565b613847565b61043f61093a366004614ed9565b613884565b6105e9600081565b6105e9600d5481565b61066361095e366004614d9a565b613892565b6003546104d09061010090046001600160a01b031681565b61042a610989366004614b46565b61389d565b61042a61099c366004614b0e565b61399f565b61043f6109af3660046150a5565b613a96565b6105e96109c2366004614f5f565b60076020526000908152604090205481565b61049d6109e2366004614e6f565b613adc565b61043f6109f5366004614fca565b613bb5565b6105e9610a08366004614f5f565b613c0d565b61042a610a1b366004614b0e565b613c1d565b61043f610a2e3660046152ed565b613ca1565b61042a610a41366004615221565b613e06565b610a4e613ffa565b8051610a619060109060208401906148eb565b507fe1ce43eeefe5feb41d71b43a7ebf155416f9e5aa2db76fe18438c0ff07b89b4781604051610a9191906156a2565b60405180910390a150565b6000610aa9848484614074565b90505b9392505050565b610abb613ffa565b8051610ace9060089060208401906148eb565b507fede12a8d509a65e2bac4bd9f8719e741f609c9c6d35d7c356dd21fd3bb6360d781604051610a9191906156a2565b805160609015610b665781516001600160401b03811115610b2f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610b6257816020015b6060815260200190600190039081610b4d5790505b5090505b60005b8251811015610bf957828181518110610b9257634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001610bac91815260200190565b604051602081830303815290604052828281518110610bdb57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080610bf19061595d565b915050610b69565b50919050565b6000546201000090046001600160a01b0316331480610c2d5750336000908152600c602052604090205460ff165b610ca45760405162461bcd60e51b815260206004820152603960248201527f4f6e6c79206f776e6572206f722077686974656c69737465642061646472657360448201527f73206d617920706572666f726d207468697320616374696f6e0000000000000060648201526084015b60405180910390fd5b6003546040516334d2a49760e11b8152600481018490526101009091046001600160a01b0316906369a5492e9060240160206040518083038186803b158015610cec57600080fd5b505afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d249190614ebd565b610d405760405162461bcd60e51b8152600401610c9b90615741565b60008281526009602090815260409091208251610d5f928401906148eb565b507f135ace08ded18cc43c25348c6633584d72fcac208fdcfeb55d2c4337276f6b438282604051610d91929190615778565b60405180910390a15050565b6001600160a01b038116610df35760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f742062652030000000000000006044820152606401610c9b565b600154600160a01b900460ff1615610e5f5760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b6064820152608401610c9b565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610a91565b610ed9613ffa565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290602001610a91565b6060806060806060806060600088519050806001600160401b03811115610f5e57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610f87578160200160208202803683370190505b509750806001600160401b03811115610fb057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610fd9578160200160208202803683370190505b509650806001600160401b0381111561100257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561102b578160200160208202803683370190505b509550806001600160401b0381111561105457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561107d578160200160208202803683370190505b509450806001600160401b038111156110a657634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110cf578160200160208202803683370190505b509350806001600160401b038111156110f857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611121578160200160208202803683370190505b509250806001600160401b0381111561114a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611173578160200160208202803683370190505b50915060005b818110156116f0576000600360019054906101000a90046001600160a01b03166001600160a01b031663f89c6f188c84815181106111c757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016111ed91815260200190565b60206040518083038186803b15801561120557600080fd5b505afa158015611219573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123d9190614b2a565b9050808a838151811061126057634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600354604051635b9fbe0760e01b8152838316600482015261010090910490911690635b9fbe079060240160206040518083038186803b1580156112b957600080fd5b505afa1580156112cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f19190614ebd565b89838151811061131157634e487b7160e01b600052603260045260246000fd5b9115156020928302919091019091015260035460405163dec72d6360e01b81526001600160a01b0383811660048301526101009092049091169063dec72d639060240160206040518083038186803b15801561136c57600080fd5b505afa158015611380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a49190614ebd565b8883815181106113c457634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600a546040516336c0d85560e01b81526001600160a01b038381166004830152909116906336c0d8559060240160206040518083038186803b15801561141957600080fd5b505afa15801561142d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114519190614ebd565b87838151811061147157634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600354604051630a928f9f60e21b81526001600160a01b03838116600483015261010090920490911690632a4a3e7c9060240160206040518083038186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115049190614ebd565b86838151811061152457634e487b7160e01b600052603260045260246000fd5b911515602092830291909101909101526001600160a01b0381166115495760006115c6565b600b546040516333dfec9960e21b81526001600160a01b0383811660048301529091169063cf7fb2649060240160206040518083038186803b15801561158e57600080fd5b505afa1580156115a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c69190614ebd565b8583815181106115e657634e487b7160e01b600052603260045260246000fd5b602002602001019015159081151581525050600360019054906101000a90046001600160a01b03166001600160a01b03166376d423db8c848151811061163c57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161166291815260200190565b60206040518083038186803b15801561167a57600080fd5b505afa15801561168e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b29190615209565b8483815181106116d257634e487b7160e01b600052603260045260246000fd5b602090810291909101015250806116e88161595d565b915050611179565b5050919395979092949650565b611705613ffa565b60035460ff16151581151514156117195750565b6003805460ff191682151590811790915560ff161561173757426002555b60035460405160ff909116151581527f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec590602001610a91565b50565b60608151600461178391906158de565b6001600160401b038111156117a857634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156117d1578160200160208202803683370190505b50905060005b8251811015610bf957600080600080600a60009054906101000a90046001600160a01b03166001600160a01b03166360b4df8588878151811061182a57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161185091815260200190565b60e06040518083038186803b15801561186857600080fd5b505afa15801561187c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a0919061500a565b965096509650965050505083868660046118ba91906158de565b6118c59060006157e4565b815181106118e357634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b81525050828686600461190691906158de565b6119119060016157e4565b8151811061192f57634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b81525050818686600461195291906158de565b61195d9060026157e4565b8151811061197b57634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b81525050808686600461199e91906158de565b6119a99060036157e4565b815181106119c757634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b815250505050505080806119ea9061595d565b9150506117d7565b600354604051631f138de360e31b81526004810183905260009182918291829182918291829161010090046001600160a01b03169063f89c6f189060240160206040518083038186803b158015611a4857600080fd5b505afa158015611a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a809190614b2a565b600354604051635b9fbe0760e01b81526001600160a01b038084166004830152929350839261010090920490911690635b9fbe079060240160206040518083038186803b158015611ad057600080fd5b505afa158015611ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b089190614ebd565b60035460405163dec72d6360e01b81526001600160a01b0385811660048301526101009092049091169063dec72d639060240160206040518083038186803b158015611b5357600080fd5b505afa158015611b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8b9190614ebd565b600a546040516336c0d85560e01b81526001600160a01b038681166004830152909116906336c0d8559060240160206040518083038186803b158015611bd057600080fd5b505afa158015611be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c089190614ebd565b600354604051630a928f9f60e21b81526001600160a01b03878116600483015261010090920490911690632a4a3e7c9060240160206040518083038186803b158015611c5357600080fd5b505afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8b9190614ebd565b6001600160a01b038616611ca0576000611d1d565b600b546040516333dfec9960e21b81526001600160a01b0388811660048301529091169063cf7fb2649060240160206040518083038186803b158015611ce557600080fd5b505afa158015611cf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1d9190614ebd565b949d939c50919a509850965090945092505050565b606081516003611d4291906158de565b6001600160401b03811115611d6757634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611d90578160200160208202803683370190505b50905060005b8251811015610bf957600a548351600091829182916001600160a01b0316906360b4df8590889087908110611ddb57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401611e0191815260200190565b60e06040518083038186803b158015611e1957600080fd5b505afa158015611e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e51919061500a565b505050509250925092508285856003611e6a91906158de565b611e759060006157e4565b81518110611e9357634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b815250508185856003611eb691906158de565b611ec19060016157e4565b81518110611edf57634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b815250508085856003611f0291906158de565b611f0d9060026157e4565b81518110611f2b57634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b815250505050508080611f4d9061595d565b915050611d96565b611f5d613ffa565b81611fb85760405162461bcd60e51b815260206004820152602560248201527f57686974656c6973746564206164647265737365732063616e6e6f7420626520604482015264656d70747960d81b6064820152608401610c9b565b60005b8281101561211057811515600c6000868685818110611fea57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611fff9190614b0e565b6001600160a01b0316815260208101919091526040016000205460ff161515146120fe5781600c600086868581811061204857634e487b7160e01b600052603260045260246000fd5b905060200201602081019061205d9190614b0e565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f58d7a3ccc34541e162fcfc87b84be7b78c34d1e1e7f15de6e4dd67d0fe70aecd8484838181106120c657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906120db9190614b0e565b604080516001600160a01b03909216825284151560208301520160405180910390a15b806121088161595d565b915050611fbb565b50505050565b6010818154811061212657600080fd5b600091825260209091200154905081565b6000612194858560008151811061215e57634e487b7160e01b600052603260045260246000fd5b60200260200101518560008151811061218757634e487b7160e01b600052603260045260246000fd5b6020026020010151613ca1565b80156121e957506121e985856001815181106121c057634e487b7160e01b600052603260045260246000fd5b60200260200101518560018151811061218757634e487b7160e01b600052603260045260246000fd5b8015612245575081806122455750612245858560028151811061221c57634e487b7160e01b600052603260045260246000fd5b60200260200101518560028151811061218757634e487b7160e01b600052603260045260246000fd5b90505b949350505050565b60008181526011602052604090205460609061226d57601061227c565b60008281526011602052604090205b8054806020026020016040519081016040528092919081815260200182805480156122c657602002820191906000526020600020905b8154815260200190600101908083116122b2575b50505050509050919050565b6060806060806060875160026122e891906158de565b6001600160401b0381111561230d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612336578160200160208202803683370190505b50945087516001600160401b0381111561236057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612389578160200160208202803683370190505b50935087516001600160401b038111156123b357634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156123dc578160200160208202803683370190505b50925087516001600160401b0381111561240657634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561242f578160200160208202803683370190505b50915087516001600160401b0381111561245957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612482578160200160208202803683370190505b50905060005b88518110156128eb576000600360019054906101000a90046001600160a01b03166001600160a01b031663f89c6f188b84815181106124d757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016124fd91815260200190565b60206040518083038186803b15801561251557600080fd5b505afa158015612529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061254d9190614b2a565b9050600080600080600f60009054906101000a90046001600160a01b03166001600160a01b03166305c84a548f888151811061259957634e487b7160e01b600052603260045260246000fd5b60200260200101518f89815181106125c157634e487b7160e01b600052603260045260246000fd5b60200260200101518f8a815181106125e957634e487b7160e01b600052603260045260246000fd5b60200260200101516040518463ffffffff1660e01b815260040161262393929190928352602083019190915260ff16604082015260600190565b60806040518083038186803b15801561263b57600080fd5b505afa15801561264f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126739190615176565b9350935093509350838a878151811061269c57634e487b7160e01b600052603260045260246000fd5b602002602001019061ffff16908161ffff1681525050808987815181106126d357634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600f5460405163017023c560e71b81526001600160a01b0387811660048301529091169063b811e2809060240160206040518083038186803b15801561272857600080fd5b505afa15801561273c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127609190614ebd565b88878151811061278057634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600f5460405163052f16ad60e31b81526001600160a01b03878116600483015290911690632978b5689060240160206040518083038186803b1580156127d557600080fd5b505afa1580156127e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061280d9190614ebd565b87878151811061282d57634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152828b61284a8860026158de565b6128559060006157e4565b8151811061287357634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b81525050818b87600261289691906158de565b6128a19060016157e4565b815181106128bf57634e487b7160e01b600052603260045260246000fd5b602002602001019060020b908160020b81525050505050505080806128e39061595d565b915050612488565b50939792965093509350565b600a54600354604051631f138de360e31b8152600481018490526000926001600160a01b03908116926336c0d855926101009091049091169063f89c6f189060240160206040518083038186803b15801561295157600080fd5b505afa158015612965573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129899190614b2a565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b1580156129c857600080fd5b505afa1580156129dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a009190614ebd565b92915050565b612a0e613ffa565b6000825111612a4f5760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610c9b565b612a5982826140bb565b5050565b612a65613ffa565b6000825111612aa65760405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606401610c9b565b612a598282614249565b60116020528160005260406000208181548110612acc57600080fd5b90600052602060002001600091509150505481565b6000808461ffff16118015612afa57508260020b600014155b8015610aa957505060020b151592915050565b60035460405163feee9ca360e01b81526004810183905260248101849052600091829160609183916101009091046001600160a01b03169063feee9ca39060440160206040518083038186803b158015612b6657600080fd5b505afa158015612b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b9e9190614ebd565b60035460405163be27f89d60e01b8152600481018990526101009091046001600160a01b03169063be27f89d9060240160206040518083038186803b158015612be657600080fd5b505afa158015612bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1e9190614ebd565b60035460405163a50267a560e01b8152600481018a9052602481018990526101009091046001600160a01b03169063a50267a59060440160006040518083038186803b158015612c6d57600080fd5b505afa158015612c81573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612ca99190810190614c85565b600f546040516314cb6a7160e01b8152600481018b90526001600160a01b03909116906314cb6a719060240160206040518083038186803b158015612ced57600080fd5b505afa158015612d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d259190614ebd565b9299919850965090945092505050565b612d3d613ffa565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f9aba0b0687cee6f6112358c0b3ce99e8237c38737e09cf1a71f3142f0d5910ba90602001610a91565b606080606080612d9a85611d32565b612da386613095565b612dac87612ec1565b612db588611773565b93509350935093509193509193565b6001546001600160a01b03163314612e3c5760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610c9b565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b606081516002612ed191906158de565b6001600160401b03811115612ef657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612f1f578160200160208202803683370190505b50905060005b8251811015610bf957600a54835160009182916001600160a01b03909116906332b566a990879086908110612f6a57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401612f9091815260200190565b60806040518083038186803b158015612fa857600080fd5b505afa158015612fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fe09190614f77565b9350935050508184846002612ff591906158de565b6130009060006157e4565b8151811061301e57634e487b7160e01b600052603260045260246000fd5b62ffffff90921660209283029190910190910152808461303f8560026158de565b61304a9060016157e4565b8151811061306857634e487b7160e01b600052603260045260246000fd5b602002602001019062ffffff16908162ffffff16815250505050808061308d9061595d565b915050612f25565b6060815160026130a591906158de565b6001600160401b038111156130ca57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156130f3578160200160208202803683370190505b50905060005b8251811015610bf957600a54835160009182916001600160a01b03909116906332b566a99087908690811061313e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161316491815260200190565b60806040518083038186803b15801561317c57600080fd5b505afa158015613190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b49190614f77565b50509150915081848460026131c991906158de565b6131d49060006157e4565b815181106131f257634e487b7160e01b600052603260045260246000fd5b602002602001019060010b908160010b81525050808484600261321591906158de565b6132209060016157e4565b8151811061323e57634e487b7160e01b600052603260045260246000fd5b602002602001019060010b908160010b815250505050808061325f9061595d565b9150506130f9565b60008160405160200161327a919061541b565b60405160208183030381529060405280519060200120836040516020016132a1919061541b565b6040516020818303038152906040528051906020012014905092915050565b6132c8613ffa565b6001600160a01b0381166132ee5760405162461bcd60e51b8152600401610c9b90615718565b600b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f81b77cb294d5a20ca475a4a84c7f2c08edd0d34162b8a72bd44d103e5fbfa2f090602001610a91565b6000610aac83836143d2565b613350613ffa565b6000828152600e602090815260409182902083905581518481529081018390527f912707207097e53d30ad2fe2ca3aa44e255c823982d25e13ef638e284a48b6019101610d91565b6000816040516020016133ab919061541b565b60405160208183030381529060405280519060200120836040516020016133d2919061541b565b60405160208183030381529060405280519060200120148061342e57506004600084604051602001613404919061541b565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff165b80610aac57506004600083604051602001613449919061541b565b60408051808303601f190181529181528151602092830120835290820192909252016000205460ff169392505050565b613481613ffa565b8060065414156134d35760405162461bcd60e51b815260206004820152601b60248201527f53616d652076616c75652061732064656661756c742076616c756500000000006044820152606401610c9b565b6000811161351c5760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b6044820152606401610c9b565b6003546040516334d2a49760e11b8152600481018490526101009091046001600160a01b0316906369a5492e9060240160206040518083038186803b15801561356457600080fd5b505afa158015613578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061359c9190614ebd565b6135b85760405162461bcd60e51b8152600401610c9b90615741565b60008281526007602052604090205481141561360d5760405162461bcd60e51b815260206004820152601460248201527353616d652076616c7565206173206265666f726560601b6044820152606401610c9b565b60008281526007602090815260409182902083905581518481529081018390527f69fd20fd8a4b59cc555abc063627a7fcecd991b0cf18c48122248455bf29699f9101610d91565b60008181526009602052604090205460609061367257600861227c565b60008281526009602052604090208054806020026020016040519081016040528092919081815260200182805480156122c657602002820191906000526020600020908154815260200190600101908083116122b25750505050509050919050565b6136dc613ffa565b6001600160a01b0381166137025760405162461bcd60e51b8152600401610c9b90615718565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f59cf4cddc1a33ae5f2e8785ba9dcc3c6e66807281882aa0afc75d385a1158cac90602001610a91565b613758613ffa565b600081116137a15760405162461bcd60e51b81526020600482015260166024820152754d757374206265206d6f7265207468656e205a45524f60501b6044820152606401610c9b565b60068190556040518181527f69d8ae57c22ebc10935a3fccebcf33c37abcf90af05eeafdf9d47b066c7a7b1f90602001610a91565b60008262ffffff168562ffffff161480156137f6575060008562ffffff16115b8015613807575060008362ffffff16115b801561381757508360020b600014155b801561224557505060020b15159392505050565b60096020528160005260406000208181548110612acc57600080fd5b61384f613ffa565b600d8190556040518181527f19eaf2f356d99bcfaf883654316c3c12a7771e09c4058e60691681a6c61b571f90602001610a91565b600061224585858585614420565b6060612a0082614473565b600054610100900460ff166138b85760005460ff16156138bc565b303b155b61391f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c9b565b600054610100900460ff16158015613941576000805461ffff19166101011790555b61394a86610d9d565b60038054610100600160a81b0319166101006001600160a01b03881602179055613975846001614249565b6139808360016140bb565b60068290558015613997576000805461ff00191690555b505050505050565b6139a7613ffa565b6001600160a01b0381166139cd5760405162461bcd60e51b8152600401610c9b90615718565b600154600160a81b900460ff1615613a1d5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b6044820152606401610c9b565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610a91565b60006005600083604051602001613aad919061541b565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1692915050565b606081516001600160401b03811115613b0557634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613b3857816020015b6060815260200190600190039081613b235790505b50905060005b8251811015610bf957613b77838281518110613b6a57634e487b7160e01b600052603260045260246000fd5b60200260200101516147c2565b828281518110613b9757634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080613bad9061595d565b915050613b3e565b6000613bc383600019615857565b60010b8560010b148015613bdb57508460010b600014155b801561380757508260010b60001415801561381757508360020b60001415801561224557505060020b15159392505050565b6008818154811061212657600080fd5b613c25613ffa565b6001600160a01b038116613c4b5760405162461bcd60e51b8152600401610c9b90615718565b60038054610100600160a81b0319166101006001600160a01b038416908102919091179091556040519081527f5f56489645cc15092ffab877840903cb7715aca3464f50d3e323ed6465777bbb90602001610a91565b600083815260076020526040812054819015613ccb57600085815260076020526040902054613ccf565b6006545b6000868152600e60205260408120549192509015613cfb576000868152600e6020526040902054613cff565b600d545b9050600081118015613d205750613d1d662386f26fc10000826158de565b85105b8015613d3b5750613d38662386f26fc10000826158de565b84105b15613d4b57600192505050610aac565b841580613d5757508385145b15613d6757600192505050610aac565b84841115613dba57613d80662386f26fc10000836158de565b613d9290670de0b6b3a76400006157e4565b85613da586670de0b6b3a76400006158de565b613daf9190615821565b111592505050610aac565b613dcb662386f26fc10000836158de565b85613dde670de0b6b3a7640000876158de565b613de89190615821565b613dfa90670de0b6b3a76400006158fd565b11159695505050505050565b6000546201000090046001600160a01b0316331480613e345750336000908152600c602052604090205460ff165b613e8a5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206f776e6572206f722077686974656c6973746564206164647265736044820152607360f81b6064820152608401610c9b565b6003546040516334d2a49760e11b8152600481018490526101009091046001600160a01b0316906369a5492e9060240160206040518083038186803b158015613ed257600080fd5b505afa158015613ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f0a9190614ebd565b8015613f8d5750600f546040516314cb6a7160e01b8152600481018490526001600160a01b03909116906314cb6a719060240160206040518083038186803b158015613f5557600080fd5b505afa158015613f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f8d9190614ebd565b613fa95760405162461bcd60e51b8152600401610c9b90615741565b60008281526011602090815260409091208251613fc8928401906148eb565b507f9c657e838c705c59a50bbb5bccc540f9f11c35d7c3b97ba8bb46d7b39b682ca88282604051610d91929190615778565b6000546201000090046001600160a01b031633146140725760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610c9b565b565b60008361408e5781158015614087575082155b9050610aac565b60018414156140a05750808211610aac565b60028414156140b25750808210610aac565b50818114610aac565b60005b825181101561424457811515600560008584815181106140ee57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614106919061541b565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff1615151461423257816005600085848151811061415b57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614173919061541b565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa8ffdf44a3dd40e8518ed36f55dbddd07d532e8d4e62cfc9af80dabb7a93c6148382815181106141ef57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614207919061541b565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b8061423c8161595d565b9150506140be565b505050565b60005b8251811015614244578115156004600085848151811061427c57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614294919061541b565b60408051601f198184030181529181528151602092830120835290820192909252016000205460ff161515146143c05781600460008584815181106142e957634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614301919061541b565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507ffe28881086408823936cdab8f3b6bb8baf3b5cfe62e5c5c136ba3fefbb5d09c283828151811061437d57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001614395919061541b565b60408051601f1981840301815282825280516020918201208352851515908301520160405180910390a15b806143ca8161595d565b91505061424c565b600082156143f95760018214806143e95750600282145b806143f2575081155b9050612a00565b60018214806144085750600282145b806144135750600382145b80610aac57505015919050565b60008415614447578260020b60001415801561444057508360020b600014155b9050612248565b8260020b60001415801561445f57508360020b600014155b8015614440575050600281900b1515612248565b6060600082516001600160401b0381111561449e57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156144c7578160200160208202803683370190505b5090506000805b84518110156146ef5760008582815181106144f957634e487b7160e01b600052603260045260246000fd5b60200260200101516000141561453c57600084838151811061452b57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506146a6565b600086838151811061455e57634e487b7160e01b600052603260045260246000fd5b602002602001015113156145e35785828151811061458c57634e487b7160e01b600052603260045260246000fd5b60200260200101519050806127106145a491906157e4565b6145b89069021e19e0c9bab2400000615821565b6145c39060646158de565b84838151811061452b57634e487b7160e01b600052603260045260246000fd5b600086838151811061460557634e487b7160e01b600052603260045260246000fd5b602002602001015112156146a65785828151811061463357634e487b7160e01b600052603260045260246000fd5b6020026020010151614644906159ba565b9050614652816127106157e4565b61466482670de0b6b3a76400006158de565b61466e9190615821565b6146799060646158de565b84838151811061469957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b8382815181106146c657634e487b7160e01b600052603260045260246000fd5b6020026020010151836146d991906157e4565b92505080806146e79061595d565b9150506144ce565b5060005b82518110156147b9578161473457600083828151811061472357634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506147a7565b8183828151811061475557634e487b7160e01b600052603260045260246000fd5b6020026020010151670de0b6b3a764000061477091906158de565b61477a9190615821565b83828151811061479a57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b806147b18161595d565b9150506146f3565b50909392505050565b606060ff82166147e95750506040805180820190915260018152600360fc1b602082015290565b8160005b60ff821615614816578061480081615978565b915061480f9050600a83615835565b91506147ed565b60008160ff166001600160401b0381111561484157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561486b576020820181803683370190505b5090505b60ff851615612248578161488281615940565b92506148919050600a86615998565b61489c9060306157fc565b60f81b818360ff16815181106148c257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506148e4600a86615835565b945061486f565b828054828255906000526020600020908101928215614926579160200282015b8281111561492657825182559160200191906001019061490b565b50614932929150614936565b5090565b5b808211156149325760008155600101614937565b600082601f83011261495b578081fd5b8135602061497061496b836157c1565b615791565b80838252828201915082860187848660051b890101111561498f578586fd5b855b858110156149ad57813584529284019290840190600101614991565b5090979650505050505050565b600082601f8301126149ca578081fd5b813560206149da61496b836157c1565b80838252828201915082860187848660051b89010111156149f9578586fd5b855b858110156149ad5781356001600160401b03811115614a18578788fd5b614a268a87838c0101614aa4565b85525092840192908401906001016149fb565b600082601f830112614a49578081fd5b81356020614a5961496b836157c1565b80838252828201915082860187848660051b8901011115614a78578586fd5b855b858110156149ad57813560ff81168114614a92578788fd5b84529284019290840190600101614a7a565b600082601f830112614ab4578081fd5b81356001600160401b03811115614acd57614acd615a00565b614ae0601f8201601f1916602001615791565b818152846020838601011115614af4578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215614b1f578081fd5b8135610aac81615a16565b600060208284031215614b3b578081fd5b8151610aac81615a16565b600080600080600060a08688031215614b5d578081fd5b8535614b6881615a16565b94506020860135614b7881615a16565b935060408601356001600160401b0380821115614b93578283fd5b614b9f89838a016149ba565b94506060880135915080821115614bb4578283fd5b50614bc1888289016149ba565b95989497509295608001359392505050565b600080600060408486031215614be7578081fd5b83356001600160401b0380821115614bfd578283fd5b818601915086601f830112614c10578283fd5b813581811115614c1e578384fd5b8760208260051b8501011115614c32578384fd5b60209283019550935050840135614c4881615a2b565b809150509250925092565b600060208284031215614c64578081fd5b81356001600160401b03811115614c79578182fd5b6122488482850161494b565b60006020808385031215614c97578182fd5b82516001600160401b03811115614cac578283fd5b8301601f81018513614cbc578283fd5b8051614cca61496b826157c1565b80828252848201915084840188868560051b8701011115614ce9578687fd5b8694505b83851015614d0b578051835260019490940193918501918501614ced565b50979650505050505050565b600080600060608486031215614d2b578081fd5b83356001600160401b0380821115614d41578283fd5b614d4d8783880161494b565b94506020860135915080821115614d62578283fd5b614d6e8783880161494b565b93506040860135915080821115614d83578283fd5b50614d9086828701614a39565b9150509250925092565b60006020808385031215614dac578182fd5b82356001600160401b03811115614dc1578283fd5b8301601f81018513614dd1578283fd5b8035614ddf61496b826157c1565b80828252848201915084840188868560051b8701011115614dfe578687fd5b8694505b83851015614d0b578035835260019490940193918501918501614e02565b60008060408385031215614e32578182fd5b82356001600160401b03811115614e47578283fd5b614e53858286016149ba565b9250506020830135614e6481615a2b565b809150509250929050565b600060208284031215614e80578081fd5b81356001600160401b03811115614e95578182fd5b61224884828501614a39565b600060208284031215614eb2578081fd5b8135610aac81615a2b565b600060208284031215614ece578081fd5b8151610aac81615a2b565b60008060008060808587031215614eee578182fd5b8435614ef981615a2b565b93506020850135614f0981615a48565b92506040850135614f1981615a48565b91506060850135614f2981615a48565b939692955090935050565b60008060408385031215614f46578182fd5b8235614f5181615a2b565b946020939093013593505050565b600060208284031215614f70578081fd5b5035919050565b60008060008060808587031215614f8c578182fd5b8451614f9781615a39565b6020860151909450614fa881615a39565b6040860151909350614fb981615a67565b6060860151909250614f2981615a67565b60008060008060808587031215614fdf578182fd5b8435614fea81615a39565b93506020850135614ffa81615a48565b92506040850135614f1981615a39565b600080600080600080600060e0888a031215615024578485fd5b875161502f81615a48565b602089015190975061504081615a48565b604089015190965061505181615a48565b606089015190955061506281615a48565b608089015190945061507381615a48565b60a089015190935061508481615a48565b60c089015190925061509581615a48565b8091505092959891949750929550565b6000602082840312156150b6578081fd5b81356001600160401b038111156150cb578182fd5b61224884828501614aa4565b600080604083850312156150e9578182fd5b82356001600160401b03808211156150ff578384fd5b61510b86838701614aa4565b93506020850135915080821115615120578283fd5b5061512d85828601614aa4565b9150509250929050565b60008060006060848603121561514b578081fd5b833561515681615a57565b9250602084013561516681615a48565b91506040840135614c4881615a48565b6000806000806080858703121561518b578182fd5b845161519681615a57565b60208601519094506151a781615a48565b60408601519093506151b881615a48565b6060860151909250614f2981615a2b565b600080600080608085870312156151de578182fd5b84356151e981615a67565b935060208501356151f981615a48565b92506040850135614f1981615a67565b60006020828403121561521a578081fd5b5051919050565b60008060408385031215615233578182fd5b8235915060208301356001600160401b0381111561524f578182fd5b61512d8582860161494b565b60008060008060808587031215615270578182fd5b8435935060208501356001600160401b038082111561528d578384fd5b6152998883890161494b565b945060408701359150808211156152ae578384fd5b506152bb8782880161494b565b9250506060850135614f2981615a2b565b600080604083850312156152de578182fd5b50508035926020909101359150565b600080600060608486031215615301578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561534957815115158752958201959082019060010161532b565b509495945050505050565b6000815180845260208085019450808401835b83811015615349578151600190810b8852968301969183019101615367565b6000815180845260208085019450808401835b8381101561534957815160020b87529582019590820190600101615399565b6000815180845260208085019450808401835b8381101561534957815162ffffff16875295820195908201906001016153cb565b6000815180845260208085019450808401835b83811015615349578151875295820195908201906001016153ff565b6000825161542d818460208701615914565b9190910192915050565b60e08082528851908201819052600090602090610100840190828c01845b8281101561547a5781516001600160a01b031684529284019290840190600101615455565b5050508381038285015261548e818b615318565b91505082810360408401526154a38189615318565b905082810360608401526154b78188615318565b905082810360808401526154cb8187615318565b905082810360a08401526154df8186615318565b905082810360c08401526154f381856153ec565b9a9950505050505050505050565b602081526000610aac6020830184615354565b602081526000610aac6020830184615386565b60808152600061553a6080830187615386565b828103602084015261554c8187615354565b9050828103604084015261556081866153b8565b905082810360608401526155748185615386565b979650505050505050565b60a08152600061559260a0830188615386565b828103602084810191909152875180835288820192820190845b818110156155cc57845161ffff16835293830193918301916001016155ac565b505084810360408601526155e08189615318565b9250505082810360608401526155f68186615318565b9050828103608084015261560a8185615318565b98975050505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b8281101561568257878503603f1901845281518051808752615663818989018a8501615914565b601f01601f19169590950186019450928501929085019060010161563c565b5092979650505050505050565b602081526000610aac60208301846153b8565b602081526000610aac60208301846153ec565b60006080820186151583526020861515818501526080604085015281865180845260a0860191508288019350845b818110156156ff578451835293830193918301916001016156e3565b5050809350505050821515606083015295945050505050565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b60208082526018908201527f53706f72744964206973206e6f7420737570706f727465640000000000000000604082015260600190565b828152604060208201526000610aa960408301846153ec565b604051601f8201601f191681016001600160401b03811182821017156157b9576157b9615a00565b604052919050565b60006001600160401b038211156157da576157da615a00565b5060051b60200190565b600082198211156157f7576157f76159d4565b500190565b600060ff821660ff84168060ff03821115615819576158196159d4565b019392505050565b600082615830576158306159ea565b500490565b600060ff831680615848576158486159ea565b8060ff84160491505092915050565b60008160010b8360010b617fff83821384841383830485118282161615615880576158806159d4565b617fff198685128281168783058712161561589d5761589d6159d4565b8787129250858205871284841616156158b8576158b86159d4565b858505871281841616156158ce576158ce6159d4565b5050509290910295945050505050565b60008160001904831182151516156158f8576158f86159d4565b500290565b60008282101561590f5761590f6159d4565b500390565b60005b8381101561592f578181015183820152602001615917565b838111156121105750506000910152565b600060ff821680615953576159536159d4565b6000190192915050565b6000600019821415615971576159716159d4565b5060010190565b600060ff821660ff81141561598f5761598f6159d4565b60010192915050565b600060ff8316806159ab576159ab6159ea565b8060ff84160691505092915050565b6000600160ff1b8214156159d0576159d06159d4565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461177057600080fd5b801515811461177057600080fd5b8060010b811461177057600080fd5b8060020b811461177057600080fd5b61ffff8116811461177057600080fd5b62ffffff8116811461177057600080fdfea26469706673582212208b3d15f169ead311b3a739eb751fe3bf1ac312a6595ef7169d3ef74e895b040c64736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading