ETH Price: $1,799.67 (+10.71%)

Contract

0xFB02ccF0492b554955e64b1a008EBDbB04dc5932

Overview

ETH Balance

0 ETH

ETH Value

$0.00
Transaction Hash
Method
Block
From
To
Claim136998182024-06-26 6:58:50301 days ago1719385130IN
0xFB02ccF0...B04dc5932
0 ETH0.000006110.0562
Claim136989542024-06-26 6:15:25301 days ago1719382525IN
0xFB02ccF0...B04dc5932
0 ETH0.000003730.0343
Claim67291322023-10-29 9:14:46542 days ago1698570886IN
0xFB02ccF0...B04dc5932
0 ETH0.000094830.8715
Predict67262812023-10-29 7:59:50542 days ago1698566390IN
0xFB02ccF0...B04dc5932
0.0034 ETH0.000173250.8535
Predict67220382023-10-29 5:58:40542 days ago1698559120IN
0xFB02ccF0...B04dc5932
0.0015 ETH0.000134580.663
Claim67205922023-10-29 5:01:04542 days ago1698555664IN
0xFB02ccF0...B04dc5932
0 ETH0.000078430.72
Predict67189832023-10-29 3:57:51542 days ago1698551871IN
0xFB02ccF0...B04dc5932
0.0033 ETH0.000166820.822
Claim67183682023-10-29 3:32:43542 days ago1698550363IN
0xFB02ccF0...B04dc5932
0 ETH0.000093780.861
Predict67164472023-10-29 1:59:31542 days ago1698544771IN
0xFB02ccF0...B04dc5932
0.0022 ETH0.000144290.711
Claim67147072023-10-29 0:34:08542 days ago1698539648IN
0xFB02ccF0...B04dc5932
0 ETH0.000066920.615
Predict67017892023-10-28 13:59:09542 days ago1698501549IN
0xFB02ccF0...B04dc5932
0.0075 ETH0.000268561.323
Claim67002732023-10-28 13:01:03542 days ago1698498063IN
0xFB02ccF0...B04dc5932
0 ETH0.000116331.068
Predict66981832023-10-28 11:58:58542 days ago1698494338IN
0xFB02ccF0...B04dc5932
0.007 ETH0.000202430.9975
Claim66860822023-10-28 7:06:22543 days ago1698476782IN
0xFB02ccF0...B04dc5932
0 ETH0.000082170.7544
Predict66835882023-10-28 5:58:42543 days ago1698472722IN
0xFB02ccF0...B04dc5932
0.0067 ETH0.000132420.6525
Claim66804962023-10-28 4:18:12543 days ago1698466692IN
0xFB02ccF0...B04dc5932
0 ETH0.00007230.6645
Predict66786542023-10-28 2:59:38543 days ago1698461978IN
0xFB02ccF0...B04dc5932
0.0011 ETH0.000143110.705
Claim66772442023-10-28 2:12:05543 days ago1698459125IN
0xFB02ccF0...B04dc5932
0 ETH0.000085690.7875
Predict66697482023-10-27 18:57:25543 days ago1698433045IN
0xFB02ccF0...B04dc5932
0.0014 ETH0.000240241.1835
Claim66670722023-10-27 17:06:58543 days ago1698426418IN
0xFB02ccF0...B04dc5932
0 ETH0.00019261.77
Predict66656962023-10-27 15:58:50543 days ago1698422330IN
0xFB02ccF0...B04dc5932
0.0066 ETH0.000362341.785
Claim66630302023-10-27 14:04:12543 days ago1698415452IN
0xFB02ccF0...B04dc5932
0 ETH0.000205661.89
Predict66611652023-10-27 12:59:31543 days ago1698411571IN
0xFB02ccF0...B04dc5932
0.00355 ETH0.000374521.845
Predict66588522023-10-27 11:59:47543 days ago1698407987IN
0xFB02ccF0...B04dc5932
0.00735 ETH0.00020731.0215
Claim66557342023-10-27 10:27:07543 days ago1698402427IN
0xFB02ccF0...B04dc5932
0 ETH0.000128941.185
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
68211512023-10-31 23:01:00539 days ago1698793260
0xFB02ccF0...B04dc5932
0.00138579 ETH
68211512023-10-31 23:01:00539 days ago1698793260
0xFB02ccF0...B04dc5932
0.00138579 ETH
68211512023-10-31 23:01:00539 days ago1698793260
0xFB02ccF0...B04dc5932
0.00138579 ETH
68211512023-10-31 23:01:00539 days ago1698793260
0xFB02ccF0...B04dc5932
0.00138579 ETH
68189282023-10-31 21:01:00539 days ago1698786060
0xFB02ccF0...B04dc5932
0.00138579 ETH
68189282023-10-31 21:01:00539 days ago1698786060
0xFB02ccF0...B04dc5932
0.00138579 ETH
68189282023-10-31 21:01:00539 days ago1698786060
0xFB02ccF0...B04dc5932
0.00138579 ETH
68189282023-10-31 21:01:00539 days ago1698786060
0xFB02ccF0...B04dc5932
0.00138579 ETH
68165902023-10-31 19:01:05539 days ago1698778865
0xFB02ccF0...B04dc5932
0.00138579 ETH
68165902023-10-31 19:01:05539 days ago1698778865
0xFB02ccF0...B04dc5932
0.00138579 ETH
68165902023-10-31 19:01:05539 days ago1698778865
0xFB02ccF0...B04dc5932
0.00138579 ETH
68165902023-10-31 19:01:05539 days ago1698778865
0xFB02ccF0...B04dc5932
0.00138579 ETH
68143602023-10-31 17:01:02539 days ago1698771662
0xFB02ccF0...B04dc5932
0.00138579 ETH
68143602023-10-31 17:01:02539 days ago1698771662
0xFB02ccF0...B04dc5932
0.00138579 ETH
68143602023-10-31 17:01:02539 days ago1698771662
0xFB02ccF0...B04dc5932
0.00138579 ETH
68143602023-10-31 17:01:02539 days ago1698771662
0xFB02ccF0...B04dc5932
0.00138579 ETH
68123642023-10-31 15:00:59539 days ago1698764459
0xFB02ccF0...B04dc5932
0.00138579 ETH
68123642023-10-31 15:00:59539 days ago1698764459
0xFB02ccF0...B04dc5932
0.00138579 ETH
68123642023-10-31 15:00:59539 days ago1698764459
0xFB02ccF0...B04dc5932
0.00138579 ETH
68123642023-10-31 15:00:59539 days ago1698764459
0xFB02ccF0...B04dc5932
0.00138579 ETH
68095772023-10-31 13:00:59539 days ago1698757259
0xFB02ccF0...B04dc5932
0.00138579 ETH
68095772023-10-31 13:00:59539 days ago1698757259
0xFB02ccF0...B04dc5932
0.00138579 ETH
68095772023-10-31 13:00:59539 days ago1698757259
0xFB02ccF0...B04dc5932
0.00138579 ETH
68095772023-10-31 13:00:59539 days ago1698757259
0xFB02ccF0...B04dc5932
0.00138579 ETH
68057902023-10-31 11:01:01539 days ago1698750061
0xFB02ccF0...B04dc5932
0.00138579 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NativeSDK

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 24 : NativeSDK.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

import { AbstractBhavishSDK } from "./AbstractBhavishSDK.sol";
import { IBhavishNativeSDK, IBhavishPredictionNative } from "../../Interface/IBhavishNativeSDK.sol";
import { IBhavishPrediction } from "../../Interface/IBhavishPrediction.sol";
import { BhavishSwap } from "../../Integrations/Swap/BhavishSwap.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract NativeSDK is AbstractBhavishSDK, IBhavishNativeSDK {
    using Address for address;
    using SafeERC20 for IERC20;

    BhavishSwap public bhavishSwap;

    constructor(
        IBhavishPredictionNative[] memory _bhavishPrediction,
        bytes32[] memory _underlying,
        bytes32[] memory _strike,
        BhavishSwap _bhavishSwap
    ) {
        require(_bhavishPrediction.length == _underlying.length, "Invalid array arguments passed");
        require(_strike.length == _underlying.length, "Invalid array arguments passed");
        require(address(_bhavishSwap).isContract(), "Swapper is not a contract");
        bhavishSwap = _bhavishSwap;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        for (uint256 i = 0; i < _bhavishPrediction.length; i++) {
            predictionMap[_underlying[i]][_strike[i]] = _bhavishPrediction[i];
            activePredictionMap[_bhavishPrediction[i]] = true;
        }
    }

    function _getNativePredictionMap(IBhavishPrediction _bhavishPrediction)
        private
        pure
        returns (IBhavishPredictionNative bhavishPrediction)
    {
        return IBhavishPredictionNative(address(_bhavishPrediction));
    }

    function predict(
        PredictionStruct memory _predStruct,
        address _userAddress,
        address _provider
    ) external payable override {
        IBhavishPredictionNative bhavishPrediction = _getNativePredictionMap(
            predictionMap[_predStruct.underlying][_predStruct.strike]
        );

        require(address(bhavishPrediction) != address(0), "Prediction Market for the asset is not present");
        require(activePredictionMap[bhavishPrediction], "Prediction Market for the asset is not active");

        address userAddress_;
        if (address(msg.sender).isContract() && validContracts[msg.sender]) {
            userAddress_ = _userAddress;
        } else {
            require(msg.sender == _userAddress, "Buyer and msg.sender cannot be different");
            userAddress_ = msg.sender;
        }

        if (_predStruct.directionUp) bhavishPrediction.predictUp{ value: msg.value }(_predStruct.roundId, userAddress_);
        else bhavishPrediction.predictDown{ value: msg.value }(_predStruct.roundId, userAddress_);

        _populateProviderInfo(_provider, msg.value);
    }

    function predictWithGasless(PredictionStruct memory _predStruct, address _provider) external payable override {
        IBhavishPredictionNative bhavishPrediction = _getNativePredictionMap(
            predictionMap[_predStruct.underlying][_predStruct.strike]
        );
        require(address(bhavishPrediction) != address(0), "Prediction Market for the asset is not active");
        require(activePredictionMap[bhavishPrediction], "Prediction Market for the asset is not active");
        require(msg.value > minimumGaslessBetAmount, "Bet amount is not eligible for gasless");

        if (_predStruct.directionUp) bhavishPrediction.predictUp{ value: msg.value }(_predStruct.roundId, msgSender());
        else bhavishPrediction.predictDown{ value: msg.value }(_predStruct.roundId, msgSender());

        _populateProviderInfo(_provider, msg.value);
    }

    function _swapAndPredict(
        BhavishSwap.SwapStruct memory _swapStruct,
        PredictionStruct memory _predStruct,
        uint256 _slippage,
        bool _isGasless,
        address _provider
    ) internal {
        IBhavishPredictionNative bhavishPrediction = _getNativePredictionMap(
            predictionMap[_predStruct.underlying][_predStruct.strike]
        );

        require(address(bhavishPrediction) != address(0), "Prediction Market for the asset is not present");
        require(activePredictionMap[bhavishPrediction], "Prediction Market for the asset is not active");
        // Fetch the path to get the erc20 token address and transfer the amountIn to sdk contract.
        address[] memory path = bhavishSwap.getPath(_swapStruct.fromAsset, _swapStruct.toAsset);
        IERC20(path[0]).safeTransferFrom(msgSender(), address(bhavishSwap), _swapStruct.amountIn);

        uint256[] memory amounts = bhavishSwap.swapExactTokensForETH(_swapStruct, address(this), _slippage);

        if (_isGasless) {
            require(amounts[amounts.length - 1] > minimumGaslessBetAmount, "Bet amount is not eligible for gasless");
        }

        if (_predStruct.directionUp)
            bhavishPrediction.predictUp{ value: amounts[amounts.length - 1] }(_predStruct.roundId, msgSender());
        else bhavishPrediction.predictDown{ value: amounts[amounts.length - 1] }(_predStruct.roundId, msgSender());

        _populateProviderInfo(_provider, amounts[amounts.length - 1]);
    }

    function swapAndPredict(
        BhavishSwap.SwapStruct memory _swapStruct,
        PredictionStruct memory _predStruct,
        uint256 slippage,
        address _provider
    ) external override {
        _swapAndPredict(_swapStruct, _predStruct, slippage, false, _provider);
    }

    function swapAndPredictWithGasless(
        BhavishSwap.SwapStruct memory _swapStruct,
        PredictionStruct memory _predStruct,
        uint256 slippage,
        address _provider
    ) external override {
        _swapAndPredict(_swapStruct, _predStruct, slippage, true, _provider);
    }

    function _claim(
        IBhavishPrediction bhavishPredict,
        uint256[] calldata roundIds,
        address userAddress,
        IBhavishPredictionNative.SwapParams memory _swapParams
    ) internal {
        IBhavishPredictionNative(address(bhavishPredict)).claim(roundIds, userAddress, _swapParams);
    }

    function claim(
        PredictionStruct memory _predStruct,
        uint256[] calldata roundIds,
        IBhavishPredictionNative.SwapParams memory _swapParams
    ) external {
        _claim(predictionMap[_predStruct.underlying][_predStruct.strike], roundIds, msg.sender, _swapParams);
    }

    function claimWithGasless(
        PredictionStruct memory _predStruct,
        uint256[] calldata roundIds,
        IBhavishPredictionNative.SwapParams memory _swapParams
    ) external {
        IBhavishPrediction bhavishPrediction = predictionMap[_predStruct.underlying][_predStruct.strike];

        uint256 avgBetAmount = bhavishPrediction.getAverageBetAmount(roundIds, msgSender());
        require(avgBetAmount > minimumGaslessBetAmount, "Not eligible for gasless");

        _claim(bhavishPrediction, roundIds, msgSender(), _swapParams);
    }
}

File 2 of 24 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../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:
 *
 * ```
 * 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}:
 *
 * ```
 * 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.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    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 override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @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 override 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 override 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 override 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 `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @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 Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 24 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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.
     *
     * _Available since v3.1._
     */
    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 `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 4 of 24 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 6 of 24 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 7 of 24 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 24 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 9 of 24 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./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);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 10 of 24 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 11 of 24 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 12 of 24 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 13 of 24 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 14 of 24 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 15 of 24 : IUniswapV2Router02.sol
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 16 of 24 : AbstractBhavishSDK.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

import { IBhavishSDK } from "../../Interface/IBhavishSDK.sol";
import { IBhavishPrediction } from "../../Interface/IBhavishPrediction.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
import { BaseRelayRecipient } from "../../Integrations/Gasless/BaseRelayRecipient.sol";
import { DateTimeLibrary } from "../../Libs/DateTimeLibrary.sol";

abstract contract AbstractBhavishSDK is IBhavishSDK, BaseRelayRecipient, AccessControl {
    using Address for address;

    mapping(bytes32 => mapping(bytes32 => IBhavishPrediction)) public predictionMap;
    mapping(IBhavishPrediction => bool) public activePredictionMap;
    uint256 public decimals = 3;
    mapping(bytes32 => bool) public usersForTheMonth;
    // Month -> Amount
    mapping(uint256 => uint256) public totalWeeklyPremiumCollected;
    mapping(uint256 => uint256) public totalMonthlyPremiumCollected;
    mapping(uint256 => uint256) public totalYearlyPremiumCollected;
    mapping(uint256 => uint256) public totalBhavishAllocated;
    // Address -> Month -> Amount
    mapping(address => mapping(uint256 => uint256)) public premiumCollected;
    mapping(address => bool) public validContracts;

    /**
     * @dev minimum gasless bet amount
     */
    uint256 public override minimumGaslessBetAmount = 0.1 ether;

    modifier onlyAdmin(address _address) {
        require(hasRole(DEFAULT_ADMIN_ROLE, _address), "SDK: caller has no access to the method");
        _;
    }

    /**
     * @notice Add funds
     */
    receive() external payable {}

    function addPredictionMarket(
        IBhavishPrediction[] memory _bhavishPrediction,
        bytes32[] memory _underlying,
        bytes32[] memory _strike
    ) external onlyAdmin(msg.sender) {
        require(_bhavishPrediction.length == _underlying.length, "Invalid array arguments passed");
        require(_strike.length == _underlying.length, "Invalid array arguments passed");
        for (uint256 i = 0; i < _bhavishPrediction.length; i++) {
            predictionMap[_underlying[i]][_strike[i]] = _bhavishPrediction[i];
            require(!activePredictionMap[_bhavishPrediction[i]], "Prediction Market is already active");
            activePredictionMap[_bhavishPrediction[i]] = true;
        }
    }

    function updatePredictionMarket(
        IBhavishPrediction _bhavishPrediction,
        bytes32 _underlying,
        bytes32 _strike
    ) external onlyAdmin(msg.sender) {
        require(address(predictionMap[_underlying][_strike]) != address(0), "Prediction market doesn't exist");
        predictionMap[_underlying][_strike] = _bhavishPrediction;
        activePredictionMap[_bhavishPrediction] = true;
    }

    function removePredictionMarket(IBhavishPrediction _bhavishPrediction) external onlyAdmin(msg.sender) {
        require(activePredictionMap[_bhavishPrediction], "Prediction market is not in active state");
        activePredictionMap[_bhavishPrediction] = false;
    }

    function setTrustedForwarder(address forwarderAddress) public onlyAdmin(msg.sender) {
        require(forwarderAddress != address(0), "SDK: Forwarder Address cannot be 0");
        trustedForwarder.push(forwarderAddress);
    }

    function removeTrustedForwarder(address forwarderAddress) public onlyAdmin(msg.sender) {
        bool found = false;
        uint256 i;
        for (i = 0; i < trustedForwarder.length; i++) {
            if (trustedForwarder[i] == forwarderAddress) {
                found = true;
                break;
            }
        }
        if (found) {
            trustedForwarder[i] = trustedForwarder[trustedForwarder.length - 1];
            trustedForwarder.pop();
        }
    }

    function versionRecipient() external view virtual override returns (string memory) {
        return "1";
    }

    function _populateProviderInfo(address _provider, uint256 _predAmt) internal {
        (, uint256 month, uint256 year, uint256 week) = DateTimeLibrary.getAll(block.timestamp);

        if (!usersForTheMonth[keccak256(abi.encode(_provider, month))]) {
            usersForTheMonth[keccak256(abi.encode(_provider, month))] = true;
            emit PredictionMarketProvider(month, _provider);
        }
        premiumCollected[_provider][month] += _predAmt;
        totalMonthlyPremiumCollected[month] += _predAmt;
        totalYearlyPremiumCollected[year] += _predAmt;
        totalWeeklyPremiumCollected[week] += _predAmt;
    }

    function setMinimumGaslessBetAmount(uint256 _amount) external onlyAdmin(msg.sender) {
        require(_amount >= 0.1 ether && _amount < 100 ether, "invalid minimum gasless premium");
        minimumGaslessBetAmount = _amount;
    }

    function _refundUsers(
        IBhavishPrediction bhavishPredict,
        uint256 roundId,
        address userAddress
    ) internal {
        bhavishPredict.refundUsers(roundId, userAddress);
    }

    function refundUsers(PredictionStruct memory _predStruct, uint256 roundId) external {
        _refundUsers(predictionMap[_predStruct.underlying][_predStruct.strike], roundId, msg.sender);
    }

    function refundUsersWithGasless(PredictionStruct memory _predStruct, uint256 roundId) external {
        IBhavishPrediction bhavishPrediction = predictionMap[_predStruct.underlying][_predStruct.strike];
        uint256[] memory roundArr = new uint256[](1);
        roundArr[0] = roundId;
        uint256 avgBetAmount = bhavishPrediction.getAverageBetAmount(roundArr, msgSender());

        require(avgBetAmount > minimumGaslessBetAmount, "Not eligible for gasless");

        _refundUsers(bhavishPrediction, roundId, msgSender());
    }

    function addContract(address _contract) external onlyAdmin(msg.sender) {
        require(_contract.isContract(), "invalid address");
        validContracts[_contract] = true;
    }

    function removeContract(address _contract) external onlyAdmin(msg.sender) {
        validContracts[_contract] = false;
    }
}

File 17 of 24 : BaseRelayRecipient.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

import "./IRelayRecipient.sol";

/**
 * A base contract to be inherited by any contract that want to receive relayed transactions
 * A subclass must use "_msgSender()" instead of "msg.sender"
 */
abstract contract BaseRelayRecipient is IRelayRecipient {
    /*
     * Forwarder singleton we accept calls from
     */

    address[] public trustedForwarder;

    /*
     * require a function to be called through GSN only
     */
    modifier trustedForwarderOnly() {
        require(isTrustedForwarder(msg.sender), "Function can only be called through the trusted Forwarder");
        _;
    }

    function isTrustedForwarder(address forwarder) public view override returns (bool) {
        for (uint256 i = 0; i < trustedForwarder.length; i++) if (forwarder == trustedForwarder[i]) return true;
        return false;
    }

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, return the original sender.
     * otherwise, return `msg.sender`.
     * should be used in the contract anywhere instead of msg.sender
     */
    function msgSender() internal view virtual override returns (address ret) {
        if (msg.data.length >= 24 && isTrustedForwarder(msg.sender)) {
            // At this point we know that the sender is a trusted forwarder,
            // so we trust that the last bytes of msg.data are the verified sender address.
            // extract sender address from the end of msg.data
            assembly {
                ret := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return msg.sender;
        }
    }
}

File 18 of 24 : IRelayRecipient.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

/**
 * a contract must implement this interface in order to support relayed transaction.
 * It is better to inherit the BaseRelayRecipient as its implementation.
 */
abstract contract IRelayRecipient {
    /**
     * return if the forwarder is trusted to forward relayed transactions to us.
     * the forwarder is required to verify the sender's signature, and verify
     * the call is not a replay.
     */
    function isTrustedForwarder(address forwarder) public view virtual returns (bool);

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes
     * of the msg.data.
     * otherwise, return `msg.sender`
     * should be used in the contract anywhere instead of msg.sender
     */
    function msgSender() internal view virtual returns (address);

    function versionRecipient() external view virtual returns (string memory);
}

File 19 of 24 : BhavishSwap.sol
// SPDX-License-Identifier: BSD-4-Clause

import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "../../Interface/IBhavishSDK.sol";

pragma solidity ^0.8.13;

contract BhavishSwap is AccessControl {
    using SafeERC20 for IERC20;

    address public UNISWAP_FACTORY;
    address public UNISWAP_ROUTER;
    mapping(bytes32 => address[]) public pathMapper;
    uint256 public decimals = 3;

    struct SwapStruct {
        uint256 amountIn;
        uint256 deadline;
        bytes32 fromAsset;
        bytes32 toAsset;
    }

    modifier onlyAsset(bytes32 fromAsset, bytes32 toAsset) {
        address[] memory path = getPath(fromAsset, toAsset);
        require(path.length > 1, "Asset swap not supported");
        _;
    }

    modifier onlyAdmin(address _address) {
        require(hasRole(DEFAULT_ADMIN_ROLE, _address), "Address not an admin");
        _;
    }

    constructor(address uniswapFactory, address uniswapRouter) {
        UNISWAP_FACTORY = uniswapFactory;
        UNISWAP_ROUTER = uniswapRouter;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    /**
     * @notice Add funds
     */
    receive() external payable {}

    function setPath(
        bytes32 fromAsset,
        bytes32 toAsset,
        address[] memory path
    ) external onlyAdmin(msg.sender) {
        require(path.length > 1, "Path cannot be empty or 1");
        pathMapper[keccak256((abi.encode(fromAsset, toAsset)))] = path;
    }

    function getPath(bytes32 fromAsset, bytes32 toAsset) public view returns (address[] memory) {
        return pathMapper[keccak256(abi.encode(fromAsset, toAsset))];
    }

    // Get the amounts out for the specified path
    function getAmountsOut(
        uint256 amountIn,
        bytes32 fromAsset,
        bytes32 toAsset
    ) public view onlyAsset(fromAsset, toAsset) returns (uint256[] memory amounts) {
        address[] memory path = getPath(fromAsset, toAsset);
        amounts = new uint256[](path.length);
        amounts = IUniswapV2Router02(UNISWAP_ROUTER).getAmountsOut(amountIn, path);
    }

    function swapExactTokensForETH(
        SwapStruct memory _swapStruct,
        address to,
        uint256 slippage
    ) external onlyAsset(_swapStruct.fromAsset, _swapStruct.toAsset) returns (uint256[] memory amounts) {
        address[] memory path = getPath(_swapStruct.fromAsset, _swapStruct.toAsset);
        uint256[] memory amountsOut = getAmountsOut(_swapStruct.amountIn, _swapStruct.fromAsset, _swapStruct.toAsset);
        uint256 amountOut = amountsOut[amountsOut.length - 1] -
            ((amountsOut[amountsOut.length - 1] * slippage) / 10**decimals);
        IERC20(path[0]).safeApprove(UNISWAP_ROUTER, _swapStruct.amountIn);
        amounts = IUniswapV2Router02(UNISWAP_ROUTER).swapExactTokensForETH(
            _swapStruct.amountIn,
            amountOut,
            path,
            to,
            _swapStruct.deadline
        );
    }

    function swapExactETHForTokens(
        SwapStruct memory _swapStruct,
        address to,
        uint256 slippage
    ) external payable onlyAsset(_swapStruct.fromAsset, _swapStruct.toAsset) returns (uint256[] memory amounts) {
        address[] memory path = getPath(_swapStruct.fromAsset, _swapStruct.toAsset);
        uint256[] memory amountsOut = getAmountsOut(msg.value, _swapStruct.fromAsset, _swapStruct.toAsset);
        uint256 amountOut = amountsOut[amountsOut.length - 1] -
            ((amountsOut[amountsOut.length - 1] * slippage) / 10**decimals);
        amounts = IUniswapV2Router02(UNISWAP_ROUTER).swapExactETHForTokens{ value: msg.value }(
            amountOut,
            path,
            to,
            _swapStruct.deadline
        );
    }
}

File 20 of 24 : IBhavishNativeSDK.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

import "./IBhavishSDK.sol";
import "./../Integrations/Swap/BhavishSwap.sol";
import { IBhavishPredictionNative } from ".././Interface/IBhavishPredictionNative.sol";

interface IBhavishNativeSDK is IBhavishSDK {
    function predict(
        PredictionStruct memory _predStruct,
        address _userAddress,
        address _provider
    ) external payable;

    function predictWithGasless(PredictionStruct memory _predStruct, address _provider) external payable;

    function swapAndPredict(
        BhavishSwap.SwapStruct memory _swapStruct,
        PredictionStruct memory _predStruct,
        uint256 slippage,
        address _provider
    ) external;

    function swapAndPredictWithGasless(
        BhavishSwap.SwapStruct memory _swapStruct,
        PredictionStruct memory _predStruct,
        uint256 slippage,
        address _provider
    ) external;

    function claim(
        PredictionStruct memory _predStruct,
        uint256[] calldata roundIds,
        IBhavishPredictionNative.SwapParams memory _swapParams
    ) external;
}

File 21 of 24 : IBhavishPrediction.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

interface IBhavishPrediction {
    enum RoundState {
        CREATED,
        STARTED,
        ENDED,
        CANCELLED
    }

    struct Round {
        uint256 roundId;
        RoundState roundState;
        uint256 upPredictAmount;
        uint256 downPredictAmount;
        uint256 totalAmount;
        uint256 rewardBaseCalAmount;
        uint256 rewardAmount;
        uint256 startPrice;
        uint256 endPrice;
        uint256 roundStartTimestamp;
        uint256 roundEndTimestamp;
    }

    struct BetInfo {
        uint256 upPredictAmount;
        uint256 downPredictAmount;
        uint256 amountDispersed;
    }

    struct AssetPair {
        bytes32 underlying;
        bytes32 strike;
    }

    struct PredictionMarketStatus {
        bool startPredictionMarketOnce;
        bool createPredictionMarketOnce;
    }

    /**
     * @notice Create Round Zero round
     * @dev callable by Operator
     * @param _roundzeroStartTimestamp: round zero round start timestamp
     */
    function createPredictionMarket(uint256 _roundzeroStartTimestamp) external;

    /**
     * @notice Start Zero round
     * @dev callable by Operator
     */
    function startPredictionMarket() external;

    /**
     * @notice Start Zero round
     * @dev callable by Operator
     */
    function startPredictionMarket(uint256 price) external;

    /**
     * @notice Execute round
     * @dev Callable by Operator
     */
    function executeRound() external;

    /**
     * @notice Execute round
     * @dev Callable by Operator
     */
    function executeRound(uint256 price) external;

    function getCurrentRoundDetails() external view returns (IBhavishPrediction.Round memory);

    function refundUsers(uint256 _predictRoundId, address userAddress) external;

    function getAverageBetAmount(uint256[] calldata roundIds, address userAddress) external returns (uint256);
}

File 22 of 24 : IBhavishPredictionNative.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;
import "./IBhavishPrediction.sol";

interface IBhavishPredictionNative is IBhavishPrediction {
    struct SwapParams {
        uint256 slippage;
        bytes32 toAsset;
        bool convert;
    }

    /**
     * @notice Bet Bull position
     * @param roundId: Round Id
     * @param userAddress: Address of the user
     */
    function predictUp(uint256 roundId, address userAddress) external payable;

    /**
     * @notice Bet Bear position
     * @param roundId: Round Id
     * @param userAddress: Address of the user
     */
    function predictDown(uint256 roundId, address userAddress) external payable;

    function claim(
        uint256[] calldata _roundIds,
        address _userAddress,
        SwapParams memory _swapParams
    ) external returns (uint256);
}

File 23 of 24 : IBhavishSDK.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

interface IBhavishSDK {
    event PredictionMarketProvider(uint256 indexed _month, address indexed _provider);

    struct PredictionStruct {
        bytes32 underlying;
        bytes32 strike;
        uint256 roundId;
        bool directionUp;
    }

    function minimumGaslessBetAmount() external returns (uint256);

    function refundUsers(PredictionStruct memory _predStruct, uint256 roundId) external;
}

File 24 of 24 : DateTimeLibrary.sol
// SPDX-License-Identifier: BSD-4-Clause

pragma solidity ^0.8.13;

// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.01
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Conventions:
// Unit      | Range         | Notes
// :-------- |:-------------:|:-----
// timestamp | >= 0          | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC
// year      | 1970 ... 2345 |
// month     | 1 ... 12      |
// day       | 1 ... 31      |
// hour      | 0 ... 23      |
// minute    | 0 ... 59      |
// second    | 0 ... 59      |
//
//
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018-2019. The MIT Licence.

library DateTimeLibrary {
    uint256 public constant SECONDS_PER_DAY = 24 * 60 * 60;
    int256 public constant OFFSET19700101 = 2440588;
    uint256 public constant WEEK_OFFSET = 345600;
    uint256 public constant DOW_FRI = 5;

    // ------------------------------------------------------------------------
    // Calculate the number of days from 1970/01/01 to year/month/day using
    // the date conversion algorithm from
    //   https://aa.usno.navy.mil/faq/JD_formula.html
    // and subtracting the offset 2440588 so that 1970/01/01 is day 0
    //
    // days = day
    //      - 32075
    //      + 1461 * (year + 4800 + (month - 14) / 12) / 4
    //      + 367 * (month - 2 - (month - 14) / 12 * 12) / 12
    //      - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4
    //      - offset
    // ------------------------------------------------------------------------
    function _daysFromDate(
        uint256 year,
        uint256 month,
        uint256 day
    ) internal pure returns (uint256 _days) {
        require(year >= 1970, "Year not in range");
        int256 _year = int256(year);
        int256 _month = int256(month);
        int256 _day = int256(day);

        int256 __days = _day -
            32075 +
            (1461 * (_year + 4800 + (_month - 14) / 12)) /
            4 +
            (367 * (_month - 2 - ((_month - 14) / 12) * 12)) /
            12 -
            (3 * ((_year + 4900 + (_month - 14) / 12) / 100)) /
            4 -
            OFFSET19700101;

        _days = uint256(__days);
    }

    // ------------------------------------------------------------------------
    // Calculate year/month/day from the number of days since 1970/01/01 using
    // the date conversion algorithm from
    //   http://aa.usno.navy.mil/faq/docs/JD_Formula.php
    // and adding the offset 2440588 so that 1970/01/01 is day 0
    //
    // int L = days + 68569 + offset
    // int N = 4 * L / 146097
    // L = L - (146097 * N + 3) / 4
    // year = 4000 * (L + 1) / 1461001
    // L = L - 1461 * year / 4 + 31
    // month = 80 * L / 2447
    // dd = L - 2447 * month / 80
    // L = month / 11
    // month = month + 2 - 12 * L
    // year = 100 * (N - 49) + year + L
    // ------------------------------------------------------------------------
    function _daysToDate(uint256 _days)
        internal
        pure
        returns (
            uint256 year,
            uint256 month,
            uint256 day
        )
    {
        int256 __days = int256(_days);

        int256 L = __days + 68569 + OFFSET19700101;
        int256 N = (4 * L) / 146097;
        L = L - (146097 * N + 3) / 4;
        int256 _year = (4000 * (L + 1)) / 1461001;
        L = L - (1461 * _year) / 4 + 31;
        int256 _month = (80 * L) / 2447;
        int256 _day = L - (2447 * _month) / 80;
        L = _month / 11;
        _month = _month + 2 - 12 * L;
        _year = 100 * (N - 49) + _year + L;

        year = uint256(_year);
        month = uint256(_month);
        day = uint256(_day);
    }

    function timestampToDay(uint256 timestamp) internal pure returns (uint256 today) {
        uint256 year;
        uint256 month;
        uint256 day;
        (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
        today = _daysFromDate(year, month, day);
    }

    function getMonth(uint256 timestamp) internal pure returns (uint256 month) {
        (, month, ) = _daysToDate(timestamp / SECONDS_PER_DAY);
    }

    function getYear(uint256 timestamp) internal pure returns (uint256 year) {
        (year, , ) = _daysToDate(timestamp / SECONDS_PER_DAY);
    }

    function getWeek(uint256 timestamp) internal pure returns (uint256 week) {
        week = ((timestamp + WEEK_OFFSET) / SECONDS_PER_DAY) / 7;
    }

    function getDayOfWeek(uint256 timestamp) internal pure returns (uint256 dayOfWeek) {
        uint256 _days = timestamp / SECONDS_PER_DAY;
        dayOfWeek = ((_days + 3) % 7) + 1;
    }

    function isWeekDay(uint256 timestamp) internal pure returns (bool weekDay) {
        weekDay = getDayOfWeek(timestamp) <= DOW_FRI;
    }

    function startTimestampOfDay(
        uint256 day,
        uint256 month,
        uint256 year
    ) internal pure returns (uint256 timestamp) {
        timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY;
    }

    function getAll(uint256 timestamp)
        internal
        pure
        returns (
            uint256 day,
            uint256 month,
            uint256 year,
            uint256 week
        )
    {
        (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
        week = getWeek(timestamp);
    }

    function getPresentDayTimestamp() internal view returns (uint256 todayTimestamp) {
        (uint256 year, uint256 month, uint256 day) = timestampToDate(block.timestamp);
        todayTimestamp = DateTimeLibrary.timestampFromDate(year, month, day);
    }

    function timestampToDate(uint256 timestamp)
        internal
        pure
        returns (
            uint256 year,
            uint256 month,
            uint256 day
        )
    {
        (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
    }

    function timestampFromDate(
        uint256 year,
        uint256 month,
        uint256 day
    ) internal pure returns (uint256 timestamp) {
        timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IBhavishPredictionNative[]","name":"_bhavishPrediction","type":"address[]"},{"internalType":"bytes32[]","name":"_underlying","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_strike","type":"bytes32[]"},{"internalType":"contract BhavishSwap","name":"_bhavishSwap","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_month","type":"uint256"},{"indexed":true,"internalType":"address","name":"_provider","type":"address"}],"name":"PredictionMarketProvider","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBhavishPrediction","name":"","type":"address"}],"name":"activePredictionMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"addContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBhavishPrediction[]","name":"_bhavishPrediction","type":"address[]"},{"internalType":"bytes32[]","name":"_underlying","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_strike","type":"bytes32[]"}],"name":"addPredictionMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bhavishSwap","outputs":[{"internalType":"contract BhavishSwap","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256[]","name":"roundIds","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"slippage","type":"uint256"},{"internalType":"bytes32","name":"toAsset","type":"bytes32"},{"internalType":"bool","name":"convert","type":"bool"}],"internalType":"struct IBhavishPredictionNative.SwapParams","name":"_swapParams","type":"tuple"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256[]","name":"roundIds","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"slippage","type":"uint256"},{"internalType":"bytes32","name":"toAsset","type":"bytes32"},{"internalType":"bool","name":"convert","type":"bool"}],"internalType":"struct IBhavishPredictionNative.SwapParams","name":"_swapParams","type":"tuple"}],"name":"claimWithGasless","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumGaslessBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"address","name":"_userAddress","type":"address"},{"internalType":"address","name":"_provider","type":"address"}],"name":"predict","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"address","name":"_provider","type":"address"}],"name":"predictWithGasless","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"predictionMap","outputs":[{"internalType":"contract IBhavishPrediction","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"premiumCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"refundUsers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"refundUsersWithGasless","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"removeContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBhavishPrediction","name":"_bhavishPrediction","type":"address"}],"name":"removePredictionMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarderAddress","type":"address"}],"name":"removeTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","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":"_amount","type":"uint256"}],"name":"setMinimumGaslessBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forwarderAddress","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes32","name":"fromAsset","type":"bytes32"},{"internalType":"bytes32","name":"toAsset","type":"bytes32"}],"internalType":"struct BhavishSwap.SwapStruct","name":"_swapStruct","type":"tuple"},{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256","name":"slippage","type":"uint256"},{"internalType":"address","name":"_provider","type":"address"}],"name":"swapAndPredict","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes32","name":"fromAsset","type":"bytes32"},{"internalType":"bytes32","name":"toAsset","type":"bytes32"}],"internalType":"struct BhavishSwap.SwapStruct","name":"_swapStruct","type":"tuple"},{"components":[{"internalType":"bytes32","name":"underlying","type":"bytes32"},{"internalType":"bytes32","name":"strike","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"bool","name":"directionUp","type":"bool"}],"internalType":"struct IBhavishSDK.PredictionStruct","name":"_predStruct","type":"tuple"},{"internalType":"uint256","name":"slippage","type":"uint256"},{"internalType":"address","name":"_provider","type":"address"}],"name":"swapAndPredictWithGasless","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalBhavishAllocated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalMonthlyPremiumCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalWeeklyPremiumCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalYearlyPremiumCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"trustedForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBhavishPrediction","name":"_bhavishPrediction","type":"address"},{"internalType":"bytes32","name":"_underlying","type":"bytes32"},{"internalType":"bytes32","name":"_strike","type":"bytes32"}],"name":"updatePredictionMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usersForTheMonth","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"validContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"versionRecipient","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600360045567016345785d8a0000600c553480156200002257600080fd5b50604051620037503803806200375083398101604081905262000045916200044f565b82518451146200009c5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e747320706173736564000060448201526064015b60405180910390fd5b8251825114620000ef5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e7473207061737365640000604482015260640162000093565b6200010e816001600160a01b03166200029b60201b6200179d1760201c565b6200015c5760405162461bcd60e51b815260206004820152601960248201527f53776170706572206973206e6f74206120636f6e747261637400000000000000604482015260640162000093565b600d80546001600160a01b0319166001600160a01b03831617905562000184600033620002aa565b60005b84518110156200029057848181518110620001a657620001a66200055b565b602002602001015160026000868481518110620001c757620001c76200055b565b602002602001015181526020019081526020016000206000858481518110620001f457620001f46200055b565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001600360008784815181106200024957620002496200055b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620002878162000571565b91505062000187565b505050505062000599565b6001600160a01b03163b151590565b620002b68282620002ba565b5050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620002b65760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000383576200038362000342565b604052919050565b60006001600160401b03821115620003a757620003a762000342565b5060051b60200190565b6001600160a01b0381168114620003c757600080fd5b50565b600082601f830112620003dc57600080fd5b81516020620003f5620003ef836200038b565b62000358565b82815260059290921b840181019181810190868411156200041557600080fd5b8286015b8481101562000432578051835291830191830162000419565b509695505050505050565b80516200044a81620003b1565b919050565b600080600080608085870312156200046657600080fd5b84516001600160401b03808211156200047e57600080fd5b818701915087601f8301126200049357600080fd5b81516020620004a6620003ef836200038b565b82815260059290921b8401810191818101908b841115620004c657600080fd5b948201945b83861015620004f1578551620004e181620003b1565b82529482019490820190620004cb565b918a01519198509093505050808211156200050b57600080fd5b6200051988838901620003ca565b945060408701519150808211156200053057600080fd5b506200053f87828801620003ca565b92505062000550606086016200043d565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b6000600182016200059257634e487b7160e01b600052601160045260246000fd5b5060010190565b6131a780620005a96000396000f3fe6080604052600436106102295760003560e01c806351cb2c9111610123578063a074e840116100ab578063c8a640471161006f578063c8a6404714610707578063d547741f14610727578063da74222814610747578063e1be274414610767578063ec1adb761461079757600080fd5b8063a074e84014610644578063a217fddf14610664578063b21b67a014610679578063bc28d3f0146106a6578063c375c2ef146106e757600080fd5b806372cfa35e116100f257806372cfa35e1461058757806384d50c70146105b45780638af261f4146105d457806391d14854146106045780639f8645701461062457600080fd5b806351cb2c91146104fa578063572b6c051461051a5780635bdf842d1461053a5780635f539d691461056757600080fd5b8063313ce567116101b157806338ae0e9c1161017557806338ae0e9c14610447578063486ff0cd14610467578063487f6630146104975780634b14c3d4146104c7578063511d84d9146104e757600080fd5b8063313ce567146103bb578063333adea2146103d157806333995105146103e757806336568abe146104075780633751d89c1461042757600080fd5b806323553d14116101f857806323553d14146102bf578063248a9ca3146102fa5780632ef582781461032b5780632f2ff15d1461036357806330fea2c11461038357600080fd5b806301ffc9a714610235578063042a5b6c1461026a57806311bb10dc1461028c57806317b6ecc51461029f57600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50610255610250366004612571565b6107b7565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028a61028536600461269e565b6107ee565b005b61028a61029a366004612724565b610802565b3480156102ab57600080fd5b5061028a6102ba36600461275c565b6109c0565b3480156102cb57600080fd5b506102ec6102da366004612791565b60076020526000908152604090205481565b604051908152602001610261565b34801561030657600080fd5b506102ec610315366004612791565b6000908152600160208190526040909120015490565b34801561033757600080fd5b5061034b610346366004612791565b610aa5565b6040516001600160a01b039091168152602001610261565b34801561036f57600080fd5b5061028a61037e3660046127aa565b610acf565b34801561038f57600080fd5b506102ec61039e3660046127cf565b600a60209081526000928352604080842090915290825290205481565b3480156103c757600080fd5b506102ec60045481565b3480156103dd57600080fd5b506102ec600c5481565b3480156103f357600080fd5b5061028a6104023660046127fb565b610af5565b34801561041357600080fd5b5061028a6104223660046127aa565b610b2a565b34801561043357600080fd5b5061028a6104423660046128c8565b610ba8565b34801561045357600080fd5b5061028a6104623660046128c8565b610ce0565b34801561047357600080fd5b5060408051808201825260018152603160f81b602082015290516102619190612911565b3480156104a357600080fd5b506102556104b23660046128c8565b600b6020526000908152604090205460ff1681565b3480156104d357600080fd5b50600d5461034b906001600160a01b031681565b61028a6104f5366004612944565b610da3565b34801561050657600080fd5b5061028a61051536600461298e565b610fae565b34801561052657600080fd5b506102556105353660046128c8565b610fe1565b34801561054657600080fd5b506102ec610555366004612791565b60066020526000908152604090205481565b34801561057357600080fd5b5061028a6105823660046128c8565b611045565b34801561059357600080fd5b506102ec6105a2366004612791565b60086020526000908152604090205481565b3480156105c057600080fd5b5061028a6105cf36600461298e565b6110db565b3480156105e057600080fd5b506102556105ef3660046128c8565b60036020526000908152604090205460ff1681565b34801561061057600080fd5b5061025561061f3660046127aa565b611221565b34801561063057600080fd5b5061028a61063f36600461269e565b61124c565b34801561065057600080fd5b5061028a61065f366004612a48565b61125a565b34801561067057600080fd5b506102ec600081565b34801561068557600080fd5b506102ec610694366004612791565b60096020526000908152604090205481565b3480156106b257600080fd5b5061034b6106c1366004612b2e565b60026020908152600092835260408084209091529082529020546001600160a01b031681565b3480156106f357600080fd5b5061028a6107023660046128c8565b6114b6565b34801561071357600080fd5b5061028a610722366004612791565b611500565b34801561073357600080fd5b5061028a6107423660046127aa565b61159a565b34801561075357600080fd5b5061028a6107623660046128c8565b6115c0565b34801561077357600080fd5b50610255610782366004612791565b60056020526000908152604090205460ff1681565b3480156107a357600080fd5b5061028a6107b23660046127fb565b611699565b60006001600160e01b03198216637965db0b60e01b14806107e857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6107fc8484846000856117ac565b50505050565b815160009081526002602090815260408083208286015184529091529020546001600160a01b0316806108505760405162461bcd60e51b815260040161084790612b50565b60405180910390fd5b6001600160a01b03811660009081526003602052604090205460ff166108885760405162461bcd60e51b815260040161084790612b50565b600c5434116108a95760405162461bcd60e51b815260040161084790612b9d565b82606001511561093457806001600160a01b0316631c389c283485604001516108d0611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b15801561091657600080fd5b505af115801561092a573d6000803e3d6000fd5b50505050506109b1565b806001600160a01b031663e44bb72f348560400151610951611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b50505050505b6109bb8234611baf565b505050565b336109cc600082611221565b6109e85760405162461bcd60e51b815260040161084790612be3565b60008381526002602090815260408083208584529091529020546001600160a01b0316610a575760405162461bcd60e51b815260206004820152601f60248201527f50726564696374696f6e206d61726b657420646f65736e2774206578697374006044820152606401610847565b50600091825260026020908152604080842092845291815281832080546001600160a01b039095166001600160a01b031990951685179055928252600390925220805460ff19166001179055565b60008181548110610ab557600080fd5b6000918252602090912001546001600160a01b0316905081565b60008281526001602081905260409091200154610aeb81611d33565b6109bb8383611d40565b835160009081526002602090815260408083208288015184529091529020546107fc906001600160a01b031684843385611dab565b6001600160a01b0381163314610b9a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610847565b610ba48282611e20565b5050565b33610bb4600082611221565b610bd05760405162461bcd60e51b815260040161084790612be3565b6000805b600054811015610c3057836001600160a01b031660008281548110610bfb57610bfb612c2a565b6000918252602090912001546001600160a01b031603610c1e5760019150610c30565b80610c2881612c56565b915050610bd4565b81156107fc5760008054610c4690600190612c6f565b81548110610c5657610c56612c2a565b600091825260208220015481546001600160a01b03909116919083908110610c8057610c80612c2a565b6000918252602082200180546001600160a01b0319166001600160a01b039390931692909217909155805480610cb857610cb8612c86565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b33610cec600082611221565b610d085760405162461bcd60e51b815260040161084790612be3565b6001600160a01b03821660009081526003602052604090205460ff16610d815760405162461bcd60e51b815260206004820152602860248201527f50726564696374696f6e206d61726b6574206973206e6f7420696e2061637469604482015267766520737461746560c01b6064820152608401610847565b506001600160a01b03166000908152600360205260409020805460ff19169055565b825160009081526002602090815260408083208287015184529091529020546001600160a01b031680610de85760405162461bcd60e51b815260040161084790612c9c565b6001600160a01b03811660009081526003602052604090205460ff16610e205760405162461bcd60e51b815260040161084790612b50565b6000333b15158015610e415750336000908152600b602052604090205460ff165b15610e4d575082610eb9565b336001600160a01b03851614610eb65760405162461bcd60e51b815260206004820152602860248201527f427579657220616e64206d73672e73656e6465722063616e6e6f7420626520646044820152671a5999995c995b9d60c21b6064820152608401610847565b50335b846060015115610f32576040858101519051630387138560e31b815260048101919091526001600160a01b038281166024830152831690631c389c289034906044016000604051808303818588803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b5050505050610f9d565b604085810151905163e44bb72f60e01b815260048101919091526001600160a01b03828116602483015283169063e44bb72f9034906044016000604051808303818588803b158015610f8357600080fd5b505af1158015610f97573d6000803e3d6000fd5b50505050505b610fa78334611baf565b5050505050565b81516000908152600260209081526040808320828601518452909152902054610ba4906001600160a01b03168233611e87565b6000805b60005481101561103c576000818154811061100257611002612c2a565b6000918252602090912001546001600160a01b039081169084160361102a5750600192915050565b8061103481612c56565b915050610fe5565b50600092915050565b33611051600082611221565b61106d5760405162461bcd60e51b815260040161084790612be3565b6001600160a01b0382163b6110b65760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206164647265737360881b6044820152606401610847565b506001600160a01b03166000908152600b60205260409020805460ff19166001179055565b8151600090815260026020908152604080832082860151845290915280822054815160018082528184019093526001600160a01b039091169291816020016020820280368337019050509050828160008151811061113b5761113b612c2a565b6020026020010181815250506000826001600160a01b031663795c296083611161611b81565b6040518363ffffffff1660e01b815260040161117e929190612cea565b6020604051808303816000875af115801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c19190612d3e565b9050600c54811161120f5760405162461bcd60e51b81526020600482015260186024820152774e6f7420656c696769626c6520666f72206761736c65737360401b6044820152606401610847565b610fa7838561121c611b81565b611e87565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6107fc8484846001856117ac565b33611266600082611221565b6112825760405162461bcd60e51b815260040161084790612be3565b82518451146112d35760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e74732070617373656400006044820152606401610847565b82518251146113245760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e74732070617373656400006044820152606401610847565b60005b8451811015610fa75784818151811061134257611342612c2a565b60200260200101516002600086848151811061136057611360612c2a565b60200260200101518152602001908152602001600020600085848151811061138a5761138a612c2a565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600360008683815181106113da576113da612c2a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff161561145a5760405162461bcd60e51b815260206004820152602360248201527f50726564696374696f6e204d61726b657420697320616c72656164792061637460448201526269766560e81b6064820152608401610847565b60016003600087848151811061147257611472612c2a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806114ae81612c56565b915050611327565b336114c2600082611221565b6114de5760405162461bcd60e51b815260040161084790612be3565b506001600160a01b03166000908152600b60205260409020805460ff19169055565b3361150c600082611221565b6115285760405162461bcd60e51b815260040161084790612be3565b67016345785d8a00008210158015611548575068056bc75e2d6310000082105b6115945760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964206d696e696d756d206761736c657373207072656d69756d006044820152606401610847565b50600c55565b600082815260016020819052604090912001546115b681611d33565b6109bb8383611e20565b336115cc600082611221565b6115e85760405162461bcd60e51b815260040161084790612be3565b6001600160a01b0382166116495760405162461bcd60e51b815260206004820152602260248201527f53444b3a20466f7277617264657220416464726573732063616e6e6f74206265604482015261020360f41b6064820152608401610847565b50600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0392909216919091179055565b835160009081526002602090815260408083208288015184529091528120546001600160a01b0316908163795c296086866116d2611b81565b6040518463ffffffff1660e01b81526004016116f093929190612d8d565b6020604051808303816000875af115801561170f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117339190612d3e565b9050600c5481116117815760405162461bcd60e51b81526020600482015260186024820152774e6f7420656c696769626c6520666f72206761736c65737360401b6044820152606401610847565b61179582868661178f611b81565b87611dab565b505050505050565b6001600160a01b03163b151590565b835160009081526002602090815260408083208288015184529091529020546001600160a01b0316806117f15760405162461bcd60e51b815260040161084790612c9c565b6001600160a01b03811660009081526003602052604090205460ff166118295760405162461bcd60e51b815260040161084790612b50565b600d546040808801516060890151915163709adf7360e11b81526000936001600160a01b03169263e135bee69261186e92909190600401918252602082015260400190565b600060405180830381865afa15801561188b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118b39190810190612db9565b90506119056118c0611b81565b600d54895184516001600160a01b039092169185906000906118e4576118e4612c2a565b60200260200101516001600160a01b0316611eee909392919063ffffffff16565b600d5460408051635228ce9f60e01b81528951600482015260208a015160248201529089015160448201526060890151606482015230608482015260a481018790526000916001600160a01b031690635228ce9f9060c4016000604051808303816000875af115801561197c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119a49190810190612e48565b905084156119f357600c5481600183516119be9190612c6f565b815181106119ce576119ce612c2a565b6020026020010151116119f35760405162461bcd60e51b815260040161084790612b9d565b866060015115611aa457826001600160a01b0316631c389c288260018451611a1b9190612c6f565b81518110611a2b57611a2b612c2a565b60200260200101518960400151611a40611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b158015611a8657600080fd5b505af1158015611a9a573d6000803e3d6000fd5b5050505050611b47565b826001600160a01b031663e44bb72f8260018451611ac29190612c6f565b81518110611ad257611ad2612c2a565b60200260200101518960400151611ae7611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b50505050505b611b77848260018451611b5a9190612c6f565b81518110611b6a57611b6a612c2a565b6020026020010151611baf565b5050505050505050565b600060183610801590611b985750611b9833610fe1565b15611baa575060131936013560601c90565b503390565b6000806000611bbd42611f48565b604080516001600160a01b038b16602082015290810184905292965090945092506005915060009060600160408051601f198184030181529181528151602092830120835290820192909252016000205460ff16611c8b57604080516001600160a01b0387166020808301829052828401879052835180840385018152606090930180855283519382019390932060009081526005909152928320805460ff191660011790559185917f1e76ea6dc8321d650d11680422e5add0e5f4bc9f644910c85e0d2c38c7c606899190a35b6001600160a01b0385166000908152600a6020908152604080832086845290915281208054869290611cbe908490612ece565b909155505060008381526007602052604081208054869290611ce1908490612ece565b909155505060008281526008602052604081208054869290611d04908490612ece565b909155505060008181526006602052604081208054869290611d27908490612ece565b90915550505050505050565b611d3d8133611f7a565b50565b611d4a8282611221565b610ba45760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6040516357957f6960e01b81526001600160a01b038616906357957f6990611ddd908790879087908790600401612ee6565b6020604051808303816000875af1158015611dfc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117959190612d3e565b611e2a8282611221565b15610ba45760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051630399a1b160e51b8152600481018390526001600160a01b038281166024830152841690637334362090604401600060405180830381600087803b158015611ed157600080fd5b505af1158015611ee5573d6000803e3d6000fd5b50505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526107fc908590611fde565b6000808080611f62611f5d6201518087612f46565b6120b0565b955093509150611f7185612224565b90509193509193565b611f848282611221565b610ba457611f9c816001600160a01b0316601461224d565b611fa783602061224d565b604051602001611fb8929190612f5a565b60408051601f198184030181529082905262461bcd60e51b825261084791600401612911565b6000612033826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123f09092919063ffffffff16565b8051909150156109bb57808060200190518101906120519190612fcf565b6109bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610847565b60008080838162253d8c6120c78362010bd9612fec565b6120d19190612fec565b9050600062023ab16120e483600461302d565b6120ee91906130b2565b905060046120ff8262023ab161302d565b61210a906003612fec565b61211491906130b2565b61211e90836130e0565b9150600062164b09612131846001612fec565b61213d90610fa061302d565b61214791906130b2565b90506004612157826105b561302d565b61216191906130b2565b61216b90846130e0565b61217690601f612fec565b9250600061098f61218885605061302d565b61219291906130b2565b9050600060506121a48361098f61302d565b6121ae91906130b2565b6121b890866130e0565b90506121c5600b836130b2565b94506121d285600c61302d565b6121dd836002612fec565b6121e791906130e0565b915084836121f66031876130e0565b61220190606461302d565b61220b9190612fec565b6122159190612fec565b9a919950975095505050505050565b60006007620151806122396205460085612ece565b6122439190612f46565b6107e89190612f46565b6060600061225c83600261311f565b612267906002612ece565b67ffffffffffffffff81111561227f5761227f61259b565b6040519080825280601f01601f1916602001820160405280156122a9576020820181803683370190505b509050600360fc1b816000815181106122c4576122c4612c2a565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106122f3576122f3612c2a565b60200101906001600160f81b031916908160001a905350600061231784600261311f565b612322906001612ece565b90505b600181111561239a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061235657612356612c2a565b1a60f81b82828151811061236c5761236c612c2a565b60200101906001600160f81b031916908160001a90535060049490941c936123938161313e565b9050612325565b5083156123e95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610847565b9392505050565b60606123ff8484600085612407565b949350505050565b6060824710156124685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610847565b6001600160a01b0385163b6124bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610847565b600080866001600160a01b031685876040516124db9190613155565b60006040518083038185875af1925050503d8060008114612518576040519150601f19603f3d011682016040523d82523d6000602084013e61251d565b606091505b509150915061252d828286612538565b979650505050505050565b606083156125475750816123e9565b8251156125575782518084602001fd5b8160405162461bcd60e51b81526004016108479190612911565b60006020828403121561258357600080fd5b81356001600160e01b0319811681146123e957600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156125d4576125d461259b565b60405290565b6040516060810167ffffffffffffffff811182821017156125d4576125d461259b565b604051601f8201601f1916810167ffffffffffffffff811182821017156126265761262661259b565b604052919050565b8015158114611d3d57600080fd5b60006080828403121561264e57600080fd5b6126566125b1565b9050813581526020820135602082015260408201356040820152606082013561267e8161262e565b606082015292915050565b6001600160a01b0381168114611d3d57600080fd5b6000806000808486036101408112156126b657600080fd5b60808112156126c457600080fd5b506126cd6125b1565b8535815260208601356020820152604086013560408201526060860135606082015280945050612700866080870161263c565b9250610100850135915061012085013561271981612689565b939692955090935050565b60008060a0838503121561273757600080fd5b612741848461263c565b9150608083013561275181612689565b809150509250929050565b60008060006060848603121561277157600080fd5b833561277c81612689565b95602085013595506040909401359392505050565b6000602082840312156127a357600080fd5b5035919050565b600080604083850312156127bd57600080fd5b82359150602083013561275181612689565b600080604083850312156127e257600080fd5b82356127ed81612689565b946020939093013593505050565b60008060008084860361010081121561281357600080fd5b61281d878761263c565b9450608086013567ffffffffffffffff8082111561283a57600080fd5b818801915088601f83011261284e57600080fd5b81358181111561285d57600080fd5b8960208260051b850101111561287257600080fd5b6020929092019550909350506060609f198201121561289057600080fd5b506128996125da565b60a0860135815260c0860135602082015260e08601356128b88161262e565b6040820152939692955090935050565b6000602082840312156128da57600080fd5b81356123e981612689565b60005b838110156129005781810151838201526020016128e8565b838111156107fc5750506000910152565b60208152600082518060208401526129308160408501602087016128e5565b601f01601f19169190910160400192915050565b600080600060c0848603121561295957600080fd5b612963858561263c565b9250608084013561297381612689565b915060a084013561298381612689565b809150509250925092565b60008060a083850312156129a157600080fd5b6129ab848461263c565b946080939093013593505050565b600067ffffffffffffffff8211156129d3576129d361259b565b5060051b60200190565b600082601f8301126129ee57600080fd5b81356020612a036129fe836129b9565b6125fd565b82815260059290921b84018101918181019086841115612a2257600080fd5b8286015b84811015612a3d5780358352918301918301612a26565b509695505050505050565b600080600060608486031215612a5d57600080fd5b833567ffffffffffffffff80821115612a7557600080fd5b818601915086601f830112612a8957600080fd5b81356020612a996129fe836129b9565b82815260059290921b8401810191818101908a841115612ab857600080fd5b948201945b83861015612adf578535612ad081612689565b82529482019490820190612abd565b97505087013592505080821115612af557600080fd5b612b01878388016129dd565b93506040860135915080821115612b1757600080fd5b50612b24868287016129dd565b9150509250925092565b60008060408385031215612b4157600080fd5b50508035926020909101359150565b6020808252602d908201527f50726564696374696f6e204d61726b657420666f72207468652061737365742060408201526c6973206e6f742061637469766560981b606082015260800190565b60208082526026908201527f42657420616d6f756e74206973206e6f7420656c696769626c6520666f72206760408201526561736c65737360d01b606082015260800190565b60208082526027908201527f53444b3a2063616c6c657220686173206e6f2061636365737320746f20746865604082015266081b595d1a1bd960ca1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612c6857612c68612c40565b5060010190565b600082821015612c8157612c81612c40565b500390565b634e487b7160e01b600052603160045260246000fd5b6020808252602e908201527f50726564696374696f6e204d61726b657420666f72207468652061737365742060408201526d1a5cc81b9bdd081c1c995cd95b9d60921b606082015260800190565b604080825283519082018190526000906020906060840190828701845b82811015612d2357815184529284019290840190600101612d07565b5050506001600160a01b039490941692019190915250919050565b600060208284031215612d5057600080fd5b5051919050565b81835260006001600160fb1b03831115612d7057600080fd5b8260051b8083602087013760009401602001938452509192915050565b604081526000612da1604083018587612d57565b905060018060a01b0383166020830152949350505050565b60006020808385031215612dcc57600080fd5b825167ffffffffffffffff811115612de357600080fd5b8301601f81018513612df457600080fd5b8051612e026129fe826129b9565b81815260059190911b82018301908381019087831115612e2157600080fd5b928401925b8284101561252d578351612e3981612689565b82529284019290840190612e26565b60006020808385031215612e5b57600080fd5b825167ffffffffffffffff811115612e7257600080fd5b8301601f81018513612e8357600080fd5b8051612e916129fe826129b9565b81815260059190911b82018301908381019087831115612eb057600080fd5b928401925b8284101561252d57835182529284019290840190612eb5565b60008219821115612ee157612ee1612c40565b500190565b60a081526000612efa60a083018688612d57565b905060018060a01b0384166020830152825160408301526020830151606083015260408301511515608083015295945050505050565b634e487b7160e01b600052601260045260246000fd5b600082612f5557612f55612f30565b500490565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612f928160178501602088016128e5565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612fc38160288401602088016128e5565b01602801949350505050565b600060208284031215612fe157600080fd5b81516123e98161262e565b600080821280156001600160ff1b038490038513161561300e5761300e612c40565b600160ff1b839003841281161561302757613027612c40565b50500190565b60006001600160ff1b038184138284138082168684048611161561305357613053612c40565b600160ff1b600087128281168783058912161561307257613072612c40565b6000871292508782058712848416161561308e5761308e612c40565b878505871281841616156130a4576130a4612c40565b505050929093029392505050565b6000826130c1576130c1612f30565b600160ff1b8214600019841416156130db576130db612c40565b500590565b60008083128015600160ff1b8501841216156130fe576130fe612c40565b6001600160ff1b038401831381161561311957613119612c40565b50500390565b600081600019048311821515161561313957613139612c40565b500290565b60008161314d5761314d612c40565b506000190190565b600082516131678184602087016128e5565b919091019291505056fea26469706673582212207971934bb9ff6a32b3691a526413f8adf3e125a51e4df0d819e0a111a6ec6f2964736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000c54f1c84d33421f878c59f00a04fb833cc8f1adf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102295760003560e01c806351cb2c9111610123578063a074e840116100ab578063c8a640471161006f578063c8a6404714610707578063d547741f14610727578063da74222814610747578063e1be274414610767578063ec1adb761461079757600080fd5b8063a074e84014610644578063a217fddf14610664578063b21b67a014610679578063bc28d3f0146106a6578063c375c2ef146106e757600080fd5b806372cfa35e116100f257806372cfa35e1461058757806384d50c70146105b45780638af261f4146105d457806391d14854146106045780639f8645701461062457600080fd5b806351cb2c91146104fa578063572b6c051461051a5780635bdf842d1461053a5780635f539d691461056757600080fd5b8063313ce567116101b157806338ae0e9c1161017557806338ae0e9c14610447578063486ff0cd14610467578063487f6630146104975780634b14c3d4146104c7578063511d84d9146104e757600080fd5b8063313ce567146103bb578063333adea2146103d157806333995105146103e757806336568abe146104075780633751d89c1461042757600080fd5b806323553d14116101f857806323553d14146102bf578063248a9ca3146102fa5780632ef582781461032b5780632f2ff15d1461036357806330fea2c11461038357600080fd5b806301ffc9a714610235578063042a5b6c1461026a57806311bb10dc1461028c57806317b6ecc51461029f57600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50610255610250366004612571565b6107b7565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028a61028536600461269e565b6107ee565b005b61028a61029a366004612724565b610802565b3480156102ab57600080fd5b5061028a6102ba36600461275c565b6109c0565b3480156102cb57600080fd5b506102ec6102da366004612791565b60076020526000908152604090205481565b604051908152602001610261565b34801561030657600080fd5b506102ec610315366004612791565b6000908152600160208190526040909120015490565b34801561033757600080fd5b5061034b610346366004612791565b610aa5565b6040516001600160a01b039091168152602001610261565b34801561036f57600080fd5b5061028a61037e3660046127aa565b610acf565b34801561038f57600080fd5b506102ec61039e3660046127cf565b600a60209081526000928352604080842090915290825290205481565b3480156103c757600080fd5b506102ec60045481565b3480156103dd57600080fd5b506102ec600c5481565b3480156103f357600080fd5b5061028a6104023660046127fb565b610af5565b34801561041357600080fd5b5061028a6104223660046127aa565b610b2a565b34801561043357600080fd5b5061028a6104423660046128c8565b610ba8565b34801561045357600080fd5b5061028a6104623660046128c8565b610ce0565b34801561047357600080fd5b5060408051808201825260018152603160f81b602082015290516102619190612911565b3480156104a357600080fd5b506102556104b23660046128c8565b600b6020526000908152604090205460ff1681565b3480156104d357600080fd5b50600d5461034b906001600160a01b031681565b61028a6104f5366004612944565b610da3565b34801561050657600080fd5b5061028a61051536600461298e565b610fae565b34801561052657600080fd5b506102556105353660046128c8565b610fe1565b34801561054657600080fd5b506102ec610555366004612791565b60066020526000908152604090205481565b34801561057357600080fd5b5061028a6105823660046128c8565b611045565b34801561059357600080fd5b506102ec6105a2366004612791565b60086020526000908152604090205481565b3480156105c057600080fd5b5061028a6105cf36600461298e565b6110db565b3480156105e057600080fd5b506102556105ef3660046128c8565b60036020526000908152604090205460ff1681565b34801561061057600080fd5b5061025561061f3660046127aa565b611221565b34801561063057600080fd5b5061028a61063f36600461269e565b61124c565b34801561065057600080fd5b5061028a61065f366004612a48565b61125a565b34801561067057600080fd5b506102ec600081565b34801561068557600080fd5b506102ec610694366004612791565b60096020526000908152604090205481565b3480156106b257600080fd5b5061034b6106c1366004612b2e565b60026020908152600092835260408084209091529082529020546001600160a01b031681565b3480156106f357600080fd5b5061028a6107023660046128c8565b6114b6565b34801561071357600080fd5b5061028a610722366004612791565b611500565b34801561073357600080fd5b5061028a6107423660046127aa565b61159a565b34801561075357600080fd5b5061028a6107623660046128c8565b6115c0565b34801561077357600080fd5b50610255610782366004612791565b60056020526000908152604090205460ff1681565b3480156107a357600080fd5b5061028a6107b23660046127fb565b611699565b60006001600160e01b03198216637965db0b60e01b14806107e857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6107fc8484846000856117ac565b50505050565b815160009081526002602090815260408083208286015184529091529020546001600160a01b0316806108505760405162461bcd60e51b815260040161084790612b50565b60405180910390fd5b6001600160a01b03811660009081526003602052604090205460ff166108885760405162461bcd60e51b815260040161084790612b50565b600c5434116108a95760405162461bcd60e51b815260040161084790612b9d565b82606001511561093457806001600160a01b0316631c389c283485604001516108d0611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b15801561091657600080fd5b505af115801561092a573d6000803e3d6000fd5b50505050506109b1565b806001600160a01b031663e44bb72f348560400151610951611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b50505050505b6109bb8234611baf565b505050565b336109cc600082611221565b6109e85760405162461bcd60e51b815260040161084790612be3565b60008381526002602090815260408083208584529091529020546001600160a01b0316610a575760405162461bcd60e51b815260206004820152601f60248201527f50726564696374696f6e206d61726b657420646f65736e2774206578697374006044820152606401610847565b50600091825260026020908152604080842092845291815281832080546001600160a01b039095166001600160a01b031990951685179055928252600390925220805460ff19166001179055565b60008181548110610ab557600080fd5b6000918252602090912001546001600160a01b0316905081565b60008281526001602081905260409091200154610aeb81611d33565b6109bb8383611d40565b835160009081526002602090815260408083208288015184529091529020546107fc906001600160a01b031684843385611dab565b6001600160a01b0381163314610b9a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610847565b610ba48282611e20565b5050565b33610bb4600082611221565b610bd05760405162461bcd60e51b815260040161084790612be3565b6000805b600054811015610c3057836001600160a01b031660008281548110610bfb57610bfb612c2a565b6000918252602090912001546001600160a01b031603610c1e5760019150610c30565b80610c2881612c56565b915050610bd4565b81156107fc5760008054610c4690600190612c6f565b81548110610c5657610c56612c2a565b600091825260208220015481546001600160a01b03909116919083908110610c8057610c80612c2a565b6000918252602082200180546001600160a01b0319166001600160a01b039390931692909217909155805480610cb857610cb8612c86565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b33610cec600082611221565b610d085760405162461bcd60e51b815260040161084790612be3565b6001600160a01b03821660009081526003602052604090205460ff16610d815760405162461bcd60e51b815260206004820152602860248201527f50726564696374696f6e206d61726b6574206973206e6f7420696e2061637469604482015267766520737461746560c01b6064820152608401610847565b506001600160a01b03166000908152600360205260409020805460ff19169055565b825160009081526002602090815260408083208287015184529091529020546001600160a01b031680610de85760405162461bcd60e51b815260040161084790612c9c565b6001600160a01b03811660009081526003602052604090205460ff16610e205760405162461bcd60e51b815260040161084790612b50565b6000333b15158015610e415750336000908152600b602052604090205460ff165b15610e4d575082610eb9565b336001600160a01b03851614610eb65760405162461bcd60e51b815260206004820152602860248201527f427579657220616e64206d73672e73656e6465722063616e6e6f7420626520646044820152671a5999995c995b9d60c21b6064820152608401610847565b50335b846060015115610f32576040858101519051630387138560e31b815260048101919091526001600160a01b038281166024830152831690631c389c289034906044016000604051808303818588803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b5050505050610f9d565b604085810151905163e44bb72f60e01b815260048101919091526001600160a01b03828116602483015283169063e44bb72f9034906044016000604051808303818588803b158015610f8357600080fd5b505af1158015610f97573d6000803e3d6000fd5b50505050505b610fa78334611baf565b5050505050565b81516000908152600260209081526040808320828601518452909152902054610ba4906001600160a01b03168233611e87565b6000805b60005481101561103c576000818154811061100257611002612c2a565b6000918252602090912001546001600160a01b039081169084160361102a5750600192915050565b8061103481612c56565b915050610fe5565b50600092915050565b33611051600082611221565b61106d5760405162461bcd60e51b815260040161084790612be3565b6001600160a01b0382163b6110b65760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206164647265737360881b6044820152606401610847565b506001600160a01b03166000908152600b60205260409020805460ff19166001179055565b8151600090815260026020908152604080832082860151845290915280822054815160018082528184019093526001600160a01b039091169291816020016020820280368337019050509050828160008151811061113b5761113b612c2a565b6020026020010181815250506000826001600160a01b031663795c296083611161611b81565b6040518363ffffffff1660e01b815260040161117e929190612cea565b6020604051808303816000875af115801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c19190612d3e565b9050600c54811161120f5760405162461bcd60e51b81526020600482015260186024820152774e6f7420656c696769626c6520666f72206761736c65737360401b6044820152606401610847565b610fa7838561121c611b81565b611e87565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6107fc8484846001856117ac565b33611266600082611221565b6112825760405162461bcd60e51b815260040161084790612be3565b82518451146112d35760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e74732070617373656400006044820152606401610847565b82518251146113245760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420617272617920617267756d656e74732070617373656400006044820152606401610847565b60005b8451811015610fa75784818151811061134257611342612c2a565b60200260200101516002600086848151811061136057611360612c2a565b60200260200101518152602001908152602001600020600085848151811061138a5761138a612c2a565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600360008683815181106113da576113da612c2a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff161561145a5760405162461bcd60e51b815260206004820152602360248201527f50726564696374696f6e204d61726b657420697320616c72656164792061637460448201526269766560e81b6064820152608401610847565b60016003600087848151811061147257611472612c2a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806114ae81612c56565b915050611327565b336114c2600082611221565b6114de5760405162461bcd60e51b815260040161084790612be3565b506001600160a01b03166000908152600b60205260409020805460ff19169055565b3361150c600082611221565b6115285760405162461bcd60e51b815260040161084790612be3565b67016345785d8a00008210158015611548575068056bc75e2d6310000082105b6115945760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964206d696e696d756d206761736c657373207072656d69756d006044820152606401610847565b50600c55565b600082815260016020819052604090912001546115b681611d33565b6109bb8383611e20565b336115cc600082611221565b6115e85760405162461bcd60e51b815260040161084790612be3565b6001600160a01b0382166116495760405162461bcd60e51b815260206004820152602260248201527f53444b3a20466f7277617264657220416464726573732063616e6e6f74206265604482015261020360f41b6064820152608401610847565b50600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0392909216919091179055565b835160009081526002602090815260408083208288015184529091528120546001600160a01b0316908163795c296086866116d2611b81565b6040518463ffffffff1660e01b81526004016116f093929190612d8d565b6020604051808303816000875af115801561170f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117339190612d3e565b9050600c5481116117815760405162461bcd60e51b81526020600482015260186024820152774e6f7420656c696769626c6520666f72206761736c65737360401b6044820152606401610847565b61179582868661178f611b81565b87611dab565b505050505050565b6001600160a01b03163b151590565b835160009081526002602090815260408083208288015184529091529020546001600160a01b0316806117f15760405162461bcd60e51b815260040161084790612c9c565b6001600160a01b03811660009081526003602052604090205460ff166118295760405162461bcd60e51b815260040161084790612b50565b600d546040808801516060890151915163709adf7360e11b81526000936001600160a01b03169263e135bee69261186e92909190600401918252602082015260400190565b600060405180830381865afa15801561188b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118b39190810190612db9565b90506119056118c0611b81565b600d54895184516001600160a01b039092169185906000906118e4576118e4612c2a565b60200260200101516001600160a01b0316611eee909392919063ffffffff16565b600d5460408051635228ce9f60e01b81528951600482015260208a015160248201529089015160448201526060890151606482015230608482015260a481018790526000916001600160a01b031690635228ce9f9060c4016000604051808303816000875af115801561197c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119a49190810190612e48565b905084156119f357600c5481600183516119be9190612c6f565b815181106119ce576119ce612c2a565b6020026020010151116119f35760405162461bcd60e51b815260040161084790612b9d565b866060015115611aa457826001600160a01b0316631c389c288260018451611a1b9190612c6f565b81518110611a2b57611a2b612c2a565b60200260200101518960400151611a40611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b158015611a8657600080fd5b505af1158015611a9a573d6000803e3d6000fd5b5050505050611b47565b826001600160a01b031663e44bb72f8260018451611ac29190612c6f565b81518110611ad257611ad2612c2a565b60200260200101518960400151611ae7611b81565b6040516001600160e01b031960e086901b16815260048101929092526001600160a01b031660248201526044016000604051808303818588803b158015611b2d57600080fd5b505af1158015611b41573d6000803e3d6000fd5b50505050505b611b77848260018451611b5a9190612c6f565b81518110611b6a57611b6a612c2a565b6020026020010151611baf565b5050505050505050565b600060183610801590611b985750611b9833610fe1565b15611baa575060131936013560601c90565b503390565b6000806000611bbd42611f48565b604080516001600160a01b038b16602082015290810184905292965090945092506005915060009060600160408051601f198184030181529181528151602092830120835290820192909252016000205460ff16611c8b57604080516001600160a01b0387166020808301829052828401879052835180840385018152606090930180855283519382019390932060009081526005909152928320805460ff191660011790559185917f1e76ea6dc8321d650d11680422e5add0e5f4bc9f644910c85e0d2c38c7c606899190a35b6001600160a01b0385166000908152600a6020908152604080832086845290915281208054869290611cbe908490612ece565b909155505060008381526007602052604081208054869290611ce1908490612ece565b909155505060008281526008602052604081208054869290611d04908490612ece565b909155505060008181526006602052604081208054869290611d27908490612ece565b90915550505050505050565b611d3d8133611f7a565b50565b611d4a8282611221565b610ba45760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6040516357957f6960e01b81526001600160a01b038616906357957f6990611ddd908790879087908790600401612ee6565b6020604051808303816000875af1158015611dfc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117959190612d3e565b611e2a8282611221565b15610ba45760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051630399a1b160e51b8152600481018390526001600160a01b038281166024830152841690637334362090604401600060405180830381600087803b158015611ed157600080fd5b505af1158015611ee5573d6000803e3d6000fd5b50505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526107fc908590611fde565b6000808080611f62611f5d6201518087612f46565b6120b0565b955093509150611f7185612224565b90509193509193565b611f848282611221565b610ba457611f9c816001600160a01b0316601461224d565b611fa783602061224d565b604051602001611fb8929190612f5a565b60408051601f198184030181529082905262461bcd60e51b825261084791600401612911565b6000612033826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123f09092919063ffffffff16565b8051909150156109bb57808060200190518101906120519190612fcf565b6109bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610847565b60008080838162253d8c6120c78362010bd9612fec565b6120d19190612fec565b9050600062023ab16120e483600461302d565b6120ee91906130b2565b905060046120ff8262023ab161302d565b61210a906003612fec565b61211491906130b2565b61211e90836130e0565b9150600062164b09612131846001612fec565b61213d90610fa061302d565b61214791906130b2565b90506004612157826105b561302d565b61216191906130b2565b61216b90846130e0565b61217690601f612fec565b9250600061098f61218885605061302d565b61219291906130b2565b9050600060506121a48361098f61302d565b6121ae91906130b2565b6121b890866130e0565b90506121c5600b836130b2565b94506121d285600c61302d565b6121dd836002612fec565b6121e791906130e0565b915084836121f66031876130e0565b61220190606461302d565b61220b9190612fec565b6122159190612fec565b9a919950975095505050505050565b60006007620151806122396205460085612ece565b6122439190612f46565b6107e89190612f46565b6060600061225c83600261311f565b612267906002612ece565b67ffffffffffffffff81111561227f5761227f61259b565b6040519080825280601f01601f1916602001820160405280156122a9576020820181803683370190505b509050600360fc1b816000815181106122c4576122c4612c2a565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106122f3576122f3612c2a565b60200101906001600160f81b031916908160001a905350600061231784600261311f565b612322906001612ece565b90505b600181111561239a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061235657612356612c2a565b1a60f81b82828151811061236c5761236c612c2a565b60200101906001600160f81b031916908160001a90535060049490941c936123938161313e565b9050612325565b5083156123e95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610847565b9392505050565b60606123ff8484600085612407565b949350505050565b6060824710156124685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610847565b6001600160a01b0385163b6124bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610847565b600080866001600160a01b031685876040516124db9190613155565b60006040518083038185875af1925050503d8060008114612518576040519150601f19603f3d011682016040523d82523d6000602084013e61251d565b606091505b509150915061252d828286612538565b979650505050505050565b606083156125475750816123e9565b8251156125575782518084602001fd5b8160405162461bcd60e51b81526004016108479190612911565b60006020828403121561258357600080fd5b81356001600160e01b0319811681146123e957600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156125d4576125d461259b565b60405290565b6040516060810167ffffffffffffffff811182821017156125d4576125d461259b565b604051601f8201601f1916810167ffffffffffffffff811182821017156126265761262661259b565b604052919050565b8015158114611d3d57600080fd5b60006080828403121561264e57600080fd5b6126566125b1565b9050813581526020820135602082015260408201356040820152606082013561267e8161262e565b606082015292915050565b6001600160a01b0381168114611d3d57600080fd5b6000806000808486036101408112156126b657600080fd5b60808112156126c457600080fd5b506126cd6125b1565b8535815260208601356020820152604086013560408201526060860135606082015280945050612700866080870161263c565b9250610100850135915061012085013561271981612689565b939692955090935050565b60008060a0838503121561273757600080fd5b612741848461263c565b9150608083013561275181612689565b809150509250929050565b60008060006060848603121561277157600080fd5b833561277c81612689565b95602085013595506040909401359392505050565b6000602082840312156127a357600080fd5b5035919050565b600080604083850312156127bd57600080fd5b82359150602083013561275181612689565b600080604083850312156127e257600080fd5b82356127ed81612689565b946020939093013593505050565b60008060008084860361010081121561281357600080fd5b61281d878761263c565b9450608086013567ffffffffffffffff8082111561283a57600080fd5b818801915088601f83011261284e57600080fd5b81358181111561285d57600080fd5b8960208260051b850101111561287257600080fd5b6020929092019550909350506060609f198201121561289057600080fd5b506128996125da565b60a0860135815260c0860135602082015260e08601356128b88161262e565b6040820152939692955090935050565b6000602082840312156128da57600080fd5b81356123e981612689565b60005b838110156129005781810151838201526020016128e8565b838111156107fc5750506000910152565b60208152600082518060208401526129308160408501602087016128e5565b601f01601f19169190910160400192915050565b600080600060c0848603121561295957600080fd5b612963858561263c565b9250608084013561297381612689565b915060a084013561298381612689565b809150509250925092565b60008060a083850312156129a157600080fd5b6129ab848461263c565b946080939093013593505050565b600067ffffffffffffffff8211156129d3576129d361259b565b5060051b60200190565b600082601f8301126129ee57600080fd5b81356020612a036129fe836129b9565b6125fd565b82815260059290921b84018101918181019086841115612a2257600080fd5b8286015b84811015612a3d5780358352918301918301612a26565b509695505050505050565b600080600060608486031215612a5d57600080fd5b833567ffffffffffffffff80821115612a7557600080fd5b818601915086601f830112612a8957600080fd5b81356020612a996129fe836129b9565b82815260059290921b8401810191818101908a841115612ab857600080fd5b948201945b83861015612adf578535612ad081612689565b82529482019490820190612abd565b97505087013592505080821115612af557600080fd5b612b01878388016129dd565b93506040860135915080821115612b1757600080fd5b50612b24868287016129dd565b9150509250925092565b60008060408385031215612b4157600080fd5b50508035926020909101359150565b6020808252602d908201527f50726564696374696f6e204d61726b657420666f72207468652061737365742060408201526c6973206e6f742061637469766560981b606082015260800190565b60208082526026908201527f42657420616d6f756e74206973206e6f7420656c696769626c6520666f72206760408201526561736c65737360d01b606082015260800190565b60208082526027908201527f53444b3a2063616c6c657220686173206e6f2061636365737320746f20746865604082015266081b595d1a1bd960ca1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612c6857612c68612c40565b5060010190565b600082821015612c8157612c81612c40565b500390565b634e487b7160e01b600052603160045260246000fd5b6020808252602e908201527f50726564696374696f6e204d61726b657420666f72207468652061737365742060408201526d1a5cc81b9bdd081c1c995cd95b9d60921b606082015260800190565b604080825283519082018190526000906020906060840190828701845b82811015612d2357815184529284019290840190600101612d07565b5050506001600160a01b039490941692019190915250919050565b600060208284031215612d5057600080fd5b5051919050565b81835260006001600160fb1b03831115612d7057600080fd5b8260051b8083602087013760009401602001938452509192915050565b604081526000612da1604083018587612d57565b905060018060a01b0383166020830152949350505050565b60006020808385031215612dcc57600080fd5b825167ffffffffffffffff811115612de357600080fd5b8301601f81018513612df457600080fd5b8051612e026129fe826129b9565b81815260059190911b82018301908381019087831115612e2157600080fd5b928401925b8284101561252d578351612e3981612689565b82529284019290840190612e26565b60006020808385031215612e5b57600080fd5b825167ffffffffffffffff811115612e7257600080fd5b8301601f81018513612e8357600080fd5b8051612e916129fe826129b9565b81815260059190911b82018301908381019087831115612eb057600080fd5b928401925b8284101561252d57835182529284019290840190612eb5565b60008219821115612ee157612ee1612c40565b500190565b60a081526000612efa60a083018688612d57565b905060018060a01b0384166020830152825160408301526020830151606083015260408301511515608083015295945050505050565b634e487b7160e01b600052601260045260246000fd5b600082612f5557612f55612f30565b500490565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612f928160178501602088016128e5565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612fc38160288401602088016128e5565b01602801949350505050565b600060208284031215612fe157600080fd5b81516123e98161262e565b600080821280156001600160ff1b038490038513161561300e5761300e612c40565b600160ff1b839003841281161561302757613027612c40565b50500190565b60006001600160ff1b038184138284138082168684048611161561305357613053612c40565b600160ff1b600087128281168783058912161561307257613072612c40565b6000871292508782058712848416161561308e5761308e612c40565b878505871281841616156130a4576130a4612c40565b505050929093029392505050565b6000826130c1576130c1612f30565b600160ff1b8214600019841416156130db576130db612c40565b500590565b60008083128015600160ff1b8501841216156130fe576130fe612c40565b6001600160ff1b038401831381161561311957613119612c40565b50500390565b600081600019048311821515161561313957613139612c40565b500290565b60008161314d5761314d612c40565b506000190190565b600082516131678184602087016128e5565b919091019291505056fea26469706673582212207971934bb9ff6a32b3691a526413f8adf3e125a51e4df0d819e0a111a6ec6f2964736f6c634300080d0033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000c54f1c84d33421f878c59f00a04fb833cc8f1adf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 000000000000000000000000c54f1c84d33421f878c59f00a04fb833cc8f1adf
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
view all blocks sequenced

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

Validator Index Block Amount
View All Withdrawals

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

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