Contract 0x760c1F07B2cf047C0A3d7685A4bFc00a30C20f8A

Contract Overview

Balance:
0 MATIC
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x5b523b82b1bca99b7db08d74934bbe200a43bfcc6ff7c997299fc028989d64d9Wager266767532022-06-09 18:54:51288 days 18 hrs ago0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b1 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.00063472786 2.500001419
0x1d2c89652546f5a86849ef11f00f670aa5b9aa35e8963a6db1187ab0eb6898b6Wager266767442022-06-09 18:54:06288 days 18 hrs ago0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b1 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000634728206 2.500002782
0x4a02c85b9a7cd0f8ac27ab44498fc1827e9658114b3a9a54404ab76ac9db236bWager266767252022-06-09 18:52:30288 days 18 hrs ago0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b1 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.1 MATIC0.000634760044 2.500010022
0x73b74f5e3abe2a73cf26b6b7c701e5869157b5349db5a8aee4004c5305f2d025Wager266766942022-06-09 18:49:55288 days 18 hrs ago0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b1 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.1 MATIC0.000677513172 2.500020931
0x12f97e315f0deb9e9b63fb5dd55025f201389bd1c422be6765371636e4df8c2cWager266331082022-06-06 22:22:19291 days 14 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000507782003 2.000000012
0x86e8383ab6956f57b7a93391df20fb379c1166049f2c6c41acaa78fdbb33b6e9Wager266202022022-06-05 23:44:21292 days 13 hrs ago0x032248754b1772504648a568226818737bea7847 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000634727502 2.50000001
0x1d2abd183b93af124b94d0d7c3ff2886c4c8853423d810ccf2a1417627fc87ddWager266201912022-06-05 23:42:31292 days 13 hrs ago0x032248754b1772504648a568226818737bea7847 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000634727502 2.500000011
0x3590c80f68f2a6aca51b84d1c7a31b21dd68faa9011abbb3567913eb53eff84bWager266201822022-06-05 23:41:01292 days 13 hrs ago0x032248754b1772504648a568226818737bea7847 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000634727502 2.500000011
0x6cfc44eb609338e3590eebedb097298da05ada1a02ab6e3c1be0caca556eed58Wager266201682022-06-05 23:38:41292 days 13 hrs ago0x032248754b1772504648a568226818737bea7847 IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.04 MATIC0.000677477502 2.500000011
0x0d5581bb98c63ef9498d331a782df9e37d96d0937ba628b1d19f02d395e48c85Wager265859712022-06-03 15:43:16294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.000796360002 2.500000008
0xf340ac2866661a40ae451f479c76d4e61e5eee83b77cf6ec96dbd9a29cdc6a0fWager265859472022-06-03 15:41:16294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0.909 MATIC0.000677537502 2.500000009
0x02976eb0ed102f35ea0b95b5af02a636875be748b39fd7cbfcbbcea48357ad05Set Token Min Be...265859222022-06-03 15:39:11294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.000071766 1.500000009
0x002aabc55851baf8a6313dee7d815af2e10125c8e59d9cd531c59f5bc027cca1Set House Edge A...265859222022-06-03 15:39:11294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.000112341 1.500000009
0x6d8298a16d4e52df4cf569e10a7a107aaf0597c7e99102781a58fcc319158147Set Token Min Be...265859082022-06-03 15:38:00294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.000051213197 1.076359768
0xf16da022d602951be64f4e03a2b09d6c6c6e1425c1d9cae9ba27125da3ff4d62Set House Edge A...265859082022-06-03 15:38:00294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.000081444914 1.076359768
0x9b97af4724f63efbd07d2cde4e47f395602d23b32a1d665cada86d3ded5efb6eSet Chainlink Co...265858262022-06-03 15:28:44294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0 MATIC0.0001034925 1.500000013
0xa39dedbbd53e139a6b147c139eaf483024a355b8ac6cd176b5100a3df67d75ac0x60c06040265858252022-06-03 15:28:34294 days 21 hrs ago0x2c305888a456e7004663bc12a74395e637eabcbc IN  Create: Dice0 MATIC0.00472065004 1.500000013
[ Download CSV Export 
Latest 17 internal transactions
Parent Txn Hash Block From To Value
0x8005a6d23eb876c0a162ceb566398b9848732899234ac00a765105e5f7b6fb60266767582022-06-09 18:55:16288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0x8005a6d23eb876c0a162ceb566398b9848732899234ac00a765105e5f7b6fb60266767582022-06-09 18:55:16288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b10.0388 MATIC
0x271a5d942905d3908eb8e6e70962eb20a6a836ab9e80d34e4a9e1b05fedea519266767492022-06-09 18:54:31288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.04 MATIC
0xad60f8878f72b6481dbcf2bea920f7d29768902f9dacdb6f7aaa7612d8cbcb92266767302022-06-09 18:52:55288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.003 MATIC
0xad60f8878f72b6481dbcf2bea920f7d29768902f9dacdb6f7aaa7612d8cbcb92266767302022-06-09 18:52:55288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0xaf9d7cf8fb7d4af4c172f2debf0cd8ea9e5a60b10.097 MATIC
0x1702dbf960d7ac11ebdcb22afdf6de6630799052605d737d30b6c72e4f35b8e2266766992022-06-09 18:50:20288 days 18 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.1 MATIC
0x80e34e6ef3e481c5b1ee0645f89d892cfee2efbf1d14ffa3819abfb1150a56d7266331142022-06-06 22:22:49291 days 14 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0x80e34e6ef3e481c5b1ee0645f89d892cfee2efbf1d14ffa3819abfb1150a56d7266331142022-06-06 22:22:49291 days 14 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0x2c305888a456e7004663bc12a74395e637eabcbc0.0388 MATIC
0x425c34fda375a3e8a4754f0a99ceabfddacb6133dff81d43d22daf35b1ada7e7266202062022-06-05 23:45:01292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0x425c34fda375a3e8a4754f0a99ceabfddacb6133dff81d43d22daf35b1ada7e7266202062022-06-05 23:45:01292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0x032248754b1772504648a568226818737bea78470.0388 MATIC
0xcd5c710ee319583f15434a7ddc490bf0f054623a5a66de34ff105fdc08163769266201952022-06-05 23:43:11292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0xcd5c710ee319583f15434a7ddc490bf0f054623a5a66de34ff105fdc08163769266201952022-06-05 23:43:11292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0x032248754b1772504648a568226818737bea78470.0388 MATIC
0x641d3d82740f242cf2ca5bbfbf9fa31fd0ece6f5279f9f9f676917686cb715db266201862022-06-05 23:41:41292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0x641d3d82740f242cf2ca5bbfbf9fa31fd0ece6f5279f9f9f676917686cb715db266201862022-06-05 23:41:41292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0x032248754b1772504648a568226818737bea78470.0388 MATIC
0xea593f895019c036ab20c69363d3ef4c95fde2f7913fcab102e8e6ea0e80fbd5266201722022-06-05 23:39:21292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.0012 MATIC
0xea593f895019c036ab20c69363d3ef4c95fde2f7913fcab102e8e6ea0e80fbd5266201722022-06-05 23:39:21292 days 13 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a0x032248754b1772504648a568226818737bea78470.0388 MATIC
0x18c041fae9d86b92a00393231f19db29e40afbc5a18c6de1c558e7ca42673405265859522022-06-03 15:41:41294 days 21 hrs ago 0x760c1f07b2cf047c0a3d7685a4bfc00a30c20f8a 0x887a3c3d25eb56953124aede7106c65c8b91720c0.909 MATIC
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Dice

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 8000 runs

Other Settings:
default evmVersion, MIT license
File 1 of 13 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/** ****************************************************************************
 * @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 2 of 13 : 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;
}

File 3 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 4 of 13 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 9 of 13 : Multicall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

import "./Address.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
abstract contract Multicall {
    /**
     * @dev Receives and executes a batch of function calls on this contract.
     */
    function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            results[i] = Address.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

File 10 of 13 : IBank.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

/// @notice Minimal interface for Bank.
/// @author Romuald Hog.
interface IBank {
    /// @notice Gets the token's allow status used on the games smart contracts.
    /// @param token Address of the token.
    /// @return Whether the token is enabled for bets.
    function isAllowedToken(address token) external view returns (bool);

    /// @notice Payouts a winning bet, and allocate the house edge fee.
    /// @param user Address of the gamer.
    /// @param token Address of the token.
    /// @param profit Number of tokens to be sent to the gamer.
    /// @param fees Bet amount and bet profit fees amount.
    function payout(
        address payable user,
        address token,
        uint256 profit,
        uint256 fees
    ) external payable;

    /// @notice Accounts a loss bet, and manage the balance overflow.
    /// @dev In case of an ERC20, the bet amount should be transfered prior to this tx.
    /// @dev In case of the gas token, the bet amount is sent along with this tx.
    /// @param tokenAddress Address of the token.
    /// @param amount Loss bet amount.
    function cashIn(address tokenAddress, uint256 amount) external payable;

    /// @notice Calculates the max bet amount based on the token balance, the balance risk, and the game multiplier.
    /// @param token Address of the token.
    /// @param multiplier The bet amount leverage determines the user's profit amount. 10000 = 100% = no profit.
    /// @return Maximum bet amount for the token.
    /// @dev The multiplier should be at least 10000.
    function getMaxBetAmount(address token, uint256 multiplier)
        external
        view
        returns (uint256);

    /// @notice Harvests tokens dividends.
    /// @return tokens The list of tokens addresses.
    /// @return amounts The list of tokens' amounts harvested.
    function harvestDividends()
        external
        returns (address[] memory tokens, uint256[] memory amounts);

    /// @notice Get the available tokens dividends amounts.
    /// @return tokens The list of tokens addresses.
    /// @return amounts The list of tokens' amounts harvested.
    function getDividends()
        external
        view
        returns (address[] memory tokens, uint256[] memory amounts);
}

File 11 of 13 : IReferral.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

/// @notice Referral interface
/// @author Romuald Hog.
interface IReferral {
    /// @notice Adds an address as referrer.
    /// @param user The address of the user.
    /// @param referrer The address would set as referrer of user.
    function addReferrer(address user, address referrer) external;

    /// @notice Updates referrer's last active timestamp.
    /// @param user The address would like to update active time.
    function updateReferrerActivity(address user) external;

    /// @notice Calculates and allocate referrer(s) credits to uplines.
    /// @param user Address of the gamer to find referrer(s).
    /// @param token The token to allocate.
    /// @param amount The number of tokens allocated for referrer(s).
    function payReferral(
        address user,
        address token,
        uint256 amount
    ) external returns (uint256);

    /// @notice Utils function for check whether an address has the referrer.
    /// @param user The address of the user.
    /// @return Whether user has a referrer.
    function hasReferrer(address user) external view returns (bool);
}

File 12 of 13 : Dice.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

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

/// @title BetSwirl's Dice game
/// @notice The game is played with a 100 sided dice. The game's goal is to guess whether the lucky number will be above your chosen number.
/// @author Romuald Hog (based on Yakitori's Dice)
/// @dev The cap is the dice number chosen by the gamer.
contract Dice is Game {
    /// @notice Dice bet information struct.
    /// @param bet The Bet struct information.
    /// @param face The chosen dice number.
    /// @dev Used to package bet information for the front-end.
    struct DiceBet {
        Bet bet;
        uint8 cap;
    }

    /// @notice Maps bets IDs to chosen dice number.
    mapping(uint256 => uint8) public diceBets;

    /// @notice Maximum dice number that a gamer can choose.
    /// @dev Dice cap 99 gives 1% chance.
    uint8 public constant MAX_CAP = 99;

    /// @notice Maps the tokens addresses to the minimum cap
    /// @dev This is used to prevent a user from setting defavorable bet
    mapping(address => uint8) public tokensMinCap;

    /// @notice Emitted after a bet is placed.
    /// @param id The bet ID.
    /// @param user Address of the gamer.
    /// @param token Address of the token.
    /// @param cap The chosen dice number.
    event PlaceBet(
        uint256 id,
        address indexed user,
        address indexed token,
        uint8 cap
    );

    /// @notice Emitted after a bet is rolled.
    /// @param id The bet ID.
    /// @param user Address of the gamer.
    /// @param token Address of the token.
    /// @param amount The bet amount.
    /// @param cap The chosen dice number.
    /// @param rolled The rolled dice number.
    /// @param payout The payout amount.
    event Roll(
        uint256 id,
        address indexed user,
        address indexed token,
        uint256 amount,
        uint8 cap,
        uint8 rolled,
        uint256 payout
    );

    /// @notice Emitted after the minimum cap is set.
    /// @param token Address of the token.
    /// @param minCap The new minimum cap.
    event SetMinCap(address indexed token, uint256 minCap);

    /// @notice Provided cap is under the minimum.
    /// @param cap The cap chosen by user.
    /// @param minCap is the minimum cap defined based on the house edge.
    /// @param maxCap is the maximum cap defined.
    error CapNotInRange(uint8 cap, uint8 minCap, uint8 maxCap);

    /// @notice Initialize the game base contract.
    /// @param bankAddress The address of the bank.
    /// @param referralProgramAddress The address of the Referral program.
    /// @param chainlinkCoordinatorAddress Address of the Chainlink VRF Coordinator.
    constructor(
        address bankAddress,
        address referralProgramAddress,
        address chainlinkCoordinatorAddress
    )
        Game(
            bankAddress,
            referralProgramAddress,
            chainlinkCoordinatorAddress,
            1
        )
    {}

    /// @notice Sets the game house edge rate for a specific token, and the minimum cap to prevent defavorable bets.
    /// @param token Address of the token.
    /// @param _houseEdge House edge rate.
    function setHouseEdgeAndMinCap(address token, uint16 _houseEdge)
        external
        onlyOwner
    {
        _setHouseEdge(token, _houseEdge);

        uint8 oldMinCap = tokensMinCap[token];
        uint8 newMinCap;
        uint8 maxCap = MAX_CAP;
        uint256 amount = 10000;
        for (uint8 cap = 1; cap < maxCap; cap++) {
            uint256 payout = getPayout(amount, cap);
            uint256 fees = _getFees(token, payout);
            if (amount / (payout - fees) < 1) {
                newMinCap = tokensMinCap[token] = cap;
                break;
            }
        }
        if (oldMinCap != newMinCap) {
            emit SetMinCap(token, newMinCap);
        }
    }

    /// @notice Creates a new bet and stores the chosen dice number.
    /// @param cap The chosen dice number.
    /// @param token Address of the token.
    /// @param tokenAmount The number of tokens bet.
    /// @param referrer Address of the referrer.
    function wager(
        uint8 cap,
        address token,
        uint256 tokenAmount,
        address referrer
    ) external payable whenNotPaused {
        if (cap < tokensMinCap[token] || cap > MAX_CAP) {
            revert CapNotInRange(cap, tokensMinCap[token], MAX_CAP);
        }

        Bet memory bet = _newBet(
            token,
            tokenAmount,
            getPayout(10000, cap),
            referrer
        );
        diceBets[bet.id] = cap;

        emit PlaceBet(bet.id, bet.user, bet.token, cap);
    }

    /// @notice Resolves the bet using the Chainlink randomness.
    /// @param id The bet ID.
    /// @param randomWords Random words list. Contains only one for this game.
    // solhint-disable-next-line private-vars-leading-underscore
    function fulfillRandomWords(uint256 id, uint256[] memory randomWords)
        internal
        override
    {
        uint8 cap = diceBets[id];
        Bet storage bet = bets[id];

        uint256 rolled = (randomWords[0] % 100) + 1;

        uint256 payout = _resolveBet(
            bet,
            rolled > cap,
            getPayout(bet.amount, cap)
        );

        emit Roll(
            bet.id,
            bet.user,
            bet.token,
            bet.amount,
            cap,
            uint8(rolled),
            payout
        );
    }

    /// @notice Gets the list of the last user bets.
    /// @param user Address of the gamer.
    /// @param dataLength The amount of bets to return.
    /// @return A list of Dice bet.
    function getLastUserBets(address user, uint256 dataLength)
        external
        view
        returns (DiceBet[] memory)
    {
        Bet[] memory lastBets = _getLastUserBets(user, dataLength);
        DiceBet[] memory lastDiceBets = new DiceBet[](lastBets.length);
        for (uint256 i; i < lastBets.length; i++) {
            lastDiceBets[i] = DiceBet(lastBets[i], diceBets[lastBets[i].id]);
        }
        return lastDiceBets;
    }

    /// @notice Calculates the target payout amount.
    /// @param betAmount Bet amount.
    /// @param cap The chosen dice number.
    /// @return The target payout amount.
    function getPayout(uint256 betAmount, uint8 cap)
        public
        pure
        returns (uint256)
    {
        return (betAmount * 100) / (100 - cap);
    }
}

File 13 of 13 : Game.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Multicall.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";

import {IBank} from "../bank/IBank.sol";
import {IReferral} from "../bank/IReferral.sol";

// import "hardhat/console.sol";

/// @title Game base contract
/// @author Romuald Hog
/// @notice This should be parent contract of each games.
/// It defines all the games common functions and state variables.
/// @dev All rates are in basis point. Chainlink VRF v2 is used.
abstract contract Game is Ownable, Pausable, Multicall, VRFConsumerBaseV2 {
    using SafeERC20 for IERC20;

    /// @notice Bet information struct.
    /// @param resolved Whether the bet has been resolved.
    /// @param user Address of the gamer.
    /// @param token Address of the token.
    /// @param id Bet ID generated by Chainlink VRF.
    /// @param amount The bet amount.
    /// @param blockNumber Block number of the bet used to refund in case Chainlink's callback fail.
    struct Bet {
        bool resolved;
        address payable user;
        address token;
        uint256 id;
        uint256 amount;
        uint256 blockNumber;
    }

    /// @notice Chainlink VRF configuration struct.
    /// @param subId Subscription ID.
    /// @param callbackGasLimit How much gas you would like in your callback to do work with the random words provided.
    /// @param requestConfirmations How many confirmations the Chainlink node should wait before responding.
    /// @param keyHash Hash of the public key used to verify the VRF proof.
    struct ChainlinkConfig {
        uint64 subId;
        uint32 callbackGasLimit;
        uint16 requestConfirmations;
        bytes32 keyHash;
    }

    /// @notice Chainlink VRF configuration state.
    ChainlinkConfig public chainlinkConfig;

    /// @notice Reference to the VRFCoordinatorV2 deployed contract.
    VRFCoordinatorV2Interface public chainlinkCoordinator;

    /// @notice How many random words is needed to resolve a game's bet.
    uint16 private immutable _numRandomWords;

    /// @notice Maps bets IDs to Bet information.
    mapping(uint256 => Bet) public bets;

    /// @notice Maps users addresses to bets IDs
    mapping(address => uint256[]) internal _userBets;

    /// @notice Maps tokens addresses to house edge rate.
    mapping(address => uint16) public tokensHouseEdges;

    /// @notice Maps tokens addresses to minimum bet amount.
    mapping(address => uint256) public tokensMinBetAmount;

    /// @notice The bank that manage to payout a won bet and collect a loss bet, and to interact with Referral program.
    IBank public bank;

    /// @notice Referral program contract.
    IReferral public referralProgram;

    /// @notice Emitted after the bank is set.
    /// @param bank Address of the bank contract.
    event SetBank(address bank);

    /// @notice Emitted after the referral program is set.
    /// @param referralProgram The referral program address.
    event SetReferralProgram(address referralProgram);

    /// @notice Emitted after the house edge is set for a token.
    /// @param token Address of the token.
    /// @param houseEdge House edge rate.
    event SetHouseEdge(address indexed token, uint16 houseEdge);

    /// @notice Emitted after the minimum bet amount is set for a token.
    /// @param token Address of the token.
    /// @param minBetAmount Minimum bet amount.
    event SetTokenMinBetAmount(address indexed token, uint256 minBetAmount);

    /// @notice Emitted after the bet amount transfer to the user failed.
    /// @param id The bet ID.
    /// @param amount Number of tokens failed to transfer.
    /// @param reason The reason provided by the external call.
    event BetAmountTransferFail(uint256 id, uint256 amount, string reason);

    /// @notice Emitted after the bet amount fee transfer to the bank failed.
    /// @param id The bet ID.
    /// @param amount Number of tokens failed to transfer.
    /// @param reason The reason provided by the external call.
    event BetAmountFeeTransferFail(uint256 id, uint256 amount, string reason);

    /// @notice Emitted after the bet profit transfer to the user failed.
    /// @param id The bet ID.
    /// @param amount Number of tokens failed to transfer.
    /// @param reason The reason provided by the external call.
    event BetProfitTransferFail(uint256 id, uint256 amount, string reason);

    /// @notice Emitted after the bet amount transfer to the bank failed.
    /// @param id The bet ID.
    /// @param amount Number of tokens failed to transfer.
    /// @param reason The reason provided by the external call.
    event BankCashInFail(uint256 id, uint256 amount, string reason);

    /// @notice Emitted after the bet amount ERC20 transfer to the bank failed.
    /// @param id The bet ID.
    /// @param amount Number of tokens failed to transfer.
    /// @param reason The reason provided by the external call.
    event BankTransferFail(uint256 id, uint256 amount, string reason);

    /// @notice Emitted after the bet amount is transfered to the user.
    /// @param id The bet ID.
    /// @param user Address of the gamer.
    /// @param amount Number of tokens refunded.
    event BetRefunded(uint256 id, address user, uint256 amount);

    /// @notice Insufficient bet amount.
    /// @param token Bet's token address.
    /// @param value Bet amount.
    error UnderMinBetAmount(address token, uint256 value);

    /// @notice Bet provided doesn't exist or was already resolved.
    /// @param id Bet ID.
    error NotPendingBet(uint256 id);

    /// @notice Bet isn't resolved yet.
    /// @param id Bet ID.
    error NotFulfilled(uint256 id);

    /// @notice House edge is capped at 4%.
    /// @param houseEdge House edge rate.
    error ExcessiveHouseEdge(uint16 houseEdge);

    /// @notice Token is not allowed.
    /// @param token Bet's token address.
    error ForbiddenToken(address token);

    /// @notice Initialize contract's state variables and VRF Consumer.
    /// @param bankAddress The address of the bank.
    /// @param chainlinkCoordinatorAddress Address of the Chainlink VRF Coordinator.
    /// @param numRandomWords How many random words is needed to resolve a game's bet.
    constructor(
        address bankAddress,
        address referralProgramAddress,
        address chainlinkCoordinatorAddress,
        uint16 numRandomWords
    ) VRFConsumerBaseV2(chainlinkCoordinatorAddress) {
        setBank(IBank(bankAddress));
        setReferralProgram(IReferral(referralProgramAddress));
        chainlinkCoordinator = VRFCoordinatorV2Interface(
            chainlinkCoordinatorAddress
        );
        _numRandomWords = numRandomWords;
    }

    /// @notice Sets the game house edge rate for a specific token.
    /// @param token Address of the token.
    /// @param houseEdge House edge rate.
    /// @dev The house edge rate couldn't exceed 4%.
    function _setHouseEdge(address token, uint16 houseEdge) internal onlyOwner {
        if (houseEdge > 400) {
            revert ExcessiveHouseEdge(houseEdge);
        }
        tokensHouseEdges[token] = houseEdge;
        emit SetHouseEdge(token, houseEdge);
    }

    /// @notice Creates a new bet, request randomness to Chainlink, add the referrer,
    /// transfer the ERC20 tokens to the contract or refund the bet amount overflow if the bet amount exceed the maxBetAmount.
    /// @param token Address of the token.
    /// @param tokenAmount The number of tokens bet.
    /// @param multiplier The bet amount leverage determines the user's profit amount. 10000 = 100% = no profit.
    /// @param referrer Address of the referrer.
    /// @return A new Bet struct information.
    function _newBet(
        address token,
        uint256 tokenAmount,
        uint256 multiplier,
        address referrer
    ) internal whenNotPaused returns (Bet memory) {
        if (bank.isAllowedToken(token) == false) {
            revert ForbiddenToken(token);
        }

        bool isGasToken = token == address(0);
        uint256 betAmount = isGasToken ? msg.value : tokenAmount;

        if (betAmount < 10000 wei || betAmount < tokensMinBetAmount[token]) {
            revert UnderMinBetAmount(token, betAmount);
        }
        uint256 maxBetAmount = bank.getMaxBetAmount(token, multiplier);
        uint256 betAmountOverflow;
        if (betAmount > maxBetAmount) {
            betAmountOverflow = betAmount - maxBetAmount;
            betAmount = maxBetAmount;
        }

        // Create bet
        address user = msg.sender;
        uint256 id = chainlinkCoordinator.requestRandomWords(
            chainlinkConfig.keyHash,
            chainlinkConfig.subId,
            chainlinkConfig.requestConfirmations,
            chainlinkConfig.callbackGasLimit,
            _numRandomWords
        );
        Bet memory newBet = Bet(
            false,
            payable(user),
            token,
            id,
            betAmount,
            block.number
        );
        _userBets[user].push(id);
        bets[id] = newBet;

        // Add referrer
        if (
            referrer != address(0) &&
            _userBets[user].length == 1 &&
            !referralProgram.hasReferrer(user)
        ) {
            referralProgram.addReferrer(user, referrer);
        } else {
            referralProgram.updateReferrerActivity(user);
        }

        // If ERC20, transfer the tokens
        if (!isGasToken) {
            IERC20(token).safeTransferFrom(user, address(this), betAmount);
        } else if (betAmountOverflow != 0) {
            Address.sendValue(payable(user), betAmountOverflow);
        }

        return newBet;
    }

    /// @notice Resolves the bet based on the game child contract result.
    /// In case bet is won, the bet amount minus the house edge is transfered to user from the game contract, and the profit is transfered to the user from the Bank.
    /// In case bet is lost, the bet amount is transfered to the Bank from the game contract.
    /// @param bet The Bet struct information.
    /// @param wins Whether the bet is winning.
    /// @param payout What should be sent to the user in case of a won bet. Payout = bet amount + profit amount.
    /// @return The payout amount.
    /// @dev Should not revert as it resolves the bet with the randomness.
    function _resolveBet(
        Bet storage bet,
        bool wins,
        uint256 payout
    ) internal returns (uint256) {
        address payable user = bet.user;
        if (bet.resolved == true || user == address(0)) {
            revert NotPendingBet(bet.id);
        }
        address token = bet.token;
        uint256 betAmount = bet.amount;
        bool isGasToken = bet.token == address(0);

        bet.resolved = true;

        // Check for the result
        if (wins) {
            uint256 profit = payout - betAmount;
            uint256 betAmountFee = _getFees(token, betAmount);
            uint256 profitFee = _getFees(token, profit);
            uint256 fee = betAmountFee + profitFee;

            payout -= fee;

            uint256 betAmountPayout = betAmount - betAmountFee;
            uint256 profitPayout = profit - profitFee;
            // Transfer the bet amount from the contract
            if (isGasToken) {
                (bool success, ) = user.call{value: betAmountPayout}("");
                if (!success) {
                    emit BetAmountTransferFail(
                        bet.id,
                        betAmount,
                        "Missing gas token funds"
                    );
                }
            } else {
                try
                    IERC20(token).transfer(user, betAmountPayout)
                {} catch Error(string memory reason) {
                    emit BetAmountTransferFail(bet.id, betAmountPayout, reason);
                }
                try
                    IERC20(token).transfer(address(bank), betAmountFee)
                {} catch Error(string memory reason) {
                    emit BetAmountFeeTransferFail(bet.id, betAmountFee, reason);
                }
            }

            // Transfer the payout from the bank
            try
                bank.payout{value: isGasToken ? betAmountFee : 0}(
                    user,
                    token,
                    profitPayout,
                    fee
                )
            {} catch Error(string memory reason) {
                emit BetProfitTransferFail(bet.id, profitPayout, reason);
            }
        } else {
            payout = 0;
            if (!isGasToken) {
                try
                    IERC20(token).transfer(address(bank), betAmount)
                {} catch Error(string memory reason) {
                    emit BankTransferFail(bet.id, betAmount, reason);
                }
            }
            try
                bank.cashIn{value: isGasToken ? betAmount : 0}(token, betAmount)
            {} catch Error(string memory reason) {
                emit BankCashInFail(bet.id, betAmount, reason);
            }
        }

        return payout;
    }

    /// @notice Gets the list of the last user bets.
    /// @param user Address of the gamer.
    /// @param dataLength The amount of bets to return.
    /// @return A list of Bet.
    function _getLastUserBets(address user, uint256 dataLength)
        internal
        view
        returns (Bet[] memory)
    {
        uint256[] memory userBetsIds = _userBets[user];
        uint256 betsLength = userBetsIds.length;

        if (betsLength < dataLength) {
            dataLength = betsLength;
        }

        Bet[] memory userBets = new Bet[](dataLength);
        if (dataLength > 0) {
            uint256 userBetsIndex = 0;
            for (uint256 i = betsLength; i > betsLength - dataLength; i--) {
                userBets[userBetsIndex] = bets[userBetsIds[i - 1]];
                userBetsIndex++;
            }
        }

        return userBets;
    }

    /// @notice Calculates the amount's fee based on the house edge.
    /// @param token Address of the token.
    /// @param amount From which the fee amount will be calculated.
    /// @return The fee amount.
    function _getFees(address token, uint256 amount)
        internal
        view
        returns (uint256)
    {
        return (tokensHouseEdges[token] * amount) / 10000;
    }

    /// @notice Sets the minimum bet amount for a specific token.
    /// @param token Address of the token.
    /// @param tokenMinBetAmount Minimum bet amount.
    function setTokenMinBetAmount(address token, uint256 tokenMinBetAmount)
        external
        onlyOwner
    {
        tokensMinBetAmount[token] = tokenMinBetAmount;
        emit SetTokenMinBetAmount(token, tokenMinBetAmount);
    }

    /// @notice Pauses the contract to disable new bets.
    function pause() external onlyOwner {
        if (paused()) {
            _unpause();
        } else {
            _pause();
        }
    }

    /// @notice Sets the Chainlink VRF V2 configuration.
    /// @param subId Subscription ID.
    /// @param callbackGasLimit How much gas you would like in your callback to do work with the random words provided.
    /// @param requestConfirmations How many confirmations the Chainlink node should wait before responding.
    /// @param keyHash Hash of the public key used to verify the VRF proof.
    function setChainlinkConfig(
        uint64 subId,
        uint32 callbackGasLimit,
        uint16 requestConfirmations,
        bytes32 keyHash
    ) external onlyOwner {
        chainlinkConfig.subId = subId;
        chainlinkConfig.callbackGasLimit = callbackGasLimit;
        chainlinkConfig.requestConfirmations = requestConfirmations;
        chainlinkConfig.keyHash = keyHash;
    }

    /// @notice Withdraws remaining tokens.
    /// @param token Address of the token.
    /// @param amount Number of tokens.
    /// @dev Useful in case some transfers failed during the bet resolution callback.
    function inCaseTokensGetStuck(address token, uint256 amount)
        external
        onlyOwner
    {
        if (token == address(0)) {
            Address.sendValue(payable(msg.sender), amount);
        } else {
            IERC20(token).safeTransfer(msg.sender, amount);
        }
    }

    /// @notice Refunds the bet to the user if the Chainlink VRF callback failed.
    /// @param id The Bet ID.
    function refundBet(uint256 id) external {
        Bet storage bet = bets[id];
        if (bet.resolved == true) {
            revert NotPendingBet(id);
        } else if (block.number < bet.blockNumber + 30) {
            revert NotFulfilled(id);
        }

        bet.resolved = true;

        if (bet.token == address(0)) {
            Address.sendValue(bet.user, bet.amount);
        } else {
            IERC20(bet.token).safeTransfer(bet.user, bet.amount);
        }

        emit BetRefunded(id, bet.user, bet.amount);
    }

    /// @notice Sets the Bank contract.
    /// @param _bank Address of the Bank contract.
    function setBank(IBank _bank) public onlyOwner {
        bank = _bank;
        emit SetBank(address(_bank));
    }

    /// @notice Sets the new referral program.
    /// @param _referralProgram The referral program address.
    function setReferralProgram(IReferral _referralProgram) public onlyOwner {
        referralProgram = _referralProgram;
        emit SetReferralProgram(address(referralProgram));
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"bankAddress","type":"address"},{"internalType":"address","name":"referralProgramAddress","type":"address"},{"internalType":"address","name":"chainlinkCoordinatorAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint8","name":"cap","type":"uint8"},{"internalType":"uint8","name":"minCap","type":"uint8"},{"internalType":"uint8","name":"maxCap","type":"uint8"}],"name":"CapNotInRange","type":"error"},{"inputs":[{"internalType":"uint16","name":"houseEdge","type":"uint16"}],"name":"ExcessiveHouseEdge","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"ForbiddenToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"NotFulfilled","type":"error"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"NotPendingBet","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"UnderMinBetAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BankCashInFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BankTransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BetAmountFeeTransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BetAmountTransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BetProfitTransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetRefunded","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint8","name":"cap","type":"uint8"}],"name":"PlaceBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"cap","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"rolled","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"Roll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bank","type":"address"}],"name":"SetBank","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint16","name":"houseEdge","type":"uint16"}],"name":"SetHouseEdge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"minCap","type":"uint256"}],"name":"SetMinCap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"referralProgram","type":"address"}],"name":"SetReferralProgram","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"minBetAmount","type":"uint256"}],"name":"SetTokenMinBetAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_CAP","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bank","outputs":[{"internalType":"contract IBank","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bets","outputs":[{"internalType":"bool","name":"resolved","type":"bool"},{"internalType":"address payable","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainlinkConfig","outputs":[{"internalType":"uint64","name":"subId","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainlinkCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"diceBets","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"dataLength","type":"uint256"}],"name":"getLastUserBets","outputs":[{"components":[{"components":[{"internalType":"bool","name":"resolved","type":"bool"},{"internalType":"address payable","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"internalType":"struct Game.Bet","name":"bet","type":"tuple"},{"internalType":"uint8","name":"cap","type":"uint8"}],"internalType":"struct Dice.DiceBet[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"betAmount","type":"uint256"},{"internalType":"uint8","name":"cap","type":"uint8"}],"name":"getPayout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"referralProgram","outputs":[{"internalType":"contract IReferral","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"refundBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IBank","name":"_bank","type":"address"}],"name":"setBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"subId","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"setChainlinkConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint16","name":"_houseEdge","type":"uint16"}],"name":"setHouseEdgeAndMinCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReferral","name":"_referralProgram","type":"address"}],"name":"setReferralProgram","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenMinBetAmount","type":"uint256"}],"name":"setTokenMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokensHouseEdges","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokensMinBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokensMinCap","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"cap","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"wager","outputs":[],"stateMutability":"payable","type":"function"}]

60c06040523480156200001157600080fd5b506040516200393d3803806200393d833981016040819052620000349162000253565b8282826001816200004533620000a8565b6000805460ff60a01b191690556001600160a01b03166080526200006984620000f8565b62000074836200019c565b600380546001600160a01b0319166001600160a01b03939093169290921790915561ffff1660a052506200029d9350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620001475760405162461bcd60e51b815260206004820181905260248201526000805160206200391d83398151915260448201526064015b60405180910390fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f10f5824683d64a0712038f2244e046b174a1cc57fbb8556bfda5ffb261244067906020015b60405180910390a150565b6000546001600160a01b03163314620001e75760405162461bcd60e51b815260206004820181905260248201526000805160206200391d83398151915260448201526064016200013e565b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f678edf136de423322d705b75c3157ecfde496e1ad82aef725aa6deb9d94d4de29060200162000191565b80516001600160a01b03811681146200024e57600080fd5b919050565b6000806000606084860312156200026957600080fd5b620002748462000236565b9250620002846020850162000236565b9150620002946040850162000236565b90509250925092565b60805160a051613653620002ca60003960006117f501526000818161076001526107bb01526136536000f3fe6080604052600436106101ac5760003560e01c806376cdb03b116100ec578063c2fb579f1161008a578063d669e1d411610064578063d669e1d414610614578063e1fdb4b414610629578063e59af73214610649578063f2fde38b1461066957600080fd5b8063c2fb579f146105a7578063c6d758cb146105d4578063cdc42344146105f457600080fd5b806394663405116100c657806394663405146104ff578063a8c026a31461052d578063ac9650d81461054d578063baa299c81461057a57600080fd5b806376cdb03b146104945780638456cb59146104cc5780638da5cb5b146104e157600080fd5b80633e32a3811161015957806358cdb0321161013357806358cdb032146103aa5780635c975abb146103bd578063653792df146103f8578063715018a61461047f57600080fd5b80633e32a3811461033a57806342258eca1461035a5780634297dcbe1461038a57600080fd5b806322af00fa1161018a57806322af00fa1461023c5780633758fabc146102d85780633d32753c1461031a57600080fd5b8063090d23b9146101b15780630fb5b5f2146101d35780631fe543e31461021c575b600080fd5b3480156101bd57600080fd5b506101d16101cc366004612de6565b610689565b005b3480156101df57600080fd5b506102046101ee366004612de6565b60066020526000908152604090205461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561022857600080fd5b506101d1610237366004612e5f565b610755565b34801561024857600080fd5b5061029d610257366004612f12565b60046020819052600091825260409091208054600182015460028301546003840154939094015460ff8316946101009093046001600160a01b0390811694921692919086565b6040805196151587526001600160a01b03958616602088015293909416928501929092526060840152608083015260a082015260c001610213565b3480156102e457600080fd5b506103086102f3366004612de6565b600b6020526000908152604090205460ff1681565b60405160ff9091168152602001610213565b34801561032657600080fd5b506101d1610335366004612f42565b6107f6565b34801561034657600080fd5b506101d1610355366004612de6565b6108e5565b34801561036657600080fd5b50610308610375366004612f12565b600a6020526000908152604090205460ff1681565b34801561039657600080fd5b506101d16103a5366004612fa7565b6109a5565b6101d16103b8366004612fe4565b610a58565b3480156103c957600080fd5b5060005474010000000000000000000000000000000000000000900460ff166040519015158152602001610213565b34801561040457600080fd5b506001546002546104469167ffffffffffffffff81169168010000000000000000820463ffffffff16916c01000000000000000000000000900461ffff169084565b6040805167ffffffffffffffff909516855263ffffffff909316602085015261ffff909116918301919091526060820152608001610213565b34801561048b57600080fd5b506101d1610c13565b3480156104a057600080fd5b506008546104b4906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156104d857600080fd5b506101d1610c79565b3480156104ed57600080fd5b506000546001600160a01b03166104b4565b34801561050b57600080fd5b5061051f61051a366004613035565b610d06565b604051908152602001610213565b34801561053957600080fd5b506101d1610548366004613061565b610d32565b34801561055957600080fd5b5061056d61056836600461308d565b610ebb565b604051610213919061315a565b34801561058657600080fd5b5061051f610595366004612de6565b60076020526000908152604090205481565b3480156105b357600080fd5b506105c76105c2366004612fa7565b610fb0565b60405161021391906131da565b3480156105e057600080fd5b506101d16105ef366004612fa7565b6110fb565b34801561060057600080fd5b506009546104b4906001600160a01b031681565b34801561062057600080fd5b50610308606381565b34801561063557600080fd5b506101d1610644366004612f12565b611181565b34801561065557600080fd5b506003546104b4906001600160a01b031681565b34801561067557600080fd5b506101d1610684366004612de6565b6112fe565b6000546001600160a01b031633146106e85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f10f5824683d64a0712038f2244e046b174a1cc57fbb8556bfda5ffb261244067906020015b60405180910390a150565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107e8576040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044016106df565b6107f282826113e0565b5050565b6000546001600160a01b031633146108505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b6001805461ffff9093166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffff63ffffffff90951668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090941667ffffffffffffffff90961695909517929092179290921692909217909155600255565b6000546001600160a01b0316331461093f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b600980547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383169081179091556040519081527f678edf136de423322d705b75c3157ecfde496e1ad82aef725aa6deb9d94d4de29060200161074a565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b6001600160a01b03821660008181526007602052604090819020839055517f8b4a07860448b613116df3f175c837980eceaca7d1dc5143c46a20ab31ec00f990610a4c9084815260200190565b60405180910390a25050565b60005474010000000000000000000000000000000000000000900460ff1615610ac35760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016106df565b6001600160a01b0383166000908152600b602052604090205460ff9081169085161080610af35750606360ff8516115b15610b59576001600160a01b0383166000908152600b6020526040908190205490517f36bde99100000000000000000000000000000000000000000000000000000000815260ff80871660048301529091166024820152606360448201526064016106df565b6000610b728484610b6c61271089610d06565b856114d8565b6060810180516000908152600a602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff8b16908117909155828501518286015194518451908152928301919091529394506001600160a01b0393841693909216917fe1ba33ec6479bc31d0fd9d1e0d62c36a1b2718e9f03a2a58140b124122c4a444910160405180910390a35050505050565b6000546001600160a01b03163314610c6d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b610c776000611bc6565b565b6000546001600160a01b03163314610cd35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b60005474010000000000000000000000000000000000000000900460ff1615610cfe57610c77611c2e565b610c77611d00565b6000610d1382606461329c565b60ff16610d218460646132bf565b610d2b919061332b565b9392505050565b6000546001600160a01b03163314610d8c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b610d968282611dd2565b6001600160a01b0382166000908152600b602052604081205460ff1690606361271060015b8260ff168160ff161015610e63576000610dd58383610d06565b90506000610de38983611eea565b90506001610df1828461333f565b610dfb908661332b565b1015610e4e5750506001600160a01b0387166000908152600b6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff8316179055925082610e63565b50508080610e5b90613356565b915050610dbb565b508260ff168460ff1614610eb35760405160ff841681526001600160a01b038716907fcd22ec6dc3f4f7e416858ebbb187dbe3f7419f0612bd7092fd189f72ed2d67af9060200160405180910390a25b505050505050565b60608167ffffffffffffffff811115610ed657610ed6612e03565b604051908082528060200260200182016040528015610f0957816020015b6060815260200190600190039081610ef45790505b50905060005b82811015610fa957610f7930858584818110610f2d57610f2d613375565b9050602002810190610f3f91906133a4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611f1692505050565b828281518110610f8b57610f8b613375565b60200260200101819052508080610fa190613410565b915050610f0f565b5092915050565b60606000610fbe8484611f3b565b90506000815167ffffffffffffffff811115610fdc57610fdc612e03565b60405190808252806020026020018201604052801561104d57816020015b60408051610100810182526000918101828152606082018390526080820183905260a0820183905260c0820183905260e0820183905281526020810191909152815260200190600190039081610ffa5790505b50905060005b82518110156110f257604051806040016040528084838151811061107957611079613375565b60200260200101518152602001600a600086858151811061109c5761109c613375565b6020908102919091018101516060015182528101919091526040016000205460ff16905282518390839081106110d4576110d4613375565b602002602001018190525080806110ea90613410565b915050611053565b50949350505050565b6000546001600160a01b031633146111555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b6001600160a01b03821661116d576107f23382612145565b6107f26001600160a01b0383163383612263565b6000818152600460205260409020805460ff1615156001036111d2576040517f1a040cf0000000000000000000000000000000000000000000000000000000008152600481018390526024016106df565b60048101546111e290601e613448565b43101561121e576040517f283bb6b1000000000000000000000000000000000000000000000000000000008152600481018390526024016106df565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558101546001600160a01b031661127d57805460038201546112789161010090046001600160a01b031690612145565b6112a8565b8054600382015460018301546112a8926001600160a01b039182169261010090910490911690612263565b80546003820154604080518581526101009093046001600160a01b031660208401528201527ff22517a5eae9f54be712c3150eca5ba925d233687b223c2ebf89272f12ee08659060600160405180910390a15050565b6000546001600160a01b031633146113585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b6001600160a01b0381166113d45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106df565b6113dd81611bc6565b50565b6000828152600a602090815260408083205460049092528220835160ff9092169290916064908590839061141657611416613375565b60200260200101516114289190613460565b611433906001613448565b90506000611454838560ff16841161144f866003015488610d06565b61230c565b600184015484546002860154600387015460408051928352602083019190915260ff898116838301528716606083015260808201859052519394506001600160a01b0392831693610100909204909216917f326deeefddbbeec0f2c3cabe67c30b881c1328c2208cf3541243d3cb67472249919081900360a00190a3505050505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915260005474010000000000000000000000000000000000000000900460ff16156115755760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016106df565b6008546040517fcbe230c30000000000000000000000000000000000000000000000000000000081526001600160a01b0387811660048301529091169063cbe230c390602401602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc9190613474565b1515600003611642576040517f1e7c09c70000000000000000000000000000000000000000000000000000000081526001600160a01b03861660048201526024016106df565b6001600160a01b0385161560008161165a578561165c565b345b905061271081108061168557506001600160a01b03871660009081526007602052604090205481105b156116ce576040517f8a8802470000000000000000000000000000000000000000000000000000000081526001600160a01b0388166004820152602481018290526044016106df565b6008546040517f278b39de0000000000000000000000000000000000000000000000000000000081526001600160a01b03898116600483015260248201889052600092169063278b39de90604401602060405180830381865afa158015611739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175d9190613496565b905060008183111561177957611773828461333f565b90508192505b6003546002546001546040517f5d3b1d30000000000000000000000000000000000000000000000000000000008152600481019290925267ffffffffffffffff811660248301526c01000000000000000000000000810461ffff90811660448401526801000000000000000090910463ffffffff1660648301527f000000000000000000000000000000000000000000000000000000000000000016608482015233916000916001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af1158015611853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118779190613496565b905060006040518060c00160405280600015158152602001846001600160a01b031681526020018d6001600160a01b0316815260200183815260200187815260200143815250905060056000846001600160a01b03166001600160a01b03168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055806004600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606082015181600201556080820151816003015560a0820151816004015590505060006001600160a01b0316896001600160a01b0316141580156119f557506001600160a01b0383166000908152600560205260409020546001145b8015611a8557506009546040517f18452cd80000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152909116906318452cd890602401602060405180830381865afa158015611a5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a839190613474565b155b15611b0f576009546040517fb94265b80000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528b811660248301529091169063b94265b890604401600060405180830381600087803b158015611af257600080fd5b505af1158015611b06573d6000803e3d6000fd5b50505050611b88565b6009546040517fce5cae920000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301529091169063ce5cae9290602401600060405180830381600087803b158015611b6f57600080fd5b505af1158015611b83573d6000803e3d6000fd5b505050505b86611ba757611ba26001600160a01b038d16843089612a09565b611bb7565b8315611bb757611bb78385612145565b9b9a5050505050505050505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60005474010000000000000000000000000000000000000000900460ff16611c985760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016106df565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60005474010000000000000000000000000000000000000000900460ff1615611d6b5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016106df565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ce33390565b6000546001600160a01b03163314611e2c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106df565b6101908161ffff161115611e72576040517f461e6e3b00000000000000000000000000000000000000000000000000000000815261ffff821660048201526024016106df565b6001600160a01b03821660008181526006602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff861690811790915591519182527f7dfd3ecb8ac83242184c019f85ca408558f2ac0a5a19af6be2a4aee697eac8129101610a4c565b6001600160a01b03821660009081526006602052604081205461271090610d2190849061ffff166132bf565b6060610d2b83836040518060600160405280602781526020016135f760279139612a60565b6001600160a01b0382166000908152600560209081526040808320805482518185028101850190935280835260609493830182828015611f9a57602002820191906000526020600020905b815481526020019060010190808311611f86575b5050835193945050505083811015611fb0578093505b60008467ffffffffffffffff811115611fcb57611fcb612e03565b60405190808252806020026020018201604052801561204957816020015b6040805160c08101825260008082526020808301829052928201819052606082018190526080820181905260a082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909201910181611fe95790505b509050841561213c576000825b612060878561333f565b81111561213957600460008661207760018561333f565b8151811061208757612087613375565b6020908102919091018101518252818101929092526040908101600020815160c081018352815460ff8116151582526001600160a01b0361010090910481169482019490945260018201549093169183019190915260028101546060830152600381015460808301526004015460a0820152835184908490811061210d5761210d613375565b6020026020010181905250818061212390613410565b9250508080612131906134af565b915050612056565b50505b95945050505050565b804710156121955760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106df565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121e2576040519150601f19603f3d011682016040523d82523d6000602084013e6121e7565b606091505b505090508061225e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106df565b505050565b6040516001600160a01b03831660248201526044810182905261225e9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612b54565b82546000906001600160a01b036101008204169060ff1615156001148061233a57506001600160a01b038116155b156123795784600201546040517f1a040cf00000000000000000000000000000000000000000000000000000000081526004016106df91815260200190565b600180860154600387015487547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921787556001600160a01b031690811586156127ff5760006123cb838861333f565b905060006123d98585611eea565b905060006123e78684611eea565b905060006123f58284613448565b9050612401818b61333f565b9950600061240f848861333f565b9050600061241d848761333f565b905086156124fc5760008a6001600160a01b03168360405160006040518083038185875af1925050503d8060008114612472576040519150601f19603f3d011682016040523d82523d6000602084013e612477565b606091505b50509050806124f65760028f015460408051918252602082018b905260609082018190526017908201527f4d697373696e672067617320746f6b656e2066756e647300000000000000000060808201527f2f47628dd4a5df2cb8dcf9bf22dcb68db93b798e9666e48454fdf5c3488c378d9060a0015b60405180910390a15b506126ea565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038b81166004830152602482018490528a169063a9059cbb906044016020604051808303816000875af1925050508015612580575060408051601f3d908101601f1916820190925261257d91810190613474565b60015b6125fc5761258c6134e4565b806308c379a0036125f057506125a0613500565b806125ab57506125f2565b7f2f47628dd4a5df2cb8dcf9bf22dcb68db93b798e9666e48454fdf5c3488c378d8f6002015484836040516125e2939291906135a8565b60405180910390a1506125fe565b505b3d6000803e3d6000fd5b505b6008546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101879052908a169063a9059cbb906044016020604051808303816000875af1925050508015612686575060408051601f3d908101601f1916820190925261268391810190613474565b60015b6126e8576126926134e4565b806308c379a0036125f057506126a6613500565b806126b157506125f2565b7ffa916ddbcce76584ab5323754780c39d03cd75048d5bfb4361e966a270d482528f6002015487836040516124ed939291906135a8565b505b6008546001600160a01b0316631f61502388612707576000612709565b865b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03808f1660048301528d16602482015260448101859052606481018790526084016000604051808303818588803b15801561277657600080fd5b505af193505050508015612788575060015b6127f4576127946134e4565b806308c379a0036125f057506127a8613500565b806127b357506125f2565b7f4faefcbc151a3b06dfca7dd0353fc453e246fee39a129b0dd0f89255b8317a158f6002015483836040516127ea939291906135a8565b60405180910390a1505b5050505050506129fd565b6000955080612902576008546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152602481018490529084169063a9059cbb906044016020604051808303816000875af1925050508015612890575060408051601f3d908101601f1916820190925261288d91810190613474565b60015b6129005761289c6134e4565b806308c379a0036125f057506128b0613500565b806128bb57506125f2565b7f6083085f60af3af3b5f0ac3fc19411dc014dff48425ef2707ebcf7059582e452896002015484836040516128f2939291906135a8565b60405180910390a150612902565b505b6008546001600160a01b0316633138809d8261291f576000612921565b835b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0387166004820152602481018690526044016000604051808303818588803b15801561297f57600080fd5b505af193505050508015612991575060015b6129fd5761299d6134e4565b806308c379a0036125f057506129b1613500565b806129bc57506125f2565b7fda6ed7532ab456201ccb34e59035ea00254ed76e71e7d47d04b4287b302153a8896002015484836040516129f3939291906135a8565b60405180910390a1505b50939695505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052612a5a9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016122a8565b50505050565b60606001600160a01b0384163b612adf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016106df565b600080856001600160a01b031685604051612afa91906135c7565b600060405180830381855af49150503d8060008114612b35576040519150601f19603f3d011682016040523d82523d6000602084013e612b3a565b606091505b5091509150612b4a828286612c39565b9695505050505050565b6000612ba9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c729092919063ffffffff16565b80519091501561225e5780806020019051810190612bc79190613474565b61225e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106df565b60608315612c48575081610d2b565b825115612c585782518084602001fd5b8160405162461bcd60e51b81526004016106df91906135e3565b6060612c818484600085612c89565b949350505050565b606082471015612d015760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106df565b6001600160a01b0385163b612d585760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b600080866001600160a01b03168587604051612d7491906135c7565b60006040518083038185875af1925050503d8060008114612db1576040519150601f19603f3d011682016040523d82523d6000602084013e612db6565b606091505b5091509150612dc6828286612c39565b979650505050505050565b6001600160a01b03811681146113dd57600080fd5b600060208284031215612df857600080fd5b8135610d2b81612dd1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715612e5857612e58612e03565b6040525050565b60008060408385031215612e7257600080fd5b8235915060208084013567ffffffffffffffff80821115612e9257600080fd5b818601915086601f830112612ea657600080fd5b813581811115612eb857612eb8612e03565b8060051b9150604051612ecd85840182612e32565b81815291830184019184810189841115612ee657600080fd5b938501935b83851015612f025784358152938501938501612eeb565b5080955050505050509250929050565b600060208284031215612f2457600080fd5b5035919050565b803561ffff81168114612f3d57600080fd5b919050565b60008060008060808587031215612f5857600080fd5b843567ffffffffffffffff81168114612f7057600080fd5b9350602085013563ffffffff81168114612f8957600080fd5b9250612f9760408601612f2b565b9396929550929360600135925050565b60008060408385031215612fba57600080fd5b8235612fc581612dd1565b946020939093013593505050565b803560ff81168114612f3d57600080fd5b60008060008060808587031215612ffa57600080fd5b61300385612fd3565b9350602085013561301381612dd1565b925060408501359150606085013561302a81612dd1565b939692955090935050565b6000806040838503121561304857600080fd5b8235915061305860208401612fd3565b90509250929050565b6000806040838503121561307457600080fd5b823561307f81612dd1565b915061305860208401612f2b565b600080602083850312156130a057600080fd5b823567ffffffffffffffff808211156130b857600080fd5b818501915085601f8301126130cc57600080fd5b8135818111156130db57600080fd5b8660208260051b85010111156130f057600080fd5b60209290920196919550909350505050565b60005b8381101561311d578181015183820152602001613105565b83811115612a5a5750506000910152565b60008151808452613146816020860160208601613102565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156131cd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526131bb85835161312e565b94509285019290850190600101613181565b5092979650505050505050565b602080825282518282018190526000919060409081850190868401855b828110156132605781518051805115158652878101516001600160a01b0390811689880152878201511687870152606080820151908701526080808201519087015260a0908101519086015286015160ff1660c085015260e090930192908501906001016131f7565b5091979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600060ff821660ff8416808210156132b6576132b661326d565b90039392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132f7576132f761326d565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261333a5761333a6132fc565b500490565b6000828210156133515761335161326d565b500390565b600060ff821660ff810361336c5761336c61326d565b60010192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126133d957600080fd5b83018035915067ffffffffffffffff8211156133f457600080fd5b60200191503681900382131561340957600080fd5b9250929050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134415761344161326d565b5060010190565b6000821982111561345b5761345b61326d565b500190565b60008261346f5761346f6132fc565b500690565b60006020828403121561348657600080fd5b81518015158114610d2b57600080fd5b6000602082840312156134a857600080fd5b5051919050565b6000816134be576134be61326d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600060033d11156134fd5760046000803e5060005160e01c5b90565b600060443d101561350e5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561355c57505050505090565b82850191508151818111156135745750505050505090565b843d870101602082850101111561358e5750505050505090565b61359d60208286010187612e32565b509095945050505050565b83815282602082015260606040820152600061213c606083018461312e565b600082516135d9818460208701613102565b9190910192915050565b602081526000610d2b602083018461312e56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220333b3ce38980fbc895479b724852653a6ad6aa372c5b7df5bcde0fc0b4e6897964736f6c634300080e00334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572000000000000000000000000887a3c3d25eb56953124aede7106c65c8b91720c000000000000000000000000a368c0ab32dd9bc0500075c0c8397b6b0168e4320000000000000000000000007a1bac17ccc5b313516c5e16fb24f7659aa5ebed

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

000000000000000000000000887a3c3d25eb56953124aede7106c65c8b91720c000000000000000000000000a368c0ab32dd9bc0500075c0c8397b6b0168e4320000000000000000000000007a1bac17ccc5b313516c5e16fb24f7659aa5ebed

-----Decoded View---------------
Arg [0] : bankAddress (address): 0x887a3c3d25eb56953124aede7106c65c8b91720c
Arg [1] : referralProgramAddress (address): 0xa368c0ab32dd9bc0500075c0c8397b6b0168e432
Arg [2] : chainlinkCoordinatorAddress (address): 0x7a1bac17ccc5b313516c5e16fb24f7659aa5ebed

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000887a3c3d25eb56953124aede7106c65c8b91720c
Arg [1] : 000000000000000000000000a368c0ab32dd9bc0500075c0c8397b6b0168e432
Arg [2] : 0000000000000000000000007a1bac17ccc5b313516c5e16fb24f7659aa5ebed


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading