APE Price: $0.18 (-3.07%)

Contract

0xA1D2812792a748f7744016288dD3876f1dF70954

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

More Info

Private Name Tags

Multichain Info

N/A
Transaction Hash
Block
From
To
Grant Role112393692025-03-09 6:45:09322 days ago1741502709IN
0xA1D28127...f1dF70954
0 APE0.0007585225.42069

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PayPerRequestPayment

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "../interfaces/IDotsVRFPayment.sol";

/**
 * @title PayPerRequestPayment
 * @notice Basic payment implementation charging per request with balance tracking
 */
contract PayPerRequestPayment is IDotsVRFPayment, AccessControl, ReentrancyGuard, Pausable {
    bytes32 public constant DOTS_VRF_ROLE = keccak256("DOTS_VRF_ROLE");
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    uint256 public requestPrice;
    mapping(address => uint256) private balances;
    address payable public owner;

    // Optional off-chain authorization tracking
    mapping(address => bool) public authorizedUsers;
    
    event Deposited(address indexed consumer, uint256 amount);
    event Withdrawn(address indexed consumer, uint256 amount);
    event RequestPriceUpdated(uint256 newPrice);
    event FeesWithdrawn(uint256 amount);
    event UserAuthorized(address indexed user, bool status);

    constructor(uint256 initialPrice, address dotsVRF) {
        require(initialPrice > 0, "Price must be greater than 0");
        require(dotsVRF != address(0), "Invalid DotsVRF address");

        requestPrice = initialPrice;
        owner = payable(msg.sender);

        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(ADMIN_ROLE, msg.sender);
        _setupRole(MANAGER_ROLE, msg.sender);
        _setupRole(DOTS_VRF_ROLE, dotsVRF);
    }

    /**
     * @notice Authorize a randomness request
     * @param requester Address requesting randomness
     * @param requestData Additional data for authorization (unused in this implementation)
     * @return success True if request is authorized
     * @return reason Optional reason if request is not authorized
     */
    function authorizeRequest(address requester, bytes calldata requestData)
        external
        override
        nonReentrant
        whenNotPaused
        onlyRole(DOTS_VRF_ROLE)
        returns (bool success, string memory reason)
    {
        // First check if user is authorized (for off-chain verification model)
        if (authorizedUsers[requester]) {
            return (true, "");
        }

        // Then check balance for pay-per-request model
        if (balances[requester] >= requestPrice) {
            balances[requester] -= requestPrice;
            return (true, "");
        }

        return (false, "Insufficient balance or unauthorized");
    }

    /**
     * @notice Check if an address can make requests
     * @param requester Address to check
     * @param requestData Additional data for verification (unused in this implementation)
     * @return canRequest True if address can make requests
     * @return reason Optional reason if address cannot make requests
     */
    function canRequestRandomness(address requester, bytes calldata requestData)
        external
        view
        override
        returns (bool canRequest, string memory reason)
    {
        // Check both authorization methods
        if (authorizedUsers[requester]) {
            return (true, "");
        }

        if (balances[requester] >= requestPrice) {
            return (true, "");
        }

        return (false, "Insufficient balance or unauthorized");
    }

    /**
     * @notice Deposit funds for future requests
     * @param consumer Address that will use the deposited funds
     */
    function deposit(address consumer)
        external
        payable
        override
        nonReentrant
        whenNotPaused
    {
        require(msg.value > 0, "Must deposit some ETH");
        require(consumer != address(0), "Invalid consumer address");
        
        balances[consumer] += msg.value;
        emit Deposited(consumer, msg.value);
    }

    /**
     * @notice Withdraw unused funds
     * @param amount Amount of ETH to withdraw
     */
    function withdraw(uint256 amount)
        external
        override
        nonReentrant
        whenNotPaused
    {
        require(amount > 0, "Amount must be greater than 0");
        require(balances[msg.sender] >= amount, "Insufficient balance");
        
        balances[msg.sender] -= amount;
        (bool success, ) = payable(msg.sender).call{value: amount}("");
        require(success, "ETH transfer failed");
        
        emit Withdrawn(msg.sender, amount);
    }

    /**
     * @notice Get balance of an address
     * @param account Address to check balance for
     * @return Balance in ETH
     */
    function balanceOf(address account) 
        external 
        view 
        override 
        returns (uint256) 
    {
        return balances[account];
    }

    // Admin functions

    /**
     * @notice Set authorization status for a user (for off-chain verification model)
     * @param user Address to authorize/unauthorize
     * @param status New authorization status
     */
    function setUserAuthorization(address user, bool status)
        external
        onlyRole(MANAGER_ROLE)
    {
        require(user != address(0), "Invalid address");
        authorizedUsers[user] = status;
        emit UserAuthorized(user, status);
    }

    /**
     * @notice Update the price per request
     * @param newPrice New price in ETH
     */
    function setRequestPrice(uint256 newPrice)
        external
        onlyRole(ADMIN_ROLE)
        whenNotPaused
    {
        require(newPrice > 0, "Price must be greater than 0");
        requestPrice = newPrice;
        emit RequestPriceUpdated(newPrice);
    }

    /**
     * @notice Withdraw accumulated fees
     */
    function withdrawFees()
        external
        nonReentrant
        onlyRole(ADMIN_ROLE)
    {
        uint256 balance = address(this).balance;
        require(balance > 0, "No fees to withdraw");
        
        (bool success, ) = owner.call{value: balance}("");
        require(success, "ETH transfer failed");
        
        emit FeesWithdrawn(balance);
    }

    /**
     * @notice Pause the contract
     */
    function pause() external onlyRole(ADMIN_ROLE) {
        _pause();
    }

    /**
     * @notice Unpause the contract
     */
    function unpause() external onlyRole(ADMIN_ROLE) {
        _unpause();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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(account),
                        " 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());
        }
    }
}

// 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;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

// 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;
    }
}

// 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;
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _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) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

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

/**
 * @title IDotsVRFPayment
 * @notice Interface for managing payments in DotsVRF system
 */
interface IDotsVRFPayment {
    /**
     * @notice Deposit funds for a consumer address to use for randomness requests
     * @param consumer Address that will use the deposited funds
     */
    function deposit(address consumer) external payable;

    /**
     * @notice Withdraw unused funds
     * @param amount Amount of ETH to withdraw
     */
    function withdraw(uint256 amount) external;

    /**
     * @notice Authorize a randomness request
     * @param requester Address requesting randomness
     * @param requestData Additional data that might be needed for authorization
     * @return success True if request is authorized
     * @return reason Optional reason if request is not authorized
     */
    function authorizeRequest(address requester, bytes calldata requestData)
        external
        returns (bool success, string memory reason);

    /**
     * @notice Check if an address can make requests
     * @param requester Address to check
     * @param requestData Additional data that might be needed for verification
     * @return canRequest True if address can make requests
     * @return reason Optional reason if address cannot make requests
     */
    function canRequestRandomness(address requester, bytes calldata requestData)
        external
        view
        returns (bool canRequest, string memory reason);

    /**
     * @notice Get balance of an address
     * @param account Address to check balance for
     * @return Balance in ETH
     */
    function balanceOf(address account) external view returns (uint256);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"address","name":"dotsVRF","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"consumer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"RequestPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"UserAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"consumer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOTS_VRF_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"requester","type":"address"},{"internalType":"bytes","name":"requestData","type":"bytes"}],"name":"authorizeRequest","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"string","name":"reason","type":"string"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedUsers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"requester","type":"address"},{"internalType":"bytes","name":"requestData","type":"bytes"}],"name":"canRequestRandomness","outputs":[{"internalType":"bool","name":"canRequest","type":"bool"},{"internalType":"string","name":"reason","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"consumer","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"payable","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":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"newPrice","type":"uint256"}],"name":"setRequestPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setUserAuthorization","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":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051612c81380380612c8183398181016040528101906100329190610403565b600180819055506000600260006101000a81548160ff02191690831515021790555060008211610097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161008e906104a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100fd9061050c565b60405180910390fd5b8160038190555033600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101616000801b336101f860201b60201c565b6101917fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775336101f860201b60201c565b6101c17f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08336101f860201b60201c565b6101f17f79f4ea602b28c29a26b178396f270910fdf9549c9e130bffae6e7c6d6bf3343b826101f860201b60201c565b505061052c565b610208828261020c60201b60201c565b5050565b61021c82826102f860201b60201c565b6102f457600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061029961036260201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b600080fd5b6000819050919050565b6103828161036f565b811461038d57600080fd5b50565b60008151905061039f81610379565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103d0826103a5565b9050919050565b6103e0816103c5565b81146103eb57600080fd5b50565b6000815190506103fd816103d7565b92915050565b6000806040838503121561041a5761041961036a565b5b600061042885828601610390565b9250506020610439858286016103ee565b9150509250929050565b600082825260208201905092915050565b7f5072696365206d7573742062652067726561746572207468616e203000000000600082015250565b600061048a601c83610443565b915061049582610454565b602082019050919050565b600060208201905081810360008301526104b98161047d565b9050919050565b7f496e76616c696420446f74735652462061646472657373000000000000000000600082015250565b60006104f6601783610443565b9150610501826104c0565b602082019050919050565b60006020820190508181036000830152610525816104e9565b9050919050565b6127468061053b6000396000f3fe60806040526004361061014b5760003560e01c80635c975abb116100b6578063a217fddf1161006f578063a217fddf14610492578063accfac05146104bd578063b03a7fd6146104e8578063d547741f14610511578063ec87621c1461053a578063f340fa01146105655761014b565b80635c975abb1461038057806370a08231146103ab57806375b238fc146103e85780638456cb59146104135780638da5cb5b1461042a57806391d14854146104555761014b565b806336568abe1161010857806336568abe146102845780633a14b256146102ad5780633f4ba83a146102eb5780633fcf7ca114610302578063476343ee1461032b578063567ecf51146103425761014b565b806301ffc9a7146101505780631604f9ea1461018d5780631828983a146101b8578063248a9ca3146101f55780632e1a7d4d146102325780632f2ff15d1461025b575b600080fd5b34801561015c57600080fd5b50610177600480360381019061017291906119d5565b610581565b6040516101849190611a1d565b60405180910390f35b34801561019957600080fd5b506101a26105fb565b6040516101af9190611a51565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190611aca565b610601565b6040516101ec9190611a1d565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190611b2d565b610621565b6040516102299190611b69565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190611bb0565b610640565b005b34801561026757600080fd5b50610282600480360381019061027d9190611bdd565b610871565b005b34801561029057600080fd5b506102ab60048036038101906102a69190611bdd565b610892565b005b3480156102b957600080fd5b506102d460048036038101906102cf9190611c82565b610915565b6040516102e2929190611d72565b60405180910390f35b3480156102f757600080fd5b50610300610aac565b005b34801561030e57600080fd5b5061032960048036038101906103249190611bb0565b610ae1565b005b34801561033757600080fd5b50610340610b98565b005b34801561034e57600080fd5b5061036960048036038101906103649190611c82565b610d24565b604051610377929190611d72565b60405180910390f35b34801561038c57600080fd5b50610395610e20565b6040516103a29190611a1d565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611aca565b610e37565b6040516103df9190611a51565b60405180910390f35b3480156103f457600080fd5b506103fd610e80565b60405161040a9190611b69565b60405180910390f35b34801561041f57600080fd5b50610428610ea4565b005b34801561043657600080fd5b5061043f610ed9565b60405161044c9190611dc3565b60405180910390f35b34801561046157600080fd5b5061047c60048036038101906104779190611bdd565b610eff565b6040516104899190611a1d565b60405180910390f35b34801561049e57600080fd5b506104a7610f69565b6040516104b49190611b69565b60405180910390f35b3480156104c957600080fd5b506104d2610f70565b6040516104df9190611b69565b60405180910390f35b3480156104f457600080fd5b5061050f600480360381019061050a9190611e0a565b610f94565b005b34801561051d57600080fd5b5061053860048036038101906105339190611bdd565b6110d7565b005b34801561054657600080fd5b5061054f6110f8565b60405161055c9190611b69565b60405180910390f35b61057f600480360381019061057a9190611aca565b61111c565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105f457506105f38261128d565b5b9050919050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000806000838152602001908152602001600020600101549050919050565b6106486112f7565b610650611346565b60008111610693576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068a90611e96565b60405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070c90611f02565b60405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107649190611f51565b9250508190555060003373ffffffffffffffffffffffffffffffffffffffff168260405161079190611fb6565b60006040518083038185875af1925050503d80600081146107ce576040519150601f19603f3d011682016040523d82523d6000602084013e6107d3565b606091505b5050905080610817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080e90612017565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58360405161085d9190611a51565b60405180910390a25061086e611390565b50565b61087a82610621565b61088381611399565b61088d83836113ad565b505050565b61089a61148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe906120a9565b60405180910390fd5b6109118282611495565b5050565b600060606109216112f7565b610929611346565b7f79f4ea602b28c29a26b178396f270910fdf9549c9e130bffae6e7c6d6bf3343b61095381611399565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109c05760016040518060200160405280600081525092509250610a9b565b600354600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610a7b57600354600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a599190611f51565b9250508190555060016040518060200160405280600081525092509250610a9b565b60006040518060600160405280602481526020016126ed60249139925092505b50610aa4611390565b935093915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610ad681611399565b610ade611576565b50565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b0b81611399565b610b13611346565b60008211610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90612115565b60405180910390fd5b816003819055507fc3d50f77154758c462c4c169109245a63ef238ce48eac8201fc45e514cdb77f282604051610b8c9190611a51565b60405180910390a15050565b610ba06112f7565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610bca81611399565b600047905060008111610c12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0990612181565b60405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610c5a90611fb6565b60006040518083038185875af1925050503d8060008114610c97576040519150601f19603f3d011682016040523d82523d6000602084013e610c9c565b606091505b5050905080610ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd790612017565b60405180910390fd5b7f9800e6f57aeb4360eaa72295a820a4293e1e66fbfcabcd8874ae141304a76deb82604051610d0f9190611a51565b60405180910390a1505050610d22611390565b565b60006060600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d955760016040518060200160405280600081525091509150610e18565b600354600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610df85760016040518060200160405280600081525091509150610e18565b60006040518060600160405280602481526020016126ed60249139915091505b935093915050565b6000600260009054906101000a900460ff16905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610ece81611399565b610ed66115d9565b50565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b81565b7f79f4ea602b28c29a26b178396f270910fdf9549c9e130bffae6e7c6d6bf3343b81565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610fbe81611399565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361102d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611024906121ed565b60405180910390fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff167f570b956a171c3a77d080bd03f4e6e3d0c536bf680da7603ab537b56e768d76df836040516110ca9190611a1d565b60405180910390a2505050565b6110e082610621565b6110e981611399565b6110f38383611495565b505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b6111246112f7565b61112c611346565b6000341161116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d5906122c5565b60405180910390fd5b34600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122d91906122e5565b925050819055508073ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c43460405161127a9190611a51565b60405180910390a261128a611390565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60026001540361133c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133390612365565b60405180910390fd5b6002600181905550565b61134e610e20565b1561138e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611385906123d1565b60405180910390fd5b565b60018081905550565b6113aa816113a561148d565b61163c565b50565b6113b78282610eff565b61148957600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061142e61148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b61149f8282610eff565b1561157257600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061151761148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b61157e6116c1565b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115c261148d565b6040516115cf9190612400565b60405180910390a1565b6115e1611346565b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861162561148d565b6040516116329190612400565b60405180910390a1565b6116468282610eff565b6116bd576116538161170a565b6116618360001c6020611737565b6040516020016116729291906124ef565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b49190612529565b60405180910390fd5b5050565b6116c9610e20565b611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff90612597565b60405180910390fd5b565b60606117308273ffffffffffffffffffffffffffffffffffffffff16601460ff16611737565b9050919050565b60606000600283600261174a91906125b7565b61175491906122e5565b67ffffffffffffffff81111561176d5761176c6125f9565b5b6040519080825280601f01601f19166020018201604052801561179f5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117d7576117d6612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061183b5761183a612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261187b91906125b7565b61188591906122e5565b90505b6001811115611925577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106118c7576118c6612628565b5b1a60f81b8282815181106118de576118dd612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061191e90612657565b9050611888565b5060008414611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611960906126cc565b60405180910390fd5b8091505092915050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6119b28161197d565b81146119bd57600080fd5b50565b6000813590506119cf816119a9565b92915050565b6000602082840312156119eb576119ea611973565b5b60006119f9848285016119c0565b91505092915050565b60008115159050919050565b611a1781611a02565b82525050565b6000602082019050611a326000830184611a0e565b92915050565b6000819050919050565b611a4b81611a38565b82525050565b6000602082019050611a666000830184611a42565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a9782611a6c565b9050919050565b611aa781611a8c565b8114611ab257600080fd5b50565b600081359050611ac481611a9e565b92915050565b600060208284031215611ae057611adf611973565b5b6000611aee84828501611ab5565b91505092915050565b6000819050919050565b611b0a81611af7565b8114611b1557600080fd5b50565b600081359050611b2781611b01565b92915050565b600060208284031215611b4357611b42611973565b5b6000611b5184828501611b18565b91505092915050565b611b6381611af7565b82525050565b6000602082019050611b7e6000830184611b5a565b92915050565b611b8d81611a38565b8114611b9857600080fd5b50565b600081359050611baa81611b84565b92915050565b600060208284031215611bc657611bc5611973565b5b6000611bd484828501611b9b565b91505092915050565b60008060408385031215611bf457611bf3611973565b5b6000611c0285828601611b18565b9250506020611c1385828601611ab5565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f840112611c4257611c41611c1d565b5b8235905067ffffffffffffffff811115611c5f57611c5e611c22565b5b602083019150836001820283011115611c7b57611c7a611c27565b5b9250929050565b600080600060408486031215611c9b57611c9a611973565b5b6000611ca986828701611ab5565b935050602084013567ffffffffffffffff811115611cca57611cc9611978565b5b611cd686828701611c2c565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d1c578082015181840152602081019050611d01565b60008484015250505050565b6000601f19601f8301169050919050565b6000611d4482611ce2565b611d4e8185611ced565b9350611d5e818560208601611cfe565b611d6781611d28565b840191505092915050565b6000604082019050611d876000830185611a0e565b8181036020830152611d998184611d39565b90509392505050565b6000611dad82611a6c565b9050919050565b611dbd81611da2565b82525050565b6000602082019050611dd86000830184611db4565b92915050565b611de781611a02565b8114611df257600080fd5b50565b600081359050611e0481611dde565b92915050565b60008060408385031215611e2157611e20611973565b5b6000611e2f85828601611ab5565b9250506020611e4085828601611df5565b9150509250929050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000611e80601d83611ced565b9150611e8b82611e4a565b602082019050919050565b60006020820190508181036000830152611eaf81611e73565b9050919050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000611eec601483611ced565b9150611ef782611eb6565b602082019050919050565b60006020820190508181036000830152611f1b81611edf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611f5c82611a38565b9150611f6783611a38565b9250828203905081811115611f7f57611f7e611f22565b5b92915050565b600081905092915050565b50565b6000611fa0600083611f85565b9150611fab82611f90565b600082019050919050565b6000611fc182611f93565b9150819050919050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b6000612001601383611ced565b915061200c82611fcb565b602082019050919050565b6000602082019050818103600083015261203081611ff4565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612093602f83611ced565b915061209e82612037565b604082019050919050565b600060208201905081810360008301526120c281612086565b9050919050565b7f5072696365206d7573742062652067726561746572207468616e203000000000600082015250565b60006120ff601c83611ced565b915061210a826120c9565b602082019050919050565b6000602082019050818103600083015261212e816120f2565b9050919050565b7f4e6f206665657320746f20776974686472617700000000000000000000000000600082015250565b600061216b601383611ced565b915061217682612135565b602082019050919050565b6000602082019050818103600083015261219a8161215e565b9050919050565b7f496e76616c696420616464726573730000000000000000000000000000000000600082015250565b60006121d7600f83611ced565b91506121e2826121a1565b602082019050919050565b60006020820190508181036000830152612206816121ca565b9050919050565b7f4d757374206465706f73697420736f6d65204554480000000000000000000000600082015250565b6000612243601583611ced565b915061224e8261220d565b602082019050919050565b6000602082019050818103600083015261227281612236565b9050919050565b7f496e76616c696420636f6e73756d657220616464726573730000000000000000600082015250565b60006122af601883611ced565b91506122ba82612279565b602082019050919050565b600060208201905081810360008301526122de816122a2565b9050919050565b60006122f082611a38565b91506122fb83611a38565b925082820190508082111561231357612312611f22565b5b92915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061234f601f83611ced565b915061235a82612319565b602082019050919050565b6000602082019050818103600083015261237e81612342565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006123bb601083611ced565b91506123c682612385565b602082019050919050565b600060208201905081810360008301526123ea816123ae565b9050919050565b6123fa81611a8c565b82525050565b600060208201905061241560008301846123f1565b92915050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b600061245c60178361241b565b915061246782612426565b601782019050919050565b600061247d82611ce2565b612487818561241b565b9350612497818560208601611cfe565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006124d960118361241b565b91506124e4826124a3565b601182019050919050565b60006124fa8261244f565b91506125068285612472565b9150612511826124cc565b915061251d8284612472565b91508190509392505050565b600060208201905081810360008301526125438184611d39565b905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612581601483611ced565b915061258c8261254b565b602082019050919050565b600060208201905081810360008301526125b081612574565b9050919050565b60006125c282611a38565b91506125cd83611a38565b92508282026125db81611a38565b915082820484148315176125f2576125f1611f22565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061266282611a38565b91506000820361267557612674611f22565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006126b6602083611ced565b91506126c182612680565b602082019050919050565b600060208201905081810360008301526126e5816126a9565b905091905056fe496e73756666696369656e742062616c616e6365206f7220756e617574686f72697a6564a2646970667358221220313d2363e2da965b047f7c328bd6eae8f61260b01186e6c0d165b8356612b0a164736f6c634300081c0033000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000007720792298cd510c15a82cb312c8c933d058467e

Deployed Bytecode

0x60806040526004361061014b5760003560e01c80635c975abb116100b6578063a217fddf1161006f578063a217fddf14610492578063accfac05146104bd578063b03a7fd6146104e8578063d547741f14610511578063ec87621c1461053a578063f340fa01146105655761014b565b80635c975abb1461038057806370a08231146103ab57806375b238fc146103e85780638456cb59146104135780638da5cb5b1461042a57806391d14854146104555761014b565b806336568abe1161010857806336568abe146102845780633a14b256146102ad5780633f4ba83a146102eb5780633fcf7ca114610302578063476343ee1461032b578063567ecf51146103425761014b565b806301ffc9a7146101505780631604f9ea1461018d5780631828983a146101b8578063248a9ca3146101f55780632e1a7d4d146102325780632f2ff15d1461025b575b600080fd5b34801561015c57600080fd5b50610177600480360381019061017291906119d5565b610581565b6040516101849190611a1d565b60405180910390f35b34801561019957600080fd5b506101a26105fb565b6040516101af9190611a51565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190611aca565b610601565b6040516101ec9190611a1d565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190611b2d565b610621565b6040516102299190611b69565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190611bb0565b610640565b005b34801561026757600080fd5b50610282600480360381019061027d9190611bdd565b610871565b005b34801561029057600080fd5b506102ab60048036038101906102a69190611bdd565b610892565b005b3480156102b957600080fd5b506102d460048036038101906102cf9190611c82565b610915565b6040516102e2929190611d72565b60405180910390f35b3480156102f757600080fd5b50610300610aac565b005b34801561030e57600080fd5b5061032960048036038101906103249190611bb0565b610ae1565b005b34801561033757600080fd5b50610340610b98565b005b34801561034e57600080fd5b5061036960048036038101906103649190611c82565b610d24565b604051610377929190611d72565b60405180910390f35b34801561038c57600080fd5b50610395610e20565b6040516103a29190611a1d565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd9190611aca565b610e37565b6040516103df9190611a51565b60405180910390f35b3480156103f457600080fd5b506103fd610e80565b60405161040a9190611b69565b60405180910390f35b34801561041f57600080fd5b50610428610ea4565b005b34801561043657600080fd5b5061043f610ed9565b60405161044c9190611dc3565b60405180910390f35b34801561046157600080fd5b5061047c60048036038101906104779190611bdd565b610eff565b6040516104899190611a1d565b60405180910390f35b34801561049e57600080fd5b506104a7610f69565b6040516104b49190611b69565b60405180910390f35b3480156104c957600080fd5b506104d2610f70565b6040516104df9190611b69565b60405180910390f35b3480156104f457600080fd5b5061050f600480360381019061050a9190611e0a565b610f94565b005b34801561051d57600080fd5b5061053860048036038101906105339190611bdd565b6110d7565b005b34801561054657600080fd5b5061054f6110f8565b60405161055c9190611b69565b60405180910390f35b61057f600480360381019061057a9190611aca565b61111c565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806105f457506105f38261128d565b5b9050919050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000806000838152602001908152602001600020600101549050919050565b6106486112f7565b610650611346565b60008111610693576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068a90611e96565b60405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070c90611f02565b60405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107649190611f51565b9250508190555060003373ffffffffffffffffffffffffffffffffffffffff168260405161079190611fb6565b60006040518083038185875af1925050503d80600081146107ce576040519150601f19603f3d011682016040523d82523d6000602084013e6107d3565b606091505b5050905080610817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080e90612017565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d58360405161085d9190611a51565b60405180910390a25061086e611390565b50565b61087a82610621565b61088381611399565b61088d83836113ad565b505050565b61089a61148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe906120a9565b60405180910390fd5b6109118282611495565b5050565b600060606109216112f7565b610929611346565b7f79f4ea602b28c29a26b178396f270910fdf9549c9e130bffae6e7c6d6bf3343b61095381611399565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109c05760016040518060200160405280600081525092509250610a9b565b600354600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610a7b57600354600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a599190611f51565b9250508190555060016040518060200160405280600081525092509250610a9b565b60006040518060600160405280602481526020016126ed60249139925092505b50610aa4611390565b935093915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610ad681611399565b610ade611576565b50565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610b0b81611399565b610b13611346565b60008211610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90612115565b60405180910390fd5b816003819055507fc3d50f77154758c462c4c169109245a63ef238ce48eac8201fc45e514cdb77f282604051610b8c9190611a51565b60405180910390a15050565b610ba06112f7565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610bca81611399565b600047905060008111610c12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0990612181565b60405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610c5a90611fb6565b60006040518083038185875af1925050503d8060008114610c97576040519150601f19603f3d011682016040523d82523d6000602084013e610c9c565b606091505b5050905080610ce0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd790612017565b60405180910390fd5b7f9800e6f57aeb4360eaa72295a820a4293e1e66fbfcabcd8874ae141304a76deb82604051610d0f9190611a51565b60405180910390a1505050610d22611390565b565b60006060600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d955760016040518060200160405280600081525091509150610e18565b600354600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610df85760016040518060200160405280600081525091509150610e18565b60006040518060600160405280602481526020016126ed60249139915091505b935093915050565b6000600260009054906101000a900460ff16905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610ece81611399565b610ed66115d9565b50565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b81565b7f79f4ea602b28c29a26b178396f270910fdf9549c9e130bffae6e7c6d6bf3343b81565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610fbe81611399565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361102d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611024906121ed565b60405180910390fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff167f570b956a171c3a77d080bd03f4e6e3d0c536bf680da7603ab537b56e768d76df836040516110ca9190611a1d565b60405180910390a2505050565b6110e082610621565b6110e981611399565b6110f38383611495565b505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b6111246112f7565b61112c611346565b6000341161116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612259565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036111de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d5906122c5565b60405180910390fd5b34600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122d91906122e5565b925050819055508073ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c43460405161127a9190611a51565b60405180910390a261128a611390565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60026001540361133c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133390612365565b60405180910390fd5b6002600181905550565b61134e610e20565b1561138e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611385906123d1565b60405180910390fd5b565b60018081905550565b6113aa816113a561148d565b61163c565b50565b6113b78282610eff565b61148957600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061142e61148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b61149f8282610eff565b1561157257600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061151761148d565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b61157e6116c1565b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115c261148d565b6040516115cf9190612400565b60405180910390a1565b6115e1611346565b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861162561148d565b6040516116329190612400565b60405180910390a1565b6116468282610eff565b6116bd576116538161170a565b6116618360001c6020611737565b6040516020016116729291906124ef565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b49190612529565b60405180910390fd5b5050565b6116c9610e20565b611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ff90612597565b60405180910390fd5b565b60606117308273ffffffffffffffffffffffffffffffffffffffff16601460ff16611737565b9050919050565b60606000600283600261174a91906125b7565b61175491906122e5565b67ffffffffffffffff81111561176d5761176c6125f9565b5b6040519080825280601f01601f19166020018201604052801561179f5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117d7576117d6612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061183b5761183a612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261187b91906125b7565b61188591906122e5565b90505b6001811115611925577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106118c7576118c6612628565b5b1a60f81b8282815181106118de576118dd612628565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061191e90612657565b9050611888565b5060008414611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611960906126cc565b60405180910390fd5b8091505092915050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6119b28161197d565b81146119bd57600080fd5b50565b6000813590506119cf816119a9565b92915050565b6000602082840312156119eb576119ea611973565b5b60006119f9848285016119c0565b91505092915050565b60008115159050919050565b611a1781611a02565b82525050565b6000602082019050611a326000830184611a0e565b92915050565b6000819050919050565b611a4b81611a38565b82525050565b6000602082019050611a666000830184611a42565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a9782611a6c565b9050919050565b611aa781611a8c565b8114611ab257600080fd5b50565b600081359050611ac481611a9e565b92915050565b600060208284031215611ae057611adf611973565b5b6000611aee84828501611ab5565b91505092915050565b6000819050919050565b611b0a81611af7565b8114611b1557600080fd5b50565b600081359050611b2781611b01565b92915050565b600060208284031215611b4357611b42611973565b5b6000611b5184828501611b18565b91505092915050565b611b6381611af7565b82525050565b6000602082019050611b7e6000830184611b5a565b92915050565b611b8d81611a38565b8114611b9857600080fd5b50565b600081359050611baa81611b84565b92915050565b600060208284031215611bc657611bc5611973565b5b6000611bd484828501611b9b565b91505092915050565b60008060408385031215611bf457611bf3611973565b5b6000611c0285828601611b18565b9250506020611c1385828601611ab5565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f840112611c4257611c41611c1d565b5b8235905067ffffffffffffffff811115611c5f57611c5e611c22565b5b602083019150836001820283011115611c7b57611c7a611c27565b5b9250929050565b600080600060408486031215611c9b57611c9a611973565b5b6000611ca986828701611ab5565b935050602084013567ffffffffffffffff811115611cca57611cc9611978565b5b611cd686828701611c2c565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d1c578082015181840152602081019050611d01565b60008484015250505050565b6000601f19601f8301169050919050565b6000611d4482611ce2565b611d4e8185611ced565b9350611d5e818560208601611cfe565b611d6781611d28565b840191505092915050565b6000604082019050611d876000830185611a0e565b8181036020830152611d998184611d39565b90509392505050565b6000611dad82611a6c565b9050919050565b611dbd81611da2565b82525050565b6000602082019050611dd86000830184611db4565b92915050565b611de781611a02565b8114611df257600080fd5b50565b600081359050611e0481611dde565b92915050565b60008060408385031215611e2157611e20611973565b5b6000611e2f85828601611ab5565b9250506020611e4085828601611df5565b9150509250929050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000611e80601d83611ced565b9150611e8b82611e4a565b602082019050919050565b60006020820190508181036000830152611eaf81611e73565b9050919050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000611eec601483611ced565b9150611ef782611eb6565b602082019050919050565b60006020820190508181036000830152611f1b81611edf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611f5c82611a38565b9150611f6783611a38565b9250828203905081811115611f7f57611f7e611f22565b5b92915050565b600081905092915050565b50565b6000611fa0600083611f85565b9150611fab82611f90565b600082019050919050565b6000611fc182611f93565b9150819050919050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b6000612001601383611ced565b915061200c82611fcb565b602082019050919050565b6000602082019050818103600083015261203081611ff4565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000612093602f83611ced565b915061209e82612037565b604082019050919050565b600060208201905081810360008301526120c281612086565b9050919050565b7f5072696365206d7573742062652067726561746572207468616e203000000000600082015250565b60006120ff601c83611ced565b915061210a826120c9565b602082019050919050565b6000602082019050818103600083015261212e816120f2565b9050919050565b7f4e6f206665657320746f20776974686472617700000000000000000000000000600082015250565b600061216b601383611ced565b915061217682612135565b602082019050919050565b6000602082019050818103600083015261219a8161215e565b9050919050565b7f496e76616c696420616464726573730000000000000000000000000000000000600082015250565b60006121d7600f83611ced565b91506121e2826121a1565b602082019050919050565b60006020820190508181036000830152612206816121ca565b9050919050565b7f4d757374206465706f73697420736f6d65204554480000000000000000000000600082015250565b6000612243601583611ced565b915061224e8261220d565b602082019050919050565b6000602082019050818103600083015261227281612236565b9050919050565b7f496e76616c696420636f6e73756d657220616464726573730000000000000000600082015250565b60006122af601883611ced565b91506122ba82612279565b602082019050919050565b600060208201905081810360008301526122de816122a2565b9050919050565b60006122f082611a38565b91506122fb83611a38565b925082820190508082111561231357612312611f22565b5b92915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061234f601f83611ced565b915061235a82612319565b602082019050919050565b6000602082019050818103600083015261237e81612342565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006123bb601083611ced565b91506123c682612385565b602082019050919050565b600060208201905081810360008301526123ea816123ae565b9050919050565b6123fa81611a8c565b82525050565b600060208201905061241560008301846123f1565b92915050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b600061245c60178361241b565b915061246782612426565b601782019050919050565b600061247d82611ce2565b612487818561241b565b9350612497818560208601611cfe565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006124d960118361241b565b91506124e4826124a3565b601182019050919050565b60006124fa8261244f565b91506125068285612472565b9150612511826124cc565b915061251d8284612472565b91508190509392505050565b600060208201905081810360008301526125438184611d39565b905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000612581601483611ced565b915061258c8261254b565b602082019050919050565b600060208201905081810360008301526125b081612574565b9050919050565b60006125c282611a38565b91506125cd83611a38565b92508282026125db81611a38565b915082820484148315176125f2576125f1611f22565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061266282611a38565b91506000820361267557612674611f22565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006126b6602083611ced565b91506126c182612680565b602082019050919050565b600060208201905081810360008301526126e5816126a9565b905091905056fe496e73756666696369656e742062616c616e6365206f7220756e617574686f72697a6564a2646970667358221220313d2363e2da965b047f7c328bd6eae8f61260b01186e6c0d165b8356612b0a164736f6c634300081c0033

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

000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000007720792298cd510c15a82cb312c8c933d058467e

-----Decoded View---------------
Arg [0] : initialPrice (uint256): 10000000000000000
Arg [1] : dotsVRF (address): 0x7720792298Cd510C15a82CB312c8C933d058467e

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [1] : 0000000000000000000000007720792298cd510c15a82cb312c8c933d058467e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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
0xA1D2812792a748f7744016288dD3876f1dF70954
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.