ETH Price: $2,460.73 (-8.17%)

Contract

0xE154dFeDDf252495B11261225b8A4CF29aa9Fd3A
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Script188373782023-12-21 22:59:47250 days ago1703199587IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0028865930.9850054
Set Script188373732023-12-21 22:58:47250 days ago1703199527IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0029017931.14814202
Set Script187736882023-12-13 0:30:23259 days ago1702427423IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0036602839.28991575
Set Vrf Request ...187658602023-12-11 22:12:35260 days ago1702332755IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0030911742.96582805
Set Script176663282023-07-10 22:49:11414 days ago1689029351IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0015068216.18902448
Set Script156191102022-09-26 17:44:11701 days ago1664214251IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0012807113.7597754
Set Script155416582022-09-15 21:07:11712 days ago1663276031IN
0xE154dFeD...29aa9Fd3A
0 ETH0.000863229.27431017
Set Script154536752022-09-01 15:36:46726 days ago1662046606IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0020883822.44011989
Grant Role154503862022-09-01 2:56:43727 days ago1662001003IN
0xE154dFeD...29aa9Fd3A
0 ETH0.0006894313.23974452
0x60c06040154502692022-09-01 2:32:28727 days ago1661999548IN
 Create: RaffleManager
0 ETH0.0323931314.23703972

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RaffleManager

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : RaffleManager.sol
// SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

import "./interfaces/IRaffleManager.sol";

error RaffleManager_RaffleAlreadyDrawn();
error RaffleManager_RaffleExpired();
error RaffleManager_InvalidRaffle();
error RaffleManager_InvalidScriptId();

/**
                        .             :++-
                       *##-          +####*          -##+
                       *####-      :%######%.      -%###*
                       *######:   =##########=   .######*
                       *#######*-#############*-*#######*
                       *################################*
                       *################################*
                       *################################*
                       *################################*
                       *################################*
                       :*******************************+.

                .:.
               *###%*=:
              .##########+-.
              +###############=:
              %##################%+
             =######################
             -######################++++++++++++++++++=-:
              =###########################################*:
               =#############################################.
  +####%#*+=-:. -#############################################:
  %############################################################=
  %##############################################################
  %##############################################################%=----::.
  %#######################################################################%:
  %##########################################+:    :+%#######################:
  *########################################*          *#######################
   -%######################################            %######################
     -%###################################%            #######################
       =###################################-          :#######################
     ....+##################################*.      .+########################
  +###########################################%*++*%##########################
  %#########################################################################*.
  %#######################################################################+
  ########################################################################-
  *#######################################################################-
  .######################################################################%.
     :+#################################################################-
         :=#####################################################:.....
             :--:.:##############################################+
   ::             +###############################################%-
  ####%+-.        %##################################################.
  %#######%*-.   :###################################################%
  %###########%*=*####################################################=
  %####################################################################
  %####################################################################+
  %#####################################################################.
  %#####################################################################%
  %######################################################################-
  .+*********************************************************************.
 * @title KaijuMart Raffle Manager
 * @author Augminted Labs, LLC
 */
contract RaffleManager is IRaffleManager, AccessControl, VRFConsumerBaseV2 {
    struct VrfRequestConfig {
        bytes32 keyHash;
        uint64 subId;
        uint32 callbackGasLimit;
        uint16 requestConfirmations;
    }

    bytes32 public constant KMART_CONTRACT_ROLE = keccak256("KMART_CONTRACT_ROLE");
    VRFCoordinatorV2Interface internal immutable COORDINATOR;

    VrfRequestConfig public vrfRequestConfig;
    mapping(uint256 => Raffle) public raffles;
    mapping(uint64 => string) public scripts;
    mapping(uint256 => uint256) internal _requests;

    constructor (
        address vrfCoordinator,
        address admin
    )
        VRFConsumerBaseV2(vrfCoordinator)
    {
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator);
    }

    /**
     * @notice Return a raffle
     * @param id Identifier of the raffle
     */
    function get(uint256 id) public view returns (Raffle memory) {
        return raffles[id];
    }

    /**
     * @notice Return whether or not a raffle has been drawn
     * @param id Identifier of the raffle
     */
    function isDrawn(
        uint256 id
    )
        public
        view
        override
        returns (bool)
    {
        return raffles[id].seed != 0;
    }

    /**
     * @notice Set configuration data for Chainlink VRF
     * @param _vrfRequestConfig Struct with updated configuration values
     */
    function setVrfRequestConfig(
        VrfRequestConfig calldata _vrfRequestConfig
    )
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        vrfRequestConfig = _vrfRequestConfig;
    }

    /**
     * @notice Set draw script URI for a raffle
     * @param id Identifier of the raffle
     * @param uri New draw script URI
     */
    function setScript(
        uint64 id,
        string calldata uri
    )
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        if (bytes(scripts[id]).length != 0) revert RaffleManager_InvalidScriptId();

        scripts[id] = uri;
    }

    /**
     * @notice Create a new raffle
     * @param id Identifier of the raffle
     * @param raffle Configuration details of the new raffle
     */
    function create(
        uint256 id,
        CreateRaffle calldata raffle
    )
        public
        override
        onlyRole(KMART_CONTRACT_ROLE)
    {
        if (
            bytes(scripts[raffle.scriptId]).length == 0 ||
            raffle.winners == 0
        ) revert RaffleManager_InvalidRaffle();

        raffles[id] = Raffle({
            scriptId: raffle.scriptId,
            winners: raffle.winners,
            endsAt: raffle.endsAt,
            seed: 0
        });
    }

    /**
     * @notice Add entries into a raffle
     * @dev Currently, no state change is needed but we should maintain function signature just in case
     * @param id Identifier of the raffle
     * @param amount Number of entries to add
     */
    function enter(
        uint256 id,
        uint32 amount
    )
        public
        view
        override
    {
        if (isDrawn(id) || raffles[id].endsAt < block.timestamp)
            revert RaffleManager_RaffleExpired();
    }

    /**
     * @notice Draw the results of a raffle
     * @param id Identifier of the raffle
     * @param vrf Flag indicating if the results should be drawn using Chainlink VRF
     */
    function draw(
        uint256 id,
        bool vrf
    )
        public
        override
        onlyRole(KMART_CONTRACT_ROLE)
    {
        if (isDrawn(id)) revert RaffleManager_RaffleAlreadyDrawn();

        if (vrf) {
            _requests[COORDINATOR.requestRandomWords(
                vrfRequestConfig.keyHash,
                vrfRequestConfig.subId,
                vrfRequestConfig.requestConfirmations,
                vrfRequestConfig.callbackGasLimit,
                1 // number of random words
            )] = id;
        } else {
            raffles[id].seed = uint256(keccak256(
                abi.encodePacked(blockhash(block.number - 1), block.difficulty, block.timestamp)
            ));
        }
    }

    /**
     * @inheritdoc VRFConsumerBaseV2
     */
    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        raffles[_requests[requestId]].seed = randomWords[0];
    }
}

File 2 of 10 : VRFCoordinatorV2Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;

  /*
   * @notice Check to see if there exists a request commitment consumers
   * for all consumers and keyhashes for a given sub.
   * @param subId - ID of the subscription
   * @return true if there exists at least one unfulfilled request for the subscription, false
   * otherwise.
   */
  function pendingRequestExists(uint64 subId) external view returns (bool);
}

File 3 of 10 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 5 of 10 : IRaffleManager.sol
// SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

interface IRaffleManager {
    struct CreateRaffle {
        uint64 scriptId;
        uint64 winners;
        uint64 endsAt;
    }

    struct Raffle {
        uint256 seed;
        uint64 scriptId;
        uint64 winners;
        uint64 endsAt;
    }

    function get(uint256 id) external view returns (Raffle memory);
    function isDrawn(uint256 id) external view returns (bool);
    function create(uint256 id, CreateRaffle calldata raffle) external;
    function enter(uint256 id, uint32 amount) external;
    function draw(uint256 id, bool vrf) external;
}

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

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"RaffleManager_InvalidRaffle","type":"error"},{"inputs":[],"name":"RaffleManager_InvalidScriptId","type":"error"},{"inputs":[],"name":"RaffleManager_RaffleAlreadyDrawn","type":"error"},{"inputs":[],"name":"RaffleManager_RaffleExpired","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"KMART_CONTRACT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint64","name":"scriptId","type":"uint64"},{"internalType":"uint64","name":"winners","type":"uint64"},{"internalType":"uint64","name":"endsAt","type":"uint64"}],"internalType":"struct IRaffleManager.CreateRaffle","name":"raffle","type":"tuple"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"vrf","type":"bool"}],"name":"draw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint32","name":"amount","type":"uint32"}],"name":"enter","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"get","outputs":[{"components":[{"internalType":"uint256","name":"seed","type":"uint256"},{"internalType":"uint64","name":"scriptId","type":"uint64"},{"internalType":"uint64","name":"winners","type":"uint64"},{"internalType":"uint64","name":"endsAt","type":"uint64"}],"internalType":"struct IRaffleManager.Raffle","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isDrawn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"raffles","outputs":[{"internalType":"uint256","name":"seed","type":"uint256"},{"internalType":"uint64","name":"scriptId","type":"uint64"},{"internalType":"uint64","name":"winners","type":"uint64"},{"internalType":"uint64","name":"endsAt","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"scripts","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"string","name":"uri","type":"string"}],"name":"setScript","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint64","name":"subId","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"requestConfirmations","type":"uint16"}],"internalType":"struct RaffleManager.VrfRequestConfig","name":"_vrfRequestConfig","type":"tuple"}],"name":"setVrfRequestConfig","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":"vrfRequestConfig","outputs":[{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint64","name":"subId","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"requestConfirmations","type":"uint16"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162002aac38038062002aac83398181016040528101906200003791906200028b565b818073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505050620000826000801b82620000be60201b60201c565b8173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050620002d2565b620000d08282620001af60201b60201c565b620001ab57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620001506200021960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002538262000226565b9050919050565b620002658162000246565b81146200027157600080fd5b50565b60008151905062000285816200025a565b92915050565b60008060408385031215620002a557620002a462000221565b5b6000620002b58582860162000274565b9250506020620002c88582860162000274565b9150509250929050565b60805160a0516127ad620002ff60003960006108ce01526000818161044e01526104a201526127ad6000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806391d14854116100ad578063b27c12eb11610071578063b27c12eb1461033f578063b72e9f361461035b578063c5a594981461037c578063d547741f14610398578063e4e5d516146103b457610121565b806391d14854146102755780639507d39a146102a557806395598408146102d5578063a217fddf146102f1578063a6a2c8051461030f57610121565b806336568abe116100f457806336568abe146101be5780635d4bc0ce146101da5780636b35f5ce1461020d5780637b5e0ae31461023d57806382069f681461025957610121565b806301ffc9a7146101265780631fe543e314610156578063248a9ca3146101725780632f2ff15d146101a2575b600080fd5b610140600480360381019061013b9190611414565b6103d2565b60405161014d919061145c565b60405180910390f35b610170600480360381019061016b9190611606565b61044c565b005b61018c60048036038101906101879190611698565b61050c565b60405161019991906116d4565b60405180910390f35b6101bc60048036038101906101b7919061174d565b61052b565b005b6101d860048036038101906101d3919061174d565b61054c565b005b6101f460048036038101906101ef919061178d565b6105cf565b60405161020494939291906117ec565b60405180910390f35b6102276004803603810190610222919061178d565b61063b565b604051610234919061145c565b60405180910390f35b61025760048036038101906102529190611855565b61065e565b005b610273600480360381019061026e91906118c1565b610857565b005b61028f600480360381019061028a919061174d565b610a26565b60405161029c919061145c565b60405180910390f35b6102bf60048036038101906102ba919061178d565b610a90565b6040516102cc9190611974565b60405180910390f35b6102ef60048036038101906102ea91906119cb565b610b5d565b005b6102f9610bdf565b60405161030691906116d4565b60405180910390f35b61032960048036038101906103249190611a37565b610be6565b6040516103369190611ae3565b60405180910390f35b61035960048036038101906103549190611b60565b610c86565b005b610363610d3d565b6040516103739493929190611bec565b60405180910390f35b61039660048036038101906103919190611c50565b610d8d565b005b6103b260048036038101906103ad919061174d565b610db0565b005b6103bc610dd1565b6040516103c991906116d4565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610445575061044482610df5565b5b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104fe57337f00000000000000000000000000000000000000000000000000000000000000006040517f1cf993f40000000000000000000000000000000000000000000000000000000081526004016104f5929190611c8c565b60405180910390fd5b6105088282610e5f565b5050565b6000806000838152602001908152602001600020600101549050919050565b6105348261050c565b61053d81610eac565b6105478383610ec0565b505050565b610554610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146105c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b890611d27565b60405180910390fd5b6105cb8282610fa8565b5050565b60036020528060005260406000206000915090508060000154908060010160009054906101000a900467ffffffffffffffff16908060010160089054906101000a900467ffffffffffffffff16908060010160109054906101000a900467ffffffffffffffff16905084565b600080600360008481526020019081526020016000206000015414159050919050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b61068881610eac565b6000600460008460000160208101906106a19190611a37565b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002080546106ce90611d76565b905014806106f8575060008260200160208101906106ec9190611a37565b67ffffffffffffffff16145b1561072f576040517f522f5cda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060800160405280600081526020018360000160208101906107549190611a37565b67ffffffffffffffff1681526020018360200160208101906107769190611a37565b67ffffffffffffffff1681526020018360400160208101906107989190611a37565b67ffffffffffffffff16815250600360008581526020019081526020016000206000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050505050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b61088181610eac565b61088a8361063b565b156108c1576040517fb9894bc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81156109cb5782600560007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635d3b1d306001600001546001800160009054906101000a900467ffffffffffffffff1660018001600c9054906101000a900461ffff166001800160089054906101000a900463ffffffff1660016040518663ffffffff1660e01b8152600401610971959493929190611dec565b6020604051808303816000875af1158015610990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b49190611e54565b815260200190815260200160002081905550610a21565b6001436109d89190611eb0565b4044426040516020016109ed93929190611f26565b6040516020818303038152906040528051906020012060001c60036000858152602001908152602001600020600001819055505b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610a98611362565b60036000838152602001908152602001600020604051806080016040529081600082015481526020016001820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050919050565b610b668261063b565b80610ba45750426003600084815260200190815260200160002060010160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16105b15610bdb576040517f7f0a83e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000801b81565b60046020528060005260406000206000915090508054610c0590611d76565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3190611d76565b8015610c7e5780601f10610c5357610100808354040283529160200191610c7e565b820191906000526020600020905b815481529060010190602001808311610c6157829003601f168201915b505050505081565b6000801b610c9381610eac565b6000600460008667ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000208054610cc790611d76565b905014610d00576040517f8441ef2800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8282600460008767ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000209182610d36929190612110565b5050505050565b60018060000154908060010160009054906101000a900467ffffffffffffffff16908060010160089054906101000a900463ffffffff169080600101600c9054906101000a900461ffff16905084565b6000801b610d9a81610eac565b8160018181610da99190612509565b9050505050565b610db98261050c565b610dc281610eac565b610dcc8383610fa8565b505050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b81565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b80600081518110610e7357610e72612517565b5b60200260200101516003600060056000868152602001908152602001600020548152602001908152602001600020600001819055505050565b610ebd81610eb8610fa0565b611089565b50565b610eca8282610a26565b610f9c57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f41610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b610fb28282610a26565b1561108557600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061102a610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6110938282610a26565b611122576110b88173ffffffffffffffffffffffffffffffffffffffff166014611126565b6110c68360001c6020611126565b6040516020016110d792919061261a565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111199190611ae3565b60405180910390fd5b5050565b6060600060028360026111399190612654565b61114391906126ae565b67ffffffffffffffff81111561115c5761115b6114c3565b5b6040519080825280601f01601f19166020018201604052801561118e5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106111c6576111c5612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061122a57611229612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261126a9190612654565b61127491906126ae565b90505b6001811115611314577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106112b6576112b5612517565b5b1a60f81b8282815181106112cd576112cc612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061130d906126e2565b9050611277565b5060008414611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134f90612757565b60405180910390fd5b8091505092915050565b604051806080016040528060008152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113f1816113bc565b81146113fc57600080fd5b50565b60008135905061140e816113e8565b92915050565b60006020828403121561142a576114296113b2565b5b6000611438848285016113ff565b91505092915050565b60008115159050919050565b61145681611441565b82525050565b6000602082019050611471600083018461144d565b92915050565b6000819050919050565b61148a81611477565b811461149557600080fd5b50565b6000813590506114a781611481565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6114fb826114b2565b810181811067ffffffffffffffff8211171561151a576115196114c3565b5b80604052505050565b600061152d6113a8565b905061153982826114f2565b919050565b600067ffffffffffffffff821115611559576115586114c3565b5b602082029050602081019050919050565b600080fd5b600061158261157d8461153e565b611523565b905080838252602082019050602084028301858111156115a5576115a461156a565b5b835b818110156115ce57806115ba8882611498565b8452602084019350506020810190506115a7565b5050509392505050565b600082601f8301126115ed576115ec6114ad565b5b81356115fd84826020860161156f565b91505092915050565b6000806040838503121561161d5761161c6113b2565b5b600061162b85828601611498565b925050602083013567ffffffffffffffff81111561164c5761164b6113b7565b5b611658858286016115d8565b9150509250929050565b6000819050919050565b61167581611662565b811461168057600080fd5b50565b6000813590506116928161166c565b92915050565b6000602082840312156116ae576116ad6113b2565b5b60006116bc84828501611683565b91505092915050565b6116ce81611662565b82525050565b60006020820190506116e960008301846116c5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061171a826116ef565b9050919050565b61172a8161170f565b811461173557600080fd5b50565b60008135905061174781611721565b92915050565b60008060408385031215611764576117636113b2565b5b600061177285828601611683565b925050602061178385828601611738565b9150509250929050565b6000602082840312156117a3576117a26113b2565b5b60006117b184828501611498565b91505092915050565b6117c381611477565b82525050565b600067ffffffffffffffff82169050919050565b6117e6816117c9565b82525050565b600060808201905061180160008301876117ba565b61180e60208301866117dd565b61181b60408301856117dd565b61182860608301846117dd565b95945050505050565b600080fd5b60006060828403121561184c5761184b611831565b5b81905092915050565b6000806080838503121561186c5761186b6113b2565b5b600061187a85828601611498565b925050602061188b85828601611836565b9150509250929050565b61189e81611441565b81146118a957600080fd5b50565b6000813590506118bb81611895565b92915050565b600080604083850312156118d8576118d76113b2565b5b60006118e685828601611498565b92505060206118f7858286016118ac565b9150509250929050565b61190a81611477565b82525050565b611919816117c9565b82525050565b6080820160008201516119356000850182611901565b5060208201516119486020850182611910565b50604082015161195b6040850182611910565b50606082015161196e6060850182611910565b50505050565b6000608082019050611989600083018461191f565b92915050565b600063ffffffff82169050919050565b6119a88161198f565b81146119b357600080fd5b50565b6000813590506119c58161199f565b92915050565b600080604083850312156119e2576119e16113b2565b5b60006119f085828601611498565b9250506020611a01858286016119b6565b9150509250929050565b611a14816117c9565b8114611a1f57600080fd5b50565b600081359050611a3181611a0b565b92915050565b600060208284031215611a4d57611a4c6113b2565b5b6000611a5b84828501611a22565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611a9e578082015181840152602081019050611a83565b60008484015250505050565b6000611ab582611a64565b611abf8185611a6f565b9350611acf818560208601611a80565b611ad8816114b2565b840191505092915050565b60006020820190508181036000830152611afd8184611aaa565b905092915050565b600080fd5b60008083601f840112611b2057611b1f6114ad565b5b8235905067ffffffffffffffff811115611b3d57611b3c611b05565b5b602083019150836001820283011115611b5957611b5861156a565b5b9250929050565b600080600060408486031215611b7957611b786113b2565b5b6000611b8786828701611a22565b935050602084013567ffffffffffffffff811115611ba857611ba76113b7565b5b611bb486828701611b0a565b92509250509250925092565b611bc98161198f565b82525050565b600061ffff82169050919050565b611be681611bcf565b82525050565b6000608082019050611c0160008301876116c5565b611c0e60208301866117dd565b611c1b6040830185611bc0565b611c286060830184611bdd565b95945050505050565b600060808284031215611c4757611c46611831565b5b81905092915050565b600060808284031215611c6657611c656113b2565b5b6000611c7484828501611c31565b91505092915050565b611c868161170f565b82525050565b6000604082019050611ca16000830185611c7d565b611cae6020830184611c7d565b9392505050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611d11602f83611a6f565b9150611d1c82611cb5565b604082019050919050565b60006020820190508181036000830152611d4081611d04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611d8e57607f821691505b602082108103611da157611da0611d47565b5b50919050565b6000819050919050565b6000819050919050565b6000611dd6611dd1611dcc84611da7565b611db1565b61198f565b9050919050565b611de681611dbb565b82525050565b600060a082019050611e0160008301886116c5565b611e0e60208301876117dd565b611e1b6040830186611bdd565b611e286060830185611bc0565b611e356080830184611ddd565b9695505050505050565b600081519050611e4e81611481565b92915050565b600060208284031215611e6a57611e696113b2565b5b6000611e7884828501611e3f565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ebb82611477565b9150611ec683611477565b9250828203905081811115611ede57611edd611e81565b5b92915050565b6000819050919050565b611eff611efa82611662565b611ee4565b82525050565b6000819050919050565b611f20611f1b82611477565b611f05565b82525050565b6000611f328286611eee565b602082019150611f428285611f0f565b602082019150611f528284611f0f565b602082019150819050949350505050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302611fd07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611f93565b611fda8683611f93565b95508019841693508086168417925050509392505050565b600061200d61200861200384611477565b611db1565b611477565b9050919050565b6000819050919050565b61202783611ff2565b61203b61203382612014565b848454611fa0565b825550505050565b600090565b612050612043565b61205b81848461201e565b505050565b5b8181101561207f57612074600082612048565b600181019050612061565b5050565b601f8211156120c45761209581611f6e565b61209e84611f83565b810160208510156120ad578190505b6120c16120b985611f83565b830182612060565b50505b505050565b600082821c905092915050565b60006120e7600019846008026120c9565b1980831691505092915050565b600061210083836120d6565b9150826002028217905092915050565b61211a8383611f63565b67ffffffffffffffff811115612133576121326114c3565b5b61213d8254611d76565b612148828285612083565b6000601f8311600181146121775760008415612165578287013590505b61216f85826120f4565b8655506121d7565b601f19841661218586611f6e565b60005b828110156121ad57848901358255600182019150602085019450602081019050612188565b868310156121ca57848901356121c6601f8916826120d6565b8355505b6001600288020188555050505b50505050505050565b600081356121ed8161166c565b80915050919050565b60008160001b9050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61222f846121f6565b9350801983169250808416831791505092915050565b600061225082611662565b9050919050565b60008160001c9050919050565b600061226f82612257565b9050919050565b61227f82612245565b61229261228b82612264565b8354612203565b8255505050565b600081356122a681611a0b565b80915050919050565b600067ffffffffffffffff6122c3846121f6565b9350801983169250808416831791505092915050565b60006122f46122ef6122ea846117c9565b611db1565b6117c9565b9050919050565b6000819050919050565b61230e826122d9565b61232161231a826122fb565b83546122af565b8255505050565b600081356123358161199f565b80915050919050565b60008160401b9050919050565b60006bffffffff00000000000000006123638461233e565b9350801983169250808416831791505092915050565b600061239461238f61238a8461198f565b611db1565b61198f565b9050919050565b6000819050919050565b6123ae82612379565b6123c16123ba8261239b565b835461234b565b8255505050565b6123d181611bcf565b81146123dc57600080fd5b50565b600081356123ec816123c8565b80915050919050565b60008160601b9050919050565b60006dffff00000000000000000000000061241c846123f5565b9350801983169250808416831791505092915050565b600061244d61244861244384611bcf565b611db1565b611bcf565b9050919050565b6000819050919050565b61246782612432565b61247a61247382612454565b8354612402565b8255505050565b600081016000830180612493816121e0565b905061249f8184612276565b5050506001810160208301806124b481612299565b90506124c08184612305565b5050506001810160408301806124d581612328565b90506124e181846123a5565b5050506001810160608301806124f6816123df565b9050612502818461245e565b5050505050565b6125138282612481565b5050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612587601783612546565b915061259282612551565b601782019050919050565b60006125a882611a64565b6125b28185612546565b93506125c2818560208601611a80565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612604601183612546565b915061260f826125ce565b601182019050919050565b60006126258261257a565b9150612631828561259d565b915061263c826125f7565b9150612648828461259d565b91508190509392505050565b600061265f82611477565b915061266a83611477565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126a3576126a2611e81565b5b828202905092915050565b60006126b982611477565b91506126c483611477565b92508282019050808211156126dc576126db611e81565b5b92915050565b60006126ed82611477565b915060008203612700576126ff611e81565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612741602083611a6f565b915061274c8261270b565b602082019050919050565b6000602082019050818103600083015261277081612734565b905091905056fea26469706673582212206afeef6138cd0b4991d64c1fba72279519653a367a208cfa4d008d654d42687b64736f6c63430008100033000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000084fd17c6a5697bd651b6482fa916c0b3a0e6161

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c806391d14854116100ad578063b27c12eb11610071578063b27c12eb1461033f578063b72e9f361461035b578063c5a594981461037c578063d547741f14610398578063e4e5d516146103b457610121565b806391d14854146102755780639507d39a146102a557806395598408146102d5578063a217fddf146102f1578063a6a2c8051461030f57610121565b806336568abe116100f457806336568abe146101be5780635d4bc0ce146101da5780636b35f5ce1461020d5780637b5e0ae31461023d57806382069f681461025957610121565b806301ffc9a7146101265780631fe543e314610156578063248a9ca3146101725780632f2ff15d146101a2575b600080fd5b610140600480360381019061013b9190611414565b6103d2565b60405161014d919061145c565b60405180910390f35b610170600480360381019061016b9190611606565b61044c565b005b61018c60048036038101906101879190611698565b61050c565b60405161019991906116d4565b60405180910390f35b6101bc60048036038101906101b7919061174d565b61052b565b005b6101d860048036038101906101d3919061174d565b61054c565b005b6101f460048036038101906101ef919061178d565b6105cf565b60405161020494939291906117ec565b60405180910390f35b6102276004803603810190610222919061178d565b61063b565b604051610234919061145c565b60405180910390f35b61025760048036038101906102529190611855565b61065e565b005b610273600480360381019061026e91906118c1565b610857565b005b61028f600480360381019061028a919061174d565b610a26565b60405161029c919061145c565b60405180910390f35b6102bf60048036038101906102ba919061178d565b610a90565b6040516102cc9190611974565b60405180910390f35b6102ef60048036038101906102ea91906119cb565b610b5d565b005b6102f9610bdf565b60405161030691906116d4565b60405180910390f35b61032960048036038101906103249190611a37565b610be6565b6040516103369190611ae3565b60405180910390f35b61035960048036038101906103549190611b60565b610c86565b005b610363610d3d565b6040516103739493929190611bec565b60405180910390f35b61039660048036038101906103919190611c50565b610d8d565b005b6103b260048036038101906103ad919061174d565b610db0565b005b6103bc610dd1565b6040516103c991906116d4565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610445575061044482610df5565b5b9050919050565b7f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104fe57337f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699096040517f1cf993f40000000000000000000000000000000000000000000000000000000081526004016104f5929190611c8c565b60405180910390fd5b6105088282610e5f565b5050565b6000806000838152602001908152602001600020600101549050919050565b6105348261050c565b61053d81610eac565b6105478383610ec0565b505050565b610554610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146105c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b890611d27565b60405180910390fd5b6105cb8282610fa8565b5050565b60036020528060005260406000206000915090508060000154908060010160009054906101000a900467ffffffffffffffff16908060010160089054906101000a900467ffffffffffffffff16908060010160109054906101000a900467ffffffffffffffff16905084565b600080600360008481526020019081526020016000206000015414159050919050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b61068881610eac565b6000600460008460000160208101906106a19190611a37565b67ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002080546106ce90611d76565b905014806106f8575060008260200160208101906106ec9190611a37565b67ffffffffffffffff16145b1561072f576040517f522f5cda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060800160405280600081526020018360000160208101906107549190611a37565b67ffffffffffffffff1681526020018360200160208101906107769190611a37565b67ffffffffffffffff1681526020018360400160208101906107989190611a37565b67ffffffffffffffff16815250600360008581526020019081526020016000206000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050505050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b61088181610eac565b61088a8361063b565b156108c1576040517fb9894bc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81156109cb5782600560007f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990973ffffffffffffffffffffffffffffffffffffffff16635d3b1d306001600001546001800160009054906101000a900467ffffffffffffffff1660018001600c9054906101000a900461ffff166001800160089054906101000a900463ffffffff1660016040518663ffffffff1660e01b8152600401610971959493929190611dec565b6020604051808303816000875af1158015610990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b49190611e54565b815260200190815260200160002081905550610a21565b6001436109d89190611eb0565b4044426040516020016109ed93929190611f26565b6040516020818303038152906040528051906020012060001c60036000858152602001908152602001600020600001819055505b505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610a98611362565b60036000838152602001908152602001600020604051806080016040529081600082015481526020016001820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050919050565b610b668261063b565b80610ba45750426003600084815260200190815260200160002060010160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16105b15610bdb576040517f7f0a83e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000801b81565b60046020528060005260406000206000915090508054610c0590611d76565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3190611d76565b8015610c7e5780601f10610c5357610100808354040283529160200191610c7e565b820191906000526020600020905b815481529060010190602001808311610c6157829003601f168201915b505050505081565b6000801b610c9381610eac565b6000600460008667ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000208054610cc790611d76565b905014610d00576040517f8441ef2800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8282600460008767ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000209182610d36929190612110565b5050505050565b60018060000154908060010160009054906101000a900467ffffffffffffffff16908060010160089054906101000a900463ffffffff169080600101600c9054906101000a900461ffff16905084565b6000801b610d9a81610eac565b8160018181610da99190612509565b9050505050565b610db98261050c565b610dc281610eac565b610dcc8383610fa8565b505050565b7f4b35b4c4f5ed4bc9ee0be7ce120f2201543aa776f93a3939a69ccca20bf7569b81565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b80600081518110610e7357610e72612517565b5b60200260200101516003600060056000868152602001908152602001600020548152602001908152602001600020600001819055505050565b610ebd81610eb8610fa0565b611089565b50565b610eca8282610a26565b610f9c57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f41610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b610fb28282610a26565b1561108557600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061102a610fa0565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6110938282610a26565b611122576110b88173ffffffffffffffffffffffffffffffffffffffff166014611126565b6110c68360001c6020611126565b6040516020016110d792919061261a565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111199190611ae3565b60405180910390fd5b5050565b6060600060028360026111399190612654565b61114391906126ae565b67ffffffffffffffff81111561115c5761115b6114c3565b5b6040519080825280601f01601f19166020018201604052801561118e5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106111c6576111c5612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061122a57611229612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261126a9190612654565b61127491906126ae565b90505b6001811115611314577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106112b6576112b5612517565b5b1a60f81b8282815181106112cd576112cc612517565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061130d906126e2565b9050611277565b5060008414611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134f90612757565b60405180910390fd5b8091505092915050565b604051806080016040528060008152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113f1816113bc565b81146113fc57600080fd5b50565b60008135905061140e816113e8565b92915050565b60006020828403121561142a576114296113b2565b5b6000611438848285016113ff565b91505092915050565b60008115159050919050565b61145681611441565b82525050565b6000602082019050611471600083018461144d565b92915050565b6000819050919050565b61148a81611477565b811461149557600080fd5b50565b6000813590506114a781611481565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6114fb826114b2565b810181811067ffffffffffffffff8211171561151a576115196114c3565b5b80604052505050565b600061152d6113a8565b905061153982826114f2565b919050565b600067ffffffffffffffff821115611559576115586114c3565b5b602082029050602081019050919050565b600080fd5b600061158261157d8461153e565b611523565b905080838252602082019050602084028301858111156115a5576115a461156a565b5b835b818110156115ce57806115ba8882611498565b8452602084019350506020810190506115a7565b5050509392505050565b600082601f8301126115ed576115ec6114ad565b5b81356115fd84826020860161156f565b91505092915050565b6000806040838503121561161d5761161c6113b2565b5b600061162b85828601611498565b925050602083013567ffffffffffffffff81111561164c5761164b6113b7565b5b611658858286016115d8565b9150509250929050565b6000819050919050565b61167581611662565b811461168057600080fd5b50565b6000813590506116928161166c565b92915050565b6000602082840312156116ae576116ad6113b2565b5b60006116bc84828501611683565b91505092915050565b6116ce81611662565b82525050565b60006020820190506116e960008301846116c5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061171a826116ef565b9050919050565b61172a8161170f565b811461173557600080fd5b50565b60008135905061174781611721565b92915050565b60008060408385031215611764576117636113b2565b5b600061177285828601611683565b925050602061178385828601611738565b9150509250929050565b6000602082840312156117a3576117a26113b2565b5b60006117b184828501611498565b91505092915050565b6117c381611477565b82525050565b600067ffffffffffffffff82169050919050565b6117e6816117c9565b82525050565b600060808201905061180160008301876117ba565b61180e60208301866117dd565b61181b60408301856117dd565b61182860608301846117dd565b95945050505050565b600080fd5b60006060828403121561184c5761184b611831565b5b81905092915050565b6000806080838503121561186c5761186b6113b2565b5b600061187a85828601611498565b925050602061188b85828601611836565b9150509250929050565b61189e81611441565b81146118a957600080fd5b50565b6000813590506118bb81611895565b92915050565b600080604083850312156118d8576118d76113b2565b5b60006118e685828601611498565b92505060206118f7858286016118ac565b9150509250929050565b61190a81611477565b82525050565b611919816117c9565b82525050565b6080820160008201516119356000850182611901565b5060208201516119486020850182611910565b50604082015161195b6040850182611910565b50606082015161196e6060850182611910565b50505050565b6000608082019050611989600083018461191f565b92915050565b600063ffffffff82169050919050565b6119a88161198f565b81146119b357600080fd5b50565b6000813590506119c58161199f565b92915050565b600080604083850312156119e2576119e16113b2565b5b60006119f085828601611498565b9250506020611a01858286016119b6565b9150509250929050565b611a14816117c9565b8114611a1f57600080fd5b50565b600081359050611a3181611a0b565b92915050565b600060208284031215611a4d57611a4c6113b2565b5b6000611a5b84828501611a22565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611a9e578082015181840152602081019050611a83565b60008484015250505050565b6000611ab582611a64565b611abf8185611a6f565b9350611acf818560208601611a80565b611ad8816114b2565b840191505092915050565b60006020820190508181036000830152611afd8184611aaa565b905092915050565b600080fd5b60008083601f840112611b2057611b1f6114ad565b5b8235905067ffffffffffffffff811115611b3d57611b3c611b05565b5b602083019150836001820283011115611b5957611b5861156a565b5b9250929050565b600080600060408486031215611b7957611b786113b2565b5b6000611b8786828701611a22565b935050602084013567ffffffffffffffff811115611ba857611ba76113b7565b5b611bb486828701611b0a565b92509250509250925092565b611bc98161198f565b82525050565b600061ffff82169050919050565b611be681611bcf565b82525050565b6000608082019050611c0160008301876116c5565b611c0e60208301866117dd565b611c1b6040830185611bc0565b611c286060830184611bdd565b95945050505050565b600060808284031215611c4757611c46611831565b5b81905092915050565b600060808284031215611c6657611c656113b2565b5b6000611c7484828501611c31565b91505092915050565b611c868161170f565b82525050565b6000604082019050611ca16000830185611c7d565b611cae6020830184611c7d565b9392505050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000611d11602f83611a6f565b9150611d1c82611cb5565b604082019050919050565b60006020820190508181036000830152611d4081611d04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611d8e57607f821691505b602082108103611da157611da0611d47565b5b50919050565b6000819050919050565b6000819050919050565b6000611dd6611dd1611dcc84611da7565b611db1565b61198f565b9050919050565b611de681611dbb565b82525050565b600060a082019050611e0160008301886116c5565b611e0e60208301876117dd565b611e1b6040830186611bdd565b611e286060830185611bc0565b611e356080830184611ddd565b9695505050505050565b600081519050611e4e81611481565b92915050565b600060208284031215611e6a57611e696113b2565b5b6000611e7884828501611e3f565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ebb82611477565b9150611ec683611477565b9250828203905081811115611ede57611edd611e81565b5b92915050565b6000819050919050565b611eff611efa82611662565b611ee4565b82525050565b6000819050919050565b611f20611f1b82611477565b611f05565b82525050565b6000611f328286611eee565b602082019150611f428285611f0f565b602082019150611f528284611f0f565b602082019150819050949350505050565b600082905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302611fd07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82611f93565b611fda8683611f93565b95508019841693508086168417925050509392505050565b600061200d61200861200384611477565b611db1565b611477565b9050919050565b6000819050919050565b61202783611ff2565b61203b61203382612014565b848454611fa0565b825550505050565b600090565b612050612043565b61205b81848461201e565b505050565b5b8181101561207f57612074600082612048565b600181019050612061565b5050565b601f8211156120c45761209581611f6e565b61209e84611f83565b810160208510156120ad578190505b6120c16120b985611f83565b830182612060565b50505b505050565b600082821c905092915050565b60006120e7600019846008026120c9565b1980831691505092915050565b600061210083836120d6565b9150826002028217905092915050565b61211a8383611f63565b67ffffffffffffffff811115612133576121326114c3565b5b61213d8254611d76565b612148828285612083565b6000601f8311600181146121775760008415612165578287013590505b61216f85826120f4565b8655506121d7565b601f19841661218586611f6e565b60005b828110156121ad57848901358255600182019150602085019450602081019050612188565b868310156121ca57848901356121c6601f8916826120d6565b8355505b6001600288020188555050505b50505050505050565b600081356121ed8161166c565b80915050919050565b60008160001b9050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61222f846121f6565b9350801983169250808416831791505092915050565b600061225082611662565b9050919050565b60008160001c9050919050565b600061226f82612257565b9050919050565b61227f82612245565b61229261228b82612264565b8354612203565b8255505050565b600081356122a681611a0b565b80915050919050565b600067ffffffffffffffff6122c3846121f6565b9350801983169250808416831791505092915050565b60006122f46122ef6122ea846117c9565b611db1565b6117c9565b9050919050565b6000819050919050565b61230e826122d9565b61232161231a826122fb565b83546122af565b8255505050565b600081356123358161199f565b80915050919050565b60008160401b9050919050565b60006bffffffff00000000000000006123638461233e565b9350801983169250808416831791505092915050565b600061239461238f61238a8461198f565b611db1565b61198f565b9050919050565b6000819050919050565b6123ae82612379565b6123c16123ba8261239b565b835461234b565b8255505050565b6123d181611bcf565b81146123dc57600080fd5b50565b600081356123ec816123c8565b80915050919050565b60008160601b9050919050565b60006dffff00000000000000000000000061241c846123f5565b9350801983169250808416831791505092915050565b600061244d61244861244384611bcf565b611db1565b611bcf565b9050919050565b6000819050919050565b61246782612432565b61247a61247382612454565b8354612402565b8255505050565b600081016000830180612493816121e0565b905061249f8184612276565b5050506001810160208301806124b481612299565b90506124c08184612305565b5050506001810160408301806124d581612328565b90506124e181846123a5565b5050506001810160608301806124f6816123df565b9050612502818461245e565b5050505050565b6125138282612481565b5050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612587601783612546565b915061259282612551565b601782019050919050565b60006125a882611a64565b6125b28185612546565b93506125c2818560208601611a80565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612604601183612546565b915061260f826125ce565b601182019050919050565b60006126258261257a565b9150612631828561259d565b915061263c826125f7565b9150612648828461259d565b91508190509392505050565b600061265f82611477565b915061266a83611477565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126a3576126a2611e81565b5b828202905092915050565b60006126b982611477565b91506126c483611477565b92508282019050808211156126dc576126db611e81565b5b92915050565b60006126ed82611477565b915060008203612700576126ff611e81565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612741602083611a6f565b915061274c8261270b565b602082019050919050565b6000602082019050818103600083015261277081612734565b905091905056fea26469706673582212206afeef6138cd0b4991d64c1fba72279519653a367a208cfa4d008d654d42687b64736f6c63430008100033

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

000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000084fd17c6a5697bd651b6482fa916c0b3a0e6161

-----Decoded View---------------
Arg [0] : vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [1] : admin (address): 0x084FD17c6A5697bd651b6482fa916C0b3a0e6161

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [1] : 000000000000000000000000084fd17c6a5697bd651b6482fa916c0b3a0e6161


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
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.