Goerli Testnet

Contract

0xC2a3b805bE1E63b6D716D08668f8A7E81Dd844ea
Source Code

Overview

ETH Balance

0 ETH

Multi Chain

Multichain Addresses

N/A
Transaction Hash
Method
Block
From
To
Value
0x6080604078442032022-10-27 15:54:36338 days 56 mins ago1666886076IN
 Create: TherundownConsumer
0 ETH0.1632698330.90239498

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TherundownConsumer

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : TherundownConsumer.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";
import "./GamesQueue.sol";

// interface
import "../../interfaces/ISportPositionalMarketManager.sol";
import "../../interfaces/ITherundownConsumerVerifier.sol";

/// @title Consumer contract which stores all data from CL data feed (Link to docs: https://market.link/nodes/TheRundown/integrations), also creates all sports markets based on that data
/// @author gruja
contract TherundownConsumer is Initializable, ProxyOwned, ProxyPausable {
    /* ========== CONSTANTS =========== */

    uint public constant CANCELLED = 0;
    uint public constant HOME_WIN = 1;
    uint public constant AWAY_WIN = 2;
    uint public constant RESULT_DRAW = 3;
    uint public constant MIN_TAG_NUMBER = 9000;

    /* ========== CONSUMER STATE VARIABLES ========== */

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

    struct GameResolve {
        bytes32 gameId;
        uint8 homeScore;
        uint8 awayScore;
        uint8 statusId;
        uint40 lastUpdated;
    }

    struct GameOdds {
        bytes32 gameId;
        int24 homeOdds;
        int24 awayOdds;
        int24 drawOdds;
    }

    /* ========== STATE VARIABLES ========== */

    // global params
    address public wrapperAddress;
    mapping(address => bool) public whitelistedAddresses;

    // Maps <RequestId, Result>
    mapping(bytes32 => bytes[]) public requestIdGamesCreated;
    mapping(bytes32 => bytes[]) public requestIdGamesResolved;
    mapping(bytes32 => bytes[]) public requestIdGamesOdds;

    // Maps <GameId, Game>
    mapping(bytes32 => GameCreate) public gameCreated;
    mapping(bytes32 => GameResolve) public gameResolved;
    mapping(bytes32 => GameOdds) public gameOdds;
    mapping(bytes32 => uint) public sportsIdPerGame;
    mapping(bytes32 => bool) public gameFulfilledCreated;
    mapping(bytes32 => bool) public gameFulfilledResolved;

    // sports props
    mapping(uint => bool) public supportedSport;
    mapping(uint => bool) public twoPositionSport;
    mapping(uint => bool) public supportResolveGameStatuses;
    mapping(uint => bool) public cancelGameStatuses;

    // market props
    ISportPositionalMarketManager public sportsManager;
    mapping(bytes32 => address) public marketPerGameId;
    mapping(address => bytes32) public gameIdPerMarket;
    mapping(address => bool) public marketResolved;
    mapping(address => bool) public marketCanceled;

    // game
    GamesQueue public queues;
    mapping(bytes32 => uint) public oddsLastPulledForGame;
    mapping(uint => bytes32[]) public gamesPerDate; // deprecated use gamesPerDatePerSport
    mapping(uint => mapping(uint => bool)) public isSportOnADate;
    mapping(address => bool) public invalidOdds;
    mapping(address => bool) public marketCreated;
    mapping(uint => mapping(uint => bytes32[])) public gamesPerDatePerSport;
    mapping(address => bool) public isPausedByCanceledStatus;
    mapping(address => bool) public canMarketBeUpdated;
    mapping(bytes32 => uint) public gameOnADate;

    ITherundownConsumerVerifier public verifier;
    mapping(bytes32 => GameOdds) public backupOdds;

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

    function initialize(
        address _owner,
        uint[] memory _supportedSportIds,
        address _sportsManager,
        uint[] memory _twoPositionSports,
        GamesQueue _queues,
        uint[] memory _resolvedStatuses,
        uint[] memory _cancelGameStatuses
    ) external initializer {
        setOwner(_owner);

        for (uint i; i < _supportedSportIds.length; i++) {
            supportedSport[_supportedSportIds[i]] = true;
        }
        for (uint i; i < _twoPositionSports.length; i++) {
            twoPositionSport[_twoPositionSports[i]] = true;
        }
        for (uint i; i < _resolvedStatuses.length; i++) {
            supportResolveGameStatuses[_resolvedStatuses[i]] = true;
        }
        for (uint i; i < _cancelGameStatuses.length; i++) {
            cancelGameStatuses[_cancelGameStatuses[i]] = true;
        }

        sportsManager = ISportPositionalMarketManager(_sportsManager);
        queues = _queues;
        whitelistedAddresses[_owner] = true;
    }

    /* ========== CONSUMER FULFILL FUNCTIONS ========== */

    /// @notice fulfill all data necessary to create sport markets
    /// @param _requestId unique request id form CL
    /// @param _games array of a games that needed to be stored and transfered to markets
    /// @param _sportId sports id which is provided from CL (Example: NBA = 4)
    /// @param _date date on which game/games are played
    function fulfillGamesCreated(
        bytes32 _requestId,
        bytes[] memory _games,
        uint _sportId,
        uint _date
    ) external onlyWrapper {
        requestIdGamesCreated[_requestId] = _games;

        if (_games.length > 0) {
            isSportOnADate[_date][_sportId] = true;
        }

        for (uint i = 0; i < _games.length; i++) {
            GameCreate memory gameForProcessing = abi.decode(_games[i], (GameCreate));
            // new game
            if (
                !queues.existingGamesInCreatedQueue(gameForProcessing.gameId) &&
                !verifier.isInvalidNames(gameForProcessing.homeTeam, gameForProcessing.awayTeam) &&
                gameForProcessing.startTime > block.timestamp
            ) {
                _updateGameOnADate(gameForProcessing.gameId, _date, _sportId);
                _createGameFulfill(_requestId, gameForProcessing, _sportId);
            }
            // old game UFC checking fighters
            else if (queues.existingGamesInCreatedQueue(gameForProcessing.gameId)) {
                GameCreate memory currentGameValues = getGameCreatedById(gameForProcessing.gameId);

                // if name of fighter (away or home) is not the same
                if (
                    (!verifier.areTeamsEqual(gameForProcessing.homeTeam, currentGameValues.homeTeam) ||
                        !verifier.areTeamsEqual(gameForProcessing.awayTeam, currentGameValues.awayTeam)) && _sportId == 7
                ) {
                    // double-check if market exists -> cancel market -> create new for queue
                    if (marketCreated[marketPerGameId[gameForProcessing.gameId]]) {
                        _cancelMarket(gameForProcessing.gameId, 0, false);
                        _updateGameOnADate(gameForProcessing.gameId, _date, _sportId);
                        _createGameFulfill(_requestId, gameForProcessing, _sportId);
                    }
                    // checking time
                } else if (gameForProcessing.startTime != currentGameValues.startTime) {
                    _updateGameOnADate(gameForProcessing.gameId, _date, _sportId);
                    // if NEW start time is in future
                    if (gameForProcessing.startTime > block.timestamp) {
                        // this checks is for new markets
                        if (canMarketBeUpdated[marketPerGameId[gameForProcessing.gameId]]) {
                            sportsManager.updateDatesForMarket(
                                marketPerGameId[gameForProcessing.gameId],
                                gameForProcessing.startTime
                            );
                            gameCreated[gameForProcessing.gameId] = gameForProcessing;
                            queues.updateGameStartDate(gameForProcessing.gameId, gameForProcessing.startTime);
                        }
                    } else {
                        // double-check if market existst
                        if (marketCreated[marketPerGameId[gameForProcessing.gameId]]) {
                            _pauseOrUnpauseMarket(marketPerGameId[gameForProcessing.gameId], true);
                        }
                    }
                }
            }
        }
    }

    /// @notice fulfill all data necessary to resolve sport markets
    /// @param _requestId unique request id form CL
    /// @param _games array of a games that needed to be resolved
    /// @param _sportId sports id which is provided from CL (Example: NBA = 4)
    function fulfillGamesResolved(
        bytes32 _requestId,
        bytes[] memory _games,
        uint _sportId
    ) external onlyWrapper {
        requestIdGamesResolved[_requestId] = _games;
        for (uint i = 0; i < _games.length; i++) {
            GameResolve memory game = abi.decode(_games[i], (GameResolve));
            // if game is not resolved already and there is market for that game
            if (!queues.existingGamesInResolvedQueue(game.gameId) && marketPerGameId[game.gameId] != address(0)) {
                _resolveGameFulfill(_requestId, game, _sportId);
            }
        }
    }

    /// @notice fulfill all data necessary to populate odds of a game
    /// @param _requestId unique request id form CL
    /// @param _games array of a games that needed to update the odds
    /// @param _date date on which game/games are played
    function fulfillGamesOdds(
        bytes32 _requestId,
        bytes[] memory _games,
        uint _date
    ) external onlyWrapper {
        requestIdGamesOdds[_requestId] = _games;
        for (uint i = 0; i < _games.length; i++) {
            GameOdds memory game = abi.decode(_games[i], (GameOdds));
            // game needs to be fulfilled and market needed to be created
            if (gameFulfilledCreated[game.gameId] && marketPerGameId[game.gameId] != address(0)) {
                _oddsGameFulfill(_requestId, game);
            }
        }
    }

    /// @notice creates market for a given game id
    /// @param _gameId game id
    function createMarketForGame(bytes32 _gameId) public {
        require(
            marketPerGameId[_gameId] == address(0) ||
                (marketCanceled[marketPerGameId[_gameId]] && marketPerGameId[_gameId] != address(0)),
            "ID1"
        );
        require(gameFulfilledCreated[_gameId], "ID2");
        require(queues.gamesCreateQueue(queues.firstCreated()) == _gameId, "ID3");
        _createMarket(_gameId);
    }

    /// @notice creates markets for a given game ids
    /// @param _gameIds game ids as array
    function createAllMarketsForGames(bytes32[] memory _gameIds) external {
        for (uint i; i < _gameIds.length; i++) {
            createMarketForGame(_gameIds[i]);
        }
    }

    /// @notice resolve market for a given game id
    /// @param _gameId game id
    function resolveMarketForGame(bytes32 _gameId) public {
        require(!isGameResolvedOrCanceled(_gameId), "ID4");
        require(gameFulfilledResolved[_gameId], "ID5");
        _resolveMarket(_gameId);
    }

    /// @notice resolve all markets for a given game ids
    /// @param _gameIds game ids as array
    function resolveAllMarketsForGames(bytes32[] memory _gameIds) external {
        for (uint i; i < _gameIds.length; i++) {
            resolveMarketForGame(_gameIds[i]);
        }
    }

    /// @notice resolve market for a given market address
    /// @param _market market address
    /// @param _outcome outcome of a game (1: home win, 2: away win, 3: draw, 0: cancel market)
    /// @param _homeScore score of home team
    /// @param _awayScore score of away team
    function resolveMarketManually(
        address _market,
        uint _outcome,
        uint8 _homeScore,
        uint8 _awayScore
    ) external isAddressWhitelisted canGameBeResolved(gameIdPerMarket[_market], _outcome, _homeScore, _awayScore) {
        _resolveMarketManually(_market, _outcome, _homeScore, _awayScore);
    }

    /// @notice cancel market for a given market address
    /// @param _market market address
    /// @param _useBackupOdds use backup odds before cancel
    function cancelMarketManually(address _market, bool _useBackupOdds)
        external
        isAddressWhitelisted
        canGameBeCanceled(gameIdPerMarket[_market])
    {
        _cancelMarketManually(_market, _useBackupOdds);
    }

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

    /// @notice view function which returns game created object based on id of a game
    /// @param _gameId game id
    /// @return GameCreate game create object
    function getGameCreatedById(bytes32 _gameId) public view returns (GameCreate memory) {
        return gameCreated[_gameId];
    }

    /// @notice view function which returns odds
    /// @param _gameId game id
    /// @return homeOdds moneyline odd in a two decimal places
    /// @return awayOdds moneyline odd in a two decimal places
    /// @return drawOdds moneyline odd in a two decimal places
    function getOddsForGame(bytes32 _gameId)
        external
        view
        returns (
            int24,
            int24,
            int24
        )
    {
        return (gameOdds[_gameId].homeOdds, gameOdds[_gameId].awayOdds, gameOdds[_gameId].drawOdds);
    }

    /// @notice view function which returns games on certan date and sportid
    /// @param _sportId date
    /// @param _date date
    /// @return bytes32[] list of games
    function getGamesPerDatePerSport(uint _sportId, uint _date) public view returns (bytes32[] memory) {
        return gamesPerDatePerSport[_sportId][_date];
    }

    /// @notice view function which returns game resolved object based on id of a game
    /// @param _gameId game id
    /// @return GameResolve game resolve object
    function getGameResolvedById(bytes32 _gameId) public view returns (GameResolve memory) {
        return gameResolved[_gameId];
    }

    /// @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 verifier.isSupportedMarketType(_market);
    }

    /// @notice view function which returns if game is resolved or canceled and ready for market to be resolved or canceled
    /// @param _gameId game id for which game is looking
    /// @return bool is it ready for resolve or cancel true/false
    function isGameResolvedOrCanceled(bytes32 _gameId) public view returns (bool) {
        return marketResolved[marketPerGameId[_gameId]] || marketCanceled[marketPerGameId[_gameId]];
    }

    /// @notice view function which returns if sport is supported or not
    /// @param _sportId sport id for which is looking
    /// @return bool is sport supported true/false
    function isSupportedSport(uint _sportId) external view returns (bool) {
        return supportedSport[_sportId];
    }

    /// @notice view function which returns if sport is two positional (no draw, example: NBA)
    /// @param _sportsId sport id for which is looking
    /// @return bool is sport two positional true/false
    function isSportTwoPositionsSport(uint _sportsId) public view returns (bool) {
        return twoPositionSport[_sportsId];
    }

    /// @notice view function which returns if game is resolved
    /// @param _gameId game id for which game is looking
    /// @return bool is game resolved true/false
    function isGameInResolvedStatus(bytes32 _gameId) public view returns (bool) {
        return _isGameStatusResolved(getGameResolvedById(_gameId));
    }

    /// @notice view function which returns normalized odds up to 100 (Example: 50-40-10)
    /// @param _gameId game id for which game is looking
    /// @return uint[] odds array normalized
    function getNormalizedOdds(bytes32 _gameId) public view returns (uint[] memory) {
        int[] memory odds = new int[](3);
        odds[0] = gameOdds[_gameId].homeOdds;
        odds[1] = gameOdds[_gameId].awayOdds;
        odds[2] = gameOdds[_gameId].drawOdds;
        return _calculateAndNormalizeOdds(odds);
    }

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

    function _createGameFulfill(
        bytes32 requestId,
        GameCreate memory _game,
        uint _sportId
    ) internal {
        gameCreated[_game.gameId] = _game;
        sportsIdPerGame[_game.gameId] = _sportId;
        queues.enqueueGamesCreated(_game.gameId, _game.startTime, _sportId);
        gameFulfilledCreated[_game.gameId] = true;
        gameOdds[_game.gameId] = GameOdds(_game.gameId, _game.homeOdds, _game.awayOdds, _game.drawOdds);
        oddsLastPulledForGame[_game.gameId] = block.timestamp;

        emit GameCreated(requestId, _sportId, _game.gameId, _game, queues.lastCreated(), getNormalizedOdds(_game.gameId));
    }

    function _resolveGameFulfill(
        bytes32 requestId,
        GameResolve memory _game,
        uint _sportId
    ) internal {
        GameCreate memory singleGameCreated = getGameCreatedById(_game.gameId);

        // if status is resolved OR (status is canceled AND start time has passed fulfill game to be resolved)
        if (
            _isGameStatusResolved(_game) ||
            (cancelGameStatuses[_game.statusId] && singleGameCreated.startTime < block.timestamp)
        ) {
            gameResolved[_game.gameId] = _game;
            queues.enqueueGamesResolved(_game.gameId);
            gameFulfilledResolved[_game.gameId] = true;

            emit GameResolved(requestId, _sportId, _game.gameId, _game, queues.lastResolved());
        }
        // if status is canceled AND start time has not passed only pause market
        else if (cancelGameStatuses[_game.statusId] && singleGameCreated.startTime >= block.timestamp) {
            isPausedByCanceledStatus[marketPerGameId[_game.gameId]] = true;
            _pauseOrUnpauseMarket(marketPerGameId[_game.gameId], true);
        }
    }

    function _oddsGameFulfill(bytes32 requestId, GameOdds memory _game) internal {
        // if odds are valid store them if not pause market
        if (_areOddsValid(_game)) {
            uint[] memory currentNormalizedOdd = getNormalizedOdds(_game.gameId);
            GameOdds memory currentOddsBeforeSave = gameOdds[_game.gameId];
            gameOdds[_game.gameId] = _game;
            oddsLastPulledForGame[_game.gameId] = block.timestamp;

            // if was paused and paused by invalid odds unpause
            if (sportsManager.isMarketPaused(marketPerGameId[_game.gameId])) {
                if (invalidOdds[marketPerGameId[_game.gameId]] || isPausedByCanceledStatus[marketPerGameId[_game.gameId]]) {
                    invalidOdds[marketPerGameId[_game.gameId]] = false;
                    isPausedByCanceledStatus[marketPerGameId[_game.gameId]] = false;
                    _pauseOrUnpauseMarket(marketPerGameId[_game.gameId], false);
                }
            } else if (
                //if market is not paused but odd are not in threshold, pause parket
                !sportsManager.isMarketPaused(marketPerGameId[_game.gameId]) &&
                !verifier.areOddsArrayInThreshold(
                    sportsIdPerGame[_game.gameId],
                    currentNormalizedOdd,
                    getNormalizedOdds(_game.gameId),
                    isSportTwoPositionsSport(sportsIdPerGame[_game.gameId])
                )
            ) {
                _pauseOrUnpauseMarket(marketPerGameId[_game.gameId], true);
                backupOdds[_game.gameId] = currentOddsBeforeSave;
            }
            emit GameOddsAdded(requestId, _game.gameId, _game, getNormalizedOdds(_game.gameId));
        } else {
            if (!sportsManager.isMarketPaused(marketPerGameId[_game.gameId])) {
                invalidOdds[marketPerGameId[_game.gameId]] = true;
                _pauseOrUnpauseMarket(marketPerGameId[_game.gameId], true);
            }

            emit InvalidOddsForMarket(requestId, marketPerGameId[_game.gameId], _game.gameId, _game);
        }
    }

    function _createMarket(bytes32 _gameId) internal {
        GameCreate memory game = getGameCreatedById(_gameId);
        // only markets in a future, if not dequeue that creation
        if (game.startTime > block.timestamp) {
            uint[] memory tags = _calculateTags(sportsIdPerGame[_gameId]);

            // create
            sportsManager.createMarket(
                _gameId,
                string(abi.encodePacked(game.homeTeam, " vs ", game.awayTeam)), // gameLabel
                game.startTime, //maturity
                0, //initialMint
                isSportTwoPositionsSport(sportsIdPerGame[_gameId]) ? 2 : 3,
                tags //tags
            );

            address marketAddress = sportsManager.getActiveMarketAddress(sportsManager.numActiveMarkets() - 1);
            marketPerGameId[game.gameId] = marketAddress;
            gameIdPerMarket[marketAddress] = game.gameId;
            marketCreated[marketAddress] = true;
            canMarketBeUpdated[marketAddress] = true;

            queues.dequeueGamesCreated();

            emit CreateSportsMarket(marketAddress, game.gameId, game, tags, getNormalizedOdds(game.gameId));
        } else {
            queues.dequeueGamesCreated();
        }
    }

    function _resolveMarket(bytes32 _gameId) internal {
        GameResolve memory game = getGameResolvedById(_gameId);
        GameCreate memory singleGameCreated = getGameCreatedById(_gameId);
        uint index = queues.unproccessedGamesIndex(_gameId);

        // it can return ZERO index, needs checking
        require(_gameId == queues.unproccessedGames(index), "ID6");

        if (_isGameStatusResolved(game)) {
            if (invalidOdds[marketPerGameId[game.gameId]]) {
                _pauseOrUnpauseMarket(marketPerGameId[game.gameId], false);
            }

            uint _outcome = _calculateOutcome(game);

            // if result is draw and game is UFC or NFL, cancel market
            if (_outcome == RESULT_DRAW && _isDrawForCancelationBySport(sportsIdPerGame[game.gameId])) {
                _cancelMarket(game.gameId, index, true);
            } else {
                // if market is paused only remove from queue
                if (!sportsManager.isMarketPaused(marketPerGameId[game.gameId])) {
                    _setMarketCancelOrResolved(marketPerGameId[game.gameId], _outcome);
                    _cleanStorageQueue(index);

                    emit ResolveSportsMarket(marketPerGameId[game.gameId], game.gameId, _outcome);
                } else {
                    queues.dequeueGamesResolved();
                }
            }
            // if status is canceled and start time of a game passed cancel market
        } else if (cancelGameStatuses[game.statusId] && singleGameCreated.startTime < block.timestamp) {
            _cancelMarket(game.gameId, index, true);
        }
    }

    function _resolveMarketManually(
        address _market,
        uint _outcome,
        uint8 _homeScore,
        uint8 _awayScore
    ) internal {
        uint index = queues.unproccessedGamesIndex(gameIdPerMarket[_market]);

        // it can return ZERO index, needs checking
        require(gameIdPerMarket[_market] == queues.unproccessedGames(index));

        _pauseOrUnpauseMarket(_market, false);
        _setMarketCancelOrResolved(_market, _outcome);
        queues.removeItemUnproccessedGames(index);
        gameResolved[gameIdPerMarket[_market]] = GameResolve(
            gameIdPerMarket[_market],
            _homeScore,
            _awayScore,
            isSportTwoPositionsSport(sportsIdPerGame[gameIdPerMarket[_market]]) ? 8 : 11,
            0
        );

        emit GameResolved(
            gameIdPerMarket[_market], // no req. from CL (manual resolve) so just put gameID
            sportsIdPerGame[gameIdPerMarket[_market]],
            gameIdPerMarket[_market],
            gameResolved[gameIdPerMarket[_market]],
            0
        );
        emit ResolveSportsMarket(_market, gameIdPerMarket[_market], _outcome);
    }

    function _cancelMarketManually(address _market, bool _useBackupOdds) internal {
        uint index = queues.unproccessedGamesIndex(gameIdPerMarket[_market]);

        // it can return ZERO index, needs checking
        require(gameIdPerMarket[_market] == queues.unproccessedGames(index));

        if (_useBackupOdds) {
            require(_areOddsValid(backupOdds[gameIdPerMarket[_market]]));
            gameOdds[gameIdPerMarket[_market]] = backupOdds[gameIdPerMarket[_market]];
            emit GameOddsAdded(
                gameIdPerMarket[_market], // // no req. from CL (manual cancel) so just put gameID
                gameIdPerMarket[_market],
                gameOdds[gameIdPerMarket[_market]],
                getNormalizedOdds(gameIdPerMarket[_market])
            );
        }

        _pauseOrUnpauseMarket(_market, false);
        _setMarketCancelOrResolved(_market, CANCELLED);
        queues.removeItemUnproccessedGames(index);

        emit CancelSportsMarket(_market, gameIdPerMarket[_market]);
    }

    function _pauseOrUnpauseMarket(address _market, bool _pause) internal {
        if (sportsManager.isMarketPaused(_market) != _pause) {
            sportsManager.setMarketPaused(_market, _pause);
            emit PauseSportsMarket(_market, _pause);
        }
    }

    function _cancelMarket(
        bytes32 _gameId,
        uint _index,
        bool cleanStorage
    ) internal {
        _setMarketCancelOrResolved(marketPerGameId[_gameId], CANCELLED);
        if (cleanStorage) {
            _cleanStorageQueue(_index);
        }

        emit CancelSportsMarket(marketPerGameId[_gameId], _gameId);
    }

    function _setMarketCancelOrResolved(address _market, uint _outcome) internal {
        sportsManager.resolveMarket(_market, _outcome);
        if (_outcome == CANCELLED) {
            marketCanceled[_market] = true;
        } else {
            marketResolved[_market] = true;
        }
    }

    function _cleanStorageQueue(uint index) internal {
        queues.dequeueGamesResolved();
        queues.removeItemUnproccessedGames(index);
    }

    function _calculateTags(uint _sportsId) internal pure returns (uint[] memory) {
        uint[] memory result = new uint[](1);
        result[0] = MIN_TAG_NUMBER + _sportsId;
        return result;
    }

    function _isDrawForCancelationBySport(uint _sportsId) internal pure returns (bool) {
        // UFC or NFL
        return _sportsId == 7 || _sportsId == 2;
    }

    function _isGameStatusResolved(GameResolve memory _game) internal view returns (bool) {
        return supportResolveGameStatuses[_game.statusId];
    }

    function _calculateOutcome(GameResolve memory _game) internal pure returns (uint) {
        if (_game.homeScore == _game.awayScore) {
            return RESULT_DRAW;
        }
        return _game.homeScore > _game.awayScore ? HOME_WIN : AWAY_WIN;
    }

    function _areOddsValid(GameOdds memory _game) internal view returns (bool) {
        return
            verifier.areOddsValid(
                isSportTwoPositionsSport(sportsIdPerGame[_game.gameId]),
                _game.homeOdds,
                _game.awayOdds,
                _game.drawOdds
            );
    }

    function _isValidOutcomeForGame(bytes32 _gameId, uint _outcome) internal view returns (bool) {
        return verifier.isValidOutcomeForGame(isSportTwoPositionsSport(sportsIdPerGame[_gameId]), _outcome);
    }

    function _isValidOutcomeWithResult(
        uint _outcome,
        uint _homeScore,
        uint _awayScore
    ) internal view returns (bool) {
        return verifier.isValidOutcomeWithResult(_outcome, _homeScore, _awayScore);
    }

    function _calculateAndNormalizeOdds(int[] memory _americanOdds) internal view returns (uint[] memory) {
        return verifier.calculateAndNormalizeOdds(_americanOdds);
    }

    function _updateGameOnADate(
        bytes32 _gameId,
        uint _date,
        uint _sportId
    ) internal {
        if (gameOnADate[_gameId] != _date) {
            gamesPerDatePerSport[_sportId][_date].push(_gameId);
            gameOnADate[_gameId] = _date;
        }
    }

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

    /// @notice sets if sport is suported or not (delete from supported sport)
    /// @param _sportId sport id which needs to be supported or not
    /// @param _isSupported true/false (supported or not)
    function setSupportedSport(uint _sportId, bool _isSupported) external onlyOwner {
        require(supportedSport[_sportId] != _isSupported);
        supportedSport[_sportId] = _isSupported;
        emit SupportedSportsChanged(_sportId, _isSupported);
    }

    /// @notice sets resolved status which is supported or not
    /// @param _status status ID which needs to be supported or not
    /// @param _isSupported true/false (supported or not)
    function setSupportedResolvedStatuses(uint _status, bool _isSupported) external onlyOwner {
        require(supportResolveGameStatuses[_status] != _isSupported);
        supportResolveGameStatuses[_status] = _isSupported;
        emit SupportedResolvedStatusChanged(_status, _isSupported);
    }

    /// @notice sets cancel status which is supported or not
    /// @param _status ststus ID which needs to be supported or not
    /// @param _isSupported true/false (supported or not)
    function setSupportedCancelStatuses(uint _status, bool _isSupported) external onlyOwner {
        require(cancelGameStatuses[_status] != _isSupported);
        cancelGameStatuses[_status] = _isSupported;
        emit SupportedCancelStatusChanged(_status, _isSupported);
    }

    /// @notice sets if sport is two positional (Example: NBA)
    /// @param _sportId sport ID which is two positional
    /// @param _isTwoPosition true/false (two positional sport or not)
    function setTwoPositionSport(uint _sportId, bool _isTwoPosition) external onlyOwner {
        require(supportedSport[_sportId] && twoPositionSport[_sportId] != _isTwoPosition);
        twoPositionSport[_sportId] = _isTwoPosition;
        emit TwoPositionSportChanged(_sportId, _isTwoPosition);
    }

    /// @notice sets wrapper, manager, queue  address
    /// @param _wrapperAddress wrapper address
    /// @param _queues queue address
    /// @param _sportsManager sport manager address
    function setSportContracts(
        address _wrapperAddress,
        GamesQueue _queues,
        address _sportsManager,
        address _verifier
    ) external onlyOwner {
        require(
            _wrapperAddress != address(0) ||
                address(_queues) != address(0) ||
                _sportsManager != address(0) ||
                _verifier != address(0)
        );

        sportsManager = ISportPositionalMarketManager(_sportsManager);
        queues = _queues;
        wrapperAddress = _wrapperAddress;
        verifier = ITherundownConsumerVerifier(_verifier);

        emit NewSportContracts(_wrapperAddress, _queues, _sportsManager, _verifier);
    }

    /// @notice adding/removing whitelist address depending on a flag
    /// @param _whitelistAddress address that needed to be whitelisted/ ore removed from WL
    /// @param _flag adding or removing from whitelist (true: add, false: remove)
    function addToWhitelist(address _whitelistAddress, bool _flag) external onlyOwner {
        require(_whitelistAddress != address(0) && whitelistedAddresses[_whitelistAddress] != _flag);
        whitelistedAddresses[_whitelistAddress] = _flag;
        emit AddedIntoWhitelist(_whitelistAddress, _flag);
    }

    /* ========== MODIFIERS ========== */

    modifier onlyWrapper() {
        require(msg.sender == wrapperAddress, "ID9");
        _;
    }

    modifier isAddressWhitelisted() {
        require(whitelistedAddresses[msg.sender], "ID10");
        _;
    }

    modifier canGameBeCanceled(bytes32 _gameId) {
        require(!isGameResolvedOrCanceled(_gameId), "ID11");
        require(marketPerGameId[_gameId] != address(0), "ID12");
        _;
    }

    modifier canGameBeResolved(
        bytes32 _gameId,
        uint _outcome,
        uint8 _homeScore,
        uint8 _awayScore
    ) {
        require(!isGameResolvedOrCanceled(_gameId), "ID13");
        require(marketPerGameId[_gameId] != address(0), "ID14");
        require(
            _isValidOutcomeForGame(_gameId, _outcome) && _isValidOutcomeWithResult(_outcome, _homeScore, _awayScore),
            "ID15"
        );
        _;
    }
    /* ========== EVENTS ========== */

    event GameCreated(
        bytes32 _requestId,
        uint _sportId,
        bytes32 _id,
        GameCreate _game,
        uint _queueIndex,
        uint[] _normalizedOdds
    );
    event GameResolved(bytes32 _requestId, uint _sportId, bytes32 _id, GameResolve _game, uint _queueIndex);
    event GameOddsAdded(bytes32 _requestId, bytes32 _id, GameOdds _game, uint[] _normalizedOdds);
    event CreateSportsMarket(address _marketAddress, bytes32 _id, GameCreate _game, uint[] _tags, uint[] _normalizedOdds);
    event ResolveSportsMarket(address _marketAddress, bytes32 _id, uint _outcome);
    event PauseSportsMarket(address _marketAddress, bool _pause);
    event CancelSportsMarket(address _marketAddress, bytes32 _id);
    event InvalidOddsForMarket(bytes32 _requestId, address _marketAddress, bytes32 _id, GameOdds _game);
    event SupportedSportsChanged(uint _sportId, bool _isSupported);
    event SupportedResolvedStatusChanged(uint _status, bool _isSupported);
    event SupportedCancelStatusChanged(uint _status, bool _isSupported);
    event TwoPositionSportChanged(uint _sportId, bool _isTwoPosition);
    event NewSportsMarketManager(address _sportsManager); // deprecated
    event NewWrapperAddress(address _wrapperAddress); // deprecated
    event NewQueueAddress(GamesQueue _queues); // deprecated
    event NewSportContracts(address _wrapperAddress, GamesQueue _queues, address _sportsManager, address _verifier);
    event AddedIntoWhitelist(address _whitelistAddress, bool _flag);
}

File 2 of 15 : 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 15 : 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 15 : 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 15 : 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 15 : GamesQueue.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";

/// @title Storage for games (created or resolved), calculation for order-making bot processing
/// @author gruja
contract GamesQueue is Initializable, ProxyOwned, ProxyPausable {
    // create games queue
    mapping(uint => bytes32) public gamesCreateQueue;
    mapping(bytes32 => bool) public existingGamesInCreatedQueue;
    uint public firstCreated;
    uint public lastCreated;
    mapping(bytes32 => uint) public gameStartPerGameId;

    // resolve games queue
    bytes32[] public unproccessedGames;
    mapping(bytes32 => uint) public unproccessedGamesIndex;
    mapping(uint => bytes32) public gamesResolvedQueue;
    mapping(bytes32 => bool) public existingGamesInResolvedQueue;
    uint public firstResolved;
    uint public lastResolved;

    address public consumer;
    mapping(address => bool) public whitelistedAddresses;

    /// @notice public initialize proxy method
    /// @param _owner future owner of a contract
    function initialize(address _owner) public initializer {
        setOwner(_owner);
        firstCreated = 1;
        lastCreated = 0;
        firstResolved = 1;
        lastResolved = 0;
    }

    /// @notice putting game in a crated queue and fill up unprocessed games array
    /// @param data id of a game in byte32
    /// @param startTime game start time
    /// @param sportsId id of a sport (Example: NBA = 4 etc.)
    function enqueueGamesCreated(
        bytes32 data,
        uint startTime,
        uint sportsId
    ) public canExecuteFunction {
        lastCreated += 1;
        gamesCreateQueue[lastCreated] = data;

        existingGamesInCreatedQueue[data] = true;
        unproccessedGames.push(data);
        unproccessedGamesIndex[data] = unproccessedGames.length - 1;
        gameStartPerGameId[data] = startTime;

        emit EnqueueGamesCreated(data, sportsId, lastCreated);
    }

    /// @notice removing first game in a queue from created queue
    /// @return data returns id of a game which is removed
    function dequeueGamesCreated() public canExecuteFunction returns (bytes32 data) {
        require(lastCreated >= firstCreated, "No more elements in a queue");

        data = gamesCreateQueue[firstCreated];

        delete gamesCreateQueue[firstCreated];
        firstCreated += 1;

        emit DequeueGamesCreated(data, firstResolved - 1);
    }

    /// @notice putting game in a resolved queue
    /// @param data id of a game in byte32
    function enqueueGamesResolved(bytes32 data) public canExecuteFunction {
        lastResolved += 1;
        gamesResolvedQueue[lastResolved] = data;
        existingGamesInResolvedQueue[data] = true;

        emit EnqueueGamesResolved(data, lastCreated);
    }

    /// @notice removing first game in a queue from resolved queue
    /// @return data returns id of a game which is removed
    function dequeueGamesResolved() public canExecuteFunction returns (bytes32 data) {
        require(lastResolved >= firstResolved, "No more elements in a queue");

        data = gamesResolvedQueue[firstResolved];

        delete gamesResolvedQueue[firstResolved];
        firstResolved += 1;

        emit DequeueGamesResolved(data, firstResolved - 1);
    }

    /// @notice removing game from array of unprocessed games
    /// @param index index in array
    function removeItemUnproccessedGames(uint index) public canExecuteFunction {
        require(index < unproccessedGames.length, "No such index in array");

        bytes32 dataProccessed = unproccessedGames[index];

        unproccessedGames[index] = unproccessedGames[unproccessedGames.length - 1];
        unproccessedGamesIndex[unproccessedGames[index]] = index;
        unproccessedGames.pop();

        emit GameProcessed(dataProccessed, index);
    }

    /// @notice update a game start date
    /// @param _gameId gameId which start date is updated
    /// @param _date date
    function updateGameStartDate(bytes32 _gameId, uint _date) public canExecuteFunction {
        require(_date > block.timestamp, "Date must be in future");
        require(gameStartPerGameId[_gameId] != 0, "Game not existing");
        gameStartPerGameId[_gameId] = _date;
        emit NewStartDateOnGame(_gameId, _date);
    }

    /// @notice public function which will return length of unprocessed array
    /// @return index index in array
    function getLengthUnproccessedGames() public view returns (uint) {
        return unproccessedGames.length;
    }

    /// @notice sets the consumer contract address, which only owner can execute
    /// @param _consumer address of a consumer contract
    function setConsumerAddress(address _consumer) external onlyOwner {
        require(_consumer != address(0), "Invalid address");
        consumer = _consumer;
        emit NewConsumerAddress(_consumer);
    }

    /// @notice adding/removing whitelist address depending on a flag
    /// @param _whitelistAddress address that needed to be whitelisted/ ore removed from WL
    /// @param _flag adding or removing from whitelist (true: add, false: remove)
    function addToWhitelist(address _whitelistAddress, bool _flag) external onlyOwner {
        require(_whitelistAddress != address(0) && whitelistedAddresses[_whitelistAddress] != _flag, "Invalid");
        whitelistedAddresses[_whitelistAddress] = _flag;
        emit AddedIntoWhitelist(_whitelistAddress, _flag);
    }

    modifier canExecuteFunction() {
        require(msg.sender == consumer || whitelistedAddresses[msg.sender], "Only consumer or whitelisted address");
        _;
    }

    event EnqueueGamesCreated(bytes32 _gameId, uint _sportId, uint _index);
    event EnqueueGamesResolved(bytes32 _gameId, uint _index);
    event DequeueGamesCreated(bytes32 _gameId, uint _index);
    event DequeueGamesResolved(bytes32 _gameId, uint _index);
    event GameProcessed(bytes32 _gameId, uint _index);
    event NewConsumerAddress(address _consumer);
    event AddedIntoWhitelist(address _whitelistAddress, bool _flag);
    event NewStartDateOnGame(bytes32 _gameId, uint _date);
}

File 7 of 15 : 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 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 isWhitelistedAddress(address _address) external view returns (bool);

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

    function createMarket(
        bytes32 gameId,
        string memory gameLabel,
        uint maturity,
        uint initialMint, // initial sUSD to mint options for,
        uint positionCount,
        uint[] memory tags
    ) 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;
}

File 8 of 15 : ITherundownConsumerVerifier.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ITherundownConsumerVerifier {
    // view functions
    function isInvalidNames(string memory _teamA, string memory _teamB) external view returns (bool);

    function areTeamsEqual(string memory _teamA, string memory _teamB) external view returns (bool);

    function isSupportedMarketType(string memory _market) external view returns (bool);

    function areOddsArrayInThreshold(
        uint _sportId,
        uint[] memory _currentOddsArray,
        uint[] memory _newOddsArray,
        bool _isTwoPositionalSport
    ) external view returns (bool);

    function areOddsValid(
        bool _isTwoPositionalSport,
        int24 _homeOdds,
        int24 _awayOdds,
        int24 _drawOdds
    ) external view returns (bool);

    function isValidOutcomeForGame(bool _isTwoPositionalSport, uint _outcome) external view returns (bool);

    function isValidOutcomeWithResult(
        uint _outcome,
        uint _homeScore,
        uint _awayScore
    ) external view returns (bool);

    function calculateAndNormalizeOdds(int[] memory _americanOdds) external view returns (uint[] memory);
}

File 9 of 15 : 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 10 of 15 : 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 11 of 15 : 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 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 tags(uint idx) external view returns (uint);

    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 getMaximumBurnable(address account) external view returns (uint amount);

    /* ========== 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;

    function burnOptions(uint amount) external;

    function burnOptionsMaximum() external;
}

File 12 of 15 : 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 13 of 15 : 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);
}

File 14 of 15 : 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 15 of 15 : 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":"address","name":"_marketAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"}],"name":"CancelSportsMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_marketAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"},{"internalType":"string","name":"homeTeam","type":"string"},{"internalType":"string","name":"awayTeam","type":"string"}],"indexed":false,"internalType":"struct TherundownConsumer.GameCreate","name":"_game","type":"tuple"},{"indexed":false,"internalType":"uint256[]","name":"_tags","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_normalizedOdds","type":"uint256[]"}],"name":"CreateSportsMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"},{"internalType":"string","name":"homeTeam","type":"string"},{"internalType":"string","name":"awayTeam","type":"string"}],"indexed":false,"internalType":"struct TherundownConsumer.GameCreate","name":"_game","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"_queueIndex","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_normalizedOdds","type":"uint256[]"}],"name":"GameCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"}],"indexed":false,"internalType":"struct TherundownConsumer.GameOdds","name":"_game","type":"tuple"},{"indexed":false,"internalType":"uint256[]","name":"_normalizedOdds","type":"uint256[]"}],"name":"GameOddsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint8","name":"homeScore","type":"uint8"},{"internalType":"uint8","name":"awayScore","type":"uint8"},{"internalType":"uint8","name":"statusId","type":"uint8"},{"internalType":"uint40","name":"lastUpdated","type":"uint40"}],"indexed":false,"internalType":"struct TherundownConsumer.GameResolve","name":"_game","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"_queueIndex","type":"uint256"}],"name":"GameResolved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_marketAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"}],"indexed":false,"internalType":"struct TherundownConsumer.GameOdds","name":"_game","type":"tuple"}],"name":"InvalidOddsForMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract GamesQueue","name":"_queues","type":"address"}],"name":"NewQueueAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_wrapperAddress","type":"address"},{"indexed":false,"internalType":"contract GamesQueue","name":"_queues","type":"address"},{"indexed":false,"internalType":"address","name":"_sportsManager","type":"address"},{"indexed":false,"internalType":"address","name":"_verifier","type":"address"}],"name":"NewSportContracts","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_sportsManager","type":"address"}],"name":"NewSportsMarketManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_wrapperAddress","type":"address"}],"name":"NewWrapperAddress","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":"address","name":"_marketAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"_pause","type":"bool"}],"name":"PauseSportsMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_marketAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_outcome","type":"uint256"}],"name":"ResolveSportsMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_status","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"SupportedCancelStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_status","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"SupportedResolvedStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"SupportedSportsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_sportId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_isTwoPosition","type":"bool"}],"name":"TwoPositionSportChanged","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":"MIN_TAG_NUMBER","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":"address","name":"_whitelistAddress","type":"address"},{"internalType":"bool","name":"_flag","type":"bool"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"backupOdds","outputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"canMarketBeUpdated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"cancelGameStatuses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"bool","name":"_useBackupOdds","type":"bool"}],"name":"cancelMarketManually","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"createAllMarketsForGames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"createMarketForGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"bytes[]","name":"_games","type":"bytes[]"},{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_date","type":"uint256"}],"name":"fulfillGamesCreated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"bytes[]","name":"_games","type":"bytes[]"},{"internalType":"uint256","name":"_date","type":"uint256"}],"name":"fulfillGamesOdds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"bytes[]","name":"_games","type":"bytes[]"},{"internalType":"uint256","name":"_sportId","type":"uint256"}],"name":"fulfillGamesResolved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameCreated","outputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"},{"internalType":"string","name":"homeTeam","type":"string"},{"internalType":"string","name":"awayTeam","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameFulfilledCreated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameFulfilledResolved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"gameIdPerMarket","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameOdds","outputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameOnADate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"gameResolved","outputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint8","name":"homeScore","type":"uint8"},{"internalType":"uint8","name":"awayScore","type":"uint8"},{"internalType":"uint8","name":"statusId","type":"uint8"},{"internalType":"uint40","name":"lastUpdated","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"gamesPerDate","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"gamesPerDatePerSport","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"getGameCreatedById","outputs":[{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"int24","name":"homeOdds","type":"int24"},{"internalType":"int24","name":"awayOdds","type":"int24"},{"internalType":"int24","name":"drawOdds","type":"int24"},{"internalType":"string","name":"homeTeam","type":"string"},{"internalType":"string","name":"awayTeam","type":"string"}],"internalType":"struct TherundownConsumer.GameCreate","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"getGameResolvedById","outputs":[{"components":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"uint8","name":"homeScore","type":"uint8"},{"internalType":"uint8","name":"awayScore","type":"uint8"},{"internalType":"uint8","name":"statusId","type":"uint8"},{"internalType":"uint40","name":"lastUpdated","type":"uint40"}],"internalType":"struct TherundownConsumer.GameResolve","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"uint256","name":"_date","type":"uint256"}],"name":"getGamesPerDatePerSport","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"getNormalizedOdds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"getOddsForGame","outputs":[{"internalType":"int24","name":"","type":"int24"},{"internalType":"int24","name":"","type":"int24"},{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256[]","name":"_supportedSportIds","type":"uint256[]"},{"internalType":"address","name":"_sportsManager","type":"address"},{"internalType":"uint256[]","name":"_twoPositionSports","type":"uint256[]"},{"internalType":"contract GamesQueue","name":"_queues","type":"address"},{"internalType":"uint256[]","name":"_resolvedStatuses","type":"uint256[]"},{"internalType":"uint256[]","name":"_cancelGameStatuses","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"invalidOdds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"isGameInResolvedStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"isGameResolvedOrCanceled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPausedByCanceledStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"isSportOnADate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportsId","type":"uint256"}],"name":"isSportTwoPositionsSport","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":"uint256","name":"_sportId","type":"uint256"}],"name":"isSupportedSport","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketCanceled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketCreated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"marketPerGameId","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketResolved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"oddsLastPulledForGame","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":"queues","outputs":[{"internalType":"contract GamesQueue","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestIdGamesCreated","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestIdGamesOdds","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestIdGamesResolved","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_gameIds","type":"bytes32[]"}],"name":"resolveAllMarketsForGames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_gameId","type":"bytes32"}],"name":"resolveMarketForGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"uint256","name":"_outcome","type":"uint256"},{"internalType":"uint8","name":"_homeScore","type":"uint8"},{"internalType":"uint8","name":"_awayScore","type":"uint8"}],"name":"resolveMarketManually","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":"_wrapperAddress","type":"address"},{"internalType":"contract GamesQueue","name":"_queues","type":"address"},{"internalType":"address","name":"_sportsManager","type":"address"},{"internalType":"address","name":"_verifier","type":"address"}],"name":"setSportContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_status","type":"uint256"},{"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"setSupportedCancelStatuses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_status","type":"uint256"},{"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"setSupportedResolvedStatuses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"bool","name":"_isSupported","type":"bool"}],"name":"setSupportedSport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sportId","type":"uint256"},{"internalType":"bool","name":"_isTwoPosition","type":"bool"}],"name":"setTwoPositionSport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"sportsIdPerGame","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":"uint256","name":"","type":"uint256"}],"name":"supportResolveGameStatuses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supportedSport","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":"uint256","name":"","type":"uint256"}],"name":"twoPositionSport","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifier","outputs":[{"internalType":"contract ITherundownConsumerVerifier","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wrapperAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50615e9e80620000216000396000f3fe608060405234801561001057600080fd5b50600436106104285760003560e01c806369a5492e1161022b578063b09bd9e311610130578063dec72d63116100b8578063e87a6b8511610087578063e87a6b8514610bb7578063efccb47a14610bda578063f89c6f1814610bed578063fa59104f14610c16578063feee9ca314610c3957600080fd5b8063dec72d6314610b4e578063e3f4c7c914610b71578063e59aff4b14610b84578063e7015ab214610b9757600080fd5b8063c39718a8116100ff578063c39718a814610ad2578063c3b83f5f14610af5578063c475e0b314610b08578063c48e62f114610b1b578063c8bbcd9614610b3b57600080fd5b8063b09bd9e314610a3b578063b4976d7b14610a7c578063bc93233f14610a9c578063be27f89d14610aaf57600080fd5b806391b4ded9116101b3578063a400a89111610182578063a400a891146109da578063a47a874f146109ed578063a50267a514610a00578063ac2c957c14610a20578063ae71dcdf14610a3357600080fd5b806391b4ded91461093357806393f4452e1461093c57806394db3a96146109a75780639aceb36e146109ba57600080fd5b80638067cd53116101fa5780638067cd53146108b2578063861de52c146108c55780638c4e8cb5146108e45780638da5cb5b146109075780638ec2c5a61461092057600080fd5b806369a5492e1461084f57806370aadcc41461087257806379ba5097146108925780637df8b8021461089a57600080fd5b806336c0d8551161033157806353a47bb7116102b957806360b4df851161028857806360b4df8514610792578063621da703146107f3578063627e7b4214610806578063630e2c351461081957806367674b141461082c57600080fd5b806353a47bb714610729578063557db4481461073c5780635b9fbe07146107625780635c975abb1461078557600080fd5b8063459c0bd011610300578063459c0bd0146106b857806346cd8622146106c0578063489f4b97146106d35780634cf5d715146106e65780635034c5881461070957600080fd5b806336c0d8551461063f5780633ec70ca514610662578063436d765a146106855780634458e51d146106a557600080fd5b80631afed5cc116103b45780632f73199d116103835780632f73199d146105e65780632fe28c48146105f95780632fff70201461061c578063300a02981461062457806331dca3841461062c57600080fd5b80631afed5cc146105945780632082af141461059d5780632a4a3e7c146105b05780632b7ac3f3146105d357600080fd5b806310063fdc116103fb57806310063fdc1461051d57806313251f5e1461054857806313af40351461055b5780631627540c1461056e57806316c38b3c1461058157600080fd5b806306c933d81461042d57806307d3d3f314610465578063097c9e0f1461047a5780630b5cde461461049b575b600080fd5b61045061043b366004615109565b60046020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61047861047336600461521a565b610c67565b005b61048d610488366004615515565b610d6c565b60405190815260200161045c565b6104e66104a9366004615444565b6009602052600090815260409020805460019091015460ff80821691610100810482169162010000820416906301000000900464ffffffffff1685565b6040805195865260ff948516602087015292841692850192909252909116606083015264ffffffffff16608082015260a00161045c565b601254610530906001600160a01b031681565b6040516001600160a01b03909116815260200161045c565b61048d61055636600461577b565b610d9d565b610478610569366004615109565b610ddb565b61047861057c366004615109565b610f16565b61047861058f36600461540c565b610f6c565b61048d61232881565b6104786105ab366004615757565b610fe2565b6104506105be366004615109565b601e6020526000908152604090205460ff1681565b602154610530906001600160a01b031681565b6104786105f4366004615474565b611080565b610450610607366004615444565b6000908152600e602052604090205460ff1690565b61048d600181565b61048d600281565b61047861063a366004615757565b6111e6565b61045061064d366004615109565b601b6020526000908152604090205460ff1681565b610450610670366004615444565b600d6020526000908152604090205460ff1681565b610698610693366004615515565b611262565b60405161045c9190615bc7565b6104786106b3366004615474565b61131b565b61048d600381565b6104786106ce366004615757565b611410565b6104506106e1366004615444565b61148c565b6104506106f4366004615444565b600f6020526000908152604090205460ff1681565b61048d610717366004615444565b60186020526000908152604090205481565b600154610530906001600160a01b031681565b61074f61074a366004615444565b6114e9565b60405161045c9796959493929190615b6d565b610450610770366004615109565b60156020526000908152604090205460ff1681565b6003546104509060ff1681565b6107cf6107a0366004615444565b6000908152600a6020526040902060010154600281810b9263010000008304820b92600160301b900490910b90565b60408051600294850b815292840b6020840152920b9181019190915260600161045c565b610450610801366004615444565b611644565b610478610814366004615141565b61166e565b610478610827366004615757565b61194c565b61045061083a366004615444565b600c6020526000908152604090205460ff1681565b61045061085d366004615444565b600e6020526000908152604090205460ff1681565b61048d610880366004615444565b600b6020526000908152604090205481565b6104786119c8565b6003546105309061010090046001600160a01b031681565b6104786108c03660046152f4565b611ac5565b61048d6108d3366004615444565b602080526000908152604090205481565b6104506108f2366004615109565b601c6020526000908152604090205460ff1681565b600054610530906201000090046001600160a01b031681565b61047861092e366004615444565b611b17565b61048d60025481565b61097d61094a366004615444565b600a6020526000908152604090208054600190910154600281810b9163010000008104820b91600160301b909104900b84565b60408051948552600293840b602086015291830b91840191909152900b606082015260800161045c565b6104786109b5366004615252565b611d24565b6109cd6109c8366004615444565b611e27565b60405161045c919061595a565b6104786109e83660046154c1565b611f4a565b6104786109fb3660046152ad565b6125dc565b610a13610a0e366004615515565b61272f565b60405161045c9190615916565b610478610a2e3660046152f4565b61279a565b61048d600081565b61097d610a49366004615444565b60226020526000908152604090208054600190910154600281810b9163010000008104820b91600160301b909104900b84565b610a8f610a8a366004615444565b6127e8565b60405161045c9190615c2f565b610478610aaa36600461521a565b612877565b610450610abd366004615444565b6000908152600f602052604090205460ff1690565b610450610ae0366004615109565b601f6020526000908152604090205460ff1681565b610478610b03366004615109565b61291b565b610698610b16366004615515565b612a34565b610b2e610b29366004615444565b612a50565b60405161045c9190615c1c565b610450610b49366004615536565b612c22565b610450610b5c366004615109565b60166020526000908152604090205460ff1681565b601754610530906001600160a01b031681565b610478610b92366004615444565b612ca3565b61048d610ba5366004615109565b60146020526000908152604090205481565b610450610bc5366004615444565b60106020526000908152604090205460ff1681565b610698610be8366004615515565b612d2c565b610530610bfb366004615444565b6013602052600090815260409020546001600160a01b031681565b610450610c24366004615444565b60116020526000908152604090205460ff1681565b610450610c47366004615515565b601a60209081526000928352604080842090915290825290205460ff1681565b3360009081526004602052604090205460ff16610cb85760405162461bcd60e51b8152600401610caf906020808252600490820152630494431360e41b604082015260600190565b60405180910390fd5b6001600160a01b038216600090815260146020526040902054610cda8161148c565b15610d105760405162461bcd60e51b8152600401610caf906020808252600490820152634944313160e01b604082015260600190565b6000818152601360205260409020546001600160a01b0316610d5d5760405162461bcd60e51b8152600401610caf9060208082526004908201526324a2189960e11b604082015260600190565b610d678383612d48565b505050565b60196020528160005260406000208181548110610d8857600080fd5b90600052602060002001600091509150505481565b601d6020528260005260406000206020528160005260406000208181548110610dc557600080fd5b9060005260206000200160009250925050505481565b6001600160a01b038116610e315760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f742062652030000000000000006044820152606401610caf565b600154600160a01b900460ff1615610e9d5760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b6064820152608401610caf565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b610f1e6130bc565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290602001610f0b565b610f746130bc565b60035460ff1615158115151415610f885750565b6003805460ff191682151590811790915560ff1615610fa657426002555b60035460405160ff909116151581527f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec590602001610f0b565b50565b610fea6130bc565b6000828152600e602052604090205460ff16801561101d57506000828152600f602052604090205460ff16151581151514155b61102657600080fd5b6000828152600f6020908152604091829020805460ff19168415159081179091558251858152918201527f5c90f67f3547cb9c3f1b7612610d878aa4f00e88a643d2c6b658c1f9005fdcda91015b60405180910390a15050565b60035461010090046001600160a01b031633146110af5760405162461bcd60e51b8152600401610caf90615bff565b600083815260066020908152604090912083516110ce92850190614e21565b5060005b82518110156111e05760008382815181106110fd57634e487b7160e01b600052603260045260246000fd5b602002602001015180602001905181019061111891906156c1565b60175481516040516301ca5e7f60e51b815260048101919091529192506001600160a01b03169063394bcfe09060240160206040518083038186803b15801561116057600080fd5b505afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111989190615428565b1580156111bd575080516000908152601360205260409020546001600160a01b031615155b156111cd576111cd858285613136565b50806111d881615def565b9150506110d2565b50505050565b6111ee6130bc565b6000828152600e602052604090205460ff161515811515141561121057600080fd5b6000828152600e6020908152604091829020805460ff19168415159081179091558251858152918201527f0a7daa18eab3013f94989c4e384004cab457b607ce1e975b8de79c4da52da9549101611074565b6006602052816000526040600020818154811061127e57600080fd5b9060005260206000200160009150915050805461129a90615db4565b80601f01602080910402602001604051908101604052809291908181526020018280546112c690615db4565b80156113135780601f106112e857610100808354040283529160200191611313565b820191906000526020600020905b8154815290600101906020018083116112f657829003601f168201915b505050505081565b60035461010090046001600160a01b0316331461134a5760405162461bcd60e51b8152600401610caf90615bff565b6000838152600760209081526040909120835161136992850190614e21565b5060005b82518110156111e057600083828151811061139857634e487b7160e01b600052603260045260246000fd5b60200260200101518060200190518101906113b3919061564d565b80516000908152600c602052604090205490915060ff1680156113ee575080516000908152601360205260409020546001600160a01b031615155b156113fd576113fd85826133dc565b508061140881615def565b91505061136d565b6114186130bc565b60008281526011602052604090205460ff161515811515141561143a57600080fd5b600082815260116020908152604091829020805460ff19168415159081179091558251858152918201527fbff84c147d533b99d8802295ac70c53aa7d9ac4e520dcd0200d2f434c34b52a39101611074565b6000818152601360209081526040808320546001600160a01b03168352601590915281205460ff16806114e357506000828152601360209081526040808320546001600160a01b03168352601690915290205460ff165b92915050565b6008602052600090815260409020805460018201546002808401546003850180549495939482840b9463010000008404850b94600160301b90940490930b92919061153390615db4565b80601f016020809104026020016040519081016040528092919081815260200182805461155f90615db4565b80156115ac5780601f10611581576101008083540402835291602001916115ac565b820191906000526020600020905b81548152906001019060200180831161158f57829003601f168201915b5050505050908060040180546115c190615db4565b80601f01602080910402602001604051908101604052809291908181526020018280546115ed90615db4565b801561163a5780601f1061160f5761010080835404028352916020019161163a565b820191906000526020600020905b81548152906001019060200180831161161d57829003601f168201915b5050505050905087565b60006114e3611652836127e8565b6060015160ff9081166000908152601060205260409020541690565b600054610100900460ff166116895760005460ff161561168d565b303b155b6116f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610caf565b600054610100900460ff16158015611712576000805461ffff19166101011790555b61171b88610ddb565b60005b875181101561178d576001600e60008a848151811061174d57634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061178590615def565b91505061171e565b5060005b8551811015611800576001600f60008884815181106117c057634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806117f890615def565b915050611791565b5060005b83518110156118735760016010600086848151811061183357634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061186b90615def565b915050611804565b5060005b82518110156118e6576001601160008584815181106118a657634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806118de90615def565b915050611877565b50601280546001600160a01b038089166001600160a01b03199283161790925560178054878416921691909117905588166000908152600460205260409020805460ff191660011790558015611942576000805461ff00191690555b5050505050505050565b6119546130bc565b60008281526010602052604090205460ff161515811515141561197657600080fd5b600082815260106020908152604091829020805460ff19168415159081179091558251858152918201527f463b22afe346e0b505997c71b3cb5c2a507adb0214a645f6aede655b186917179101611074565b6001546001600160a01b03163314611a405760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610caf565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b60005b8151811015611b1357611b01828281518110611af457634e487b7160e01b600052603260045260246000fd5b6020026020010151612ca3565b80611b0b81615def565b915050611ac8565b5050565b6000818152601360205260409020546001600160a01b03161580611b8057506000818152601360209081526040808320546001600160a01b03168352601690915290205460ff168015611b8057506000818152601360205260409020546001600160a01b031615155b611bb25760405162461bcd60e51b815260206004820152600360248201526249443160e81b6044820152606401610caf565b6000818152600c602052604090205460ff16611bf65760405162461bcd60e51b815260206004820152600360248201526224a21960e91b6044820152606401610caf565b60175460408051634b40849760e01b8152905183926001600160a01b0316916303aac5d5918391634b408497916004808301926020929190829003018186803b158015611c4257600080fd5b505afa158015611c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c7a919061545c565b6040518263ffffffff1660e01b8152600401611c9891815260200190565b60206040518083038186803b158015611cb057600080fd5b505afa158015611cc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce8919061545c565b14611d1b5760405162461bcd60e51b815260206004820152600360248201526249443360e81b6044820152606401610caf565b610fdf81613982565b611d2c6130bc565b6001600160a01b038416151580611d4b57506001600160a01b03831615155b80611d5e57506001600160a01b03821615155b80611d7157506001600160a01b03811615155b611d7a57600080fd5b601280546001600160a01b03199081166001600160a01b0385811691821790935560178054831687851690811790915560038054610100600160a81b0319166101008a8716908102919091179091556021805490941694861694851790935560408051938452602084019190915282015260608101919091527f4c84616e9e609cf4ac55d948b151efc8a5a3fc742345ad2fe2149dd68e400b9e906080015b60405180910390a150505050565b60408051600380825260808201909252606091600091906020820184803683375050506000848152600a60205260408120600101548251929350600290810b900b91839190611e8657634e487b7160e01b600052603260045260246000fd5b602002602001018181525050600a600084815260200190815260200160002060010160039054906101000a900460020b60020b81600181518110611eda57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050600a600084815260200190815260200160002060010160069054906101000a900460020b60020b81600281518110611f2e57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050611f4381613d3e565b9392505050565b60035461010090046001600160a01b03163314611f795760405162461bcd60e51b8152600401610caf90615bff565b60008481526005602090815260409091208451611f9892860190614e21565b50825115611fc5576000818152601a602090815260408083208584529091529020805460ff191660011790555b60005b83518110156125d5576000848281518110611ff357634e487b7160e01b600052603260045260246000fd5b602002602001015180602001905181019061200e919061557b565b6017548151604051631666d90f60e01b815260048101919091529192506001600160a01b031690631666d90f9060240160206040518083038186803b15801561205657600080fd5b505afa15801561206a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208e9190615428565b158015612122575060215460a082015160c08301516040516397dc205d60e01b81526001600160a01b03909316926397dc205d926120d0929091600401615bda565b60206040518083038186803b1580156120e857600080fd5b505afa1580156120fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121209190615428565b155b80156121315750428160200151115b15612153578051612143908486613dc3565b61214e868286613e0e565b6125c2565b6017548151604051631666d90f60e01b81526001600160a01b0390921691631666d90f916121879160040190815260200190565b60206040518083038186803b15801561219f57600080fd5b505afa1580156121b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d79190615428565b156125c25760006121eb8260000151612a50565b60215460a08085015190830151604051637fabe16b60e01b81529394506001600160a01b0390921692637fabe16b926122279291600401615bda565b60206040518083038186803b15801561223f57600080fd5b505afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190615428565b158061230a575060215460c08084015190830151604051637fabe16b60e01b81526001600160a01b0390931692637fabe16b926122b8929091600401615bda565b60206040518083038186803b1580156122d057600080fd5b505afa1580156122e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123089190615428565b155b80156123165750846007145b156123755781516000908152601360209081526040808320546001600160a01b03168352601c90915290205460ff1615612370578151612358906000806140ca565b8151612365908587613dc3565b612370878387613e0e565b6125c0565b80602001518260200151146125c0578151612391908587613dc3565b428260200151111561256c5781516000908152601360209081526040808320546001600160a01b03168352601f90915290205460ff1615612370576012548251600090815260136020908152604091829020549085015191516327ad762d60e21b81526001600160a01b039182166004820152602481019290925290911690639eb5d8b490604401600060405180830381600087803b15801561243357600080fd5b505af1158015612447573d6000803e3d6000fd5b5050835160009081526008602090815260409182902086518155818701516001820155918601516002808401805460608a015160808b0151840b62ffffff908116600160301b0262ffffff60301b1992860b821663010000000265ffffffffffff199094169690950b1694909417179290921617905560a086015180518795509293506124dd9260038501929190910190614e7e565b5060c082015180516124f9916004840191602090910190614e7e565b505060175483516020850151604051630464f33160e31b8152600481019290925260248201526001600160a01b039091169150632327998890604401600060405180830381600087803b15801561254f57600080fd5b505af1158015612563573d6000803e3d6000fd5b505050506125c0565b81516000908152601360209081526040808320546001600160a01b03168352601c90915290205460ff16156125c05781516000908152601360205260409020546125c0906001600160a01b0316600161414d565b505b50806125cd81615def565b915050611fc8565b5050505050565b3360009081526004602052604090205460ff166126245760405162461bcd60e51b8152600401610caf906020808252600490820152630494431360e41b604082015260600190565b6001600160a01b0384166000908152601460205260409020548383836126498461148c565b1561267f5760405162461bcd60e51b8152600401610caf906020808252600490820152634944313360e01b604082015260600190565b6000848152601360205260409020546001600160a01b03166126cc5760405162461bcd60e51b8152600401610caf9060208082526004908201526312510c4d60e21b604082015260600190565b6126d6848461427b565b80156126ee57506126ee838360ff168360ff16614325565b6127235760405162461bcd60e51b8152600401610caf906020808252600490820152634944313560e01b604082015260600190565b611942888888886143b8565b6000828152601d6020908152604080832084845282529182902080548351818402810184019094528084526060939283018282801561278d57602002820191906000526020600020905b815481526020019060010190808311612779575b5050505050905092915050565b60005b8151811015611b13576127d68282815181106127c957634e487b7160e01b600052603260045260246000fd5b6020026020010151611b17565b806127e081615def565b91505061279d565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915250600090815260096020908152604091829020825160a0810184528154815260019091015460ff8082169383019390935261010081048316938201939093526201000083049091166060820152630100000090910464ffffffffff16608082015290565b61287f6130bc565b6001600160a01b038216158015906128b657506001600160a01b03821660009081526004602052604090205460ff16151581151514155b6128bf57600080fd5b6001600160a01b038216600081815260046020908152604091829020805460ff19168515159081179091558251938452908301527f58d7a3ccc34541e162fcfc87b84be7b78c34d1e1e7f15de6e4dd67d0fe70aecd9101611074565b6129236130bc565b6001600160a01b03811661296b5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610caf565b600154600160a81b900460ff16156129bb5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b6044820152606401610caf565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610f0b565b6005602052816000526040600020818154811061127e57600080fd5b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c0810191909152600082815260086020908152604091829020825160e0810184528154815260018201549281019290925260028082015480820b820b820b9484019490945263010000008404810b810b810b6060840152600160301b909304830b830b90920b608082015260038201805491929160a084019190612b0790615db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612b3390615db4565b8015612b805780601f10612b5557610100808354040283529160200191612b80565b820191906000526020600020905b815481529060010190602001808311612b6357829003601f168201915b50505050508152602001600482018054612b9990615db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612bc590615db4565b8015612c125780601f10612be757610100808354040283529160200191612c12565b820191906000526020600020905b815481529060010190602001808311612bf557829003601f168201915b5050505050815250509050919050565b60215460405163645de6cb60e11b81526000916001600160a01b03169063c8bbcd9690612c53908590600401615bc7565b60206040518083038186803b158015612c6b57600080fd5b505afa158015612c7f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e39190615428565b612cac8161148c565b15612cdf5760405162461bcd60e51b815260206004820152600360248201526212510d60ea1b6044820152606401610caf565b6000818152600d602052604090205460ff16612d235760405162461bcd60e51b815260206004820152600360248201526249443560e81b6044820152606401610caf565b610fdf81614756565b6007602052816000526040600020818154811061127e57600080fd5b6017546001600160a01b038381166000908152601460205260408082205490516366b6f1a960e01b81526004810191909152909291909116906366b6f1a99060240160206040518083038186803b158015612da257600080fd5b505afa158015612db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dda919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b158015612e1f57600080fd5b505afa158015612e33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e57919061545c565b6001600160a01b03841660009081526014602052604090205414612e7a57600080fd5b8115612ff1576001600160a01b03831660009081526014602090815260408083205483526022825291829020825160808101845281548152600190910154600281810b810b810b9383019390935263010000008104830b830b830b93820193909352600160301b909204810b810b900b6060820152612ef890614b4f565b612f0157600080fd5b6001600160a01b03831660008181526014602081815260408084208054855260228352818520600a84528286208154815560019182018054929091018054600293840b840b62ffffff90811662ffffff198316811784558454630100000090819004870b870b83160265ffffffffffff1990931617919091178083559254600160301b90819004850b90940b1690920262ffffff60301b199091161790555480855290842094909352527f6dbef43d1350d7949e2842bb76a35b376ad7765645efae3a02965a48a88eebd9918190612fd882611e27565b604051612fe89493929190615a21565b60405180910390a15b612ffc83600061414d565b613007836000614bc6565b601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b15801561304d57600080fd5b505af1158015613061573d6000803e3d6000fd5b505050506001600160a01b038316600081815260146020908152604091829020548251938452908301527fb71d01900104b9abac3b5fb2ce8418fe7a6cdacf50d1f3cd0f9e4497961f4fdc91015b60405180910390a1505050565b6000546201000090046001600160a01b031633146131345760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610caf565b565b60006131458360000151612a50565b9050613167836060015160ff9081166000908152601060205260409020541690565b806131965750606083015160ff9081166000908152601160205260409020541680156131965750428160200151105b156133605782516000908152600960209081526040918290208551808255918601516001909101805484880151606089015160808a015164ffffffffff1663010000000267ffffffffff0000001960ff92831662010000021667ffffffffffff0000199383166101000261ffff199095169290961691909117929092171692909217919091179055601754915163602726b560e11b81526001600160a01b039092169163c04e4d6a9161324f9160040190815260200190565b600060405180830381600087803b15801561326957600080fd5b505af115801561327d573d6000803e3d6000fd5b505084516000908152600d6020908152604091829020805460ff1916600117905586516017548351638f0ac45360e01b815293517f9b6a2889290ea187763cae1d385adecd9295e6c5e49527154213bbfa4e1aba7396508a9550889492938a936001600160a01b0390931692638f0ac4539260048083019392829003018186803b15801561330a57600080fd5b505afa15801561331e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613342919061545c565b604051613353959493929190615afe565b60405180910390a16111e0565b606083015160ff90811660009081526011602052604090205416801561338a575042816020015110155b156111e05782516000908152601360208181526040808420546001600160a01b039081168552601e8352818520805460ff191660019081179091558851865293909252909220546111e092169061414d565b6133e581614b4f565b156138505760006133f98260000151611e27565b82516000908152600a60208181526040808420815160808101835281548152600191820154600281810b810b810b838701526301000000808304820b820b820b84870152600160301b92839004820b820b820b6060808601919091528c518a529787528589208c51808255888e0151919096018054888f01519a8f015192850b62ffffff90811665ffffffffffff19909216919091179a850b81169093029990991762ffffff60301b1916920b1690910217909455845260188252808420429055601254875185526013909252928390205492516333dfec9960e21b81526001600160a01b039384166004820152939450909291169063cf7fb2649060240160206040518083038186803b15801561351057600080fd5b505afa158015613524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135489190615428565b156136195782516000908152601360209081526040808320546001600160a01b03168352601b90915290205460ff16806135a8575082516000908152601360209081526040808320546001600160a01b03168352601e90915290205460ff165b156136145782516000908152601360208181526040808420546001600160a01b039081168552601b8352818520805460ff19908116909155885186528484528286205482168652601e84528286208054909116905587518552929091528220546136149291169061414d565b613810565b6012548351600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b15801561366f57600080fd5b505afa158015613683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a79190615428565b158015613775575060215483516000908152600b602052604090205484516001600160a01b03909216916342fa646a919085906136e390611e27565b87516000908152600b60209081526040808320548352600f90915290205460ff166040518563ffffffff1660e01b81526004016137239493929190615c78565b60206040518083038186803b15801561373b57600080fd5b505afa15801561374f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137739190615428565b155b1561381057825160009081526013602052604090205461379f906001600160a01b0316600161414d565b8251600090815260226020908152604091829020835181559083015160019091018054928401516060850151600290810b62ffffff908116600160301b0262ffffff60301b1993830b821663010000000265ffffffffffff199097169590920b169390931793909317929092161790555b82517f6dbef43d1350d7949e2842bb76a35b376ad7765645efae3a02965a48a88eebd99085908561384082611e27565b604051611e1994939291906159c1565b6012548151600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b1580156138a657600080fd5b505afa1580156138ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138de9190615428565b61392f5780516000908152601360208181526040808420546001600160a01b039081168552601b8352818520805460ff1916600190811790915586518652939092529092205461392f92169061414d565b80516000908152601360205260409081902054825191517fc923185f6beaaa6dfa175827bef4c69973568e863e15215dc86c57697100be2e926110749286926001600160a01b039091169190869061596d565b600061398d82612a50565b90504281602001511115613cb6576000828152600b60205260408120546139b390614c83565b60125460a084015160c08501516040519394506001600160a01b039092169263e3eb40d99287926139e99290919060200161587e565b60408051808303601f1901815291815260208781015160008a8152600b8352838120548152600f9092529181205460ff16613a25576003613a28565b60025b876040518763ffffffff1660e01b8152600401613a4a96959493929190615a74565b602060405180830381600087803b158015613a6457600080fd5b505af1158015613a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9c9190615125565b5060125460408051622610c560e41b815290516000926001600160a01b03169163dd5adfa39160019184916302610c5091600480820192602092909190829003018186803b158015613aed57600080fd5b505afa158015613b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b25919061545c565b613b2f9190615d71565b6040518263ffffffff1660e01b8152600401613b4d91815260200190565b60206040518083038186803b158015613b6557600080fd5b505afa158015613b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b9d9190615125565b8351600090815260136020908152604080832080546001600160a01b0319166001600160a01b0386811691821790925588519085526014845282852055601c8352818420805460ff199081166001908117909255601f85528386208054909116909117905560175482516389daf7eb60e01b8152925195965016936389daf7eb93600480840194938390030190829087803b158015613c3b57600080fd5b505af1158015613c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c73919061545c565b5082517f889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f9082908585613ca583611e27565b604051611e199594939291906158bd565b601760009054906101000a90046001600160a01b03166001600160a01b03166389daf7eb6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015613d0657600080fd5b505af1158015613d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d67919061545c565b602154604051632c85b65d60e21b81526060916001600160a01b03169063b216d97490613d6f908590600401615916565b60006040518083038186803b158015613d8757600080fd5b505afa158015613d9b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114e39190810190615386565b60008381526020805260409020548214610d67576000908152601d60209081526040808320848452825280832080546001810182559084528284200185905593825280529190912055565b815160009081526008602090815260409182902084518155818501516001820155918401516002808401805460608801516080890151840b62ffffff908116600160301b0262ffffff60301b1992860b821663010000000265ffffffffffff199094169690950b1694909417179290921617905560a08401518051859392613e9d926003850192910190614e7e565b5060c08201518051613eb9916004840191602090910190614e7e565b505082516000908152600b6020908152604091829020849055601754855191860151925163e9c962eb60e01b815260048101929092526024820192909252604481018490526001600160a01b03909116915063e9c962eb90606401600060405180830381600087803b158015613f2e57600080fd5b505af1158015613f42573d6000803e3d6000fd5b505083516000908152600c60209081526040808320805460ff1916600190811790915581516080808201845289518252838a0151600290810b8387019081526060808d0151830b858801908152938d0151830b9085019081528c518952600a885286892094518555905193909401805492519451820b62ffffff908116600160301b0262ffffff60301b1996840b821663010000000265ffffffffffff199095169590930b1693909317919091179290921691909117905586518352601882529182902042905585516017548351632bffd69960e21b815293517faba5c0e34b9b54828db4e0ac6b951ca282a0b171289eebf93353c296f9e8261396508995508794929389936001600160a01b039093169263afff5a649260048083019392829003018186803b15801561407557600080fd5b505afa158015614089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140ad919061545c565b87516140b890611e27565b6040516130af96959493929190615ac1565b6000838152601360205260408120546140ee916001600160a01b0390911690614bc6565b80156140fd576140fd82614ce7565b6000838152601360209081526040918290205482516001600160a01b0390911681529081018590527fb71d01900104b9abac3b5fb2ce8418fe7a6cdacf50d1f3cd0f9e4497961f4fdc91016130af565b6012546040516333dfec9960e21b81526001600160a01b03848116600483015283151592169063cf7fb2649060240160206040518083038186803b15801561419457600080fd5b505afa1580156141a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141cc9190615428565b151514611b1357601254604051637f8c2d6160e01b81526001600160a01b038481166004830152831515602483015290911690637f8c2d6190604401600060405180830381600087803b15801561422257600080fd5b505af1158015614236573d6000803e3d6000fd5b5050604080516001600160a01b038616815284151560208201527f2b8992e59f9813c2f92be2374e9bdd5384146ff8f719b038fbaf7d3dbfa78fde9350019050611074565b6021546000838152600b60209081526040808320548352600f90915281205490916001600160a01b03169063879c0c5e9060ff166040516001600160e01b031960e084901b16815290151560048201526024810185905260440160206040518083038186803b1580156142ed57600080fd5b505afa158015614301573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f439190615428565b6021546040516303727eb960e01b81526004810185905260248101849052604481018390526000916001600160a01b0316906303727eb99060640160206040518083038186803b15801561437857600080fd5b505afa15801561438c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143b09190615428565b949350505050565b6017546001600160a01b038581166000908152601460205260408082205490516366b6f1a960e01b81526004810191909152909291909116906366b6f1a99060240160206040518083038186803b15801561441257600080fd5b505afa158015614426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061444a919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b15801561448f57600080fd5b505afa1580156144a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144c7919061545c565b6001600160a01b038616600090815260146020526040902054146144ea57600080fd5b6144f585600061414d565b6144ff8585614bc6565b601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b15801561454557600080fd5b505af1158015614559573d6000803e3d6000fd5b50506040805160a0810182526001600160a01b0389166000908152601460209081528382205480845260ff8a81168386015289811685870152908352600b8252848320548352600f90915292902054909350606084019250166145bd57600b6145c0565b60085b60ff9081168252600060209283018190526001600160a01b03891681526014835260408082208054835260098086528284208751815587870151600191820180548a8701516060808d015160809d8e0151958c1661ffff1990941693909317610100928c1683021767ffffffffffff0000191662010000938c169390930267ffffffffff000000191692909217630100000064ffffffffff95861602179092559454808852600b8a5286882054948a5286882087518281529a8b019590955295890195909552825493880193909352015480851696860196909652600886901c841660a0860152601086901c90931660c085015260189490941c90911660e0830152918101919091527f9b6a2889290ea187763cae1d385adecd9295e6c5e49527154213bbfa4e1aba73906101200160405180910390a16001600160a01b0385166000818152601460209081526040918290205482519384529083015281018590527f1bf3a61a401436c0f119e17875fafabde9c95fbb6787cef2850d2d4a8f31e4449060600160405180910390a15050505050565b6000614761826127e8565b9050600061476e83612a50565b6017546040516366b6f1a960e01b8152600481018690529192506000916001600160a01b03909116906366b6f1a99060240160206040518083038186803b1580156147b857600080fd5b505afa1580156147cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147f0919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b15801561483557600080fd5b505afa158015614849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486d919061545c565b84146148a15760405162461bcd60e51b815260206004820152600360248201526224a21b60e91b6044820152606401610caf565b606083015160ff9081166000908152601060205260409020541615614b135782516000908152601360209081526040808320546001600160a01b03168352601b90915290205460ff1615614915578251600090815260136020526040812054614915916001600160a01b039091169061414d565b600061492084614dca565b9050600381148015614947575083516000908152600b602052604090205461494790614e0e565b1561495f57835161495a908360016140ca565b614b0d565b6012548451600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b1580156149b557600080fd5b505afa1580156149c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149ed9190615428565b614a83578351600090815260136020526040902054614a15906001600160a01b031682614bc6565b614a1e82614ce7565b835160009081526013602090815260409182902054865183516001600160a01b039092168252918101919091529081018290527f1bf3a61a401436c0f119e17875fafabde9c95fbb6787cef2850d2d4a8f31e4449060600160405180910390a1614b0d565b601760009054906101000a90046001600160a01b03166001600160a01b03166377d078d76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614ad357600080fd5b505af1158015614ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b0b919061545c565b505b506111e0565b606083015160ff908116600090815260116020526040902054168015614b3c5750428260200151105b156111e05782516111e0908260016140ca565b60215481516000908152600b60209081526040808320548352600f825280832054918501518186015160608701519251631578f73160e31b815260ff90941615156004850152600291820b6024850152810b60448401520b606482015290916001600160a01b03169063abc7b98890608401612c53565b60125460405163b91f5e3560e01b81526001600160a01b038481166004830152602482018490529091169063b91f5e3590604401600060405180830381600087803b158015614c1457600080fd5b505af1158015614c28573d6000803e3d6000fd5b505050506000811415614c5c576001600160a01b0382166000908152601660205260409020805460ff191660011790555050565b6001600160a01b0382166000908152601560205260409020805460ff191660011790555050565b6040805160018082528183019092526060916000919060208083019080368337019050509050614cb583612328615d59565b81600081518110614cd657634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b601760009054906101000a90046001600160a01b03166001600160a01b03166377d078d76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614d3757600080fd5b505af1158015614d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d6f919061545c565b50601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b158015614db657600080fd5b505af11580156125d5573d6000803e3d6000fd5b6000816040015160ff16826020015160ff161415614dea57506003919050565b816040015160ff16826020015160ff1611614e065760026114e3565b600192915050565b600081600714806114e357505060021490565b828054828255906000526020600020908101928215614e6e579160200282015b82811115614e6e5782518051614e5e918491602090910190614e7e565b5091602001919060010190614e41565b50614e7a929150614efe565b5090565b828054614e8a90615db4565b90600052602060002090601f016020900481019282614eac5760008555614ef2565b82601f10614ec557805160ff1916838001178555614ef2565b82800160010185558215614ef2579182015b82811115614ef2578251825591602001919060010190614ed7565b50614e7a929150614f1b565b80821115614e7a576000614f128282614f30565b50600101614efe565b5b80821115614e7a5760008155600101614f1c565b508054614f3c90615db4565b6000825580601f10614f4c575050565b601f016020900490600052602060002090810190610fdf9190614f1b565b6000614f7d614f7884615d32565b615cdf565b9050828152838383011115614f9157600080fd5b828260208301376000602084830101529392505050565b8035614fb381615e36565b919050565b600082601f830112614fc8578081fd5b81356020614fd8614f7883615d0f565b80838252828201915082860187848660051b8901011115614ff7578586fd5b855b8581101561504a5781356001600160401b03811115615016578788fd5b8801603f81018a13615026578788fd5b6150378a8783013560408401614f6a565b8552509284019290840190600101614ff9565b5090979650505050505050565b600082601f830112615067578081fd5b81356020615077614f7883615d0f565b80838252828201915082860187848660051b8901011115615096578586fd5b855b8581101561504a57813584529284019290840190600101615098565b8051600281900b8114614fb357600080fd5b600082601f8301126150d6578081fd5b81516150e4614f7882615d32565b8181528460208386010111156150f8578283fd5b6143b0826020830160208701615d88565b60006020828403121561511a578081fd5b8135611f4381615e36565b600060208284031215615136578081fd5b8151611f4381615e36565b600080600080600080600060e0888a03121561515b578283fd5b61516488614fa8565b965060208801356001600160401b038082111561517f578485fd5b61518b8b838c01615057565b975061519960408b01614fa8565b965060608a01359150808211156151ae578485fd5b6151ba8b838c01615057565b95506151c860808b01614fa8565b945060a08a01359150808211156151dd578384fd5b6151e98b838c01615057565b935060c08a01359150808211156151fe578283fd5b5061520b8a828b01615057565b91505092959891949750929550565b6000806040838503121561522c578182fd5b823561523781615e36565b9150602083013561524781615e4b565b809150509250929050565b60008060008060808587031215615267578182fd5b843561527281615e36565b9350602085013561528281615e36565b9250604085013561529281615e36565b915060608501356152a281615e36565b939692955090935050565b600080600080608085870312156152c2578182fd5b84356152cd81615e36565b93506020850135925060408501356152e481615e59565b915060608501356152a281615e59565b60006020808385031215615306578182fd5b82356001600160401b0381111561531b578283fd5b8301601f8101851361532b578283fd5b8035615339614f7882615d0f565b80828252848201915084840188868560051b8701011115615358578687fd5b8694505b8385101561537a57803583526001949094019391850191850161535c565b50979650505050505050565b60006020808385031215615398578182fd5b82516001600160401b038111156153ad578283fd5b8301601f810185136153bd578283fd5b80516153cb614f7882615d0f565b80828252848201915084840188868560051b87010111156153ea578687fd5b8694505b8385101561537a5780518352600194909401939185019185016153ee565b60006020828403121561541d578081fd5b8135611f4381615e4b565b600060208284031215615439578081fd5b8151611f4381615e4b565b600060208284031215615455578081fd5b5035919050565b60006020828403121561546d578081fd5b5051919050565b600080600060608486031215615488578081fd5b8335925060208401356001600160401b038111156154a4578182fd5b6154b086828701614fb8565b925050604084013590509250925092565b600080600080608085870312156154d6578182fd5b8435935060208501356001600160401b038111156154f2578283fd5b6154fe87828801614fb8565b949794965050505060408301359260600135919050565b60008060408385031215615527578182fd5b50508035926020909101359150565b600060208284031215615547578081fd5b81356001600160401b0381111561555c578182fd5b8201601f8101841361556c578182fd5b6143b084823560208401614f6a565b60006020828403121561558c578081fd5b81516001600160401b03808211156155a2578283fd5b9083019060e082860312156155b5578283fd5b6155bd615cb7565b82518152602083015160208201526155d7604084016150b4565b60408201526155e8606084016150b4565b60608201526155f9608084016150b4565b608082015260a08301518281111561560f578485fd5b61561b878286016150c6565b60a08301525060c083015182811115615632578485fd5b61563e878286016150c6565b60c08301525095945050505050565b60006080828403121561565e578081fd5b604051608081018181106001600160401b038211171561568057615680615e20565b60405282518152615693602084016150b4565b60208201526156a4604084016150b4565b60408201526156b5606084016150b4565b60608201529392505050565b600060a082840312156156d2578081fd5b60405160a081018181106001600160401b03821117156156f4576156f4615e20565b60405282518152602083015161570981615e59565b6020820152604083015161571c81615e59565b6040820152606083015161572f81615e59565b6060820152608083015164ffffffffff8116811461574b578283fd5b60808201529392505050565b60008060408385031215615769578182fd5b82359150602083013561524781615e4b565b60008060006060848603121561578f578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b838110156157d5578151875295820195908201906001016157b9565b509495945050505050565b600081518084526157f8816020860160208601615d88565b601f01601f19169290920160200192915050565b8051825260208101516020830152604081015160020b6040830152606081015160020b6060830152608081015160020b6080830152600060a082015160e060a085015261585c60e08501826157e0565b905060c083015184820360c086015261587582826157e0565b95945050505050565b60008351615890818460208801615d88565b630103b39960e51b90830190815283516158b1816004840160208801615d88565b01600401949350505050565b60018060a01b038616815284602082015260a0604082015260006158e460a083018661580c565b82810360608401526158f681866157a6565b9050828103608084015261590a81856157a6565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561594e57835183529284019291840191600101615932565b50909695505050505050565b602081526000611f4360208301846157a6565b8481526001600160a01b03841660208201526040810183905260e08101615875606083018480518252602081015160020b6020830152604081015160020b6040830152606081015160020b60608301525050565b848152836020820152615a01604082018480518252602081015160020b6020830152604081015160020b6040830152606081015160020b60608301525050565b60e060c08201526000615a1760e08301846157a6565b9695505050505050565b8481528360208201528254604082015260006001840154600281810b810b60608501528160181c810b810b60808501528160301c810b810b60a0850152505060e060c0830152615a1760e08301846157a6565b86815260c060208201526000615a8d60c08301886157e0565b86604084015285606084015260ff8516608084015282810360a0840152615ab481856157a6565b9998505050505050505050565b86815285602082015284604082015260c060608201526000615ae660c083018661580c565b84608084015282810360a0840152615ab481856157a6565b85815260208101859052604081018490526101208101615b5c60608301858051825260ff602082015116602083015260ff604082015116604083015260ff606082015116606083015264ffffffffff60808201511660808301525050565b826101008301529695505050505050565b8781528660208201528560020b60408201528460020b60608201528360020b608082015260e060a08201526000615ba760e08301856157e0565b82810360c0840152615bb981856157e0565b9a9950505050505050505050565b602081526000611f4360208301846157e0565b604081526000615bed60408301856157e0565b828103602084015261587581856157e0565b60208082526003908201526249443960e81b604082015260600190565b602081526000611f43602083018461580c565b60a081016114e382848051825260ff602082015116602083015260ff604082015116604083015260ff606082015116606083015264ffffffffff60808201511660808301525050565b848152608060208201526000615c9160808301866157a6565b8281036040840152615ca381866157a6565b915050821515606083015295945050505050565b60405160e081016001600160401b0381118282101715615cd957615cd9615e20565b60405290565b604051601f8201601f191681016001600160401b0381118282101715615d0757615d07615e20565b604052919050565b60006001600160401b03821115615d2857615d28615e20565b5060051b60200190565b60006001600160401b03821115615d4b57615d4b615e20565b50601f01601f191660200190565b60008219821115615d6c57615d6c615e0a565b500190565b600082821015615d8357615d83615e0a565b500390565b60005b83811015615da3578181015183820152602001615d8b565b838111156111e05750506000910152565b600181811c90821680615dc857607f821691505b60208210811415615de957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e0357615e03615e0a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610fdf57600080fd5b8015158114610fdf57600080fd5b60ff81168114610fdf57600080fdfea264697066735822122016866ff4599bc42d351912b8ff2809ad0e70ac10c847794745144d5d59526a0164736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106104285760003560e01c806369a5492e1161022b578063b09bd9e311610130578063dec72d63116100b8578063e87a6b8511610087578063e87a6b8514610bb7578063efccb47a14610bda578063f89c6f1814610bed578063fa59104f14610c16578063feee9ca314610c3957600080fd5b8063dec72d6314610b4e578063e3f4c7c914610b71578063e59aff4b14610b84578063e7015ab214610b9757600080fd5b8063c39718a8116100ff578063c39718a814610ad2578063c3b83f5f14610af5578063c475e0b314610b08578063c48e62f114610b1b578063c8bbcd9614610b3b57600080fd5b8063b09bd9e314610a3b578063b4976d7b14610a7c578063bc93233f14610a9c578063be27f89d14610aaf57600080fd5b806391b4ded9116101b3578063a400a89111610182578063a400a891146109da578063a47a874f146109ed578063a50267a514610a00578063ac2c957c14610a20578063ae71dcdf14610a3357600080fd5b806391b4ded91461093357806393f4452e1461093c57806394db3a96146109a75780639aceb36e146109ba57600080fd5b80638067cd53116101fa5780638067cd53146108b2578063861de52c146108c55780638c4e8cb5146108e45780638da5cb5b146109075780638ec2c5a61461092057600080fd5b806369a5492e1461084f57806370aadcc41461087257806379ba5097146108925780637df8b8021461089a57600080fd5b806336c0d8551161033157806353a47bb7116102b957806360b4df851161028857806360b4df8514610792578063621da703146107f3578063627e7b4214610806578063630e2c351461081957806367674b141461082c57600080fd5b806353a47bb714610729578063557db4481461073c5780635b9fbe07146107625780635c975abb1461078557600080fd5b8063459c0bd011610300578063459c0bd0146106b857806346cd8622146106c0578063489f4b97146106d35780634cf5d715146106e65780635034c5881461070957600080fd5b806336c0d8551461063f5780633ec70ca514610662578063436d765a146106855780634458e51d146106a557600080fd5b80631afed5cc116103b45780632f73199d116103835780632f73199d146105e65780632fe28c48146105f95780632fff70201461061c578063300a02981461062457806331dca3841461062c57600080fd5b80631afed5cc146105945780632082af141461059d5780632a4a3e7c146105b05780632b7ac3f3146105d357600080fd5b806310063fdc116103fb57806310063fdc1461051d57806313251f5e1461054857806313af40351461055b5780631627540c1461056e57806316c38b3c1461058157600080fd5b806306c933d81461042d57806307d3d3f314610465578063097c9e0f1461047a5780630b5cde461461049b575b600080fd5b61045061043b366004615109565b60046020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61047861047336600461521a565b610c67565b005b61048d610488366004615515565b610d6c565b60405190815260200161045c565b6104e66104a9366004615444565b6009602052600090815260409020805460019091015460ff80821691610100810482169162010000820416906301000000900464ffffffffff1685565b6040805195865260ff948516602087015292841692850192909252909116606083015264ffffffffff16608082015260a00161045c565b601254610530906001600160a01b031681565b6040516001600160a01b03909116815260200161045c565b61048d61055636600461577b565b610d9d565b610478610569366004615109565b610ddb565b61047861057c366004615109565b610f16565b61047861058f36600461540c565b610f6c565b61048d61232881565b6104786105ab366004615757565b610fe2565b6104506105be366004615109565b601e6020526000908152604090205460ff1681565b602154610530906001600160a01b031681565b6104786105f4366004615474565b611080565b610450610607366004615444565b6000908152600e602052604090205460ff1690565b61048d600181565b61048d600281565b61047861063a366004615757565b6111e6565b61045061064d366004615109565b601b6020526000908152604090205460ff1681565b610450610670366004615444565b600d6020526000908152604090205460ff1681565b610698610693366004615515565b611262565b60405161045c9190615bc7565b6104786106b3366004615474565b61131b565b61048d600381565b6104786106ce366004615757565b611410565b6104506106e1366004615444565b61148c565b6104506106f4366004615444565b600f6020526000908152604090205460ff1681565b61048d610717366004615444565b60186020526000908152604090205481565b600154610530906001600160a01b031681565b61074f61074a366004615444565b6114e9565b60405161045c9796959493929190615b6d565b610450610770366004615109565b60156020526000908152604090205460ff1681565b6003546104509060ff1681565b6107cf6107a0366004615444565b6000908152600a6020526040902060010154600281810b9263010000008304820b92600160301b900490910b90565b60408051600294850b815292840b6020840152920b9181019190915260600161045c565b610450610801366004615444565b611644565b610478610814366004615141565b61166e565b610478610827366004615757565b61194c565b61045061083a366004615444565b600c6020526000908152604090205460ff1681565b61045061085d366004615444565b600e6020526000908152604090205460ff1681565b61048d610880366004615444565b600b6020526000908152604090205481565b6104786119c8565b6003546105309061010090046001600160a01b031681565b6104786108c03660046152f4565b611ac5565b61048d6108d3366004615444565b602080526000908152604090205481565b6104506108f2366004615109565b601c6020526000908152604090205460ff1681565b600054610530906201000090046001600160a01b031681565b61047861092e366004615444565b611b17565b61048d60025481565b61097d61094a366004615444565b600a6020526000908152604090208054600190910154600281810b9163010000008104820b91600160301b909104900b84565b60408051948552600293840b602086015291830b91840191909152900b606082015260800161045c565b6104786109b5366004615252565b611d24565b6109cd6109c8366004615444565b611e27565b60405161045c919061595a565b6104786109e83660046154c1565b611f4a565b6104786109fb3660046152ad565b6125dc565b610a13610a0e366004615515565b61272f565b60405161045c9190615916565b610478610a2e3660046152f4565b61279a565b61048d600081565b61097d610a49366004615444565b60226020526000908152604090208054600190910154600281810b9163010000008104820b91600160301b909104900b84565b610a8f610a8a366004615444565b6127e8565b60405161045c9190615c2f565b610478610aaa36600461521a565b612877565b610450610abd366004615444565b6000908152600f602052604090205460ff1690565b610450610ae0366004615109565b601f6020526000908152604090205460ff1681565b610478610b03366004615109565b61291b565b610698610b16366004615515565b612a34565b610b2e610b29366004615444565b612a50565b60405161045c9190615c1c565b610450610b49366004615536565b612c22565b610450610b5c366004615109565b60166020526000908152604090205460ff1681565b601754610530906001600160a01b031681565b610478610b92366004615444565b612ca3565b61048d610ba5366004615109565b60146020526000908152604090205481565b610450610bc5366004615444565b60106020526000908152604090205460ff1681565b610698610be8366004615515565b612d2c565b610530610bfb366004615444565b6013602052600090815260409020546001600160a01b031681565b610450610c24366004615444565b60116020526000908152604090205460ff1681565b610450610c47366004615515565b601a60209081526000928352604080842090915290825290205460ff1681565b3360009081526004602052604090205460ff16610cb85760405162461bcd60e51b8152600401610caf906020808252600490820152630494431360e41b604082015260600190565b60405180910390fd5b6001600160a01b038216600090815260146020526040902054610cda8161148c565b15610d105760405162461bcd60e51b8152600401610caf906020808252600490820152634944313160e01b604082015260600190565b6000818152601360205260409020546001600160a01b0316610d5d5760405162461bcd60e51b8152600401610caf9060208082526004908201526324a2189960e11b604082015260600190565b610d678383612d48565b505050565b60196020528160005260406000208181548110610d8857600080fd5b90600052602060002001600091509150505481565b601d6020528260005260406000206020528160005260406000208181548110610dc557600080fd5b9060005260206000200160009250925050505481565b6001600160a01b038116610e315760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f742062652030000000000000006044820152606401610caf565b600154600160a01b900460ff1615610e9d5760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b6064820152608401610caf565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b610f1e6130bc565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290602001610f0b565b610f746130bc565b60035460ff1615158115151415610f885750565b6003805460ff191682151590811790915560ff1615610fa657426002555b60035460405160ff909116151581527f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec590602001610f0b565b50565b610fea6130bc565b6000828152600e602052604090205460ff16801561101d57506000828152600f602052604090205460ff16151581151514155b61102657600080fd5b6000828152600f6020908152604091829020805460ff19168415159081179091558251858152918201527f5c90f67f3547cb9c3f1b7612610d878aa4f00e88a643d2c6b658c1f9005fdcda91015b60405180910390a15050565b60035461010090046001600160a01b031633146110af5760405162461bcd60e51b8152600401610caf90615bff565b600083815260066020908152604090912083516110ce92850190614e21565b5060005b82518110156111e05760008382815181106110fd57634e487b7160e01b600052603260045260246000fd5b602002602001015180602001905181019061111891906156c1565b60175481516040516301ca5e7f60e51b815260048101919091529192506001600160a01b03169063394bcfe09060240160206040518083038186803b15801561116057600080fd5b505afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111989190615428565b1580156111bd575080516000908152601360205260409020546001600160a01b031615155b156111cd576111cd858285613136565b50806111d881615def565b9150506110d2565b50505050565b6111ee6130bc565b6000828152600e602052604090205460ff161515811515141561121057600080fd5b6000828152600e6020908152604091829020805460ff19168415159081179091558251858152918201527f0a7daa18eab3013f94989c4e384004cab457b607ce1e975b8de79c4da52da9549101611074565b6006602052816000526040600020818154811061127e57600080fd5b9060005260206000200160009150915050805461129a90615db4565b80601f01602080910402602001604051908101604052809291908181526020018280546112c690615db4565b80156113135780601f106112e857610100808354040283529160200191611313565b820191906000526020600020905b8154815290600101906020018083116112f657829003601f168201915b505050505081565b60035461010090046001600160a01b0316331461134a5760405162461bcd60e51b8152600401610caf90615bff565b6000838152600760209081526040909120835161136992850190614e21565b5060005b82518110156111e057600083828151811061139857634e487b7160e01b600052603260045260246000fd5b60200260200101518060200190518101906113b3919061564d565b80516000908152600c602052604090205490915060ff1680156113ee575080516000908152601360205260409020546001600160a01b031615155b156113fd576113fd85826133dc565b508061140881615def565b91505061136d565b6114186130bc565b60008281526011602052604090205460ff161515811515141561143a57600080fd5b600082815260116020908152604091829020805460ff19168415159081179091558251858152918201527fbff84c147d533b99d8802295ac70c53aa7d9ac4e520dcd0200d2f434c34b52a39101611074565b6000818152601360209081526040808320546001600160a01b03168352601590915281205460ff16806114e357506000828152601360209081526040808320546001600160a01b03168352601690915290205460ff165b92915050565b6008602052600090815260409020805460018201546002808401546003850180549495939482840b9463010000008404850b94600160301b90940490930b92919061153390615db4565b80601f016020809104026020016040519081016040528092919081815260200182805461155f90615db4565b80156115ac5780601f10611581576101008083540402835291602001916115ac565b820191906000526020600020905b81548152906001019060200180831161158f57829003601f168201915b5050505050908060040180546115c190615db4565b80601f01602080910402602001604051908101604052809291908181526020018280546115ed90615db4565b801561163a5780601f1061160f5761010080835404028352916020019161163a565b820191906000526020600020905b81548152906001019060200180831161161d57829003601f168201915b5050505050905087565b60006114e3611652836127e8565b6060015160ff9081166000908152601060205260409020541690565b600054610100900460ff166116895760005460ff161561168d565b303b155b6116f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610caf565b600054610100900460ff16158015611712576000805461ffff19166101011790555b61171b88610ddb565b60005b875181101561178d576001600e60008a848151811061174d57634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061178590615def565b91505061171e565b5060005b8551811015611800576001600f60008884815181106117c057634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806117f890615def565b915050611791565b5060005b83518110156118735760016010600086848151811061183357634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061186b90615def565b915050611804565b5060005b82518110156118e6576001601160008584815181106118a657634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806118de90615def565b915050611877565b50601280546001600160a01b038089166001600160a01b03199283161790925560178054878416921691909117905588166000908152600460205260409020805460ff191660011790558015611942576000805461ff00191690555b5050505050505050565b6119546130bc565b60008281526010602052604090205460ff161515811515141561197657600080fd5b600082815260106020908152604091829020805460ff19168415159081179091558251858152918201527f463b22afe346e0b505997c71b3cb5c2a507adb0214a645f6aede655b186917179101611074565b6001546001600160a01b03163314611a405760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610caf565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b60005b8151811015611b1357611b01828281518110611af457634e487b7160e01b600052603260045260246000fd5b6020026020010151612ca3565b80611b0b81615def565b915050611ac8565b5050565b6000818152601360205260409020546001600160a01b03161580611b8057506000818152601360209081526040808320546001600160a01b03168352601690915290205460ff168015611b8057506000818152601360205260409020546001600160a01b031615155b611bb25760405162461bcd60e51b815260206004820152600360248201526249443160e81b6044820152606401610caf565b6000818152600c602052604090205460ff16611bf65760405162461bcd60e51b815260206004820152600360248201526224a21960e91b6044820152606401610caf565b60175460408051634b40849760e01b8152905183926001600160a01b0316916303aac5d5918391634b408497916004808301926020929190829003018186803b158015611c4257600080fd5b505afa158015611c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c7a919061545c565b6040518263ffffffff1660e01b8152600401611c9891815260200190565b60206040518083038186803b158015611cb057600080fd5b505afa158015611cc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce8919061545c565b14611d1b5760405162461bcd60e51b815260206004820152600360248201526249443360e81b6044820152606401610caf565b610fdf81613982565b611d2c6130bc565b6001600160a01b038416151580611d4b57506001600160a01b03831615155b80611d5e57506001600160a01b03821615155b80611d7157506001600160a01b03811615155b611d7a57600080fd5b601280546001600160a01b03199081166001600160a01b0385811691821790935560178054831687851690811790915560038054610100600160a81b0319166101008a8716908102919091179091556021805490941694861694851790935560408051938452602084019190915282015260608101919091527f4c84616e9e609cf4ac55d948b151efc8a5a3fc742345ad2fe2149dd68e400b9e906080015b60405180910390a150505050565b60408051600380825260808201909252606091600091906020820184803683375050506000848152600a60205260408120600101548251929350600290810b900b91839190611e8657634e487b7160e01b600052603260045260246000fd5b602002602001018181525050600a600084815260200190815260200160002060010160039054906101000a900460020b60020b81600181518110611eda57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050600a600084815260200190815260200160002060010160069054906101000a900460020b60020b81600281518110611f2e57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050611f4381613d3e565b9392505050565b60035461010090046001600160a01b03163314611f795760405162461bcd60e51b8152600401610caf90615bff565b60008481526005602090815260409091208451611f9892860190614e21565b50825115611fc5576000818152601a602090815260408083208584529091529020805460ff191660011790555b60005b83518110156125d5576000848281518110611ff357634e487b7160e01b600052603260045260246000fd5b602002602001015180602001905181019061200e919061557b565b6017548151604051631666d90f60e01b815260048101919091529192506001600160a01b031690631666d90f9060240160206040518083038186803b15801561205657600080fd5b505afa15801561206a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208e9190615428565b158015612122575060215460a082015160c08301516040516397dc205d60e01b81526001600160a01b03909316926397dc205d926120d0929091600401615bda565b60206040518083038186803b1580156120e857600080fd5b505afa1580156120fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121209190615428565b155b80156121315750428160200151115b15612153578051612143908486613dc3565b61214e868286613e0e565b6125c2565b6017548151604051631666d90f60e01b81526001600160a01b0390921691631666d90f916121879160040190815260200190565b60206040518083038186803b15801561219f57600080fd5b505afa1580156121b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d79190615428565b156125c25760006121eb8260000151612a50565b60215460a08085015190830151604051637fabe16b60e01b81529394506001600160a01b0390921692637fabe16b926122279291600401615bda565b60206040518083038186803b15801561223f57600080fd5b505afa158015612253573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122779190615428565b158061230a575060215460c08084015190830151604051637fabe16b60e01b81526001600160a01b0390931692637fabe16b926122b8929091600401615bda565b60206040518083038186803b1580156122d057600080fd5b505afa1580156122e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123089190615428565b155b80156123165750846007145b156123755781516000908152601360209081526040808320546001600160a01b03168352601c90915290205460ff1615612370578151612358906000806140ca565b8151612365908587613dc3565b612370878387613e0e565b6125c0565b80602001518260200151146125c0578151612391908587613dc3565b428260200151111561256c5781516000908152601360209081526040808320546001600160a01b03168352601f90915290205460ff1615612370576012548251600090815260136020908152604091829020549085015191516327ad762d60e21b81526001600160a01b039182166004820152602481019290925290911690639eb5d8b490604401600060405180830381600087803b15801561243357600080fd5b505af1158015612447573d6000803e3d6000fd5b5050835160009081526008602090815260409182902086518155818701516001820155918601516002808401805460608a015160808b0151840b62ffffff908116600160301b0262ffffff60301b1992860b821663010000000265ffffffffffff199094169690950b1694909417179290921617905560a086015180518795509293506124dd9260038501929190910190614e7e565b5060c082015180516124f9916004840191602090910190614e7e565b505060175483516020850151604051630464f33160e31b8152600481019290925260248201526001600160a01b039091169150632327998890604401600060405180830381600087803b15801561254f57600080fd5b505af1158015612563573d6000803e3d6000fd5b505050506125c0565b81516000908152601360209081526040808320546001600160a01b03168352601c90915290205460ff16156125c05781516000908152601360205260409020546125c0906001600160a01b0316600161414d565b505b50806125cd81615def565b915050611fc8565b5050505050565b3360009081526004602052604090205460ff166126245760405162461bcd60e51b8152600401610caf906020808252600490820152630494431360e41b604082015260600190565b6001600160a01b0384166000908152601460205260409020548383836126498461148c565b1561267f5760405162461bcd60e51b8152600401610caf906020808252600490820152634944313360e01b604082015260600190565b6000848152601360205260409020546001600160a01b03166126cc5760405162461bcd60e51b8152600401610caf9060208082526004908201526312510c4d60e21b604082015260600190565b6126d6848461427b565b80156126ee57506126ee838360ff168360ff16614325565b6127235760405162461bcd60e51b8152600401610caf906020808252600490820152634944313560e01b604082015260600190565b611942888888886143b8565b6000828152601d6020908152604080832084845282529182902080548351818402810184019094528084526060939283018282801561278d57602002820191906000526020600020905b815481526020019060010190808311612779575b5050505050905092915050565b60005b8151811015611b13576127d68282815181106127c957634e487b7160e01b600052603260045260246000fd5b6020026020010151611b17565b806127e081615def565b91505061279d565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915250600090815260096020908152604091829020825160a0810184528154815260019091015460ff8082169383019390935261010081048316938201939093526201000083049091166060820152630100000090910464ffffffffff16608082015290565b61287f6130bc565b6001600160a01b038216158015906128b657506001600160a01b03821660009081526004602052604090205460ff16151581151514155b6128bf57600080fd5b6001600160a01b038216600081815260046020908152604091829020805460ff19168515159081179091558251938452908301527f58d7a3ccc34541e162fcfc87b84be7b78c34d1e1e7f15de6e4dd67d0fe70aecd9101611074565b6129236130bc565b6001600160a01b03811661296b5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610caf565b600154600160a81b900460ff16156129bb5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b6044820152606401610caf565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610f0b565b6005602052816000526040600020818154811061127e57600080fd5b6040805160e0810182526000808252602082018190529181018290526060808201839052608082019290925260a0810182905260c0810191909152600082815260086020908152604091829020825160e0810184528154815260018201549281019290925260028082015480820b820b820b9484019490945263010000008404810b810b810b6060840152600160301b909304830b830b90920b608082015260038201805491929160a084019190612b0790615db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612b3390615db4565b8015612b805780601f10612b5557610100808354040283529160200191612b80565b820191906000526020600020905b815481529060010190602001808311612b6357829003601f168201915b50505050508152602001600482018054612b9990615db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612bc590615db4565b8015612c125780601f10612be757610100808354040283529160200191612c12565b820191906000526020600020905b815481529060010190602001808311612bf557829003601f168201915b5050505050815250509050919050565b60215460405163645de6cb60e11b81526000916001600160a01b03169063c8bbcd9690612c53908590600401615bc7565b60206040518083038186803b158015612c6b57600080fd5b505afa158015612c7f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e39190615428565b612cac8161148c565b15612cdf5760405162461bcd60e51b815260206004820152600360248201526212510d60ea1b6044820152606401610caf565b6000818152600d602052604090205460ff16612d235760405162461bcd60e51b815260206004820152600360248201526249443560e81b6044820152606401610caf565b610fdf81614756565b6007602052816000526040600020818154811061127e57600080fd5b6017546001600160a01b038381166000908152601460205260408082205490516366b6f1a960e01b81526004810191909152909291909116906366b6f1a99060240160206040518083038186803b158015612da257600080fd5b505afa158015612db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dda919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b158015612e1f57600080fd5b505afa158015612e33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e57919061545c565b6001600160a01b03841660009081526014602052604090205414612e7a57600080fd5b8115612ff1576001600160a01b03831660009081526014602090815260408083205483526022825291829020825160808101845281548152600190910154600281810b810b810b9383019390935263010000008104830b830b830b93820193909352600160301b909204810b810b900b6060820152612ef890614b4f565b612f0157600080fd5b6001600160a01b03831660008181526014602081815260408084208054855260228352818520600a84528286208154815560019182018054929091018054600293840b840b62ffffff90811662ffffff198316811784558454630100000090819004870b870b83160265ffffffffffff1990931617919091178083559254600160301b90819004850b90940b1690920262ffffff60301b199091161790555480855290842094909352527f6dbef43d1350d7949e2842bb76a35b376ad7765645efae3a02965a48a88eebd9918190612fd882611e27565b604051612fe89493929190615a21565b60405180910390a15b612ffc83600061414d565b613007836000614bc6565b601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b15801561304d57600080fd5b505af1158015613061573d6000803e3d6000fd5b505050506001600160a01b038316600081815260146020908152604091829020548251938452908301527fb71d01900104b9abac3b5fb2ce8418fe7a6cdacf50d1f3cd0f9e4497961f4fdc91015b60405180910390a1505050565b6000546201000090046001600160a01b031633146131345760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610caf565b565b60006131458360000151612a50565b9050613167836060015160ff9081166000908152601060205260409020541690565b806131965750606083015160ff9081166000908152601160205260409020541680156131965750428160200151105b156133605782516000908152600960209081526040918290208551808255918601516001909101805484880151606089015160808a015164ffffffffff1663010000000267ffffffffff0000001960ff92831662010000021667ffffffffffff0000199383166101000261ffff199095169290961691909117929092171692909217919091179055601754915163602726b560e11b81526001600160a01b039092169163c04e4d6a9161324f9160040190815260200190565b600060405180830381600087803b15801561326957600080fd5b505af115801561327d573d6000803e3d6000fd5b505084516000908152600d6020908152604091829020805460ff1916600117905586516017548351638f0ac45360e01b815293517f9b6a2889290ea187763cae1d385adecd9295e6c5e49527154213bbfa4e1aba7396508a9550889492938a936001600160a01b0390931692638f0ac4539260048083019392829003018186803b15801561330a57600080fd5b505afa15801561331e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613342919061545c565b604051613353959493929190615afe565b60405180910390a16111e0565b606083015160ff90811660009081526011602052604090205416801561338a575042816020015110155b156111e05782516000908152601360208181526040808420546001600160a01b039081168552601e8352818520805460ff191660019081179091558851865293909252909220546111e092169061414d565b6133e581614b4f565b156138505760006133f98260000151611e27565b82516000908152600a60208181526040808420815160808101835281548152600191820154600281810b810b810b838701526301000000808304820b820b820b84870152600160301b92839004820b820b820b6060808601919091528c518a529787528589208c51808255888e0151919096018054888f01519a8f015192850b62ffffff90811665ffffffffffff19909216919091179a850b81169093029990991762ffffff60301b1916920b1690910217909455845260188252808420429055601254875185526013909252928390205492516333dfec9960e21b81526001600160a01b039384166004820152939450909291169063cf7fb2649060240160206040518083038186803b15801561351057600080fd5b505afa158015613524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135489190615428565b156136195782516000908152601360209081526040808320546001600160a01b03168352601b90915290205460ff16806135a8575082516000908152601360209081526040808320546001600160a01b03168352601e90915290205460ff165b156136145782516000908152601360208181526040808420546001600160a01b039081168552601b8352818520805460ff19908116909155885186528484528286205482168652601e84528286208054909116905587518552929091528220546136149291169061414d565b613810565b6012548351600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b15801561366f57600080fd5b505afa158015613683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a79190615428565b158015613775575060215483516000908152600b602052604090205484516001600160a01b03909216916342fa646a919085906136e390611e27565b87516000908152600b60209081526040808320548352600f90915290205460ff166040518563ffffffff1660e01b81526004016137239493929190615c78565b60206040518083038186803b15801561373b57600080fd5b505afa15801561374f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137739190615428565b155b1561381057825160009081526013602052604090205461379f906001600160a01b0316600161414d565b8251600090815260226020908152604091829020835181559083015160019091018054928401516060850151600290810b62ffffff908116600160301b0262ffffff60301b1993830b821663010000000265ffffffffffff199097169590920b169390931793909317929092161790555b82517f6dbef43d1350d7949e2842bb76a35b376ad7765645efae3a02965a48a88eebd99085908561384082611e27565b604051611e1994939291906159c1565b6012548151600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b1580156138a657600080fd5b505afa1580156138ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138de9190615428565b61392f5780516000908152601360208181526040808420546001600160a01b039081168552601b8352818520805460ff1916600190811790915586518652939092529092205461392f92169061414d565b80516000908152601360205260409081902054825191517fc923185f6beaaa6dfa175827bef4c69973568e863e15215dc86c57697100be2e926110749286926001600160a01b039091169190869061596d565b600061398d82612a50565b90504281602001511115613cb6576000828152600b60205260408120546139b390614c83565b60125460a084015160c08501516040519394506001600160a01b039092169263e3eb40d99287926139e99290919060200161587e565b60408051808303601f1901815291815260208781015160008a8152600b8352838120548152600f9092529181205460ff16613a25576003613a28565b60025b876040518763ffffffff1660e01b8152600401613a4a96959493929190615a74565b602060405180830381600087803b158015613a6457600080fd5b505af1158015613a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9c9190615125565b5060125460408051622610c560e41b815290516000926001600160a01b03169163dd5adfa39160019184916302610c5091600480820192602092909190829003018186803b158015613aed57600080fd5b505afa158015613b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b25919061545c565b613b2f9190615d71565b6040518263ffffffff1660e01b8152600401613b4d91815260200190565b60206040518083038186803b158015613b6557600080fd5b505afa158015613b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b9d9190615125565b8351600090815260136020908152604080832080546001600160a01b0319166001600160a01b0386811691821790925588519085526014845282852055601c8352818420805460ff199081166001908117909255601f85528386208054909116909117905560175482516389daf7eb60e01b8152925195965016936389daf7eb93600480840194938390030190829087803b158015613c3b57600080fd5b505af1158015613c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c73919061545c565b5082517f889e2060e46779287c2fcbf489c195ef20f5b44a74e3dcb58d491ae073c1370f9082908585613ca583611e27565b604051611e199594939291906158bd565b601760009054906101000a90046001600160a01b03166001600160a01b03166389daf7eb6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015613d0657600080fd5b505af1158015613d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d67919061545c565b602154604051632c85b65d60e21b81526060916001600160a01b03169063b216d97490613d6f908590600401615916565b60006040518083038186803b158015613d8757600080fd5b505afa158015613d9b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114e39190810190615386565b60008381526020805260409020548214610d67576000908152601d60209081526040808320848452825280832080546001810182559084528284200185905593825280529190912055565b815160009081526008602090815260409182902084518155818501516001820155918401516002808401805460608801516080890151840b62ffffff908116600160301b0262ffffff60301b1992860b821663010000000265ffffffffffff199094169690950b1694909417179290921617905560a08401518051859392613e9d926003850192910190614e7e565b5060c08201518051613eb9916004840191602090910190614e7e565b505082516000908152600b6020908152604091829020849055601754855191860151925163e9c962eb60e01b815260048101929092526024820192909252604481018490526001600160a01b03909116915063e9c962eb90606401600060405180830381600087803b158015613f2e57600080fd5b505af1158015613f42573d6000803e3d6000fd5b505083516000908152600c60209081526040808320805460ff1916600190811790915581516080808201845289518252838a0151600290810b8387019081526060808d0151830b858801908152938d0151830b9085019081528c518952600a885286892094518555905193909401805492519451820b62ffffff908116600160301b0262ffffff60301b1996840b821663010000000265ffffffffffff199095169590930b1693909317919091179290921691909117905586518352601882529182902042905585516017548351632bffd69960e21b815293517faba5c0e34b9b54828db4e0ac6b951ca282a0b171289eebf93353c296f9e8261396508995508794929389936001600160a01b039093169263afff5a649260048083019392829003018186803b15801561407557600080fd5b505afa158015614089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140ad919061545c565b87516140b890611e27565b6040516130af96959493929190615ac1565b6000838152601360205260408120546140ee916001600160a01b0390911690614bc6565b80156140fd576140fd82614ce7565b6000838152601360209081526040918290205482516001600160a01b0390911681529081018590527fb71d01900104b9abac3b5fb2ce8418fe7a6cdacf50d1f3cd0f9e4497961f4fdc91016130af565b6012546040516333dfec9960e21b81526001600160a01b03848116600483015283151592169063cf7fb2649060240160206040518083038186803b15801561419457600080fd5b505afa1580156141a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141cc9190615428565b151514611b1357601254604051637f8c2d6160e01b81526001600160a01b038481166004830152831515602483015290911690637f8c2d6190604401600060405180830381600087803b15801561422257600080fd5b505af1158015614236573d6000803e3d6000fd5b5050604080516001600160a01b038616815284151560208201527f2b8992e59f9813c2f92be2374e9bdd5384146ff8f719b038fbaf7d3dbfa78fde9350019050611074565b6021546000838152600b60209081526040808320548352600f90915281205490916001600160a01b03169063879c0c5e9060ff166040516001600160e01b031960e084901b16815290151560048201526024810185905260440160206040518083038186803b1580156142ed57600080fd5b505afa158015614301573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f439190615428565b6021546040516303727eb960e01b81526004810185905260248101849052604481018390526000916001600160a01b0316906303727eb99060640160206040518083038186803b15801561437857600080fd5b505afa15801561438c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143b09190615428565b949350505050565b6017546001600160a01b038581166000908152601460205260408082205490516366b6f1a960e01b81526004810191909152909291909116906366b6f1a99060240160206040518083038186803b15801561441257600080fd5b505afa158015614426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061444a919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b15801561448f57600080fd5b505afa1580156144a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144c7919061545c565b6001600160a01b038616600090815260146020526040902054146144ea57600080fd5b6144f585600061414d565b6144ff8585614bc6565b601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b15801561454557600080fd5b505af1158015614559573d6000803e3d6000fd5b50506040805160a0810182526001600160a01b0389166000908152601460209081528382205480845260ff8a81168386015289811685870152908352600b8252848320548352600f90915292902054909350606084019250166145bd57600b6145c0565b60085b60ff9081168252600060209283018190526001600160a01b03891681526014835260408082208054835260098086528284208751815587870151600191820180548a8701516060808d015160809d8e0151958c1661ffff1990941693909317610100928c1683021767ffffffffffff0000191662010000938c169390930267ffffffffff000000191692909217630100000064ffffffffff95861602179092559454808852600b8a5286882054948a5286882087518281529a8b019590955295890195909552825493880193909352015480851696860196909652600886901c841660a0860152601086901c90931660c085015260189490941c90911660e0830152918101919091527f9b6a2889290ea187763cae1d385adecd9295e6c5e49527154213bbfa4e1aba73906101200160405180910390a16001600160a01b0385166000818152601460209081526040918290205482519384529083015281018590527f1bf3a61a401436c0f119e17875fafabde9c95fbb6787cef2850d2d4a8f31e4449060600160405180910390a15050505050565b6000614761826127e8565b9050600061476e83612a50565b6017546040516366b6f1a960e01b8152600481018690529192506000916001600160a01b03909116906366b6f1a99060240160206040518083038186803b1580156147b857600080fd5b505afa1580156147cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147f0919061545c565b60175460405163dc12996360e01b8152600481018390529192506001600160a01b03169063dc1299639060240160206040518083038186803b15801561483557600080fd5b505afa158015614849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486d919061545c565b84146148a15760405162461bcd60e51b815260206004820152600360248201526224a21b60e91b6044820152606401610caf565b606083015160ff9081166000908152601060205260409020541615614b135782516000908152601360209081526040808320546001600160a01b03168352601b90915290205460ff1615614915578251600090815260136020526040812054614915916001600160a01b039091169061414d565b600061492084614dca565b9050600381148015614947575083516000908152600b602052604090205461494790614e0e565b1561495f57835161495a908360016140ca565b614b0d565b6012548451600090815260136020526040908190205490516333dfec9960e21b81526001600160a01b03918216600482015291169063cf7fb2649060240160206040518083038186803b1580156149b557600080fd5b505afa1580156149c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149ed9190615428565b614a83578351600090815260136020526040902054614a15906001600160a01b031682614bc6565b614a1e82614ce7565b835160009081526013602090815260409182902054865183516001600160a01b039092168252918101919091529081018290527f1bf3a61a401436c0f119e17875fafabde9c95fbb6787cef2850d2d4a8f31e4449060600160405180910390a1614b0d565b601760009054906101000a90046001600160a01b03166001600160a01b03166377d078d76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614ad357600080fd5b505af1158015614ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b0b919061545c565b505b506111e0565b606083015160ff908116600090815260116020526040902054168015614b3c5750428260200151105b156111e05782516111e0908260016140ca565b60215481516000908152600b60209081526040808320548352600f825280832054918501518186015160608701519251631578f73160e31b815260ff90941615156004850152600291820b6024850152810b60448401520b606482015290916001600160a01b03169063abc7b98890608401612c53565b60125460405163b91f5e3560e01b81526001600160a01b038481166004830152602482018490529091169063b91f5e3590604401600060405180830381600087803b158015614c1457600080fd5b505af1158015614c28573d6000803e3d6000fd5b505050506000811415614c5c576001600160a01b0382166000908152601660205260409020805460ff191660011790555050565b6001600160a01b0382166000908152601560205260409020805460ff191660011790555050565b6040805160018082528183019092526060916000919060208083019080368337019050509050614cb583612328615d59565b81600081518110614cd657634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b601760009054906101000a90046001600160a01b03166001600160a01b03166377d078d76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015614d3757600080fd5b505af1158015614d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d6f919061545c565b50601754604051634a65daa960e11b8152600481018390526001600160a01b03909116906394cbb55290602401600060405180830381600087803b158015614db657600080fd5b505af11580156125d5573d6000803e3d6000fd5b6000816040015160ff16826020015160ff161415614dea57506003919050565b816040015160ff16826020015160ff1611614e065760026114e3565b600192915050565b600081600714806114e357505060021490565b828054828255906000526020600020908101928215614e6e579160200282015b82811115614e6e5782518051614e5e918491602090910190614e7e565b5091602001919060010190614e41565b50614e7a929150614efe565b5090565b828054614e8a90615db4565b90600052602060002090601f016020900481019282614eac5760008555614ef2565b82601f10614ec557805160ff1916838001178555614ef2565b82800160010185558215614ef2579182015b82811115614ef2578251825591602001919060010190614ed7565b50614e7a929150614f1b565b80821115614e7a576000614f128282614f30565b50600101614efe565b5b80821115614e7a5760008155600101614f1c565b508054614f3c90615db4565b6000825580601f10614f4c575050565b601f016020900490600052602060002090810190610fdf9190614f1b565b6000614f7d614f7884615d32565b615cdf565b9050828152838383011115614f9157600080fd5b828260208301376000602084830101529392505050565b8035614fb381615e36565b919050565b600082601f830112614fc8578081fd5b81356020614fd8614f7883615d0f565b80838252828201915082860187848660051b8901011115614ff7578586fd5b855b8581101561504a5781356001600160401b03811115615016578788fd5b8801603f81018a13615026578788fd5b6150378a8783013560408401614f6a565b8552509284019290840190600101614ff9565b5090979650505050505050565b600082601f830112615067578081fd5b81356020615077614f7883615d0f565b80838252828201915082860187848660051b8901011115615096578586fd5b855b8581101561504a57813584529284019290840190600101615098565b8051600281900b8114614fb357600080fd5b600082601f8301126150d6578081fd5b81516150e4614f7882615d32565b8181528460208386010111156150f8578283fd5b6143b0826020830160208701615d88565b60006020828403121561511a578081fd5b8135611f4381615e36565b600060208284031215615136578081fd5b8151611f4381615e36565b600080600080600080600060e0888a03121561515b578283fd5b61516488614fa8565b965060208801356001600160401b038082111561517f578485fd5b61518b8b838c01615057565b975061519960408b01614fa8565b965060608a01359150808211156151ae578485fd5b6151ba8b838c01615057565b95506151c860808b01614fa8565b945060a08a01359150808211156151dd578384fd5b6151e98b838c01615057565b935060c08a01359150808211156151fe578283fd5b5061520b8a828b01615057565b91505092959891949750929550565b6000806040838503121561522c578182fd5b823561523781615e36565b9150602083013561524781615e4b565b809150509250929050565b60008060008060808587031215615267578182fd5b843561527281615e36565b9350602085013561528281615e36565b9250604085013561529281615e36565b915060608501356152a281615e36565b939692955090935050565b600080600080608085870312156152c2578182fd5b84356152cd81615e36565b93506020850135925060408501356152e481615e59565b915060608501356152a281615e59565b60006020808385031215615306578182fd5b82356001600160401b0381111561531b578283fd5b8301601f8101851361532b578283fd5b8035615339614f7882615d0f565b80828252848201915084840188868560051b8701011115615358578687fd5b8694505b8385101561537a57803583526001949094019391850191850161535c565b50979650505050505050565b60006020808385031215615398578182fd5b82516001600160401b038111156153ad578283fd5b8301601f810185136153bd578283fd5b80516153cb614f7882615d0f565b80828252848201915084840188868560051b87010111156153ea578687fd5b8694505b8385101561537a5780518352600194909401939185019185016153ee565b60006020828403121561541d578081fd5b8135611f4381615e4b565b600060208284031215615439578081fd5b8151611f4381615e4b565b600060208284031215615455578081fd5b5035919050565b60006020828403121561546d578081fd5b5051919050565b600080600060608486031215615488578081fd5b8335925060208401356001600160401b038111156154a4578182fd5b6154b086828701614fb8565b925050604084013590509250925092565b600080600080608085870312156154d6578182fd5b8435935060208501356001600160401b038111156154f2578283fd5b6154fe87828801614fb8565b949794965050505060408301359260600135919050565b60008060408385031215615527578182fd5b50508035926020909101359150565b600060208284031215615547578081fd5b81356001600160401b0381111561555c578182fd5b8201601f8101841361556c578182fd5b6143b084823560208401614f6a565b60006020828403121561558c578081fd5b81516001600160401b03808211156155a2578283fd5b9083019060e082860312156155b5578283fd5b6155bd615cb7565b82518152602083015160208201526155d7604084016150b4565b60408201526155e8606084016150b4565b60608201526155f9608084016150b4565b608082015260a08301518281111561560f578485fd5b61561b878286016150c6565b60a08301525060c083015182811115615632578485fd5b61563e878286016150c6565b60c08301525095945050505050565b60006080828403121561565e578081fd5b604051608081018181106001600160401b038211171561568057615680615e20565b60405282518152615693602084016150b4565b60208201526156a4604084016150b4565b60408201526156b5606084016150b4565b60608201529392505050565b600060a082840312156156d2578081fd5b60405160a081018181106001600160401b03821117156156f4576156f4615e20565b60405282518152602083015161570981615e59565b6020820152604083015161571c81615e59565b6040820152606083015161572f81615e59565b6060820152608083015164ffffffffff8116811461574b578283fd5b60808201529392505050565b60008060408385031215615769578182fd5b82359150602083013561524781615e4b565b60008060006060848603121561578f578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b838110156157d5578151875295820195908201906001016157b9565b509495945050505050565b600081518084526157f8816020860160208601615d88565b601f01601f19169290920160200192915050565b8051825260208101516020830152604081015160020b6040830152606081015160020b6060830152608081015160020b6080830152600060a082015160e060a085015261585c60e08501826157e0565b905060c083015184820360c086015261587582826157e0565b95945050505050565b60008351615890818460208801615d88565b630103b39960e51b90830190815283516158b1816004840160208801615d88565b01600401949350505050565b60018060a01b038616815284602082015260a0604082015260006158e460a083018661580c565b82810360608401526158f681866157a6565b9050828103608084015261590a81856157a6565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561594e57835183529284019291840191600101615932565b50909695505050505050565b602081526000611f4360208301846157a6565b8481526001600160a01b03841660208201526040810183905260e08101615875606083018480518252602081015160020b6020830152604081015160020b6040830152606081015160020b60608301525050565b848152836020820152615a01604082018480518252602081015160020b6020830152604081015160020b6040830152606081015160020b60608301525050565b60e060c08201526000615a1760e08301846157a6565b9695505050505050565b8481528360208201528254604082015260006001840154600281810b810b60608501528160181c810b810b60808501528160301c810b810b60a0850152505060e060c0830152615a1760e08301846157a6565b86815260c060208201526000615a8d60c08301886157e0565b86604084015285606084015260ff8516608084015282810360a0840152615ab481856157a6565b9998505050505050505050565b86815285602082015284604082015260c060608201526000615ae660c083018661580c565b84608084015282810360a0840152615ab481856157a6565b85815260208101859052604081018490526101208101615b5c60608301858051825260ff602082015116602083015260ff604082015116604083015260ff606082015116606083015264ffffffffff60808201511660808301525050565b826101008301529695505050505050565b8781528660208201528560020b60408201528460020b60608201528360020b608082015260e060a08201526000615ba760e08301856157e0565b82810360c0840152615bb981856157e0565b9a9950505050505050505050565b602081526000611f4360208301846157e0565b604081526000615bed60408301856157e0565b828103602084015261587581856157e0565b60208082526003908201526249443960e81b604082015260600190565b602081526000611f43602083018461580c565b60a081016114e382848051825260ff602082015116602083015260ff604082015116604083015260ff606082015116606083015264ffffffffff60808201511660808301525050565b848152608060208201526000615c9160808301866157a6565b8281036040840152615ca381866157a6565b915050821515606083015295945050505050565b60405160e081016001600160401b0381118282101715615cd957615cd9615e20565b60405290565b604051601f8201601f191681016001600160401b0381118282101715615d0757615d07615e20565b604052919050565b60006001600160401b03821115615d2857615d28615e20565b5060051b60200190565b60006001600160401b03821115615d4b57615d4b615e20565b50601f01601f191660200190565b60008219821115615d6c57615d6c615e0a565b500190565b600082821015615d8357615d83615e0a565b500390565b60005b83811015615da3578181015183820152602001615d8b565b838111156111e05750506000910152565b600181811c90821680615dc857607f821691505b60208210811415615de957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e0357615e03615e0a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610fdf57600080fd5b8015158114610fdf57600080fd5b60ff81168114610fdf57600080fdfea264697066735822122016866ff4599bc42d351912b8ff2809ad0e70ac10c847794745144d5d59526a0164736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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