Contract 0x517D8293a7f2Bfb8803b081D7750fE3fC51623B3 7

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x79bd2b19c5af3968457bc8e5f1a2829d8178a856ac95f12ac57c5956bd54768aSet Referral Per...1335885752023-09-22 17:24:0773 days 9 hrs agoThe Game DAO: Deployer IN  0x517d8293a7f2bfb8803b081d7750fe3fc51623b30 ETH0.00002812 0.1
0xc366f88b8c5561b82c7e4a6f5455ff1f64a72a294588b745076f7f9118aae9ceStart Game1335831502023-09-22 17:00:3673 days 9 hrs agoThe Game DAO: Deployer IN  0x517d8293a7f2bfb8803b081d7750fe3fc51623b30 ETH0.00002465 0.1
0x63d6f05e5f976b97d119eb1e6526958342bc280ad7d978b31984aa357da18c6a0x60c060401335088392023-09-22 11:43:4173 days 14 hrs agoThe Game DAO: Deployer IN  Create: TheBullionGameWeeklyAzulArb0 ETH0.0012686 0.1
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TheBullionGameWeeklyAzulArb

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 22 : AutomationBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract AutomationBase {
  error OnlySimulatedBackend();

  /**
   * @notice method that allows it to be simulated via eth_call by checking that
   * the sender is the zero address.
   */
  function preventExecution() internal view {
    if (tx.origin != address(0)) {
      revert OnlySimulatedBackend();
    }
  }

  /**
   * @notice modifier that allows it to be simulated via eth_call by checking
   * that the sender is the zero address.
   */
  modifier cannotExecute() {
    preventExecution();
    _;
  }
}

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

import "./AutomationBase.sol";
import "./interfaces/AutomationCompatibleInterface.sol";

abstract contract AutomationCompatible is AutomationBase, AutomationCompatibleInterface {}

File 3 of 22 : 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 22 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 5 of 22 : AutomationCompatibleInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AutomationCompatibleInterface {
  /**
   * @notice method that is simulated by the keepers to see if any work actually
   * needs to be performed. This method does does not actually need to be
   * executable, and since it is only ever simulated it can consume lots of gas.
   * @dev To ensure that it is never called, you may want to add the
   * cannotExecute modifier from KeeperBase to your implementation of this
   * method.
   * @param checkData specified in the upkeep registration so it is always the
   * same for a registered upkeep. This can easily be broken down into specific
   * arguments using `abi.decode`, so multiple upkeeps can be registered on the
   * same contract and easily differentiated by the contract.
   * @return upkeepNeeded boolean to indicate whether the keeper should call
   * performUpkeep or not.
   * @return performData bytes that the keeper should call performUpkeep with, if
   * upkeep is needed. If you would like to encode data to decode later, try
   * `abi.encode`.
   */
  function checkUpkeep(bytes calldata checkData) external returns (bool upkeepNeeded, bytes memory performData);

  /**
   * @notice method that is actually executed by the keepers, via the registry.
   * The data returned by the checkUpkeep simulation will be passed into
   * this method to actually be executed.
   * @dev The input to this method should not be trusted, and the caller of the
   * method should not even be restricted to any single registry. Anyone should
   * be able call it, and the input should be validated, there is no guarantee
   * that the data passed in is the performData returned from checkUpkeep. This
   * could happen due to malicious keepers, racing keepers, or simply a state
   * change while the performUpkeep transaction is waiting for confirmation.
   * Always validate the data passed in.
   * @param performData is the data which was passed back from the checkData
   * simulation. If it is encoded, it can easily be decoded into other types by
   * calling `abi.decode`. This data should not be trusted, and should be
   * validated against the contract's current state.
   */
  function performUpkeep(bytes calldata performData) external;
}

File 6 of 22 : 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 7 of 22 : AccessControl.sol
// 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());
        }
    }
}

File 8 of 22 : 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 9 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 10 of 22 : ReentrancyGuard.sol
// 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;
    }
}

File 11 of 22 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 12 of 22 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 13 of 22 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 14 of 22 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 15 of 22 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 16 of 22 : 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 17 of 22 : Strings.sol
// 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);
    }
}

File 18 of 22 : 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 19 of 22 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 20 of 22 : Math.sol
// 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);
        }
    }
}

File 21 of 22 : DepositDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

contract DepositDistributor is ERC1155Holder, Ownable, ReentrancyGuard {
    // ERC1155 token and deposit-related state variables
    IERC1155 public erc1155Token; // ERC1155 token interface

    uint256 private daoTokenId; // DAO token ID

    // Staking-related state variables
    mapping(address => uint256) public stakedAt; // Timestamp when a user staked their tokens
    mapping(address => uint256) public stakedTokens; // Mapping of staked tokens per user
    address[] public stakedUsers; // Array of staked user addresses
    mapping(address => uint256) public stakedBalances; // Mapping of staked token balances per user
    mapping(address => uint256) public stakedUserIndexes; // Mapping of user indexes in the stakedUsers array
    uint256 public constant MINIMUM_STAKING_DURATION = 21 days; // Minimum staking duration

    // Deposit-related state variables
    mapping(uint256 => uint256) public depositTimestamps; // Mapping of deposit timestamps
    mapping(address => uint256) public balances; // Mapping of user balances
    mapping(address => mapping(uint256 => bool)) private claimed; // Mapping of claimed deposits per user
    mapping(address => bool) public allowList; // Mapping of allowed addresses for depositing
    uint256 private totalDeposits; // Total deposits for rewards distribution
    uint256 private totalDeposited; // Total deposited funds in the contract

    uint256 private daoTokenTotalSupply; // Total supply of the DAO token

    // Beneficiary state variable
    address public beneficiary; // Address of the beneficiary for unclaimed rewards

    // Events declaration
    event Deposited(
        address indexed depositor,
        uint256 amount,
        uint256 totalDeposited
    );
    event Distributed(uint256 totalDistributed);
    event Claimed(address indexed claimer, uint256 amount);
    event Staked(address indexed staker, uint256 amount);
    event Unstaked(address indexed unstaker, uint256 amount);

    constructor(
        address _erc1155Token,
        uint256 _daoTokenId,
        address _beneficiary,
        uint256 _initialTotalSupply
    ) Ownable() {
        erc1155Token = IERC1155(_erc1155Token);
        daoTokenId = _daoTokenId;
        beneficiary = _beneficiary;
        daoTokenTotalSupply = _initialTotalSupply;
    }

    // Function to deposit funds restricted to addresses on the allow list
    function deposit(
        uint256 amount
    ) external payable onlyAllowList {
        require(msg.value == amount, "Incorrect deposit amount");

        totalDeposited += amount;
        distribute();

        depositTimestamps[totalDeposits] = block.timestamp;

        totalDeposits += 1;

        emit Deposited(msg.sender, amount, totalDeposited);
    }

    // Function to stake tokens
    function distribute() private  {

        if (stakedUsers.length == 0) {
        return;
    }


        uint256 totalDistributed = 0;

        for (uint256 i = 0; i < stakedUsers.length; i++) {
            address member = stakedUsers[i];
            uint256 balance = stakedBalances[member];

            uint256 share = (balance * totalDeposited) / (daoTokenTotalSupply);
            balances[member] += share;
            totalDistributed += share;
        }

        uint256 unclaimedRewards = totalDeposited - totalDistributed;
        (bool success, ) = payable(beneficiary).call{value: unclaimedRewards}(
            ""
        );
        require(success, "Transfer failed.");
        totalDeposited = 0;

        emit Distributed(totalDistributed);
    }

    // Function to claim rewards restricted to DAO members
    function claim() external nonReentrant {
        require(balances[msg.sender] > 0, "No balance to claim");
        require(
            !claimed[msg.sender][totalDeposits],
            "Already claimed for this deposit"
        );
        require(isStaked(msg.sender), "Not staked");
        claimed[msg.sender][totalDeposits] = true;

        uint256 balance = balances[msg.sender];
        balances[msg.sender] = 0;
        (bool success, ) = payable(msg.sender).call{value: balance}("");
        require(success, "Transfer failed.");

        emit Claimed(msg.sender, balance);
    }

    // Function to stake tokens
    function stake() external nonReentrant {
        uint256 userBalance = erc1155Token.balanceOf(msg.sender, daoTokenId);
        require(userBalance > 0, "Sender is not a member");
        require(stakedAt[msg.sender] == 0, "Already staked");

        erc1155Token.safeTransferFrom(
            msg.sender,
            address(this),
            daoTokenId,
            userBalance,
            ""
        );

        stakedAt[msg.sender] = block.timestamp;
        stakedTokens[msg.sender] = userBalance;
        stakedBalances[msg.sender] = userBalance;
        stakedUsers.push(msg.sender);
        stakedUserIndexes[msg.sender] = stakedUsers.length - 1;

        emit Staked(msg.sender, userBalance);
    }

    // Function to unstake tokens
    function unstake() external nonReentrant {
        require(stakedAt[msg.sender] > 0, "Not staked");
        uint256 stakedTime = block.timestamp - stakedAt[msg.sender];
        require(
            stakedTime >= MINIMUM_STAKING_DURATION,
            "Minimum staking duration not reached"
        );

        uint256 userStakedTokens = stakedTokens[msg.sender];
        erc1155Token.safeTransferFrom(
            address(this),
            msg.sender,
            daoTokenId,
            userStakedTokens,
            ""
        );

        stakedAt[msg.sender] = 0;
        stakedTokens[msg.sender] = 0;
        stakedBalances[msg.sender] = 0;

        uint256 userIndex = stakedUserIndexes[msg.sender];
        uint256 lastIndex = stakedUsers.length - 1;
        stakedUsers[userIndex] = stakedUsers[lastIndex];
        stakedUserIndexes[stakedUsers[userIndex]] = userIndex;
        stakedUsers.pop();

        emit Unstaked(msg.sender, userStakedTokens);
    }

    // Function to check whether a member is staked
    function isStaked(address member) public view returns (bool) {
        return stakedAt[member] > 0;
    }

    // Function to add an address to the allow list, restricted to the contract owner
    function addToAllowList(address _user) external onlyOwner {
        allowList[_user] = true;
    }

    // Function to remove an address from the allow list, restricted to the contract owner
    function removeFromAllowList(address _user) external onlyOwner {
        allowList[_user] = false;
    }

    // Modifier to restrict access to addresses on the allow list
    modifier onlyAllowList() {
        require(allowList[msg.sender], "Sender not on allow list");
        _;
    }

    fallback() external payable {
        revert("Direct transfers not allowed");
    }

    receive() external payable {
        revert("Direct transfers not allowed");
    }

    // Function to get the total number of deposits made to the contract
    function getTotalDeposits() external view returns (uint256) {
        return totalDeposits;
    }

    // Function to get the total amount of funds deposited to the contract
    function getTotalDeposited() external view returns (uint256) {
        return totalDeposited;
    }

    // Function to get the total supply of the DAO token
    function getDaoTokenTotalSupply() external view returns (uint256) {
        return daoTokenTotalSupply;
    }

    // Function to get the ID of the DAO token
    function getDaoTokenId() external view returns (uint256) {
        return daoTokenId;
    }

    function getStakedBalance(address user) public view returns (uint256) {
    return stakedBalances[user];

    }

    function getStakedTokens(address user) public view returns (uint256) {
    return stakedTokens[user];
    
    }

    function getBalance(address user) public view returns (uint256) {
    return balances[user];
    
    }

    // Function to check if a specific address has claimed rewards
    function hasClaimed(
        address user,
        uint256 depositIndex
    ) external view returns (bool) {
        return claimed[user][depositIndex];
    }

    // Function to check if a specific address has claimed rewards
}

File 22 of 22 : TheBullionGameIjebu.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;

import "@chainlink/contracts/src/v0.8/AutomationCompatible.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "./DepositDistributor.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Address.sol";

contract TheBullionGameWeeklyAzulArb is
    VRFConsumerBaseV2,
    ReentrancyGuard,
    Ownable,
    AutomationCompatibleInterface,
    AccessControl
{ 
    using Address for address payable;

    address private upkeepAddress;
    address payable[] private players;
    address payable private commission;
    address payable private daoPayments;
    uint private gameId;
    mapping(uint => address payable) private gameHistory;
    mapping(uint256 => bool) public requestIdMap;
    uint public randomResult;

    address payable private depositDistributorAddress;
    mapping(uint256 => uint256) private deposits;
    uint256 private depositCount;
    mapping(uint256 => address payable) requestIdToWinner;
    mapping(address => bool) public allowList; // Mapping of allowed addresses for depositing

    enum GAME_STATE {
        CLOSED,
        OPEN,
        CALCULATING_WINNER,
        PAYING_WINNER,
        WINNER_PAID,
        PAYING_RUNNERS_UP,
        RUNNERS_UP_PAID,
        PAYING_DAO
    }

    GAME_STATE private game_state;

    bytes32 private keyHash;
    uint32 private callbackGasLimit;
    uint16 private requestConfirmations;
    uint16 private numWords;
    uint64 public subscriptionId;
    address private vrfCoordinatorV2Address;
    VRFCoordinatorV2Interface public vrfCoordinatorV2;

    AggregatorV3Interface internal priceFeed;
    uint256 private entryFeeInUSD;
    uint256 private constant PERCENT_DIVISOR = 100;
    uint256 private commissionPercentage;

    bytes32 public constant UPKEEP_ROLE = keccak256("UPKEEP_ROLE");
    bytes32 public constant SETTINGS_ROLE = keccak256("SETTINGS_ROLE");

    uint public immutable interval;
    uint private lastTimeStamp;

    bool private upkeepPerformed;
    bool private performedUpkeep;

    uint256 public referralPercentage; 


   

    event WinnerDeclared(address indexed winner, uint256 amount);
    event RunnerUpDeclared(address indexed runnerUp, uint256 amount);
    event BalanceTransferredToDAO(
        address indexed daoAddress,
        uint256 membersDepositAmount,
        uint256 amount
    );
    event UpkeepPerformed(uint256 indexed gameId);
    event randomRequested(uint256 requesRandomId);
    event DepositRecorded(uint256 indexed depositCount, uint256 depositAmount);
    event DepositMade(uint256 amount);

    event GameStateChanged(GAME_STATE newState);

    event Deposited(
        address indexed depositor,
        uint256 totalDeposited
    );

    constructor(
        address _daoPayments,
        address _commission,
        uint _updateInterval,
        address _depositDistributorAddress,
        address _priceFeed,
        address _upkeepAddress,
        bytes32 _keyHash,
        uint32 _callbackGasLimit,
        uint16 _requestConfirmations,
        uint16 _numWords,
        uint64 _subscriptionId,
        address _vrfCoordinatorV2Address
    ) VRFConsumerBaseV2(_vrfCoordinatorV2Address) {
        require(_daoPayments != address(0), "Invalid DAO payments address");
        require(
            _commission != address(0),
            "Invalid transaction commission address"
        );
        upkeepAddress = _upkeepAddress;
        gameId = 1;
        commission = payable(_commission);
        daoPayments = payable(_daoPayments);
        game_state = GAME_STATE.CLOSED;
        upkeepPerformed = false;

        performedUpkeep = false;
        interval = _updateInterval;
        lastTimeStamp = block.timestamp;
        priceFeed = AggregatorV3Interface(_priceFeed);
        entryFeeInUSD = 5.5 * 1e18;
        commissionPercentage = 10;
        depositDistributorAddress = payable(_depositDistributorAddress);
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(SETTINGS_ROLE, msg.sender);
        _setupRole(UPKEEP_ROLE, upkeepAddress);

        keyHash = _keyHash;
        callbackGasLimit = _callbackGasLimit;
        requestConfirmations = _requestConfirmations;
        numWords = _numWords;
        subscriptionId = _subscriptionId;
        vrfCoordinatorV2Address = _vrfCoordinatorV2Address;
        vrfCoordinatorV2 = VRFCoordinatorV2Interface(_vrfCoordinatorV2Address);
    }

    modifier onlyUpkeep() {
        require(msg.sender == upkeepAddress);
        _;
    }

    function updateEntryFee(
        uint256 _entryFeeInUSD
    ) external onlyRole(SETTINGS_ROLE) {
        entryFeeInUSD = _entryFeeInUSD;
    }

    function grantUpkeepRole(
        address chainlinkNodeAddress
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        grantRole(UPKEEP_ROLE, chainlinkNodeAddress);
    }

    function grantSettingsRole(
        address account
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        grantRole(SETTINGS_ROLE, account);
    }

    function revokeUpkeepRole(
        address account
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        revokeRole(UPKEEP_ROLE, account);
    }

    function revokeSettingsRole(
        address account
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        revokeRole(SETTINGS_ROLE, account);
    }

    function setUpkeepAddress(
        address _upkeepAddress
    ) public onlyOwner returns (address) {
        upkeepAddress = _upkeepAddress;
        return upkeepAddress;
    }

    function updatePriceFeed(
        address newPriceFeed
    ) external onlyRole(SETTINGS_ROLE) {
        priceFeed = AggregatorV3Interface(newPriceFeed);
    }

    function getWinnerByLottery(
        uint game
    ) public view returns (address payable) {
        return gameHistory[game];
    }

    function getBalance() public view returns (uint) {
        return address(this).balance;
    }

    function getPlayers() public view returns (address payable[] memory) {
        return players;
    }

    function resetTimer() public onlyOwner {
        lastTimeStamp = block.timestamp;
    }

    function getTimeLeft() public view returns (uint) {
        return block.timestamp - lastTimeStamp;
    }

    function getDepositDistributorAddress() public view returns (address) {
        return depositDistributorAddress;
    }

    function getDAOPaymentsAddress() public view returns (address) {
        return daoPayments;
    }

    function getGameState() public view returns (GAME_STATE) {
        return game_state;
    }

    function getCommissionPercentage() public view returns (uint256) {
        return commissionPercentage;
    }

    function getEntryFeeInUsd() public view returns (uint256) {
        return entryFeeInUSD;
    }

    function getGameId() public view returns (uint256) {
        return gameId;
    }

    function updateCallbackGasLimit(
        uint32 _callbackGasLimit
    ) external onlyRole(SETTINGS_ROLE) {
        callbackGasLimit = _callbackGasLimit;
    }

    function updateKeyHash(bytes32 _keyHash) external onlyRole(SETTINGS_ROLE) {
        keyHash = _keyHash;
    }


    function updateDepositDistributorAddress(address _depositDistributorAddress) external onlyRole(SETTINGS_ROLE) {
        depositDistributorAddress = payable(_depositDistributorAddress);
    }

    function updateRequestConfirmations(
        uint16 _requestConfirmations
    ) external onlyRole(SETTINGS_ROLE) {
        requestConfirmations = _requestConfirmations;
    }

    function updateNumWords(uint16 _numWords) external onlyRole(SETTINGS_ROLE) {
        numWords = _numWords;
    }

    function updateSubscriptionId(
        uint64 _subscriptionId
    ) external onlyRole(SETTINGS_ROLE) {
        subscriptionId = _subscriptionId;
    }

    

    function updateVrfCoordinatorV2Address(
        address _vrfCoordinatorV2Address
    ) external onlyRole(SETTINGS_ROLE) {
        vrfCoordinatorV2Address = _vrfCoordinatorV2Address;
        vrfCoordinatorV2 = VRFCoordinatorV2Interface(_vrfCoordinatorV2Address);
    }

    function startGame() public {
        require(game_state == GAME_STATE.CLOSED);
        game_state = GAME_STATE.OPEN;
        lastTimeStamp = block.timestamp;
    }

    function endGame() public onlyOwner {
        requestRandomWords();
    }

    function setGameState(GAME_STATE newState) external onlyOwner {
    require(newState != game_state, "New state is same as current state");
     
    game_state = newState;
    
    emit GameStateChanged(game_state);
}


    function updateGameState() public onlyOwner {
        performedUpkeep = true;
        requestRandomWords();
    }


    function checkUpkeep(
        bytes calldata checkData
    )
        external
        view
        override
        onlyRole(UPKEEP_ROLE)
        returns (bool upkeepNeeded, bytes memory performData)
    {
        if (
            (game_state == GAME_STATE.OPEN) &&
            keccak256(checkData) == keccak256(hex"01")
        ) {
            upkeepNeeded = (block.timestamp - lastTimeStamp) >= interval;
            performData = checkData;
        }
    }

    function performUpkeep(
        bytes calldata performData
    ) external override {
        require(
            (block.timestamp - lastTimeStamp) >= interval,
            "Game has not ended!"
        );

        if (keccak256(performData) == keccak256(hex"01")) {
          
            checkEnoughPlayers();
        }
    }

   function checkEnoughPlayers() public {
    require(
        (block.timestamp - lastTimeStamp) >= interval,
        "Game has not ended!"
    );

    if ((address(this).balance >= 0.3 ether) || (players.length >= 10)) {
        upkeepPerformed = false;
        requestRandomWords();
    }

    lastTimeStamp = block.timestamp;
}



    function requestRandomWords()
        public
        nonReentrant
        returns (uint256 requestId)
    {
        require(
            (block.timestamp - lastTimeStamp) >= interval,
            "Game has not ended!"
        );
        game_state = GAME_STATE.CALCULATING_WINNER;

        requestId = vrfCoordinatorV2.requestRandomWords(
            keyHash,
            subscriptionId,
            requestConfirmations,
            callbackGasLimit,
            numWords
        );
        requestIdMap[requestId] = true;
        return requestId;
    }

    function fulfillRandomWords(
        uint256 _requestId,
        uint256[] memory _randomWords
    ) internal override {
        require(
            game_state == GAME_STATE.CALCULATING_WINNER,
            "Game state not CALCULATING_WINNER"
        );
        require(
            msg.sender == vrfCoordinatorV2Address,
            "Only VRFCoordinatorV2 can fulfill"
        );
        // require(_requestId > 0, "Invalid requestId");
        require(_randomWords.length > 0, "Invalid randomWords");
        require(requestIdMap[_requestId], "Invalid request ID");

        game_state = GAME_STATE.PAYING_WINNER;
        uint256 index = _randomWords[0] % players.length;
        delete requestIdMap[_requestId];
        address payable winnerAddress = payable(players[index]);
        requestIdToWinner[_requestId] = winnerAddress; // Store the winner's address for the given request ID
        declareWinner(_requestId, winnerAddress, _randomWords);
    }

    function declareWinner(
        uint256 _requestId,
        address payable winner,
        uint256[] memory _randomWords
    ) private {
        require(
            game_state == GAME_STATE.PAYING_WINNER,
            "Game must be in Paying winner state"
        );
        require(
            winner != address(0) && winner != address(this),
            "Invalid winner address "
        );
        require(
            requestIdToWinner[_requestId] == winner,
            "Winner does not match requestIdToWinner mapping"
        );
        game_state = GAME_STATE.WINNER_PAID;
        uint256 winnerShares = address(this).balance / 2;
        winner.sendValue(winnerShares);
        gameHistory[gameId] = winner;
        emit WinnerDeclared(winner, winnerShares);
        declareRunnerUps(winner, _randomWords);
    }

    function declareRunnerUps(
        address payable winner,
        uint256[] memory _randomWords
    ) private {
        require(
            game_state == GAME_STATE.WINNER_PAID,
            "Game must be in Closed state"
        );

        game_state = GAME_STATE.PAYING_RUNNERS_UP;
        uint256 index = 0;
        for (uint256 i = 0; i < players.length; i++) {
            if (players[i] == winner) {
                index = i;
                break;
            }
        }

        uint256 runnersUpShare = (address(this).balance * 2) / 5;
        uint256 numRunnersUp = players.length - 1;
        uint256 iterations = numRunnersUp <= 20 ? numRunnersUp : 20;
        uint256[] memory runnerIndices = new uint256[](iterations);

        if (numRunnersUp > 0) {
            for (uint256 j = 0; j < iterations; j++) {
                uint256 randomIndex = _randomWords[j + 1] % (numRunnersUp - j);
                runnerIndices[j] = index != 0
                    ? (randomIndex >= index ? randomIndex + 1 : randomIndex)
                    : randomIndex;
                if (runnerIndices[j] == index) runnerIndices[j]++;
                if (randomIndex < numRunnersUp - j - 1)
                    _randomWords[randomIndex + 1] = _randomWords[
                        numRunnersUp - j
                    ];
            }
        }

        uint256 runnersUpSharePerPlayer = runnersUpShare / numRunnersUp;
        for (uint256 j = 0; j < players.length; j++) {
            if (j != index) {
                address payable runner = payable(players[j]);
                require(
                    runner != address(0) && runner != address(this),
                    "Invalid runner-up address"
                );
                runner.sendValue(runnersUpSharePerPlayer);
                emit RunnerUpDeclared(players[j], runnersUpSharePerPlayer);
            }
        }

        game_state = GAME_STATE.RUNNERS_UP_PAID;
        transferBalanceToDAO();
    }

    function transferBalanceToDAO() private {
        require(
            game_state == GAME_STATE.RUNNERS_UP_PAID,
            "Game must be in Runersup Paid state"
        );

        game_state = GAME_STATE.PAYING_DAO;
        uint256 balance = address(this).balance;
        uint256 depositAmount = (balance * 3) / 10; // Calculate 30% of the balance
        uint256 remainingBalance = balance - depositAmount;

        // Store deposit amount for later withdrawal
        deposits[depositCount] = depositAmount;
        depositCount++;

        emit DepositRecorded(depositCount, depositAmount);
        (bool success, ) = daoPayments.call{value: remainingBalance}("");
        require(success, "Transfer to DAO failed");

        emit BalanceTransferredToDAO(
            daoPayments,
            depositAmount,
            remainingBalance
        );

        gameId++;
        players = new address payable[](0);

        game_state = GAME_STATE.CLOSED;
        startGame();
    }

    // Deposit the specified amount to the deposit distributor contract
    function depositToDistributor(uint256 amount) private {
       

        DepositDistributor depositDistributorInstance = DepositDistributor(
            depositDistributorAddress
        );

        depositDistributorInstance.deposit{value: amount}(amount);

        emit DepositMade(amount);
    }

    function autoDepositStaking() external onlyOwner {
        for (uint256 i = 0; i < depositCount; i++) {
            uint256 amount = deposits[i];
            deposits[i] = 0;
            depositToDistributor(amount);
        }
    }

    function manualDepositStaking(uint256 index) external onlyOwner {
        require(deposits[index] > 0, "No deposit at this index");

        uint256 amount = deposits[index];
        deposits[index] = 0;
        depositToDistributor(amount);
}

    function getLatestBNBUsdPrice() public view returns (uint256) {
        (, int256 price, , , ) = priceFeed.latestRoundData();
        uint256 adjustedPrice = uint256(price) / 1e8;
        uint256 entryFee = entryFeeInUSD / adjustedPrice;
        // uint256 adjustedForDifference = entryFee + (entryFee * 1 / 100)
        return entryFee;
    }

    function enter() public payable nonReentrant {
        require(game_state == GAME_STATE.OPEN, "Game state not OPEN");
        require(msg.sender != owner(), "Owner cannot enter");

        require(msg.value >= getLatestBNBUsdPrice(), "Entry fee too low");

        uint256 commissionInWei = (msg.value * commissionPercentage) /
            PERCENT_DIVISOR;

        players.push(payable(msg.sender));
        commission.transfer(commissionInWei);
    }


     function setReferralPercentage(uint256 newPercentage) public onlyOwner {
        require(newPercentage <= 100, "Referral percentage cannot exceed 100");
        referralPercentage = newPercentage;
    }

    function enterRef(address payable referralAddress) public payable nonReentrant {
    require(game_state == GAME_STATE.OPEN, "Game state not OPEN");
    require(msg.sender != owner(), "Owner cannot enter");
    require(msg.value >= getLatestBNBUsdPrice(), "Entry fee too low");
    require(referralAddress != msg.sender, "Referral address cannot be the sender");

    uint256 totalAmount = msg.value;
    uint256 commissionInWei = (totalAmount * commissionPercentage) / PERCENT_DIVISOR;
    uint256 referralShare = (commissionInWei * referralPercentage) / PERCENT_DIVISOR;

    players.push(payable(msg.sender));

    require(referralShare <= commissionInWei, "Referral share cannot exceed commission");

    referralAddress.transfer(referralShare);
    commission.transfer(commissionInWei - referralShare);
}




function depositBonus() external payable onlyAllowList {
        require(msg.value > 0, "Incorrect deposit amount"); 

        emit Deposited(msg.sender, msg.value);
    }


modifier onlyAllowList() {
        require(allowList[msg.sender], "Sender not on allow list");
        _;
    }


function addToAllowList(address _user) external onlyOwner {
    allowList[_user] = true;
}

// Function to remove an address from the allow list, restricted to the contract owner
function removeFromAllowList(address _user) external onlyOwner {
    allowList[_user] = false;
}


}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_daoPayments","type":"address"},{"internalType":"address","name":"_commission","type":"address"},{"internalType":"uint256","name":"_updateInterval","type":"uint256"},{"internalType":"address","name":"_depositDistributorAddress","type":"address"},{"internalType":"address","name":"_priceFeed","type":"address"},{"internalType":"address","name":"_upkeepAddress","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"_requestConfirmations","type":"uint16"},{"internalType":"uint16","name":"_numWords","type":"uint16"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"address","name":"_vrfCoordinatorV2Address","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"daoAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"membersDepositAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BalanceTransferredToDAO","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositMade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"depositCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"}],"name":"DepositRecorded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalDeposited","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum TheBullionGameWeeklyAzulArb.GAME_STATE","name":"newState","type":"uint8"}],"name":"GameStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":true,"internalType":"address","name":"runnerUp","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RunnerUpDeclared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gameId","type":"uint256"}],"name":"UpkeepPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WinnerDeclared","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requesRandomId","type":"uint256"}],"name":"randomRequested","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTINGS_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPKEEP_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"addToAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"autoDepositStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkEnoughPlayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"checkData","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBonus","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"endGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"referralAddress","type":"address"}],"name":"enterRef","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCommissionPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDAOPaymentsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDepositDistributorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEntryFeeInUsd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameState","outputs":[{"internalType":"enum TheBullionGameWeeklyAzulArb.GAME_STATE","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestBNBUsdPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlayers","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimeLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"game","type":"uint256"}],"name":"getWinnerByLottery","outputs":[{"internalType":"address payable","name":"","type":"address"}],"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":"address","name":"account","type":"address"}],"name":"grantSettingsRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"chainlinkNodeAddress","type":"address"}],"name":"grantUpkeepRole","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":"interval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"manualDepositStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"performData","type":"bytes"}],"name":"performUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"randomResult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"referralPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"removeFromAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"uint256","name":"","type":"uint256"}],"name":"requestIdMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestRandomWords","outputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetTimer","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":"address","name":"account","type":"address"}],"name":"revokeSettingsRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeUpkeepRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TheBullionGameWeeklyAzulArb.GAME_STATE","name":"newState","type":"uint8"}],"name":"setGameState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setReferralPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_upkeepAddress","type":"address"}],"name":"setUpkeepAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"subscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"}],"name":"updateCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_depositDistributorAddress","type":"address"}],"name":"updateDepositDistributorAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_entryFeeInUSD","type":"uint256"}],"name":"updateEntryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateGameState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"updateKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_numWords","type":"uint16"}],"name":"updateNumWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPriceFeed","type":"address"}],"name":"updatePriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_requestConfirmations","type":"uint16"}],"name":"updateRequestConfirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"updateSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vrfCoordinatorV2Address","type":"address"}],"name":"updateVrfCoordinatorV2Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vrfCoordinatorV2","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b506040516200397b3803806200397b833981016040819052620000349162000486565b6001600160a01b0381166080526001600055620000513362000338565b6001600160a01b038c16620000ad5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642044414f207061796d656e747320616464726573730000000060448201526064015b60405180910390fd5b6001600160a01b038b16620001145760405162461bcd60e51b815260206004820152602660248201527f496e76616c6964207472616e73616374696f6e20636f6d6d697373696f6e206160448201526564647265737360d01b6064820152608401620000a4565b86600360006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060016007819055508a600560006101000a8154816001600160a01b0302191690836001600160a01b031602179055508b600660006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000601060006101000a81548160ff02191690836007811115620001b957620001b962000573565b02179055506019805461ffff1916905560a08a905242601855601580546001600160a01b03808b166001600160a01b031992831617909255674c53ecdc18a60000601655600a601755600b8054928c1692909116919091179055620002206000336200038a565b6200024c7ffaf9b26485088dee58863e57c46603d6cdcbadc7475ac6d8910fab0ecf603095336200038a565b60035462000285907f3e49606c6ae7fea13e1df031e21c9a3c3350a65a6842ad7cbaee71b9e7574e5a906001600160a01b03166200038a565b601195909555601280546001600160401b039092166801000000000000000002600160401b600160801b031961ffff94851666010000000000000216600160301b600160801b0319949095166401000000000265ffffffffffff1990931663ffffffff90961695909517919091179190911691909117919091179055601380546001600160a01b039092166001600160a01b03199283168117909155601480549092161790555062000589945050505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200039682826200039a565b5050565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff16620003965760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200045657600080fd5b919050565b805161ffff811681146200045657600080fd5b80516001600160401b03811681146200045657600080fd5b6000806000806000806000806000806000806101808d8f031215620004aa57600080fd5b620004b58d6200043e565b9b50620004c560208e016200043e565b9a5060408d01519950620004dc60608e016200043e565b9850620004ec60808e016200043e565b9750620004fc60a08e016200043e565b965060c08d0151955060e08d015163ffffffff811681146200051d57600080fd5b94506200052e6101008e016200045b565b93506200053f6101208e016200045b565b9250620005506101408e016200046e565b9150620005616101608e016200043e565b90509295989b509295989b509295989b565b634e487b7160e01b600052602160045260246000fd5b60805160a0516133a9620005d26000396000818161084f01528181610bc5015281816110ce0152818161140801526118c7015260008181610c5d0152610c9f01526133a96000f3fe6080604052600436106103ad5760003560e01c806387a5a50e116101e7578063ba00f6c51161010d578063e7fa67e5116100a0578063f33fa9d51161006f578063f33fa9d514610ac0578063f628988714610ae0578063f6f4268914610b02578063f7d76a5c14610b2257600080fd5b8063e7fa67e514610a58578063e97dcb6214610a78578063eba8dabc14610a80578063f2fde38b14610aa057600080fd5b8063d547741f116100dc578063d547741f146109f9578063d65ab5f214610a19578063dfe5a66814610a2e578063e0c8628914610a4357600080fd5b8063ba00f6c51461098f578063c0bd8351146109af578063c7e284b8146109c4578063ca04a927146109d957600080fd5b8063a0311bd411610185578063aa18262611610154578063aa18262614610911578063b0e8d08614610931578063b1fe742514610951578063b7d0628b1461096f57600080fd5b8063a0311bd4146108a7578063a217fddf146108c7578063a5dbd814146108dc578063a65972a1146108f157600080fd5b806391d14854116101c157806391d148541461081d578063947a36fb1461083d57806395877f781461087157806396ea8b9c1461089157600080fd5b806387a5a50e146107c85780638b5b9ccc146107dd5780638da5cb5b146107ff57600080fd5b806336568abe116102d75780636dd047f31161026a57806370bde7571161023957806370bde75714610769578063715018a6146107895780637d2c85011461079e5780637d55d304146107b357600080fd5b80636dd047f3146106db5780636e04ff0d146106fb578063704562a81461072957806370b3a2f01461074957600080fd5b80634585e33b116102a65780634585e33b146106895780634f0c563f146106a957806366c04ca7146106b15780636cbc2ded146106c657600080fd5b806336568abe146106135780633c6c3ffe146106335780633d35c4f51461065357806342619f661461067357600080fd5b8063248a9ca31161034f57806329308a9c1161031e57806329308a9c146105a05780632f2ff15d146105c057806331293ae5146105e057806331f59102146105f357600080fd5b8063248a9ca3146104c25780632621bd57146104f2578063281d098d146105225780632848aeaf1461057057600080fd5b806312065fe01161038b57806312065fe01461045857806314b1dd1b1461046b5780631ee03f2b1461048d5780631fe543e3146104a257600080fd5b806301ffc9a7146103b257806302e72ff8146103e757806309c1ba2e14610417575b600080fd5b3480156103be57600080fd5b506103d26103cd366004612d77565b610b40565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b5061040960008051602061335483398151915281565b6040519081526020016103de565b34801561042357600080fd5b5060125461043f90600160401b900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016103de565b34801561046457600080fd5b5047610409565b34801561047757600080fd5b5061048b610486366004612da1565b610b77565b005b34801561049957600080fd5b5061048b610bc3565b3480156104ae57600080fd5b5061048b6104bd366004612de1565b610c52565b3480156104ce57600080fd5b506104096104dd366004612eab565b60009081526002602052604090206001015490565b3480156104fe57600080fd5b506103d261050d366004612eab565b60096020526000908152604090205460ff1681565b34801561052e57600080fd5b5061055861053d366004612eab565b6000908152600860205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016103de565b34801561057c57600080fd5b506103d261058b366004612ed9565b600f6020526000908152604090205460ff1681565b3480156105ac57600080fd5b506105586105bb366004612ed9565b610cda565b3480156105cc57600080fd5b5061048b6105db366004612ef6565b610d09565b61048b6105ee366004612ed9565b610d33565b3480156105ff57600080fd5b5061048b61060e366004612ed9565b611003565b34801561061f57600080fd5b5061048b61062e366004612ef6565b61102f565b34801561063f57600080fd5b5061048b61064e366004612ed9565b6110a9565b34801561065f57600080fd5b50601454610558906001600160a01b031681565b34801561067f57600080fd5b50610409600a5481565b34801561069557600080fd5b5061048b6106a4366004612f26565b6110cc565b61048b611160565b3480156106bd57600080fd5b5061048b611246565b3480156106d257600080fd5b5061048b61128a565b3480156106e757600080fd5b5061048b6106f6366004612f98565b61129a565b34801561070757600080fd5b5061071b610716366004612f26565b611389565b6040516103de929190613011565b34801561073557600080fd5b5061048b610744366004612ed9565b61147b565b34801561075557600080fd5b5061048b610764366004612ed9565b61149e565b34801561077557600080fd5b5061048b61078436600461302c565b6114c1565b34801561079557600080fd5b5061048b611502565b3480156107aa57600080fd5b50610409611516565b3480156107bf57600080fd5b5061048b6115c2565b3480156107d457600080fd5b50601654610409565b3480156107e957600080fd5b506107f26115ca565b6040516103de9190613050565b34801561080b57600080fd5b506001546001600160a01b0316610558565b34801561082957600080fd5b506103d2610838366004612ef6565b61162c565b34801561084957600080fd5b506104097f000000000000000000000000000000000000000000000000000000000000000081565b34801561087d57600080fd5b5061048b61088c366004612ed9565b611657565b34801561089d57600080fd5b50610409601a5481565b3480156108b357600080fd5b5061048b6108c2366004612eab565b611692565b3480156108d357600080fd5b50610409600081565b3480156108e857600080fd5b50601754610409565b3480156108fd57600080fd5b5061048b61090c366004612eab565b6116fe565b34801561091d57600080fd5b5061048b61092c366004612eab565b61177d565b34801561093d57600080fd5b5061048b61094c36600461309d565b61179b565b34801561095d57600080fd5b50600b546001600160a01b0316610558565b34801561097b57600080fd5b5060105460ff166040516103de91906130d9565b34801561099b57600080fd5b5061048b6109aa36600461302c565b6117d0565b3480156109bb57600080fd5b50600754610409565b3480156109d057600080fd5b5061040961180d565b3480156109e557600080fd5b5061048b6109f4366004612ed9565b611822565b348015610a0557600080fd5b5061048b610a14366004612ef6565b611845565b348015610a2557600080fd5b5061048b61186a565b348015610a3a57600080fd5b5061048b6118a0565b348015610a4f57600080fd5b506104096118bb565b348015610a6457600080fd5b5061048b610a73366004612eab565b611a02565b61048b611a20565b348015610a8c57600080fd5b5061048b610a9b366004612ed9565b611bc2565b348015610aac57600080fd5b5061048b610abb366004612ed9565b611beb565b348015610acc57600080fd5b5061048b610adb366004612ed9565b611c61565b348015610aec57600080fd5b5061040960008051602061333483398151915281565b348015610b0e57600080fd5b5061048b610b1d366004612ed9565b611c9c565b348015610b2e57600080fd5b506006546001600160a01b0316610558565b60006001600160e01b03198216637965db0b60e01b1480610b7157506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080516020613334833981519152610b8f81611ce1565b506012805467ffffffffffffffff909216600160401b026fffffffffffffffff000000000000000019909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000060185442610bf29190613117565b1015610c195760405162461bcd60e51b8152600401610c109061312e565b60405180910390fd5b670429d069189e000047101580610c335750600454600a11155b15610c4c576019805460ff19169055610c4a6118bb565b505b42601855565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ccc5760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610c10565b610cd68282611ceb565b5050565b6000610ce4611f0a565b50600380546001600160a01b0319166001600160a01b0383169081179091555b919050565b600082815260026020526040902060010154610d2481611ce1565b610d2e8383611f64565b505050565b610d3b611fea565b600160105460ff166007811115610d5457610d546130c3565b14610d975760405162461bcd60e51b815260206004820152601360248201527223b0b6b29039ba30ba32903737ba1027a822a760691b6044820152606401610c10565b6001546001600160a01b0316331415610de75760405162461bcd60e51b815260206004820152601260248201527127bbb732b91031b0b73737ba1032b73a32b960711b6044820152606401610c10565b610def611516565b341015610e325760405162461bcd60e51b8152602060048201526011602482015270456e7472792066656520746f6f206c6f7760781b6044820152606401610c10565b6001600160a01b038116331415610e995760405162461bcd60e51b815260206004820152602560248201527f526566657272616c20616464726573732063616e6e6f7420626520746865207360448201526432b73232b960d91b6064820152608401610c10565b6017543490600090606490610eae908461315b565b610eb89190613190565b905060006064601a5483610ecc919061315b565b610ed69190613190565b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b03191633179055905081811115610f7a5760405162461bcd60e51b815260206004820152602760248201527f526566657272616c2073686172652063616e6e6f742065786365656420636f6d60448201526636b4b9b9b4b7b760c91b6064820152608401610c10565b6040516001600160a01b0385169082156108fc029083906000818181858888f19350505050158015610fb0573d6000803e3d6000fd5b506005546001600160a01b03166108fc610fca8385613117565b6040518115909202916000818181858888f19350505050158015610ff2573d6000803e3d6000fd5b505050506110006001600055565b50565b61100b611f0a565b6001600160a01b03166000908152600f60205260409020805460ff19166001179055565b6001600160a01b038116331461109f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c10565b610cd68282612044565b60006110b481611ce1565b610cd660008051602061333483398151915283610d09565b7f0000000000000000000000000000000000000000000000000000000000000000601854426110fb9190613117565b10156111195760405162461bcd60e51b8152600401610c109061312e565b7f5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2828260405161114a9291906131a4565b60405180910390201415610cd657610cd6610bc3565b336000908152600f602052604090205460ff166111bf5760405162461bcd60e51b815260206004820152601860248201527f53656e646572206e6f74206f6e20616c6c6f77206c69737400000000000000006044820152606401610c10565b6000341161120f5760405162461bcd60e51b815260206004820152601860248201527f496e636f7272656374206465706f73697420616d6f756e7400000000000000006044820152606401610c10565b60405134815233907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c49060200160405180910390a2565b61124e611f0a565b60005b600d54811015611000576000818152600c602052604081208054919055611277816120ab565b5080611282816131b4565b915050611251565b611292611f0a565b6110006118bb565b6112a2611f0a565b60105460ff1660078111156112b9576112b96130c3565b8160078111156112cb576112cb6130c3565b14156113245760405162461bcd60e51b815260206004820152602260248201527f4e65772073746174652069732073616d652061732063757272656e7420737461604482015261746560f01b6064820152608401610c10565b6010805482919060ff19166001836007811115611343576113436130c3565b02179055506010546040517ea8b06dd72552dea96e97c9a96acf39a1908ada44765cefe367620485b2c7e19161137e9160ff909116906130d9565b60405180910390a150565b600060606000805160206133548339815191526113a581611ce1565b600160105460ff1660078111156113be576113be6130c3565b14801561140157507f5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd285856040516113f79291906131a4565b6040518091039020145b15611473577f0000000000000000000000000000000000000000000000000000000000000000601854426114359190613117565b1015925084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b509250929050565b600061148681611ce1565b610cd660008051602061335483398151915283611845565b60006114a981611ce1565b610cd660008051602061333483398151915283611845565b6000805160206133348339815191526114d981611ce1565b506012805461ffff90921666010000000000000267ffff00000000000019909216919091179055565b61150a611f0a565b611514600061214a565b565b600080601560009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561156c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159091906131e9565b50505091505060006305f5e100826115a89190613190565b90506000816016546115ba9190613190565b949350505050565b610c4c611f0a565b6060600480548060200260200160405190810160405280929190818152602001828054801561162257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611604575b5050505050905090565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061333483398151915261166f81611ce1565b50601580546001600160a01b0319166001600160a01b0392909216919091179055565b61169a611f0a565b60648111156116f95760405162461bcd60e51b815260206004820152602560248201527f526566657272616c2070657263656e746167652063616e6e6f74206578636565604482015264064203130360dc1b6064820152608401610c10565b601a55565b611706611f0a565b6000818152600c60205260409020546117615760405162461bcd60e51b815260206004820152601860248201527f4e6f206465706f736974206174207468697320696e64657800000000000000006044820152606401610c10565b6000818152600c602052604081208054919055610cd6816120ab565b60008051602061333483398151915261179581611ce1565b50601655565b6000805160206133348339815191526117b381611ce1565b506012805463ffffffff191663ffffffff92909216919091179055565b6000805160206133348339815191526117e881611ce1565b506012805461ffff9092166401000000000265ffff0000000019909216919091179055565b60006018544261181d9190613117565b905090565b600061182d81611ce1565b610cd660008051602061335483398151915283610d09565b60008281526002602052604090206001015461186081611ce1565b610d2e8383612044565b600060105460ff166007811115611883576118836130c3565b1461188d57600080fd5b6010805460ff1916600117905542601855565b6118a8611f0a565b6019805461ff0019166101001790556110005b60006118c5611fea565b7f0000000000000000000000000000000000000000000000000000000000000000601854426118f49190613117565b10156119125760405162461bcd60e51b8152600401610c109061312e565b6010805460ff191660021790556014546011546012546040516305d3b1d360e41b8152600481019290925267ffffffffffffffff600160401b820416602483015261ffff64010000000082048116604484015263ffffffff8216606484015266010000000000009091041660848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af11580156119b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119da9190613239565b6000818152600960205260409020805460ff1916600117905590506119ff6001600055565b90565b600080516020613334833981519152611a1a81611ce1565b50601155565b611a28611fea565b600160105460ff166007811115611a4157611a416130c3565b14611a845760405162461bcd60e51b815260206004820152601360248201527223b0b6b29039ba30ba32903737ba1027a822a760691b6044820152606401610c10565b6001546001600160a01b0316331415611ad45760405162461bcd60e51b815260206004820152601260248201527127bbb732b91031b0b73737ba1032b73a32b960711b6044820152606401610c10565b611adc611516565b341015611b1f5760405162461bcd60e51b8152602060048201526011602482015270456e7472792066656520746f6f206c6f7760781b6044820152606401610c10565b6000606460175434611b31919061315b565b611b3b9190613190565b6004805460018101825560009182527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b031916331790556005546040519293506001600160a01b03169183156108fc0291849190818181858888f19350505050158015611bb6573d6000803e3d6000fd5b50506115146001600055565b611bca611f0a565b6001600160a01b03166000908152600f60205260409020805460ff19169055565b611bf3611f0a565b6001600160a01b038116611c585760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c10565b6110008161214a565b600080516020613334833981519152611c7981611ce1565b50600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020613334833981519152611cb481611ce1565b50601380546001600160a01b039092166001600160a01b0319928316811790915560148054909216179055565b611000813361219c565b600260105460ff166007811115611d0457611d046130c3565b14611d5b5760405162461bcd60e51b815260206004820152602160248201527f47616d65207374617465206e6f742043414c43554c4154494e475f57494e4e456044820152602960f91b6064820152608401610c10565b6013546001600160a01b03163314611dbf5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920565246436f6f7264696e61746f7256322063616e2066756c66696c6044820152601b60fa1b6064820152608401610c10565b6000815111611e065760405162461bcd60e51b8152602060048201526013602482015272496e76616c69642072616e646f6d576f72647360681b6044820152606401610c10565b60008281526009602052604090205460ff16611e595760405162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c995c5d595cdd08125160721b6044820152606401610c10565b6010805460ff1916600317905560045481516000919083908390611e7f57611e7f613252565b6020026020010151611e919190613268565b6000848152600960205260408120805460ff1916905560048054929350909183908110611ec057611ec0613252565b6000918252602080832090910154868352600e909152604090912080546001600160a01b0319166001600160a01b0390921691821790559050611f048482856121f5565b50505050565b6001546001600160a01b031633146115145760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c10565b611f6e828261162c565b610cd65760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611fa63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6002600054141561203d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c10565b6002600055565b61204e828261162c565b15610cd65760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600b5460405163b6b55f2560e01b8152600481018390526001600160a01b0390911690819063b6b55f259084906024016000604051808303818588803b1580156120f457600080fd5b505af1158015612108573d6000803e3d6000fd5b50505050507f4b5e331941ecaccdb150876050ec45085fa2dbe4937f81ee2d79a2958f477c628260405161213e91815260200190565b60405180910390a15050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6121a6828261162c565b610cd6576121b3816123ef565b6121be836020612401565b6040516020016121cf92919061327c565b60408051601f198184030181529082905262461bcd60e51b8252610c10916004016132f1565b600360105460ff16600781111561220e5761220e6130c3565b146122675760405162461bcd60e51b815260206004820152602360248201527f47616d65206d75737420626520696e20506179696e672077696e6e657220737460448201526261746560e81b6064820152608401610c10565b6001600160a01b0382161580159061228857506001600160a01b0382163014155b6122d45760405162461bcd60e51b815260206004820152601760248201527f496e76616c69642077696e6e65722061646472657373200000000000000000006044820152606401610c10565b6000838152600e60205260409020546001600160a01b038381169116146123555760405162461bcd60e51b815260206004820152602f60248201527f57696e6e657220646f6573206e6f74206d61746368207265717565737449645460448201526e6f57696e6e6572206d617070696e6760881b6064820152608401610c10565b6010805460ff19166004179055600061236f600247613190565b90506123846001600160a01b038416826125a4565b60075460009081526008602090815260409182902080546001600160a01b0319166001600160a01b03871690811790915591518381527f3cf1af53e79884a92609ce59db1ec9f584d88e2d14c8eaba43a21db81318301e910160405180910390a2611f0483836126bd565b6060610b716001600160a01b03831660145b6060600061241083600261315b565b61241b906002613304565b67ffffffffffffffff81111561243357612433612dcb565b6040519080825280601f01601f19166020018201604052801561245d576020820181803683370190505b509050600360fc1b8160008151811061247857612478613252565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106124a7576124a7613252565b60200101906001600160f81b031916908160001a90535060006124cb84600261315b565b6124d6906001613304565b90505b600181111561254e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061250a5761250a613252565b1a60f81b82828151811061252057612520613252565b60200101906001600160f81b031916908160001a90535060049490941c936125478161331c565b90506124d9565b50831561259d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c10565b9392505050565b804710156125f45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610c10565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612641576040519150601f19603f3d011682016040523d82523d6000602084013e612646565b606091505b5050905080610d2e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610c10565b600460105460ff1660078111156126d6576126d66130c3565b146127235760405162461bcd60e51b815260206004820152601c60248201527f47616d65206d75737420626520696e20436c6f736564207374617465000000006044820152606401610c10565b6010805460ff191660051790556000805b60045481101561279057836001600160a01b03166004828154811061275b5761275b613252565b6000918252602090912001546001600160a01b0316141561277e57809150612790565b80612788816131b4565b915050612734565b50600060056127a047600261315b565b6127aa9190613190565b6004549091506000906127bf90600190613117565b9050600060148211156127d35760146127d5565b815b905060008167ffffffffffffffff8111156127f2576127f2612dcb565b60405190808252806020026020018201604052801561281b578160200160208202803683370190505b50905082156129795760005b8281101561297757600061283b8286613117565b88612847846001613304565b8151811061285757612857613252565b60200260200101516128699190613268565b905086612876578061288f565b86811015612884578061288f565b61288f816001613304565b8383815181106128a1576128a1613252565b602002602001018181525050868383815181106128c0576128c0613252565b602002602001015114156128f9578282815181106128e0576128e0613252565b6020026020010180518091906128f5906131b4565b9052505b60016129058387613117565b61290f9190613117565b81101561296457876129218387613117565b8151811061293157612931613252565b6020026020010151888260016129479190613304565b8151811061295757612957613252565b6020026020010181815250505b508061296f816131b4565b915050612827565b505b60006129858486613190565b905060005b600454811015612aaf57868114612a9d576000600482815481106129b0576129b0613252565b6000918252602090912001546001600160a01b0316905080158015906129df57506001600160a01b0381163014155b612a2b5760405162461bcd60e51b815260206004820152601960248201527f496e76616c69642072756e6e65722d75702061646472657373000000000000006044820152606401610c10565b612a3e6001600160a01b038216846125a4565b60048281548110612a5157612a51613252565b600091825260209182902001546040518581526001600160a01b03909116917fba0f0a2589146e83cc3b36a049aaded5e4a29ca378f060344553370dc6b741fc910160405180910390a2505b80612aa7816131b4565b91505061298a565b506010805460ff19166006179055612ac5612acf565b5050505050505050565b600660105460ff166007811115612ae857612ae86130c3565b14612b415760405162461bcd60e51b815260206004820152602360248201527f47616d65206d75737420626520696e2052756e6572737570205061696420737460448201526261746560e81b6064820152608401610c10565b6010805460ff19166007179055476000600a612b5e83600361315b565b612b689190613190565b90506000612b768284613117565b600d80546000908152600c602052604081208590558154929350612b99836131b4565b9091555050600d546040518381527f69248d6f9bc8c871371cbf8dd076a3b56052282fa7b75832a57b3133fd8ccc589060200160405180910390a26006546040516000916001600160a01b03169083908381818185875af1925050503d8060008114612c21576040519150601f19603f3d011682016040523d82523d6000602084013e612c26565b606091505b5050905080612c705760405162461bcd60e51b8152602060048201526016602482015275151c985b9cd9995c881d1bc8111053c819985a5b195960521b6044820152606401610c10565b60065460408051858152602081018590526001600160a01b03909216917fb3b55fec26128dec32a9b432a85e33e44342210c2c24ca04ce79b505234eaeec910160405180910390a260078054906000612cc8836131b4565b90915550506040805160008152602081019182905251612cea91600491612cfd565b506010805460ff19169055611f0461186a565b828054828255906000526020600020908101928215612d52579160200282015b82811115612d5257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612d1d565b50612d5e929150612d62565b5090565b5b80821115612d5e5760008155600101612d63565b600060208284031215612d8957600080fd5b81356001600160e01b03198116811461259d57600080fd5b600060208284031215612db357600080fd5b813567ffffffffffffffff8116811461259d57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215612df457600080fd5b8235915060208084013567ffffffffffffffff80821115612e1457600080fd5b818601915086601f830112612e2857600080fd5b813581811115612e3a57612e3a612dcb565b8060051b604051601f19603f83011681018181108582111715612e5f57612e5f612dcb565b604052918252848201925083810185019189831115612e7d57600080fd5b938501935b82851015612e9b57843584529385019392850192612e82565b8096505050505050509250929050565b600060208284031215612ebd57600080fd5b5035919050565b6001600160a01b038116811461100057600080fd5b600060208284031215612eeb57600080fd5b813561259d81612ec4565b60008060408385031215612f0957600080fd5b823591506020830135612f1b81612ec4565b809150509250929050565b60008060208385031215612f3957600080fd5b823567ffffffffffffffff80821115612f5157600080fd5b818501915085601f830112612f6557600080fd5b813581811115612f7457600080fd5b866020828501011115612f8657600080fd5b60209290920196919550909350505050565b600060208284031215612faa57600080fd5b81356008811061259d57600080fd5b60005b83811015612fd4578181015183820152602001612fbc565b83811115611f045750506000910152565b60008151808452612ffd816020860160208601612fb9565b601f01601f19169290920160200192915050565b82151581526040602082015260006115ba6040830184612fe5565b60006020828403121561303e57600080fd5b813561ffff8116811461259d57600080fd5b6020808252825182820181905260009190848201906040850190845b818110156130915783516001600160a01b03168352928401929184019160010161306c565b50909695505050505050565b6000602082840312156130af57600080fd5b813563ffffffff8116811461259d57600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600883106130fb57634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b60008282101561312957613129613101565b500390565b60208082526013908201527247616d6520686173206e6f7420656e6465642160681b604082015260600190565b600081600019048311821515161561317557613175613101565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261319f5761319f61317a565b500490565b8183823760009101908152919050565b60006000198214156131c8576131c8613101565b5060010190565b805169ffffffffffffffffffff81168114610d0457600080fd5b600080600080600060a0868803121561320157600080fd5b61320a866131cf565b945060208601519350604086015192506060860151915061322d608087016131cf565b90509295509295909350565b60006020828403121561324b57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b6000826132775761327761317a565b500690565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516132b4816017850160208801612fb9565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516132e5816028840160208801612fb9565b01602801949350505050565b60208152600061259d6020830184612fe5565b6000821982111561331757613317613101565b500190565b60008161332b5761332b613101565b50600019019056fefaf9b26485088dee58863e57c46603d6cdcbadc7475ac6d8910fab0ecf6030953e49606c6ae7fea13e1df031e21c9a3c3350a65a6842ad7cbaee71b9e7574e5aa26469706673582212205b6f968cc171eaab98caf963885079a91af662bb88fdfb70bac7b19a509f659664736f6c634300080b0033000000000000000000000000cd4b33051d2332f6a4248d915c38a33a754287d1000000000000000000000000b682ad0b24ae702b696b2afc71ef9040fd2ccf040000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000dfc424b01ea80f0805df3f6ba4d0160693c781a6000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba61200000000000000000000000075c0530885f385721fdda23c539af3701d6183d408ba8f62ff6c40a58877a106147661db43bc58dabfb814793847a839aa03367f00000000000000000000000000000000000000000000000000000000002625a000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000015000000000000000000000000000000000000000000000000000000000000003200000000000000000000000041034678d6c633d8a95c75e1138a360a28ba15d1

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

000000000000000000000000cd4b33051d2332f6a4248d915c38a33a754287d1000000000000000000000000b682ad0b24ae702b696b2afc71ef9040fd2ccf040000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000dfc424b01ea80f0805df3f6ba4d0160693c781a6000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba61200000000000000000000000075c0530885f385721fdda23c539af3701d6183d408ba8f62ff6c40a58877a106147661db43bc58dabfb814793847a839aa03367f00000000000000000000000000000000000000000000000000000000002625a000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000015000000000000000000000000000000000000000000000000000000000000003200000000000000000000000041034678d6c633d8a95c75e1138a360a28ba15d1

-----Decoded View---------------
Arg [0] : _daoPayments (address): 0xcD4B33051D2332f6a4248d915C38a33a754287d1
Arg [1] : _commission (address): 0xB682Ad0b24ae702B696b2afc71ef9040FD2ccF04
Arg [2] : _updateInterval (uint256): 604800
Arg [3] : _depositDistributorAddress (address): 0xDFc424b01Ea80F0805Df3F6bA4d0160693c781A6
Arg [4] : _priceFeed (address): 0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612
Arg [5] : _upkeepAddress (address): 0x75c0530885F385721fddA23C539AF3701d6183D4
Arg [6] : _keyHash (bytes32): 0x08ba8f62ff6c40a58877a106147661db43bc58dabfb814793847a839aa03367f
Arg [7] : _callbackGasLimit (uint32): 2500000
Arg [8] : _requestConfirmations (uint16): 3
Arg [9] : _numWords (uint16): 21
Arg [10] : _subscriptionId (uint64): 50
Arg [11] : _vrfCoordinatorV2Address (address): 0x41034678D6C633D8a95c75e1138A360a28bA15d1

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000cd4b33051d2332f6a4248d915c38a33a754287d1
Arg [1] : 000000000000000000000000b682ad0b24ae702b696b2afc71ef9040fd2ccf04
Arg [2] : 0000000000000000000000000000000000000000000000000000000000093a80
Arg [3] : 000000000000000000000000dfc424b01ea80f0805df3f6ba4d0160693c781a6
Arg [4] : 000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612
Arg [5] : 00000000000000000000000075c0530885f385721fdda23c539af3701d6183d4
Arg [6] : 08ba8f62ff6c40a58877a106147661db43bc58dabfb814793847a839aa03367f
Arg [7] : 00000000000000000000000000000000000000000000000000000000002625a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [11] : 00000000000000000000000041034678d6c633d8a95c75e1138a360a28ba15d1


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.