ETH Price: $3,449.38 (+1.23%)

Contract

0xDfAb44CAcf80124761DF97d688E93B7ad83F86cE

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Amount:Between 1-100k
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UpDown

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {ITreasury} from "./interfaces/ITreasury.sol";
import {IDataStreamsVerifier} from "./interfaces/IDataStreamsVerifier.sol";

contract UpDown is AccessControl {
    event NewMaxPlayersAmount(uint256 newMax);
    event NewFee(uint256 newFee);
    event NewTreasury(address newTreasury);
    event UpDownCreated(
        uint256 startTime,
        uint32 stopPredictAt,
        uint32 endTime,
        uint8 feedNumber,
        bytes32 gameId,
        address token
    );
    event UpDownNewPlayer(
        address player,
        bool isLong,
        uint256 depositAmount,
        bytes32 gameId,
        uint256 rakeback
    );
    event UpDownStarted(int192 startingPrice, bytes32 gameId);
    event UpDownFinalized(int192 finalPrice, bool isLong, bytes32 gameId);
    event UpDownCancelled(bytes32 gameId);

    struct GameInfo {
        uint256 startTime;
        uint256 endTime;
        uint256 stopPredictAt;
        uint8 feedNumber;
    }

    uint256 constant timeGap = 30 seconds;
    uint256 packedData;
    bytes32 public constant GAME_MASTER_ROLE = keccak256("GAME_MASTER_ROLE");
    address[] public UpPlayers;
    address[] public DownPlayers;
    mapping(address => bool) public isParticipating;
    mapping(address => uint256) public depositAmounts;
    bytes32 public currentGameId;
    address public treasury;
    uint256 public minDepositAmount;
    uint256 public startingPrice;
    uint256 public totalDepositsUp;
    uint256 public totalDepositsDown;
    uint256 public totalRakebackUp;
    uint256 public totalRakebackDown;
    uint256 public maxPlayers = 100;
    uint256 public fee = 1500;

    constructor() {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    /**
     * Creates up/down game
     * @param endTime when the game will end
     * @param stopPredictAt time when players can't enter the game
     * @param depositAmount amount to enter the game
     * @param token token for game deposits
     * @param feedNumber token position in array of Chainlink DataStreams feed IDs
     */
    function startGame(
        uint32 endTime,
        uint32 stopPredictAt,
        uint256 depositAmount,
        address token,
        uint8 feedNumber
    ) public onlyRole(GAME_MASTER_ROLE) {
        require(packedData == 0, "Finish previous game first");
        require(stopPredictAt - block.timestamp >= timeGap, "Wrong stop time");
        require(
            endTime - stopPredictAt >= timeGap,
            "Timeframe gap must be higher"
        );
        require(
            depositAmount >= ITreasury(treasury).minDepositAmount(token),
            "Wrong min deposit amount"
        );
        require(
            IDataStreamsVerifier(ITreasury(treasury).upkeep()).assetId(
                feedNumber
            ) != bytes32(0),
            "Wrong feed number"
        );
        packedData = (block.timestamp |
            (uint256(stopPredictAt) << 32) |
            (uint256(endTime) << 64) |
            (uint256(feedNumber) << 96));
        currentGameId = keccak256(
            abi.encodePacked(endTime, block.timestamp, address(this))
        );
        ITreasury(treasury).setGameToken(currentGameId, token);
        minDepositAmount = depositAmount;
        emit UpDownCreated(
            block.timestamp,
            stopPredictAt,
            endTime,
            feedNumber,
            currentGameId,
            token
        );
    }

    /**
     * Take a participation in up/down game and deposit funds
     * @param isLong up = true, down = false
     * @param depositAmount amount to deposit in game
     */
    function play(bool isLong, uint256 depositAmount) public {
        require(depositAmount >= minDepositAmount, "Wrong deposit amount");
        require(!isParticipating[msg.sender], "Already participating");
        require(
            DownPlayers.length + UpPlayers.length + 1 <= maxPlayers,
            "Max player amount reached"
        );
        GameInfo memory game = decodeData();
        require(
            game.stopPredictAt > block.timestamp,
            "Game is closed for new players"
        );

        depositAmounts[msg.sender] = depositAmount;
        isParticipating[msg.sender] = true;
        uint256 rakeback = ITreasury(treasury).depositAndLock(
            depositAmount,
            msg.sender,
            currentGameId,
            true
        );
        if (isLong) {
            totalRakebackUp += rakeback;
            totalDepositsUp += depositAmount;
            UpPlayers.push(msg.sender);
        } else {
            totalRakebackDown += rakeback;
            totalDepositsDown += depositAmount;
            DownPlayers.push(msg.sender);
        }
        emit UpDownNewPlayer(
            msg.sender,
            isLong,
            depositAmount,
            currentGameId,
            rakeback
        );
    }

    /**
     * Take a participation in up/down game using deposited funds
     * @param isLong up = true, down = false
     * @param depositAmount amount to deposit in game
     */
    function playWithDeposit(bool isLong, uint256 depositAmount) public {
        require(depositAmount >= minDepositAmount, "Wrong deposit amount");
        require(!isParticipating[msg.sender], "Already participating");
        require(
            DownPlayers.length + UpPlayers.length + 1 <= maxPlayers,
            "Max player amount reached"
        );
        GameInfo memory game = decodeData();
        require(
            game.stopPredictAt > block.timestamp,
            "Game is closed for new players"
        );
        depositAmounts[msg.sender] = depositAmount;
        uint256 rakeback = ITreasury(treasury).lock(
            depositAmount,
            msg.sender,
            currentGameId,
            true
        );
        if (isLong) {
            totalRakebackUp += rakeback;
            totalDepositsUp += depositAmount;
            UpPlayers.push(msg.sender);
        } else {
            totalRakebackDown += rakeback;
            totalDepositsDown += depositAmount;
            DownPlayers.push(msg.sender);
        }
        isParticipating[msg.sender] = true;
        emit UpDownNewPlayer(
            msg.sender,
            isLong,
            depositAmount,
            currentGameId,
            rakeback
        );
    }

    /**
     * Take a participation in up/down game and deposit funds
     * @param isLong up = true, down = false
     */
    function playWithPermit(
        bool isLong,
        uint256 depositAmount,
        ITreasury.PermitData calldata permitData
    ) public {
        require(depositAmount >= minDepositAmount, "Wrong deposit amount");
        require(!isParticipating[msg.sender], "Already participating");
        require(
            DownPlayers.length + UpPlayers.length + 1 <= maxPlayers,
            "Max player amount reached"
        );
        GameInfo memory game = decodeData();
        require(
            game.stopPredictAt > block.timestamp,
            "Game is closed for new players"
        );
        depositAmounts[msg.sender] = depositAmount;
        isParticipating[msg.sender] = true;
        uint256 rakeback = ITreasury(treasury).depositAndLockWithPermit(
            depositAmount,
            msg.sender,
            currentGameId,
            true,
            permitData.deadline,
            permitData.v,
            permitData.r,
            permitData.s
        );
        if (isLong) {
            totalRakebackUp += rakeback;
            totalDepositsUp += depositAmount;
            UpPlayers.push(msg.sender);
        } else {
            totalRakebackDown += rakeback;
            totalDepositsDown += depositAmount;
            DownPlayers.push(msg.sender);
        }
        emit UpDownNewPlayer(
            msg.sender,
            isLong,
            depositAmount,
            currentGameId,
            rakeback
        );
    }

    /**
     * Sets starting price wich will be used to compare with final price
     * @param unverifiedReport Chainlink DataStreams report
     */
    function setStartingPrice(
        bytes memory unverifiedReport
    ) public onlyRole(GAME_MASTER_ROLE) {
        GameInfo memory game = decodeData();
        require(startingPrice == 0, "Starting price already set");
        require(block.timestamp >= game.stopPredictAt, "Too early");
        require(
            UpPlayers.length != 0 || DownPlayers.length != 0,
            "Not enough players"
        );
        address upkeep = ITreasury(treasury).upkeep();
        (int192 priceData, uint32 priceTimestamp) = IDataStreamsVerifier(upkeep)
            .verifyReportWithTimestamp(unverifiedReport, game.feedNumber);
        require(
            priceTimestamp - game.stopPredictAt <= 1 minutes,
            "Old chainlink report"
        );
        startingPrice = uint192(priceData);
        emit UpDownStarted(priceData, currentGameId);
    }

    /**
     * Finalizes up/down game and distributes rewards to players
     * @param unverifiedReport Chainlink DataStreams report
     */
    function finalizeGame(
        bytes memory unverifiedReport
    ) public onlyRole(GAME_MASTER_ROLE) {
        GameInfo memory game = decodeData();
        require(packedData != 0, "Start the game first");
        require(block.timestamp >= game.endTime, "Too early to finish");
        if (UpPlayers.length == 0 || DownPlayers.length == 0) {
            if (UpPlayers.length > 0) {
                for (uint i; i < UpPlayers.length; i++) {
                    ITreasury(treasury).refund(
                        depositAmounts[UpPlayers[i]],
                        UpPlayers[i],
                        currentGameId
                    );
                    isParticipating[UpPlayers[i]] = false;
                    depositAmounts[UpPlayers[i]] = 0;
                }
                delete UpPlayers;
            } else if (DownPlayers.length > 0) {
                for (uint i; i < DownPlayers.length; i++) {
                    ITreasury(treasury).refund(
                        depositAmounts[DownPlayers[i]],
                        DownPlayers[i],
                        currentGameId
                    );
                    isParticipating[DownPlayers[i]] = false;
                    depositAmounts[DownPlayers[i]] = 0;
                }
                delete DownPlayers;
            }
            emit UpDownCancelled(currentGameId);
            packedData = 0;
            totalDepositsUp = 0;
            totalDepositsDown = 0;
            totalRakebackUp = 0;
            totalRakebackDown = 0;
            startingPrice = 0;
            currentGameId = bytes32(0);
            return;
        }
        require(startingPrice != 0, "Starting price must be set");
        address upkeep = ITreasury(treasury).upkeep();
        (int192 finalPrice, uint32 priceTimestamp) = IDataStreamsVerifier(
            upkeep
        ).verifyReportWithTimestamp(unverifiedReport, game.feedNumber);
        require(
            priceTimestamp - game.endTime <= 1 minutes,
            "Old chainlink report"
        );
        if (uint192(finalPrice) > startingPrice) {
            ITreasury(treasury).withdrawGameFee(
                totalDepositsDown,
                fee,
                currentGameId
            );
            uint256 finalRate = ITreasury(treasury).calculateRate(
                totalDepositsUp,
                totalRakebackDown,
                currentGameId
            );
            for (uint i = 0; i < UpPlayers.length; i++) {
                ITreasury(treasury).universalDistribute(
                    UpPlayers[i],
                    depositAmounts[UpPlayers[i]],
                    currentGameId,
                    finalRate
                );
            }
            emit UpDownFinalized(finalPrice, true, currentGameId);
        } else if (uint192(finalPrice) < startingPrice) {
            ITreasury(treasury).withdrawGameFee(
                totalDepositsUp,
                fee,
                currentGameId
            );
            uint256 finalRate = ITreasury(treasury).calculateRate(
                totalDepositsDown,
                totalRakebackUp,
                currentGameId
            );
            for (uint i = 0; i < DownPlayers.length; i++) {
                ITreasury(treasury).universalDistribute(
                    DownPlayers[i],
                    depositAmounts[DownPlayers[i]],
                    currentGameId,
                    finalRate
                );
            }
            emit UpDownFinalized(finalPrice, false, currentGameId);
        } else if (uint192(finalPrice) == startingPrice) {
            for (uint i; i < UpPlayers.length; i++) {
                ITreasury(treasury).refund(
                    depositAmounts[UpPlayers[i]],
                    UpPlayers[i],
                    currentGameId
                );
                isParticipating[UpPlayers[i]] = false;
            }
            delete UpPlayers;
            for (uint i; i < DownPlayers.length; i++) {
                ITreasury(treasury).refund(
                    depositAmounts[DownPlayers[i]],
                    DownPlayers[i],
                    currentGameId
                );
                isParticipating[DownPlayers[i]] = false;
            }
            delete DownPlayers;
            emit UpDownCancelled(currentGameId);
            totalDepositsUp = 0;
            totalDepositsDown = 0;
            totalRakebackUp = 0;
            totalRakebackDown = 0;
            startingPrice = 0;
            packedData = 0;
            totalRakebackUp = 0;
            totalRakebackDown = 0;
            currentGameId = bytes32(0);
            return;
        }

        for (uint i = 0; i < UpPlayers.length; i++) {
            depositAmounts[UpPlayers[i]] = 0;
            isParticipating[UpPlayers[i]] = false;
        }
        for (uint i = 0; i < DownPlayers.length; i++) {
            depositAmounts[DownPlayers[i]] = 0;
            isParticipating[DownPlayers[i]] = false;
        }

        delete DownPlayers;
        delete UpPlayers;
        ITreasury(treasury).setGameFinished(currentGameId);
        currentGameId = bytes32(0);
        packedData = 0;
        totalDepositsUp = 0;
        totalDepositsDown = 0;
        totalRakebackUp = 0;
        totalRakebackDown = 0;
        startingPrice = 0;
    }

    /**
     * Closes game and refunds tokens
     */
    function closeGame() public onlyRole(GAME_MASTER_ROLE) {
        require(currentGameId != bytes32(0), "Game not started");
        for (uint i; i < UpPlayers.length; i++) {
            ITreasury(treasury).refund(
                depositAmounts[UpPlayers[i]],
                UpPlayers[i],
                currentGameId
            );
            isParticipating[UpPlayers[i]] = false;
            depositAmounts[UpPlayers[i]] = 0;
        }
        delete UpPlayers;
        for (uint i; i < DownPlayers.length; i++) {
            ITreasury(treasury).refund(
                depositAmounts[DownPlayers[i]],
                DownPlayers[i],
                currentGameId
            );
            isParticipating[DownPlayers[i]] = false;
            depositAmounts[DownPlayers[i]] = 0;
        }
        delete DownPlayers;
        emit UpDownCancelled(currentGameId);
        currentGameId = bytes32(0);
        packedData = 0;
        totalDepositsUp = 0;
        totalDepositsDown = 0;
        totalRakebackUp = 0;
        totalRakebackDown = 0;
        startingPrice = 0;
    }

    /**
     * Returns decoded game data
     */
    function decodeData() public view returns (GameInfo memory data) {
        data.startTime = uint256(uint32(packedData));
        data.stopPredictAt = uint256(uint32(packedData >> 32));
        data.endTime = uint256(uint32(packedData >> 64));
        data.feedNumber = uint8(packedData >> 96);
    }

    /**
     * Returns total amount of participants
     */
    function getTotalPlayers() public view returns (uint256, uint256) {
        return (UpPlayers.length, DownPlayers.length);
    }

    /**
     * Change maximum players number
     * @param newMax new maximum number
     */
    function setMaxPlayers(uint256 newMax) public onlyRole(DEFAULT_ADMIN_ROLE) {
        maxPlayers = newMax;
        emit NewMaxPlayersAmount(newMax);
    }

    /**
     * Change treasury address
     * @param newTreasury new treasury address
     */
    function setTreasury(
        address newTreasury
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        require(newTreasury != address(0), "Zero address");
        treasury = newTreasury;
        emit NewTreasury(newTreasury);
    }

    /**
     * Change fee
     * @param newFee new fee in bp
     */
    function setFee(uint256 newFee) public onlyRole(DEFAULT_ADMIN_ROLE) {
        require(newFee <= 3000, "Fee exceeds the cap");
        fee = newFee;
        emit NewFee(newFee);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IDataStreamsVerifier {
    function lastRetrievedPrice() external view returns (int192);

    function getPrice() external view returns (int192);

    function verifyReportWithTimestamp(
        bytes memory unverifiedReport,
        uint8 feedNumber
    ) external returns (int192, uint32);

    function assetId(uint8 index) external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface ITreasury {
    struct PermitData {
        uint256 deadline;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    function DISTRIBUTOR_ROLE() external view returns (bytes32);

    function grantRole(bytes32 role, address account) external;

    function lockedRakeback(
        bytes32 gameId,
        address player,
        uint256 depositId
    ) external returns (uint256);

    function depositAndLock(
        uint256 amount,
        address from,
        bytes32 gameId,
        uint256 depositId
    ) external returns (uint256);

    function depositAndLock(
        uint256 amount,
        address from,
        bytes32 gameId,
        bool isRakeback
    ) external returns (uint256 rakeback);

    function depositAndLockWithPermit(
        uint256 amount,
        address from,
        bytes32 gameId,
        uint256 depositId,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 rakeback);

    function depositAndLockWithPermit(
        uint256 amount,
        address from,
        bytes32 gameId,
        bool isRakeback,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 rakeback);

    function lock(
        uint256 amount,
        address from,
        uint256 depositId,
        bytes32 gameId
    ) external returns (uint256 rakeback);

    function lock(
        uint256 amount,
        address from,
        bytes32 gameId,
        bool isRakeback
    ) external returns (uint256 rakeback);

    function upkeep() external view returns (address);

    function bullseyeResetLockedAmount(bytes32 gameId) external;

    function distributeBullseye(
        uint256 rate,
        uint256 lostTeamRakeback,
        address to,
        bytes32 gameId,
        uint256 depositId
    ) external;

    function approvedTokens(address token) external returns (bool);

    function refund(uint256 amount, address to, bytes32 gameId) external;

    function refund(
        uint256 amount,
        address to,
        bytes32 gameId,
        uint256 depositId
    ) external;

    function refundWithFees(
        uint256 amount,
        address to,
        uint256 refundFee,
        bytes32 gameId
    ) external;

    function refundWithFees(
        uint256 amount,
        address to,
        uint256 refundFee,
        bytes32 gameId,
        uint256 depositId
    ) external;

    function universalDistribute(
        address to,
        uint256 initialDeposit,
        bytes32 gameId,
        uint256 rate
    ) external;

    function withdrawGameFee(
        uint256 lostTeamDeposits,
        uint256 gameFee,
        bytes32 gameId
    ) external returns (uint256 withdrawnFees);

    function calculateRate(
        uint256 wonTeamTotal,
        uint256 lostTeamRakeback,
        bytes32 gameId
    ) external returns (uint256);

    function withdrawInitiatorFee(
        uint256 lostTeamDeposits,
        uint256 wonTeamDeposits,
        uint256 initiatorFee,
        address initiator,
        bytes32 gameId
    ) external returns (uint256 withdrawnFees);

    function calculateRakebackAmount(
        address target,
        uint256 initialDeposit
    ) external;

    function setGameFinished(bytes32 gameId) external;

    function withdrawRakebackSetup(bytes32 gameId, address target) external;

    function setGameToken(bytes32 gameId, address token) external;

    function minDepositAmount(address token) external returns (uint256 amount);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"NewFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"NewMaxPlayersAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTreasury","type":"address"}],"name":"NewTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"UpDownCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"stopPredictAt","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"endTime","type":"uint32"},{"indexed":false,"internalType":"uint8","name":"feedNumber","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"UpDownCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int192","name":"finalPrice","type":"int192"},{"indexed":false,"internalType":"bool","name":"isLong","type":"bool"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"UpDownFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"bool","name":"isLong","type":"bool"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"rakeback","type":"uint256"}],"name":"UpDownNewPlayer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int192","name":"startingPrice","type":"int192"},{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"UpDownStarted","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"DownPlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAME_MASTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"UpPlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentGameId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decodeData","outputs":[{"components":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"stopPredictAt","type":"uint256"},{"internalType":"uint8","name":"feedNumber","type":"uint8"}],"internalType":"struct UpDown.GameInfo","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"unverifiedReport","type":"bytes"}],"name":"finalizeGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isParticipating","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDepositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isLong","type":"bool"},{"internalType":"uint256","name":"depositAmount","type":"uint256"}],"name":"play","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isLong","type":"bool"},{"internalType":"uint256","name":"depositAmount","type":"uint256"}],"name":"playWithDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isLong","type":"bool"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ITreasury.PermitData","name":"permitData","type":"tuple"}],"name":"playWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMaxPlayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"unverifiedReport","type":"bytes"}],"name":"setStartingPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"uint32","name":"stopPredictAt","type":"uint32"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"feedNumber","type":"uint8"}],"name":"startGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDepositsDown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDepositsUp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRakebackDown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRakebackUp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040526064600e556105dc600f553480156200001c57600080fd5b506200002a60003362000031565b50620000e0565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16620000d6576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556200008d3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620000da565b5060005b92915050565b61313b80620000f06000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c806385ddbaf21161011a578063c0bf4152116100ad578063dbbb50c51161007c578063dbbb50c514610465578063ddca3f431461046e578063ddfd29cf14610477578063f0f442601461048a578063f4caee881461049d57600080fd5b8063c0bf4152146103f8578063ce07b0751461040b578063d547741f14610449578063d6fbf2021461045c57600080fd5b8063acc37344116100e9578063acc373441461039d578063acebb280146103b0578063ad1def1e146103c3578063bf0294d0146103d857600080fd5b806385ddbaf21461036657806391d1485414610379578063a098875b1461038c578063a217fddf1461039557600080fd5b8063536a3ddc1161019d578063645006ca1161016c578063645006ca1461031c57806369fe0e2d1461032557806376f9ed3414610338578063786b844b1461034b5780637d26b6be1461035357600080fd5b8063536a3ddc146102cc5780636024a6b3146102d5578063603c2e6b1461030057806361d027b31461030957600080fd5b806336568abe116101d957806336568abe1461028c57806337c9ce491461029f5780634529cae7146102a85780634c2412a2146102c357600080fd5b806301ffc9a71461020b578063248a9ca314610233578063288dee3b146102645780632f2ff15d14610279575b600080fd5b61021e610219366004612bf8565b6104c0565b60405190151581526020015b60405180910390f35b610256610241366004612c29565b60009081526020819052604090206001015490565b60405190815260200161022a565b610277610272366004612c29565b6104f7565b005b610277610287366004612c57565b61053f565b61027761029a366004612c57565b61056a565b610256600d5481565b6002546003546040805192835260208301919091520161022a565b610256600e5481565b61025660065481565b6102e86102e3366004612c29565b6105a2565b6040516001600160a01b03909116815260200161022a565b610256600c5481565b6007546102e8906001600160a01b031681565b61025660085481565b610277610333366004612c29565b6105cc565b610277610346366004612caf565b610659565b610277610ab8565b610277610361366004612d23565b610e7b565b610277610374366004612d81565b611171565b61021e610387366004612c57565b61140c565b610256600a5481565b610256600081565b6102e86103ab366004612c29565b611435565b6102776103be366004612d81565b611445565b6102566000805160206130e683398151915281565b6102566103e6366004612e32565b60056020526000908152604090205481565b610277610406366004612e4f565b612415565b6104136126c3565b60405161022a919081518152602080830151908201526040808301519082015260609182015160ff169181019190915260800190565b610277610457366004612c57565b612727565b61025660095481565b610256600b5481565b610256600f5481565b610277610485366004612e4f565b61274c565b610277610498366004612e32565b6129e5565b61021e6104ab366004612e32565b60046020526000908152604090205460ff1681565b60006001600160e01b03198216637965db0b60e01b14806104f157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061050281612a83565b600e8290556040518281527f6c31254b0e0eb7c0dc776ffcdc449905584ed6806f9504cb4fdb3dc1578e613a906020015b60405180910390a15050565b60008281526020819052604090206001015461055a81612a83565b6105648383612a90565b50505050565b6001600160a01b03811633146105935760405163334bd91960e11b815260040160405180910390fd5b61059d8282612b22565b505050565b600381815481106105b257600080fd5b6000918252602090912001546001600160a01b0316905081565b60006105d781612a83565b610bb88211156106245760405162461bcd60e51b815260206004820152601360248201527204665652065786365656473207468652063617606c1b60448201526064015b60405180910390fd5b600f8290556040518281527f63fe946ed58429ac3c5e64d4356ff92c26d7fa1e73586515df8ba9f059ab54a590602001610533565b6000805160206130e683398151915261067181612a83565b600154156106c15760405162461bcd60e51b815260206004820152601a60248201527f46696e6973682070726576696f75732067616d65206669727374000000000000604482015260640161061b565b601e6106d34263ffffffff8816612e8f565b10156107135760405162461bcd60e51b815260206004820152600f60248201526e57726f6e672073746f702074696d6560881b604482015260640161061b565b601e61071f8688612ea2565b63ffffffff1610156107735760405162461bcd60e51b815260206004820152601c60248201527f54696d656672616d6520676170206d7573742062652068696768657200000000604482015260640161061b565b60075460405163722ec76f60e01b81526001600160a01b0385811660048301529091169063722ec76f906024016020604051808303816000875af11580156107bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e39190612ec6565b8410156108325760405162461bcd60e51b815260206004820152601860248201527f57726f6e67206d696e206465706f73697420616d6f756e740000000000000000604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa15801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612edf565b60405163ae82b5c960e01b815260ff851660048201526001600160a01b03919091169063ae82b5c990602401602060405180830381865afa1580156108e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090d9190612ec6565b0361094e5760405162461bcd60e51b81526020600482015260116024820152702bb937b733903332b2b210373ab6b132b960791b604482015260640161061b565b60608260ff16901b60408763ffffffff16901b60208763ffffffff16901b421717176001819055508542306040516020016109bd9392919060e09390931b6001600160e01b0319168352600483019190915260601b6bffffffffffffffffffffffff1916602482015260380190565b60408051808303601f19018152908290528051602090910120600681905560075463039279d760e61b835260048301919091526001600160a01b038581166024840152169063e49e75c090604401600060405180830381600087803b158015610a2557600080fd5b505af1158015610a39573d6000803e3d6000fd5b5050506008859055506006546040805142815263ffffffff808916602083015289169181019190915260ff8416606082015260808101919091526001600160a01b03841660a08201527f4439485efd184bcd23fddb305919729ddfad3c7a5251d09b470fe56fe57ade3a9060c0015b60405180910390a1505050505050565b6000805160206130e6833981519152610ad081612a83565b600654610b125760405162461bcd60e51b815260206004820152601060248201526f11d85b59481b9bdd081cdd185c9d195960821b604482015260640161061b565b60005b600254811015610c8957600754600280546001600160a01b0390921691630a0d4556916005916000919086908110610b4f57610b4f612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546002805485908110610b8857610b88612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152610bc393926001600160a01b03169190600401612f12565b600060405180830381600087803b158015610bdd57600080fd5b505af1158015610bf1573d6000803e3d6000fd5b5050505060006004600060028481548110610c0e57610c0e612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff19169215159290921790915560028054600591839185908110610c5c57610c5c612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610b15565b50610c9660026000612bc6565b60005b600354811015610e0d57600754600380546001600160a01b0390921691630a0d4556916005916000919086908110610cd357610cd3612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546003805485908110610d0c57610d0c612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152610d4793926001600160a01b03169190600401612f12565b600060405180830381600087803b158015610d6157600080fd5b505af1158015610d75573d6000803e3d6000fd5b5050505060006004600060038481548110610d9257610d92612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff19169215159290921790915560038054600591839185908110610de057610de0612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610c99565b50610e1a60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf32630600654604051610e4d91815260200190565b60405180910390a150600060068190556001819055600a819055600b819055600c819055600d819055600955565b600854821015610e9d5760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff1615610ecd5760405162461bcd60e51b815260040161061b90612f5f565b600e54600254600354610ee09190612f8e565b610eeb906001612f8e565b1115610f095760405162461bcd60e51b815260040161061b90612fa1565b6000610f136126c3565b905042816040015111610f385760405162461bcd60e51b815260040161061b90612fd8565b33600081815260056020908152604080832087905560048252808320805460ff1916600190811790915560075460065494956001600160a01b039190911694636affb29a948a94929391928a3591610f94918c01908c0161300f565b604080516001600160e01b031960e08a901b16815260048101979097526001600160a01b03909516602487015260448601939093529015156064850152608484015260ff1660a483015286013560c4820152606086013560e4820152610104016020604051808303816000875af1158015611013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110379190612ec6565b905084156110b65780600c60008282546110519190612f8e565b9250508190555083600a600082825461106a9190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b03191633179055611129565b80600d60008282546110c89190612f8e565b9250508190555083600b60008282546110e19190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b7f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d73386866006548560405161116295949392919061302a565b60405180910390a15050505050565b6000805160206130e683398151915261118981612a83565b60006111936126c3565b90506009546000146111e75760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e6720707269636520616c726561647920736574000000000000604482015260640161061b565b80604001514210156112275760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015260640161061b565b600254151580611238575060035415155b6112795760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820706c617965727360701b604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e79190612edf565b9050600080826001600160a01b031663d369dc618786606001516040518363ffffffff1660e01b815260040161131e929190613058565b60408051808303816000875af115801561133c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136091906130b0565b91509150603c84604001518263ffffffff1661137c9190612e8f565b11156113c15760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161061b565b6001600160c01b03821660095560065460408051601785900b815260208101929092527ffcd72aeb09107db0b2cdb05b7c9377eafa86a5ac4474c90a97c61258db9cba149101610aa8565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600281815481106105b257600080fd5b6000805160206130e683398151915261145d81612a83565b60006114676126c3565b90506001546000036114b25760405162461bcd60e51b815260206004820152601460248201527314dd185c9d081d1a194819d85b5948199a5c9cdd60621b604482015260640161061b565b80602001514210156114fc5760405162461bcd60e51b81526020600482015260136024820152720a8dede40cac2e4d8f240e8de40ccd2dcd2e6d606b1b604482015260640161061b565b600254158061150b5750600354155b1561189057600254156116a15760005b60025481101561168f57600754600280546001600160a01b0390921691630a0d455691600591600091908690811061155557611555612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902054600280548590811061158e5761158e612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b1681526115c993926001600160a01b03169190600401612f12565b600060405180830381600087803b1580156115e357600080fd5b505af11580156115f7573d6000803e3d6000fd5b505050506000600460006002848154811061161457611614612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff1916921515929092179091556002805460059183918590811061166257611662612efc565b60009182526020808320909101546001600160a01b0316835282019290925260400190205560010161151b565b5061169c60026000612bc6565b61182d565b6003541561182d5760005b60035481101561182057600754600380546001600160a01b0390921691630a0d45569160059160009190869081106116e6576116e6612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902054600380548590811061171f5761171f612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b16815261175a93926001600160a01b03169190600401612f12565b600060405180830381600087803b15801561177457600080fd5b505af1158015611788573d6000803e3d6000fd5b50505050600060046000600384815481106117a5576117a5612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff191692151592909217909155600380546005918391859081106117f3576117f3612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020556001016116ac565b5061182d60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf3263060065460405161186091815260200190565b60405180910390a15060006001819055600a819055600b819055600c819055600d81905560098190556006555050565b6009546000036118e25760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e67207072696365206d75737420626520736574000000000000604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa15801561192c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119509190612edf565b9050600080826001600160a01b031663d369dc618786606001516040518363ffffffff1660e01b8152600401611987929190613058565b60408051808303816000875af11580156119a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c991906130b0565b91509150603c84602001518263ffffffff166119e59190612e8f565b1115611a2a5760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161061b565b600954826001600160c01b03161115611ca957600754600b54600f54600654604051637b85343760e11b81526004810193909352602483019190915260448201526001600160a01b039091169063f70a686e906064016020604051808303816000875af1158015611a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac39190612ec6565b50600754600a54600d546006546040516328ac5cf760e21b81526004810193909352602483019190915260448201526000916001600160a01b03169063a2b173dc906064016020604051808303816000875af1158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190612ec6565b905060005b600254811015611c5857600754600280546001600160a01b03909216916388cc22ff919084908110611b8457611b84612efc565b9060005260206000200160009054906101000a90046001600160a01b03166005600060028681548110611bb957611bb9612efc565b6000918252602080832091909101546001600160a01b039081168452908301939093526040918201902054600654915160e086901b6001600160e01b03191681529390921660048401526024830191909152604482015260648101859052608401600060405180830381600087803b158015611c3457600080fd5b505af1158015611c48573d6000803e3d6000fd5b505060019092019150611b509050565b5060065460408051601786900b815260016020820152908101919091527ff4570c324e50c8cf2966e6ca6c7dce637fd012713169a420ddf51f963cf3dd69906060015b60405180910390a150612222565b600954826001600160c01b03161015611f1e57600754600a54600f54600654604051637b85343760e11b81526004810193909352602483019190915260448201526001600160a01b039091169063f70a686e906064016020604051808303816000875af1158015611d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d429190612ec6565b50600754600b54600c546006546040516328ac5cf760e21b81526004810193909352602483019190915260448201526000916001600160a01b03169063a2b173dc906064016020604051808303816000875af1158015611da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dca9190612ec6565b905060005b600354811015611ed757600754600380546001600160a01b03909216916388cc22ff919084908110611e0357611e03612efc565b9060005260206000200160009054906101000a90046001600160a01b03166005600060038681548110611e3857611e38612efc565b6000918252602080832091909101546001600160a01b039081168452908301939093526040918201902054600654915160e086901b6001600160e01b03191681529390921660048401526024830191909152604482015260648101859052608401600060405180830381600087803b158015611eb357600080fd5b505af1158015611ec7573d6000803e3d6000fd5b505060019092019150611dcf9050565b5060065460408051601786900b815260006020820152908101919091527ff4570c324e50c8cf2966e6ca6c7dce637fd012713169a420ddf51f963cf3dd6990606001611c9b565b600954826001600160c01b0316036122225760005b60025481101561206857600754600280546001600160a01b0390921691630a0d4556916005916000919086908110611f6d57611f6d612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546002805485908110611fa657611fa6612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152611fe193926001600160a01b03169190600401612f12565b600060405180830381600087803b158015611ffb57600080fd5b505af115801561200f573d6000803e3d6000fd5b505050506000600460006002848154811061202c5761202c612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101611f33565b5061207560026000612bc6565b60005b6003548110156121ad57600754600380546001600160a01b0390921691630a0d45569160059160009190869081106120b2576120b2612efc565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460038054859081106120eb576120eb612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b16815261212693926001600160a01b03169190600401612f12565b600060405180830381600087803b15801561214057600080fd5b505af1158015612154573d6000803e3d6000fd5b505050506000600460006003848154811061217157612171612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612078565b506121ba60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf326306006546040516121ed91815260200190565b60405180910390a150506000600a819055600b819055600c819055600d81905560098190556001819055600655506124119050565b60005b6002548110156122c5576000600560006002848154811061224857612248612efc565b60009182526020808320909101546001600160a01b031683528201929092526040018120919091556002805460049183918590811061228957612289612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612225565b5060005b60035481101561236957600060056000600384815481106122ec576122ec612efc565b60009182526020808320909101546001600160a01b031683528201929092526040018120919091556003805460049183918590811061232d5761232d612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff19169115159190911790556001016122c9565b5061237660036000612bc6565b61238260026000612bc6565b600754600654604051634f0644ef60e01b81526001600160a01b0390921691634f0644ef916123b79160040190815260200190565b600060405180830381600087803b1580156123d157600080fd5b505af11580156123e5573d6000803e3d6000fd5b5050600060068190556001819055600a819055600b819055600c819055600d8190556009555050505050505b5050565b6008548110156124375760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff16156124675760405162461bcd60e51b815260040161061b90612f5f565b600e5460025460035461247a9190612f8e565b612485906001612f8e565b11156124a35760405162461bcd60e51b815260040161061b90612fa1565b60006124ad6126c3565b9050428160400151116124d25760405162461bcd60e51b815260040161061b90612fd8565b336000818152600560205260408082208590556007546006549151632407471360e11b815260048101879052602481019490945260448401919091526001606484015290916001600160a01b039091169063480e8e26906084016020604051808303816000875af115801561254b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256f9190612ec6565b905083156125ee5780600c60008282546125899190612f8e565b9250508190555082600a60008282546125a29190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b03191633179055612661565b80600d60008282546126009190612f8e565b9250508190555082600b60008282546126199190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b3360008181526004602052604090819020805460ff1916600117905560065490517f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d7926126b592909188918891879061302a565b60405180910390a150505050565b6126f16040518060800160405280600081526020016000815260200160008152602001600060ff1681525090565b60015463ffffffff8082168352602082811c821660408086019190915283901c9091169083015260ff606091821c169082015290565b60008281526020819052604090206001015461274281612a83565b6105648383612b22565b60085481101561276e5760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff161561279e5760405162461bcd60e51b815260040161061b90612f5f565b600e546002546003546127b19190612f8e565b6127bc906001612f8e565b11156127da5760405162461bcd60e51b815260040161061b90612fa1565b60006127e46126c3565b9050428160400151116128095760405162461bcd60e51b815260040161061b90612fd8565b336000818152600560209081526040808320869055600491829052808320805460ff19166001908117909155600754600654925163c4e2f86560e01b815293840188905260248401959095526044830191909152606482015290916001600160a01b03169063c4e2f865906084016020604051808303816000875af1158015612896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ba9190612ec6565b905083156129395780600c60008282546128d49190612f8e565b9250508190555082600a60008282546128ed9190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b031916331790556129ac565b80600d600082825461294b9190612f8e565b9250508190555082600b60008282546129649190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b7f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d7338585600654856040516126b595949392919061302a565b60006129f081612a83565b6001600160a01b038216612a355760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b604482015260640161061b565b600780546001600160a01b0319166001600160a01b0384169081179091556040519081527fafa147634b29e2c7bd53ce194256b9f41cfb9ba3036f2b822fdd1d965beea08690602001610533565b612a8d8133612b8d565b50565b6000612a9c838361140c565b612b1a576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055612ad23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016104f1565b5060006104f1565b6000612b2e838361140c565b15612b1a576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016104f1565b612b97828261140c565b6124115760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161061b565b5080546000825590600052602060002090810190612a8d91905b80821115612bf45760008155600101612be0565b5090565b600060208284031215612c0a57600080fd5b81356001600160e01b031981168114612c2257600080fd5b9392505050565b600060208284031215612c3b57600080fd5b5035919050565b6001600160a01b0381168114612a8d57600080fd5b60008060408385031215612c6a57600080fd5b823591506020830135612c7c81612c42565b809150509250929050565b63ffffffff81168114612a8d57600080fd5b803560ff81168114612caa57600080fd5b919050565b600080600080600060a08688031215612cc757600080fd5b8535612cd281612c87565b94506020860135612ce281612c87565b9350604086013592506060860135612cf981612c42565b9150612d0760808701612c99565b90509295509295909350565b80358015158114612caa57600080fd5b600080600083850360c0811215612d3957600080fd5b612d4285612d13565b9350602085013592506080603f1982011215612d5d57600080fd5b506040840190509250925092565b634e487b7160e01b600052604160045260246000fd5b600060208284031215612d9357600080fd5b813567ffffffffffffffff80821115612dab57600080fd5b818401915084601f830112612dbf57600080fd5b813581811115612dd157612dd1612d6b565b604051601f8201601f19908116603f01168101908382118183101715612df957612df9612d6b565b81604052828152876020848701011115612e1257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215612e4457600080fd5b8135612c2281612c42565b60008060408385031215612e6257600080fd5b612e6b83612d13565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104f1576104f1612e79565b63ffffffff828116828216039080821115612ebf57612ebf612e79565b5092915050565b600060208284031215612ed857600080fd5b5051919050565b600060208284031215612ef157600080fd5b8151612c2281612c42565b634e487b7160e01b600052603260045260246000fd5b9283526001600160a01b03919091166020830152604082015260600190565b60208082526014908201527315dc9bdb99c819195c1bdcda5d08185b5bdd5b9d60621b604082015260600190565b602080825260159082015274416c72656164792070617274696369706174696e6760581b604082015260600190565b808201808211156104f1576104f1612e79565b60208082526019908201527f4d617820706c6179657220616d6f756e74207265616368656400000000000000604082015260600190565b6020808252601e908201527f47616d6520697320636c6f73656420666f72206e657720706c61796572730000604082015260600190565b60006020828403121561302157600080fd5b612c2282612c99565b6001600160a01b03959095168552921515602085015260408401919091526060830152608082015260a00190565b604081526000835180604084015260005b818110156130865760208187018101516060868401015201613069565b506000606082850101526060601f19601f83011684010191505060ff831660208301529392505050565b600080604083850312156130c357600080fd5b82518060170b81146130d457600080fd5b6020840151909250612c7c81612c8756fe1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b4a264697066735822122069465d4a08d293b79c1d004a152112f2aa1a31cbdfb339218c9a88e3b2366cda64736f6c63430008180033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c806385ddbaf21161011a578063c0bf4152116100ad578063dbbb50c51161007c578063dbbb50c514610465578063ddca3f431461046e578063ddfd29cf14610477578063f0f442601461048a578063f4caee881461049d57600080fd5b8063c0bf4152146103f8578063ce07b0751461040b578063d547741f14610449578063d6fbf2021461045c57600080fd5b8063acc37344116100e9578063acc373441461039d578063acebb280146103b0578063ad1def1e146103c3578063bf0294d0146103d857600080fd5b806385ddbaf21461036657806391d1485414610379578063a098875b1461038c578063a217fddf1461039557600080fd5b8063536a3ddc1161019d578063645006ca1161016c578063645006ca1461031c57806369fe0e2d1461032557806376f9ed3414610338578063786b844b1461034b5780637d26b6be1461035357600080fd5b8063536a3ddc146102cc5780636024a6b3146102d5578063603c2e6b1461030057806361d027b31461030957600080fd5b806336568abe116101d957806336568abe1461028c57806337c9ce491461029f5780634529cae7146102a85780634c2412a2146102c357600080fd5b806301ffc9a71461020b578063248a9ca314610233578063288dee3b146102645780632f2ff15d14610279575b600080fd5b61021e610219366004612bf8565b6104c0565b60405190151581526020015b60405180910390f35b610256610241366004612c29565b60009081526020819052604090206001015490565b60405190815260200161022a565b610277610272366004612c29565b6104f7565b005b610277610287366004612c57565b61053f565b61027761029a366004612c57565b61056a565b610256600d5481565b6002546003546040805192835260208301919091520161022a565b610256600e5481565b61025660065481565b6102e86102e3366004612c29565b6105a2565b6040516001600160a01b03909116815260200161022a565b610256600c5481565b6007546102e8906001600160a01b031681565b61025660085481565b610277610333366004612c29565b6105cc565b610277610346366004612caf565b610659565b610277610ab8565b610277610361366004612d23565b610e7b565b610277610374366004612d81565b611171565b61021e610387366004612c57565b61140c565b610256600a5481565b610256600081565b6102e86103ab366004612c29565b611435565b6102776103be366004612d81565b611445565b6102566000805160206130e683398151915281565b6102566103e6366004612e32565b60056020526000908152604090205481565b610277610406366004612e4f565b612415565b6104136126c3565b60405161022a919081518152602080830151908201526040808301519082015260609182015160ff169181019190915260800190565b610277610457366004612c57565b612727565b61025660095481565b610256600b5481565b610256600f5481565b610277610485366004612e4f565b61274c565b610277610498366004612e32565b6129e5565b61021e6104ab366004612e32565b60046020526000908152604090205460ff1681565b60006001600160e01b03198216637965db0b60e01b14806104f157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061050281612a83565b600e8290556040518281527f6c31254b0e0eb7c0dc776ffcdc449905584ed6806f9504cb4fdb3dc1578e613a906020015b60405180910390a15050565b60008281526020819052604090206001015461055a81612a83565b6105648383612a90565b50505050565b6001600160a01b03811633146105935760405163334bd91960e11b815260040160405180910390fd5b61059d8282612b22565b505050565b600381815481106105b257600080fd5b6000918252602090912001546001600160a01b0316905081565b60006105d781612a83565b610bb88211156106245760405162461bcd60e51b815260206004820152601360248201527204665652065786365656473207468652063617606c1b60448201526064015b60405180910390fd5b600f8290556040518281527f63fe946ed58429ac3c5e64d4356ff92c26d7fa1e73586515df8ba9f059ab54a590602001610533565b6000805160206130e683398151915261067181612a83565b600154156106c15760405162461bcd60e51b815260206004820152601a60248201527f46696e6973682070726576696f75732067616d65206669727374000000000000604482015260640161061b565b601e6106d34263ffffffff8816612e8f565b10156107135760405162461bcd60e51b815260206004820152600f60248201526e57726f6e672073746f702074696d6560881b604482015260640161061b565b601e61071f8688612ea2565b63ffffffff1610156107735760405162461bcd60e51b815260206004820152601c60248201527f54696d656672616d6520676170206d7573742062652068696768657200000000604482015260640161061b565b60075460405163722ec76f60e01b81526001600160a01b0385811660048301529091169063722ec76f906024016020604051808303816000875af11580156107bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e39190612ec6565b8410156108325760405162461bcd60e51b815260206004820152601860248201527f57726f6e67206d696e206465706f73697420616d6f756e740000000000000000604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa15801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612edf565b60405163ae82b5c960e01b815260ff851660048201526001600160a01b03919091169063ae82b5c990602401602060405180830381865afa1580156108e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090d9190612ec6565b0361094e5760405162461bcd60e51b81526020600482015260116024820152702bb937b733903332b2b210373ab6b132b960791b604482015260640161061b565b60608260ff16901b60408763ffffffff16901b60208763ffffffff16901b421717176001819055508542306040516020016109bd9392919060e09390931b6001600160e01b0319168352600483019190915260601b6bffffffffffffffffffffffff1916602482015260380190565b60408051808303601f19018152908290528051602090910120600681905560075463039279d760e61b835260048301919091526001600160a01b038581166024840152169063e49e75c090604401600060405180830381600087803b158015610a2557600080fd5b505af1158015610a39573d6000803e3d6000fd5b5050506008859055506006546040805142815263ffffffff808916602083015289169181019190915260ff8416606082015260808101919091526001600160a01b03841660a08201527f4439485efd184bcd23fddb305919729ddfad3c7a5251d09b470fe56fe57ade3a9060c0015b60405180910390a1505050505050565b6000805160206130e6833981519152610ad081612a83565b600654610b125760405162461bcd60e51b815260206004820152601060248201526f11d85b59481b9bdd081cdd185c9d195960821b604482015260640161061b565b60005b600254811015610c8957600754600280546001600160a01b0390921691630a0d4556916005916000919086908110610b4f57610b4f612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546002805485908110610b8857610b88612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152610bc393926001600160a01b03169190600401612f12565b600060405180830381600087803b158015610bdd57600080fd5b505af1158015610bf1573d6000803e3d6000fd5b5050505060006004600060028481548110610c0e57610c0e612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff19169215159290921790915560028054600591839185908110610c5c57610c5c612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610b15565b50610c9660026000612bc6565b60005b600354811015610e0d57600754600380546001600160a01b0390921691630a0d4556916005916000919086908110610cd357610cd3612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546003805485908110610d0c57610d0c612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152610d4793926001600160a01b03169190600401612f12565b600060405180830381600087803b158015610d6157600080fd5b505af1158015610d75573d6000803e3d6000fd5b5050505060006004600060038481548110610d9257610d92612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff19169215159290921790915560038054600591839185908110610de057610de0612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610c99565b50610e1a60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf32630600654604051610e4d91815260200190565b60405180910390a150600060068190556001819055600a819055600b819055600c819055600d819055600955565b600854821015610e9d5760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff1615610ecd5760405162461bcd60e51b815260040161061b90612f5f565b600e54600254600354610ee09190612f8e565b610eeb906001612f8e565b1115610f095760405162461bcd60e51b815260040161061b90612fa1565b6000610f136126c3565b905042816040015111610f385760405162461bcd60e51b815260040161061b90612fd8565b33600081815260056020908152604080832087905560048252808320805460ff1916600190811790915560075460065494956001600160a01b039190911694636affb29a948a94929391928a3591610f94918c01908c0161300f565b604080516001600160e01b031960e08a901b16815260048101979097526001600160a01b03909516602487015260448601939093529015156064850152608484015260ff1660a483015286013560c4820152606086013560e4820152610104016020604051808303816000875af1158015611013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110379190612ec6565b905084156110b65780600c60008282546110519190612f8e565b9250508190555083600a600082825461106a9190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b03191633179055611129565b80600d60008282546110c89190612f8e565b9250508190555083600b60008282546110e19190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b7f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d73386866006548560405161116295949392919061302a565b60405180910390a15050505050565b6000805160206130e683398151915261118981612a83565b60006111936126c3565b90506009546000146111e75760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e6720707269636520616c726561647920736574000000000000604482015260640161061b565b80604001514210156112275760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015260640161061b565b600254151580611238575060035415155b6112795760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820706c617965727360701b604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e79190612edf565b9050600080826001600160a01b031663d369dc618786606001516040518363ffffffff1660e01b815260040161131e929190613058565b60408051808303816000875af115801561133c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136091906130b0565b91509150603c84604001518263ffffffff1661137c9190612e8f565b11156113c15760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161061b565b6001600160c01b03821660095560065460408051601785900b815260208101929092527ffcd72aeb09107db0b2cdb05b7c9377eafa86a5ac4474c90a97c61258db9cba149101610aa8565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600281815481106105b257600080fd5b6000805160206130e683398151915261145d81612a83565b60006114676126c3565b90506001546000036114b25760405162461bcd60e51b815260206004820152601460248201527314dd185c9d081d1a194819d85b5948199a5c9cdd60621b604482015260640161061b565b80602001514210156114fc5760405162461bcd60e51b81526020600482015260136024820152720a8dede40cac2e4d8f240e8de40ccd2dcd2e6d606b1b604482015260640161061b565b600254158061150b5750600354155b1561189057600254156116a15760005b60025481101561168f57600754600280546001600160a01b0390921691630a0d455691600591600091908690811061155557611555612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902054600280548590811061158e5761158e612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b1681526115c993926001600160a01b03169190600401612f12565b600060405180830381600087803b1580156115e357600080fd5b505af11580156115f7573d6000803e3d6000fd5b505050506000600460006002848154811061161457611614612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff1916921515929092179091556002805460059183918590811061166257611662612efc565b60009182526020808320909101546001600160a01b0316835282019290925260400190205560010161151b565b5061169c60026000612bc6565b61182d565b6003541561182d5760005b60035481101561182057600754600380546001600160a01b0390921691630a0d45569160059160009190869081106116e6576116e6612efc565b60009182526020808320909101546001600160a01b03168352820192909252604001902054600380548590811061171f5761171f612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b16815261175a93926001600160a01b03169190600401612f12565b600060405180830381600087803b15801561177457600080fd5b505af1158015611788573d6000803e3d6000fd5b50505050600060046000600384815481106117a5576117a5612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040018120805460ff191692151592909217909155600380546005918391859081106117f3576117f3612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020556001016116ac565b5061182d60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf3263060065460405161186091815260200190565b60405180910390a15060006001819055600a819055600b819055600c819055600d81905560098190556006555050565b6009546000036118e25760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e67207072696365206d75737420626520736574000000000000604482015260640161061b565b6007546040805163167a382560e11b815290516000926001600160a01b031691632cf4704a9160048083019260209291908290030181865afa15801561192c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119509190612edf565b9050600080826001600160a01b031663d369dc618786606001516040518363ffffffff1660e01b8152600401611987929190613058565b60408051808303816000875af11580156119a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c991906130b0565b91509150603c84602001518263ffffffff166119e59190612e8f565b1115611a2a5760405162461bcd60e51b815260206004820152601460248201527313db190818da185a5b9b1a5b9ac81c995c1bdc9d60621b604482015260640161061b565b600954826001600160c01b03161115611ca957600754600b54600f54600654604051637b85343760e11b81526004810193909352602483019190915260448201526001600160a01b039091169063f70a686e906064016020604051808303816000875af1158015611a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac39190612ec6565b50600754600a54600d546006546040516328ac5cf760e21b81526004810193909352602483019190915260448201526000916001600160a01b03169063a2b173dc906064016020604051808303816000875af1158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190612ec6565b905060005b600254811015611c5857600754600280546001600160a01b03909216916388cc22ff919084908110611b8457611b84612efc565b9060005260206000200160009054906101000a90046001600160a01b03166005600060028681548110611bb957611bb9612efc565b6000918252602080832091909101546001600160a01b039081168452908301939093526040918201902054600654915160e086901b6001600160e01b03191681529390921660048401526024830191909152604482015260648101859052608401600060405180830381600087803b158015611c3457600080fd5b505af1158015611c48573d6000803e3d6000fd5b505060019092019150611b509050565b5060065460408051601786900b815260016020820152908101919091527ff4570c324e50c8cf2966e6ca6c7dce637fd012713169a420ddf51f963cf3dd69906060015b60405180910390a150612222565b600954826001600160c01b03161015611f1e57600754600a54600f54600654604051637b85343760e11b81526004810193909352602483019190915260448201526001600160a01b039091169063f70a686e906064016020604051808303816000875af1158015611d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d429190612ec6565b50600754600b54600c546006546040516328ac5cf760e21b81526004810193909352602483019190915260448201526000916001600160a01b03169063a2b173dc906064016020604051808303816000875af1158015611da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dca9190612ec6565b905060005b600354811015611ed757600754600380546001600160a01b03909216916388cc22ff919084908110611e0357611e03612efc565b9060005260206000200160009054906101000a90046001600160a01b03166005600060038681548110611e3857611e38612efc565b6000918252602080832091909101546001600160a01b039081168452908301939093526040918201902054600654915160e086901b6001600160e01b03191681529390921660048401526024830191909152604482015260648101859052608401600060405180830381600087803b158015611eb357600080fd5b505af1158015611ec7573d6000803e3d6000fd5b505060019092019150611dcf9050565b5060065460408051601786900b815260006020820152908101919091527ff4570c324e50c8cf2966e6ca6c7dce637fd012713169a420ddf51f963cf3dd6990606001611c9b565b600954826001600160c01b0316036122225760005b60025481101561206857600754600280546001600160a01b0390921691630a0d4556916005916000919086908110611f6d57611f6d612efc565b60009182526020808320909101546001600160a01b031683528201929092526040019020546002805485908110611fa657611fa6612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b168152611fe193926001600160a01b03169190600401612f12565b600060405180830381600087803b158015611ffb57600080fd5b505af115801561200f573d6000803e3d6000fd5b505050506000600460006002848154811061202c5761202c612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101611f33565b5061207560026000612bc6565b60005b6003548110156121ad57600754600380546001600160a01b0390921691630a0d45569160059160009190869081106120b2576120b2612efc565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460038054859081106120eb576120eb612efc565b6000918252602090912001546006546040516001600160e01b031960e086901b16815261212693926001600160a01b03169190600401612f12565b600060405180830381600087803b15801561214057600080fd5b505af1158015612154573d6000803e3d6000fd5b505050506000600460006003848154811061217157612171612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612078565b506121ba60036000612bc6565b7f902a8e7f6231be7266d538b9ebd51fc2d2275f10cf965f3d80fbf3988cf326306006546040516121ed91815260200190565b60405180910390a150506000600a819055600b819055600c819055600d81905560098190556001819055600655506124119050565b60005b6002548110156122c5576000600560006002848154811061224857612248612efc565b60009182526020808320909101546001600160a01b031683528201929092526040018120919091556002805460049183918590811061228957612289612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612225565b5060005b60035481101561236957600060056000600384815481106122ec576122ec612efc565b60009182526020808320909101546001600160a01b031683528201929092526040018120919091556003805460049183918590811061232d5761232d612efc565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff19169115159190911790556001016122c9565b5061237660036000612bc6565b61238260026000612bc6565b600754600654604051634f0644ef60e01b81526001600160a01b0390921691634f0644ef916123b79160040190815260200190565b600060405180830381600087803b1580156123d157600080fd5b505af11580156123e5573d6000803e3d6000fd5b5050600060068190556001819055600a819055600b819055600c819055600d8190556009555050505050505b5050565b6008548110156124375760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff16156124675760405162461bcd60e51b815260040161061b90612f5f565b600e5460025460035461247a9190612f8e565b612485906001612f8e565b11156124a35760405162461bcd60e51b815260040161061b90612fa1565b60006124ad6126c3565b9050428160400151116124d25760405162461bcd60e51b815260040161061b90612fd8565b336000818152600560205260408082208590556007546006549151632407471360e11b815260048101879052602481019490945260448401919091526001606484015290916001600160a01b039091169063480e8e26906084016020604051808303816000875af115801561254b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256f9190612ec6565b905083156125ee5780600c60008282546125899190612f8e565b9250508190555082600a60008282546125a29190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b03191633179055612661565b80600d60008282546126009190612f8e565b9250508190555082600b60008282546126199190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b3360008181526004602052604090819020805460ff1916600117905560065490517f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d7926126b592909188918891879061302a565b60405180910390a150505050565b6126f16040518060800160405280600081526020016000815260200160008152602001600060ff1681525090565b60015463ffffffff8082168352602082811c821660408086019190915283901c9091169083015260ff606091821c169082015290565b60008281526020819052604090206001015461274281612a83565b6105648383612b22565b60085481101561276e5760405162461bcd60e51b815260040161061b90612f31565b3360009081526004602052604090205460ff161561279e5760405162461bcd60e51b815260040161061b90612f5f565b600e546002546003546127b19190612f8e565b6127bc906001612f8e565b11156127da5760405162461bcd60e51b815260040161061b90612fa1565b60006127e46126c3565b9050428160400151116128095760405162461bcd60e51b815260040161061b90612fd8565b336000818152600560209081526040808320869055600491829052808320805460ff19166001908117909155600754600654925163c4e2f86560e01b815293840188905260248401959095526044830191909152606482015290916001600160a01b03169063c4e2f865906084016020604051808303816000875af1158015612896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ba9190612ec6565b905083156129395780600c60008282546128d49190612f8e565b9250508190555082600a60008282546128ed9190612f8e565b9091555050600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b031916331790556129ac565b80600d600082825461294b9190612f8e565b9250508190555082600b60008282546129649190612f8e565b9091555050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b031916331790555b7f65ea1892d2ac0674bd1736b4fdd4eec7f8017f3fca171de2f42d13414fc7f3d7338585600654856040516126b595949392919061302a565b60006129f081612a83565b6001600160a01b038216612a355760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b604482015260640161061b565b600780546001600160a01b0319166001600160a01b0384169081179091556040519081527fafa147634b29e2c7bd53ce194256b9f41cfb9ba3036f2b822fdd1d965beea08690602001610533565b612a8d8133612b8d565b50565b6000612a9c838361140c565b612b1a576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055612ad23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016104f1565b5060006104f1565b6000612b2e838361140c565b15612b1a576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016104f1565b612b97828261140c565b6124115760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161061b565b5080546000825590600052602060002090810190612a8d91905b80821115612bf45760008155600101612be0565b5090565b600060208284031215612c0a57600080fd5b81356001600160e01b031981168114612c2257600080fd5b9392505050565b600060208284031215612c3b57600080fd5b5035919050565b6001600160a01b0381168114612a8d57600080fd5b60008060408385031215612c6a57600080fd5b823591506020830135612c7c81612c42565b809150509250929050565b63ffffffff81168114612a8d57600080fd5b803560ff81168114612caa57600080fd5b919050565b600080600080600060a08688031215612cc757600080fd5b8535612cd281612c87565b94506020860135612ce281612c87565b9350604086013592506060860135612cf981612c42565b9150612d0760808701612c99565b90509295509295909350565b80358015158114612caa57600080fd5b600080600083850360c0811215612d3957600080fd5b612d4285612d13565b9350602085013592506080603f1982011215612d5d57600080fd5b506040840190509250925092565b634e487b7160e01b600052604160045260246000fd5b600060208284031215612d9357600080fd5b813567ffffffffffffffff80821115612dab57600080fd5b818401915084601f830112612dbf57600080fd5b813581811115612dd157612dd1612d6b565b604051601f8201601f19908116603f01168101908382118183101715612df957612df9612d6b565b81604052828152876020848701011115612e1257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215612e4457600080fd5b8135612c2281612c42565b60008060408385031215612e6257600080fd5b612e6b83612d13565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104f1576104f1612e79565b63ffffffff828116828216039080821115612ebf57612ebf612e79565b5092915050565b600060208284031215612ed857600080fd5b5051919050565b600060208284031215612ef157600080fd5b8151612c2281612c42565b634e487b7160e01b600052603260045260246000fd5b9283526001600160a01b03919091166020830152604082015260600190565b60208082526014908201527315dc9bdb99c819195c1bdcda5d08185b5bdd5b9d60621b604082015260600190565b602080825260159082015274416c72656164792070617274696369706174696e6760581b604082015260600190565b808201808211156104f1576104f1612e79565b60208082526019908201527f4d617820706c6179657220616d6f756e74207265616368656400000000000000604082015260600190565b6020808252601e908201527f47616d6520697320636c6f73656420666f72206e657720706c61796572730000604082015260600190565b60006020828403121561302157600080fd5b612c2282612c99565b6001600160a01b03959095168552921515602085015260408401919091526060830152608082015260a00190565b604081526000835180604084015260005b818110156130865760208187018101516060868401015201613069565b506000606082850101526060601f19601f83011684010191505060ff831660208301529392505050565b600080604083850312156130c357600080fd5b82518060170b81146130d457600080fd5b6020840151909250612c7c81612c8756fe1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b4a264697066735822122069465d4a08d293b79c1d004a152112f2aa1a31cbdfb339218c9a88e3b2366cda64736f6c63430008180033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.