Contract 0xf4CC8b8520cbb57829379ECa18b1911cc401c97D 1

 

Contract Overview

Balance:
68.808981459359141931 MATIC

MATIC Value:
$61.52 (@ $0.89/MATIC)

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x10f797670c8f5014bb7e9c57c862ed2a86a010377d6148a87f611f584cfa01e6Wager365574582022-12-08 0:44:431 hr 20 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.477554332743811 MATIC0.009135324007 33.000000028
0xc426ee43b7c74dcd86a9d0c412d45ef558affd9b4fc209a021e1d54159ed04ffWager365574302022-12-08 0:43:431 hr 21 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.477554332741736 MATIC0.009792420006 33.000000023
0x5a6194902bfb2bcfb62dda75d7d15e4a2491fe1c76917490807b17fb5d83eec1Wager365573612022-12-08 0:41:211 hr 24 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d1.766554332753356 MATIC0.009135720014 33.000000051
0xde6ff3432a0bfe3e73fa7b5db5e0f73bce434d81a51e181fec450ba3561e99adWager365573482022-12-08 0:40:551 hr 24 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.766554332749621 MATIC0.009135720011 33.000000042
0x6e89e0cf4df617de71f537b82d219095876e478480192d43a5cc311c7c161e8aWager365573362022-12-08 0:40:311 hr 24 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.507554332749621 MATIC0.009135324011 33.000000042
0x4d91fdc8c35b71c678e79a3f9e9c0bf1204477c73ba607cf7accbd467c586539Wager365570352022-12-08 0:30:091 hr 35 mins ago0x863c5bf79bb048958f35636cc3455cd61766c36a IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.776554332751696 MATIC0.009135720013 33.000000047
0xcb7cf7a9709012c0fdc55c4d56c3a0ee4d1a703da33a0814fe528a2ccacaf8e5Wager365559952022-12-07 23:52:122 hrs 13 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017554332740906 MATIC0.011917851007 33.000000021
0xc63f6bbbbdb131ecb52d7a1e0562da30eb6ca0a027ea2aa1bfef2a918ae58d12Wager365559762022-12-07 23:51:342 hrs 13 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017554332740491 MATIC0.011917851007 33.00000002
0x4308eee302a0fc908dddc6fc4cc88eb1c4ed689098c16bcf7ad7622ced226a7cWager365559492022-12-07 23:50:362 hrs 14 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017554332740906 MATIC0.011917851007 33.000000021
0xbc6b2c2cba9c65f7b7efbf949f5f2c7847a4117471a47a01e31c13aec00d229eWager365558962022-12-07 23:48:462 hrs 16 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017554332740906 MATIC0.011917851007 33.000000021
0x18d840a1e66c171a4bb1ee5895dc46c83d9f1532d40338e9d85c7fd0995363dcWager365558402022-12-07 23:46:542 hrs 18 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017554332741321 MATIC0.011917851007 33.000000021
0x4ab178b341077a437cac46a92280a2482aeddc16d71ec099c513139c0b734498Wager365551812022-12-07 23:24:122 hrs 41 mins ago0xa02a1d5019a0b274da207554a3a9de854f9ef097 IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d15.017554339019856 MATIC0.009792424495 33.000015151
0x5fe95089e71dda47cb8d041932813ba68d4a39b3707929fe267a6aeff8bc9d13Wager365542802022-12-07 22:48:413 hrs 16 mins ago0x36b3560b03e67325732bde47e345f8a28d202116 IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.317554503188461 MATIC0.009792538159 33.000398193
0x4fd007f2761200f398c495891cd613c89bbe43447ba1606eef1beffaf4c297edWager365542582022-12-07 22:47:573 hrs 17 mins ago0x36b3560b03e67325732bde47e345f8a28d202116 IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.317554501547551 MATIC0.009792540709 33.000406784
0x22fd19cb9217a3f174c0f65a5750541baec9c4d3ef8ecff85668ac63d9f05118Wager365535342022-12-07 22:23:013 hrs 42 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017666660490861 MATIC0.012015602404 33.270669298
0xa831722391861095472e40ec954fe59aa7e9f7c336b8e5d0a548cca3cbe138f3Wager365534942022-12-07 22:21:413 hrs 43 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017689146466571 MATIC0.012035170459 33.324852372
0xb42a3d2fc97edb97c967ef55cb5db79f5ec86944f7b8deadcde3b45fd8b19550Wager365534762022-12-07 22:21:053 hrs 44 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017677420886836 MATIC0.012025366023 33.296597963
0x385e430cf0dacddaed8d91abec2b2749b9b855d3213f1d1cd67e1120b535e8a2Wager365534622022-12-07 22:20:333 hrs 44 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017668683695126 MATIC0.012017762372 33.275544489
0xdaf0753113c18a51c3afc1574b01ebc985a3a014808bef6911da050825df804bWager365534462022-12-07 22:20:013 hrs 45 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017673057687641 MATIC0.012021568894 33.28608423
0x2191fb0d371350b424f447bafb2aad0ed33a60b042ddedbedf053a4acdc81007Wager365534302022-12-07 22:19:293 hrs 45 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017675631083551 MATIC0.012036901619 33.328538455
0x1a952314222b8b6d140f19a640227ce200aa656ec9c13ce3b7d1ed63ca2e8dc5Wager365534142022-12-07 22:18:573 hrs 46 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017671861203216 MATIC0.012033306611 33.318584366
0x900c2bcfce00325e05f2e6e9ea638b594c56153f6cd5b0a4fd21e1478b720f29Wager365533962022-12-07 22:18:173 hrs 47 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017657137126886 MATIC0.012007713825 33.247721433
0x6aead52a0ab54d8c347379d271b8e0b70b52c53b05f47dba7fabc8e8c7b0c17dWager365533782022-12-07 22:17:413 hrs 47 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017657702395066 MATIC0.012004244063 33.238114138
0xa741b9261503bade121ebb587f4c8a803f7e6d6eddaf18235ea81c0d30d3ac72Wager365533602022-12-07 22:17:053 hrs 48 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017722494208646 MATIC0.012069101262 33.417694872
0x66de3f7662f5c7cbb22eca957c4e1d8a6f5eb669d68cea090ff1e090956f746fWager365533322022-12-07 22:16:053 hrs 49 mins ago0x743deac8774b19df9154256ac825bcc58697302f IN  0xf4cc8b8520cbb57829379eca18b1911cc401c97d0.017757865603601 MATIC0.012050365304 33.366926222
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x273cd9286f1a53b97b5652ac6df8ed59a1fd7c72dfc457b84036da664ed4ba2d365574652022-12-08 0:44:571 hr 20 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.46 MATIC
0x80d1591bd589ffb2cc5b0411d51206c2f8256f6c09917f17f4b638a28f2a999d365574372022-12-08 0:43:571 hr 21 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.0138 MATIC
0x80d1591bd589ffb2cc5b0411d51206c2f8256f6c09917f17f4b638a28f2a999d365574372022-12-08 0:43:571 hr 21 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x863c5bf79bb048958f35636cc3455cd61766c36a0.4462 MATIC
0xade7fbb2f100d35206bd38ef1a86deb3c7f0bc193166365d09430a8d50036863365573672022-12-08 0:41:331 hr 23 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.05247 MATIC
0xade7fbb2f100d35206bd38ef1a86deb3c7f0bc193166365d09430a8d50036863365573672022-12-08 0:41:331 hr 23 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x863c5bf79bb048958f35636cc3455cd61766c36a1.69653 MATIC
0xbfaf92fb89642f73a849e47e8208da38fa9ce3c86b812c3c8993829e7f2e03a5365573542022-12-08 0:41:071 hr 24 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.749 MATIC
0x314dc16606f3d1901655d0be7b726bdd8ba6d72bfd45738e6a6a7a6a020e249d365573412022-12-08 0:40:411 hr 24 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.49 MATIC
0x3849d2dfccb0f2c5cd68b598562e07cdde340fc8d2bce4ce6a44708c61574eb9365570412022-12-08 0:30:211 hr 35 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.02277 MATIC
0x3849d2dfccb0f2c5cd68b598562e07cdde340fc8d2bce4ce6a44708c61574eb9365570412022-12-08 0:30:211 hr 35 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x863c5bf79bb048958f35636cc3455cd61766c36a0.73623 MATIC
0x0d6196e0cf67ac55944b6d00d836ed5e892f592d61a653608a1fcf1656ce15ff365551882022-12-07 23:24:262 hrs 41 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e15 MATIC
0xa1249c567dfa4a5dabd4e7927cf2cb8ee8fcc1638ea6247de893f8404ef6d71a365542862022-12-07 22:48:533 hrs 16 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.009 MATIC
0xa1249c567dfa4a5dabd4e7927cf2cb8ee8fcc1638ea6247de893f8404ef6d71a365542862022-12-07 22:48:533 hrs 16 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x36b3560b03e67325732bde47e345f8a28d2021160.291 MATIC
0xd24ea2d47d214aee7c8c2e41bc48e0e9f65cbdd6d9212efc9a348908948470e4365542652022-12-07 22:48:113 hrs 17 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.009 MATIC
0xd24ea2d47d214aee7c8c2e41bc48e0e9f65cbdd6d9212efc9a348908948470e4365542652022-12-07 22:48:113 hrs 17 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x36b3560b03e67325732bde47e345f8a28d2021160.291 MATIC
0x0e71157c38405b2cca41bb33e8ae535b28fa485d43fa4ae904b215b9673fe66c365424342022-12-07 15:47:4110 hrs 17 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.36 MATIC
0x67475e804fe14bcd1224996c4311b075d3317199fc26b2f9329bb88588525d17365409312022-12-07 14:56:0111 hrs 9 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.03 MATIC
0x67475e804fe14bcd1224996c4311b075d3317199fc26b2f9329bb88588525d17365409312022-12-07 14:56:0111 hrs 9 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0x17f490f2e8f4d266366865857e1034033bd7f7a60.97 MATIC
0xbf5d146c5a5d6583c7de5ec1bdfffeb9ba76555222a0b124a662f13c341cb683365388782022-12-07 13:44:5112 hrs 20 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e1.7770155632219367 MATIC
0x166d007b328ffeac55a837f0219449da1aa1f62a4bb69859a2e9967f222bdcd0365366282022-12-07 12:24:5613 hrs 40 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.1 MATIC
0xdfcfc436d2fe19a3b44e47bd23856ab4eb0f6b3b2dfd03b27871e472f32da55d365326642022-12-07 10:06:0615 hrs 59 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.4 MATIC
0x52fc76cfc7d154edd8e01eff464faf2abe3d7073d431260d64ca89151bd25dc2365309132022-12-07 9:03:3717 hrs 1 min ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.1 MATIC
0x29d3af7cf562bf6dad7c6440fabc1579150417a082f39fa5219c6bc4194899ed365253762022-12-07 5:47:5720 hrs 17 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.6 MATIC
0x29d3af7cf562bf6dad7c6440fabc1579150417a082f39fa5219c6bc4194899ed365253762022-12-07 5:47:5720 hrs 17 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0xa02a1d5019a0b274da207554a3a9de854f9ef09719.4 MATIC
0x88fc6f8a092a8a31664e2048194618dbf192bbdb4100b2416c7b960a9c0ccc95365250962022-12-07 5:37:4720 hrs 27 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d 0x999b6d28a9e78c4be13d51469c49585d6d25be5e0.3 MATIC
0x88fc6f8a092a8a31664e2048194618dbf192bbdb4100b2416c7b960a9c0ccc95365250962022-12-07 5:37:4720 hrs 27 mins ago 0xf4cc8b8520cbb57829379eca18b1911cc401c97d0xa02a1d5019a0b274da207554a3a9de854f9ef0979.7 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:
CoinToss

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 80000 runs

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

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

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

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

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

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

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

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

  function version() external view returns (uint256);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

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

File 6 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 15 : 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 12 of 15 : 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 13 of 15 : IBank.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

/// @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 user,
        address token,
        uint256 profit,
        uint256 fees
    ) external payable;

    /// @notice Accounts a loss bet.
    /// @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.
    /// @param fees Bet amount and bet profit fees amount.
    function cashIn(
        address tokenAddress,
        uint256 amount,
        uint256 fees
    ) 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);

    function getVRFSubId(address token) external view returns (uint64);

    function getTokenOwner(address token) external view returns (address);

    function getMinBetAmount(address token) external view returns (uint256);
}

File 14 of 15 : CoinToss.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

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

/// @title BetSwirl's Coin Toss game
/// @notice The game is played with a two-sided coin. The game's goal is to guess whether the lucky coin face will be Heads or Tails.
/// @author Romuald Hog (based on Yakitori's Coin Toss)
contract CoinToss is Game {
    /// @notice Full coin toss bet information struct.
    /// @param bet The Bet struct information.
    /// @param diceBet The Coin Toss bet struct information.
    /// @dev Used to package bet information for the front-end.
    struct FullCoinTossBet {
        Bet bet;
        CoinTossBet coinTossBet;
    }

    /// @notice Coin Toss bet information struct.
    /// @param face The chosen coin face.
    /// @param rolled The rolled coin face.
    struct CoinTossBet {
        bool face;
        bool rolled;
    }

    /// @notice Maps bets IDs to chosen and rolled coin faces.
    /// @dev Coin faces: true = Tails, false = Heads.
    mapping(uint256 => CoinTossBet) public coinTossBets;

    /// @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 amount The bet amount.
    /// @param vrfCost The Chainlink VRF cost paid by player.
    /// @param face The chosen coin face.
    event PlaceBet(
        uint256 id,
        address indexed user,
        address indexed token,
        uint256 amount,
        uint256 vrfCost,
        bool face
    );

    /// @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 face The chosen coin face.
    /// @param rolled The rolled coin face.
    /// @param payout The payout amount.
    event Roll(
        uint256 id,
        address indexed user,
        address indexed token,
        uint256 amount,
        bool face,
        bool rolled,
        uint256 payout
    );

    /// @notice Initialize the game base contract.
    /// @param bankAddress The address of the bank.
    /// @param chainlinkCoordinatorAddress Address of the Chainlink VRF Coordinator.
    /// @param LINK_ETH_feedAddress Address of the Chainlink LINK/ETH price feed.
    constructor(
        address bankAddress,
        address chainlinkCoordinatorAddress,
        address LINK_ETH_feedAddress
    ) Game(bankAddress, chainlinkCoordinatorAddress, 1, LINK_ETH_feedAddress) {}

    /// @notice Calculates the target payout amount.
    /// @param betAmount Bet amount.
    /// @return The target payout amount.
    function _getPayout(uint256 betAmount) private pure returns (uint256) {
        return betAmount * 2;
    }

    /// @notice Creates a new bet and stores the chosen coin face.
    /// @param face The chosen coin face.
    /// @param token Address of the token.
    /// @param tokenAmount The number of tokens bet.
    function wager(
        bool face,
        address token,
        uint256 tokenAmount
    ) external payable whenNotPaused {
        Bet memory bet = _newBet(token, tokenAmount, _getPayout(10000));

        coinTossBets[bet.id].face = face;

        emit PlaceBet(
            bet.id,
            bet.user,
            bet.token,
            bet.amount,
            bet.vrfCost,
            face
        );
    }

    /// @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
    {
        uint256 startGas = gasleft();

        CoinTossBet storage coinTossBet = coinTossBets[id];
        Bet storage bet = bets[id];

        uint256 rolled = randomWords[0] % 2;

        bool[2] memory coinSides = [false, true];
        bool rolledCoinSide = coinSides[rolled];
        coinTossBet.rolled = rolledCoinSide;
        uint256 payout = _resolveBet(
            bet,
            rolledCoinSide == coinTossBet.face ?
                _getPayout(bet.amount) : 0
        );

        emit Roll(
            bet.id,
            bet.user,
            bet.token,
            bet.amount,
            coinTossBet.face,
            rolledCoinSide,
            payout
        );

        _accountVRFCost(bet, startGas);
    }

    /// @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 Coin Toss bet.
    function getLastUserBets(address user, uint256 dataLength)
        external
        view
        returns (FullCoinTossBet[] memory)
    {
        Bet[] memory lastBets = _getLastUserBets(user, dataLength);
        FullCoinTossBet[] memory lastCoinTossBets = new FullCoinTossBet[](
            lastBets.length
        );
        for (uint256 i; i < lastBets.length; i++) {
            lastCoinTossBets[i] = FullCoinTossBet(
                lastBets[i],
                coinTossBets[lastBets[i].id]
            );
        }
        return lastCoinTossBets;
    }
}

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

pragma solidity 0.8.17;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Multicall} from "@openzeppelin/contracts/utils/Multicall.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

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

// import "hardhat/console.sol";

interface IVRFCoordinatorV2 is VRFCoordinatorV2Interface {
    function getFeeConfig()
        external
        view
        returns (
            uint32 fulfillmentFlatFeeLinkPPMTier1,
            uint32 fulfillmentFlatFeeLinkPPMTier2,
            uint32 fulfillmentFlatFeeLinkPPMTier3,
            uint32 fulfillmentFlatFeeLinkPPMTier4,
            uint32 fulfillmentFlatFeeLinkPPMTier5,
            uint24 reqsForTier2,
            uint24 reqsForTier3,
            uint24 reqsForTier4,
            uint24 reqsForTier5
        );
}

/// @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,
    ReentrancyGuard
{
    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.
    /// @param payout The payout amount.
    /// @param vrfCost The Chainlink VRF cost paid by player.
    struct Bet {
        bool resolved;
        address user;
        address token;
        uint256 id;
        uint256 amount;
        uint256 blockNumber;
        uint256 payout;
        uint256 vrfCost;
    }

    /// @notice Token struct.
    /// @param houseEdge House edge rate.
    /// @param pendingCount Number of pending bets.
    /// @param VRFCallbackGasLimit How much gas is needed in the Chainlink VRF callback.
    /// @param VRFFees Chainlink's VRF collected fees amount.
    struct Token {
        uint16 houseEdge;
        uint64 pendingCount;
        uint32 VRFCallbackGasLimit;
        uint256 VRFFees;
    }

    /// @notice Chainlink VRF configuration struct.
    /// @param requestConfirmations How many confirmations the Chainlink node should wait before responding.
    /// @param numRandomWords How many random words is needed to resolve a game's bet.
    /// @param keyHash Hash of the public key used to verify the VRF proof.
    /// @param chainlinkCoordinator Reference to the VRFCoordinatorV2 deployed contract.
    /// @param gasAfterCalculation Gas to be added for VRF cost refund.
    struct ChainlinkConfig {
        uint16 requestConfirmations;
        uint16 numRandomWords;
        bytes32 keyHash;
        IVRFCoordinatorV2 chainlinkCoordinator;
        uint256 gasAfterCalculation;
    }

    /// @notice Chainlink VRF configuration state.
    ChainlinkConfig private _chainlinkConfig;

    /// @notice Chainlink price feed.
    AggregatorV3Interface private immutable _LINK_ETH_feed;

    /// @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 token configuration.
    mapping(address => Token) public tokens;

    /// @notice Maps user addresses to VRF overcharged cost.
    mapping(address => uint256) public userOverchargedVRFCost;

    /// @notice The bank that manage to payout a won bet and collect a loss bet.
    IBank public immutable bank;

    /// @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 Chainlink callback gas limit is set for a token.
    /// @param token Address of the token.
    /// @param callbackGasLimit New Chainlink VRF callback gas limit.
    event SetVRFCallbackGasLimit(
        address indexed token,
        uint32 callbackGasLimit
    );

    /// @notice Emitted after the Chainlink config is set.
    /// @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.
    /// @param gasAfterCalculation Gas to be added for VRF cost refund.
    event SetChainlinkConfig(
        uint16 requestConfirmations,
        bytes32 keyHash,
        uint256 gasAfterCalculation
    );

    /// @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.
    /// @param chainlinkVRFCost The Chainlink VRF cost refunded to player.
    event BetRefunded(
        uint256 id,
        address user,
        uint256 amount,
        uint256 chainlinkVRFCost
    );

    /// @notice Emitted after the token's VRF fees amount is transfered to the user.
    /// @param token Address of the token.
    /// @param amount Number of tokens refunded.
    event DistributeTokenVRFFees(address indexed token, uint256 amount);

    /// @notice Emitted after the user's overcharged VRF cost amount is transfered.
    /// @param user Address of the user.
    /// @param overchargedVRFCost Number of tokens refunded.
    event DistributeOverchargedVRFCost(
        address indexed user,
        uint256 overchargedVRFCost
    );

    /// @notice Emitted after the overcharged VRF cost amount is accounted.
    /// @param user Address of the user.
    /// @param overchargedVRFCost Number of tokens overcharged.
    event AccountOverchargedVRFCost(
        address indexed user,
        uint256 overchargedVRFCost
    );

    /// @notice No user's overcharged Chainlink fee.
    error NoOverchargedVRFCost();

    /// @notice Insufficient bet amount.
    /// @param minBetAmount Bet amount.
    error UnderMinBetAmount(uint256 minBetAmount);

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

    /// @notice Bet isn't resolved yet.
    error NotFulfilled();

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

    /// @notice Token is not allowed.
    error ForbiddenToken();

    /// @notice Chainlink price feed not working
    /// @param linkWei LINK/ETH price returned.
    error InvalidLinkWeiPrice(int256 linkWei);

    /// @notice The msg.value is not enough to cover Chainlink's fee.
    error WrongGasValueToCoverFee();

    /// @notice Reverting error when sender isn't allowed.
    error AccessDenied();

    /// @notice Reverting error when provided address isn't valid.
    error InvalidAddress();

    /// @notice Reverting error when token has pending bets.
    error TokenHasPendingBets();

    /// @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.
    /// @param LINK_ETH_feedAddress Address of the Chainlink LINK/ETH price feed.
    constructor(
        address bankAddress,
        address chainlinkCoordinatorAddress,
        uint16 numRandomWords,
        address LINK_ETH_feedAddress
    ) VRFConsumerBaseV2(chainlinkCoordinatorAddress) {
        if (
            LINK_ETH_feedAddress == address(0) ||
            chainlinkCoordinatorAddress == address(0) ||
            bankAddress == address(0)
        ) {
            revert InvalidAddress();
        }
        require(
            numRandomWords != 0 && numRandomWords <= 500,
            "Wrong Chainlink NumRandomWords"
        );

        bank = IBank(bankAddress);
        _chainlinkConfig.chainlinkCoordinator = IVRFCoordinatorV2(
            chainlinkCoordinatorAddress
        );
        _chainlinkConfig.numRandomWords = numRandomWords;
        _LINK_ETH_feed = AggregatorV3Interface(LINK_ETH_feedAddress);
    }

    /// @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)
        private
        view
        returns (uint256)
    {
        return (tokens[token].houseEdge * amount) / 10000;
    }

    /// @notice Creates a new bet and request randomness to Chainlink,
    /// transfer the ERC20 tokens to the contract or refund the bet amount overflow if the bet amount exceed the maxBetAmount.
    /// @param tokenAddress 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.
    /// @return A new Bet struct information.
    function _newBet(
        address tokenAddress,
        uint256 tokenAmount,
        uint256 multiplier
    ) internal whenNotPaused nonReentrant returns (Bet memory) {
        Token storage token = tokens[tokenAddress];
        if (
            bank.isAllowedToken(tokenAddress) == false || token.houseEdge == 0
        ) {
            revert ForbiddenToken();
        }

        address user = msg.sender;
        bool isGasToken = tokenAddress == address(0);
        uint256 fee = isGasToken ? (msg.value - tokenAmount) : msg.value;
        uint256 betAmount = isGasToken ? msg.value - fee : tokenAmount;

        // Charge user for Chainlink VRF fee.
        {
            uint256 chainlinkVRFCost = getChainlinkVRFCost(tokenAddress);
            if (fee < (chainlinkVRFCost - ((10 * chainlinkVRFCost) / 100))) {
                // 10% slippage.
                revert WrongGasValueToCoverFee();
            }
        }

        // Bet amount is capped.
        {
            uint256 minBetAmount = bank.getMinBetAmount(tokenAddress);
            if (betAmount < minBetAmount) {
                revert UnderMinBetAmount(minBetAmount);
            }

            uint256 maxBetAmount = bank.getMaxBetAmount(
                tokenAddress,
                multiplier
            );
            if (betAmount > maxBetAmount) {
                if (isGasToken) {
                    Address.sendValue(payable(user), betAmount - maxBetAmount);
                }
                betAmount = maxBetAmount;
            }
        }

        // Create bet
        uint256 id = _chainlinkConfig.chainlinkCoordinator.requestRandomWords(
            _chainlinkConfig.keyHash,
            bank.getVRFSubId(tokenAddress),
            _chainlinkConfig.requestConfirmations,
            token.VRFCallbackGasLimit,
            _chainlinkConfig.numRandomWords
        );
        Bet memory newBet = Bet(
            false,
            user,
            tokenAddress,
            id,
            betAmount,
            block.number,
            0,
            fee
        );
        _userBets[user].push(id);
        bets[id] = newBet;
        token.pendingCount++;

        // If ERC20, transfer the tokens
        if (!isGasToken) {
            IERC20(tokenAddress).safeTransferFrom(
                user,
                address(this),
                betAmount
            );
        }

        return newBet;
    }

    /// @notice Calculates the overcharged VRF cost based on the gas consumed.
    /// @param bet The Bet struct information.
    /// @param startGas Gas amount at start.
    function _accountVRFCost(Bet storage bet, uint256 startGas) internal {
        (, int256 weiPerUnitLink, , , ) = _LINK_ETH_feed.latestRoundData();
        if (weiPerUnitLink < 0) {
            weiPerUnitLink = 0;
        }
        // Get Chainlink VRF v2 fee amount.
        (
            uint32 fulfillmentFlatFeeLinkPPMTier1,
            ,
            ,
            ,
            ,
            ,
            ,
            ,

        ) = _chainlinkConfig.chainlinkCoordinator.getFeeConfig();
        // Calculates the VRF premium fee in ETH
        uint256 chainlinkPremium = ((1e12 *
            uint256(fulfillmentFlatFeeLinkPPMTier1) *
            uint256(weiPerUnitLink)) / 1e18);
            
        // Calculate the gas fee (adding the estimated gas spent after this calculation) + premium
        uint256 actualVRFCost = (tx.gasprice *
            (startGas - gasleft() + _chainlinkConfig.gasAfterCalculation)) +
            chainlinkPremium;

        // If the actual VRF cost is higher than what the player paid.
        if (actualVRFCost > bet.vrfCost) {
            actualVRFCost = bet.vrfCost;
        } else {
            // Otherwise credits it to his account.
            uint256 overchargedVRFCost = bet.vrfCost - actualVRFCost;
            userOverchargedVRFCost[bet.user] += overchargedVRFCost;
            bet.vrfCost = actualVRFCost;
            emit AccountOverchargedVRFCost(bet.user, overchargedVRFCost);
        }

        // Credits the actual VRF cost to fund the VRF subscription.
        tokens[bet.token].VRFFees += actualVRFCost;
    }

    /// @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 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, uint256 payout)
        internal
        returns (uint256)
    {
        if (bet.resolved == true || bet.id == 0) {
            revert NotPendingBet();
        }
        bet.resolved = true;

        address token = bet.token;
        tokens[token].pendingCount--;

        uint256 betAmount = bet.amount;
        bool isGasToken = bet.token == address(0);

        if (payout > betAmount) {
            // The user has won more than his bet
            address user = bet.user;

            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 payout to the player
            if (isGasToken) {
                Address.sendValue(payable(user), betAmountPayout);
            } else {
                IERC20(token).safeTransfer(user, betAmountPayout);
                // Transfer the bet amount fee to the bank.
                IERC20(token).safeTransfer(address(bank), betAmountFee);
            }

            // Transfer the payout from the bank, the bet amount fee to the bank, and account fees.
            bank.payout{value: isGasToken ? betAmountFee : 0}(
                user,
                token,
                profitPayout,
                fee
            );
        } else if (payout > 0) {
            // The user has won something smaller than his bet
            address user = bet.user;

            uint256 fee = _getFees(token, payout);
            payout -= fee;
            uint256 bankCashIn = betAmount - payout;

            // Transfer the bet amount payout to the player
            if (isGasToken) {
                Address.sendValue(payable(user), payout);
            } else {
                IERC20(token).safeTransfer(user, payout);
                // Transfer the lost bet amount and fee to the bank
                IERC20(token).safeTransfer(address(bank), bankCashIn);
            }

            bank.cashIn{value: isGasToken ? bankCashIn : 0}(
                token,
                bankCashIn,
                fee
            );
        } else {
            // The user did not win anything
            if (!isGasToken) {
                IERC20(token).safeTransfer(address(bank), betAmount);
            }
            bank.cashIn{value: isGasToken ? betAmount : 0}(token, betAmount, 0);
        }

        bet.payout = payout;
        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;
            for (uint256 i = betsLength; i > betsLength - dataLength; i--) {
                userBets[userBetsIndex] = bets[userBetsIds[i - 1]];
                userBetsIndex++;
            }
        }

        return userBets;
    }

    /// @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) external onlyOwner {
        if (houseEdge > 400) {
            revert ExcessiveHouseEdge();
        }
        if (hasPendingBets(token)) {
            revert TokenHasPendingBets();
        }
        tokens[token].houseEdge = houseEdge;
        emit SetHouseEdge(token, houseEdge);
    }

    /// @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 requestConfirmations How many confirmations the Chainlink node should wait before responding.
    /// @param keyHash Hash of the public key used to verify the VRF proof.
    /// @param gasAfterCalculation Gas to be added for VRF cost refund.
    function setChainlinkConfig(
        uint16 requestConfirmations,
        bytes32 keyHash,
        uint256 gasAfterCalculation
    ) external onlyOwner {
        _chainlinkConfig.requestConfirmations = requestConfirmations;
        _chainlinkConfig.keyHash = keyHash;
        _chainlinkConfig.gasAfterCalculation = gasAfterCalculation;
        emit SetChainlinkConfig(
            requestConfirmations,
            keyHash,
            gasAfterCalculation
        );
    }

    /// @notice Sets the Chainlink VRF V2 configuration.
    /// @param callbackGasLimit How much gas is needed in the Chainlink VRF callback.
    function setVRFCallbackGasLimit(address token, uint32 callbackGasLimit)
        external
        onlyOwner
    {
        tokens[token].VRFCallbackGasLimit = callbackGasLimit;
        emit SetVRFCallbackGasLimit(token, callbackGasLimit);
    }

    /// @notice Distributes the token's collected Chainlink fees.
    /// @param token Address of the token.
    function withdrawTokensVRFFees(address token) external {
        uint256 tokenChainlinkFees = tokens[token].VRFFees;
        if (tokenChainlinkFees != 0) {
            delete tokens[token].VRFFees;
            Address.sendValue(
                payable(bank.getTokenOwner(token)),
                tokenChainlinkFees
            );
            emit DistributeTokenVRFFees(token, tokenChainlinkFees);
        }
    }

    /// @notice Withdraw user's overcharged Chainlink fees.
    function withdrawOverchargedVRFCost(address user) external {
        uint256 overchargedVRFCost = userOverchargedVRFCost[user];
        if (overchargedVRFCost == 0) {
            revert NoOverchargedVRFCost();
        }

        delete userOverchargedVRFCost[user];
        Address.sendValue(payable(user), overchargedVRFCost);
        emit DistributeOverchargedVRFCost(user, overchargedVRFCost);
    }

    /// @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 || bet.id == 0) {
            revert NotPendingBet();
        } else if (block.number < bet.blockNumber + 30) {
            revert NotFulfilled();
        }

        Token storage token = tokens[bet.token];
        token.pendingCount--;

        bet.resolved = true;
        bet.payout = bet.amount;

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

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

    /// @notice Returns the Chainlink VRF config.
    /// @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.
    /// @param chainlinkCoordinator Reference to the VRFCoordinatorV2 deployed contract.
    /// @param gasAfterCalculation Gas to be added for VRF cost refund.
    function getChainlinkConfig()
        external
        view
        returns (
            uint16 requestConfirmations,
            bytes32 keyHash,
            IVRFCoordinatorV2 chainlinkCoordinator,
            uint256 gasAfterCalculation
        )
    {
        return (
            _chainlinkConfig.requestConfirmations,
            _chainlinkConfig.keyHash,
            _chainlinkConfig.chainlinkCoordinator,
            _chainlinkConfig.gasAfterCalculation
        );
    }

    /// @notice Returns whether the token has pending bets.
    /// @return Whether the token has pending bets.
    function hasPendingBets(address token) public view returns (bool) {
        return tokens[token].pendingCount != 0;
    }

    /// @notice Returns the amount of ETH that should be passed to the wager transaction.
    /// to cover Chainlink VRF fee.
    /// @return The bet resolution cost amount.
    function getChainlinkVRFCost(address token) public view returns (uint256) {
        (, int256 weiPerUnitLink, , , ) = _LINK_ETH_feed.latestRoundData();
        if (weiPerUnitLink <= 0) {
            revert InvalidLinkWeiPrice(weiPerUnitLink);
        }
        // Get Chainlink VRF v2 fee amount.
        (
            uint32 fulfillmentFlatFeeLinkPPMTier1,
            ,
            ,
            ,
            ,
            ,
            ,
            ,

        ) = _chainlinkConfig.chainlinkCoordinator.getFeeConfig();
        // 115000 gas is the average Verification gas of Chainlink VRF.
        return
            (tx.gasprice * (115000 + tokens[token].VRFCallbackGasLimit)) +
            ((1e12 *
                uint256(fulfillmentFlatFeeLinkPPMTier1) *
                uint256(weiPerUnitLink)) / 1e18);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"bankAddress","type":"address"},{"internalType":"address","name":"chainlinkCoordinatorAddress","type":"address"},{"internalType":"address","name":"LINK_ETH_feedAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessDenied","type":"error"},{"inputs":[],"name":"ExcessiveHouseEdge","type":"error"},{"inputs":[],"name":"ForbiddenToken","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[{"internalType":"int256","name":"linkWei","type":"int256"}],"name":"InvalidLinkWeiPrice","type":"error"},{"inputs":[],"name":"NoOverchargedVRFCost","type":"error"},{"inputs":[],"name":"NotFulfilled","type":"error"},{"inputs":[],"name":"NotPendingBet","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"TokenHasPendingBets","type":"error"},{"inputs":[{"internalType":"uint256","name":"minBetAmount","type":"uint256"}],"name":"UnderMinBetAmount","type":"error"},{"inputs":[],"name":"WrongGasValueToCoverFee","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"overchargedVRFCost","type":"uint256"}],"name":"AccountOverchargedVRFCost","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"},{"indexed":false,"internalType":"uint256","name":"chainlinkVRFCost","type":"uint256"}],"name":"BetRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"overchargedVRFCost","type":"uint256"}],"name":"DistributeOverchargedVRFCost","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DistributeTokenVRFFees","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":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vrfCost","type":"uint256"},{"indexed":false,"internalType":"bool","name":"face","type":"bool"}],"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":"bool","name":"face","type":"bool"},{"indexed":false,"internalType":"bool","name":"rolled","type":"bool"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"Roll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"gasAfterCalculation","type":"uint256"}],"name":"SetChainlinkConfig","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":"uint32","name":"callbackGasLimit","type":"uint32"}],"name":"SetVRFCallbackGasLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"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","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":"uint256","name":"payout","type":"uint256"},{"internalType":"uint256","name":"vrfCost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"coinTossBets","outputs":[{"internalType":"bool","name":"face","type":"bool"},{"internalType":"bool","name":"rolled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainlinkConfig","outputs":[{"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"contract IVRFCoordinatorV2","name":"chainlinkCoordinator","type":"address"},{"internalType":"uint256","name":"gasAfterCalculation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getChainlinkVRFCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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","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":"uint256","name":"payout","type":"uint256"},{"internalType":"uint256","name":"vrfCost","type":"uint256"}],"internalType":"struct Game.Bet","name":"bet","type":"tuple"},{"components":[{"internalType":"bool","name":"face","type":"bool"},{"internalType":"bool","name":"rolled","type":"bool"}],"internalType":"struct CoinToss.CoinTossBet","name":"coinTossBet","type":"tuple"}],"internalType":"struct CoinToss.FullCoinTossBet[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"hasPendingBets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"refundBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"requestConfirmations","type":"uint16"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint256","name":"gasAfterCalculation","type":"uint256"}],"name":"setChainlinkConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint16","name":"houseEdge","type":"uint16"}],"name":"setHouseEdge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint32","name":"callbackGasLimit","type":"uint32"}],"name":"setVRFCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokens","outputs":[{"internalType":"uint16","name":"houseEdge","type":"uint16"},{"internalType":"uint64","name":"pendingCount","type":"uint64"},{"internalType":"uint32","name":"VRFCallbackGasLimit","type":"uint32"},{"internalType":"uint256","name":"VRFFees","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userOverchargedVRFCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"face","type":"bool"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"wager","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"withdrawOverchargedVRFCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawTokensVRFFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040523480156200001157600080fd5b5060405162003f4938038062003f498339810160408190526200003491620001d8565b82826001838262000045336200016b565b6000805460ff60a01b191690556001600160a01b0390811660805260018055811615806200007a57506001600160a01b038316155b806200008d57506001600160a01b038416155b15620000ac5760405163e6c4247b60e01b815260040160405180910390fd5b61ffff821615801590620000c657506101f48261ffff1611155b620001175760405162461bcd60e51b815260206004820152601e60248201527f57726f6e6720436861696e6c696e6b204e756d52616e646f6d576f7264730000604482015260640160405180910390fd5b6001600160a01b0393841660c052600480549385166001600160a01b0319909416939093179092556002805461ffff909216620100000263ffff0000199092169190911790551660a0525062000222915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620001d357600080fd5b919050565b600080600060608486031215620001ee57600080fd5b620001f984620001bb565b92506200020960208501620001bb565b91506200021960408501620001bb565b90509250925092565b60805160a05160c051613c9c620002ad600039600081816103c8015281816109bf01528181611842015281816119ee01528181611ae901528181611bd6015281816127d7015281816127fe01528181612982015281816129a901528181612aa50152612acc015260008181610c8e0152612bb40152600081816106c4015261072c0152613c9c6000f3fe6080604052600436106101805760003560e01c80637d0807d7116100d6578063c2fb579f1161007f578063e32fe50411610059578063e32fe504146105d2578063e4860339146105f2578063f2fde38b1461068c57600080fd5b8063c2fb579f14610535578063e051ece914610562578063e1fdb4b4146105b257600080fd5b80638da5cb5b116100b05780638da5cb5b146104bd578063982c3fdd146104e8578063ac9650d81461050857600080fd5b80637d0807d71461042f57806382b0c00b146104885780638456cb59146104a857600080fd5b80635c975abb11610138578063715018a611610112578063715018a6146103a157806376cdb03b146103b657806378bcde221461040f57600080fd5b80635c975abb146103315780637038942f14610361578063707cd55e1461038157600080fd5b8063277d35af11610169578063277d35af1461027e57806350462ea0146102b9578063594043fd146102cc57600080fd5b80631fe543e31461018557806322af00fa146101a7575b600080fd5b34801561019157600080fd5b506101a56101a0366004613364565b6106ac565b005b3480156101b357600080fd5b506102236101c236600461344c565b6006602081905260009182526040909120805460018201546002830154600384015460048501546005860154959096015460ff85169661010090950473ffffffffffffffffffffffffffffffffffffffff9081169694169492939192919088565b60408051981515895273ffffffffffffffffffffffffffffffffffffffff97881660208a015295909616948701949094526060860192909252608085015260a084015260c083015260e0820152610100015b60405180910390f35b34801561028a57600080fd5b506102ab610299366004613487565b60096020526000908152604090205481565b604051908152602001610275565b6101a56102c73660046134b2565b61076c565b3480156102d857600080fd5b506103216102e7366004613487565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205462010000900467ffffffffffffffff16151590565b6040519015158152602001610275565b34801561033d57600080fd5b5060005474010000000000000000000000000000000000000000900460ff16610321565b34801561036d57600080fd5b506101a561037c366004613487565b61084c565b34801561038d57600080fd5b506101a561039c366004613487565b610930565b3480156103ad57600080fd5b506101a5610a78565b3480156103c257600080fd5b506103ea7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610275565b34801561041b57600080fd5b506101a561042a36600461350a565b610a8c565b34801561043b57600080fd5b506002546003546004546005546040805161ffff9095168552602085019390935273ffffffffffffffffffffffffffffffffffffffff909116918301919091526060820152608001610275565b34801561049457600080fd5b506101a56104a336600461353f565b610bc6565b3480156104b457600080fd5b506101a5610c4e565b3480156104c957600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166103ea565b3480156104f457600080fd5b506102ab610503366004613487565b610c89565b34801561051457600080fd5b50610528610523366004613572565b610e9c565b6040516102759190613655565b34801561054157600080fd5b506105556105503660046136d5565b610f92565b6040516102759190613701565b34801561056e57600080fd5b5061059b61057d36600461344c565b600a6020526000908152604090205460ff8082169161010090041682565b604080519215158352901515602083015201610275565b3480156105be57600080fd5b506101a56105cd36600461344c565b611120565b3480156105de57600080fd5b506101a56105ed3660046137d6565b61138f565b3480156105fe57600080fd5b5061065361060d366004613487565b6008602052600090815260409020805460019091015461ffff82169162010000810467ffffffffffffffff16916a010000000000000000000090910463ffffffff169084565b6040805161ffff909516855267ffffffffffffffff909316602085015263ffffffff909116918301919091526060820152608001610275565b34801561069857600080fd5b506101a56106a7366004613487565b61142e565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461075e576040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b61076882826114e5565b5050565b610774611669565b600061078b83836107866127106116ee565b6116fb565b606081810180516000908152600a602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168a15159081179091558286015182870151945160808089015160e08a0151875193845295830152948101939093529482015293945073ffffffffffffffffffffffffffffffffffffffff9283169392909116917fa056e15b055f378463e53b317d9503bc9aba54ace23957ea9ff7fbfa0bf2efc0910160405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260096020526040812054908190036108ac576040517f8ab4c5d700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600960205260408120556108dc8282611f59565b8173ffffffffffffffffffffffffffffffffffffffff167f3f206d449945dd03c1742ee98a9c5b872ac6c165788363e06af2796dd5de1f548260405161092491815260200190565b60405180910390a25050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526008602052604090206001015480156107685773ffffffffffffffffffffffffffffffffffffffff82811660008181526008602052604080822060010191909155517fdc17c9ca0000000000000000000000000000000000000000000000000000000081526004810191909152610a30917f0000000000000000000000000000000000000000000000000000000000000000169063dc17c9ca90602401602060405180830381865afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a919061380f565b82611f59565b8173ffffffffffffffffffffffffffffffffffffffff167f1d3f9fc0810d9e182e982399cb91de735f6c415728fb9bc42664b84087c2af568260405161092491815260200190565b610a806120b8565b610a8a6000612139565b565b610a946120b8565b6101908161ffff161115610ad4576040517f70b5774c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604090205462010000900467ffffffffffffffff1615610b41576040517faa4256e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff861690811790915591519182527f7dfd3ecb8ac83242184c019f85ca408558f2ac0a5a19af6be2a4aee697eac8129101610924565b610bce6120b8565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff851690811790915560038390556005829055604080519182526020820184905281018290527fdb0c33bbe22ccb7d7c379a53ef932b131d6fb1b3bd0a7cfe7247d9513ba2a22a9060600160405180910390a1505050565b610c566120b8565b60005474010000000000000000000000000000000000000000900460ff1615610c8157610a8a6121ae565b610a8a61222b565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610cf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1b9190613846565b50505091505060008113610d5e576040517f43d4cf6600000000000000000000000000000000000000000000000000000000815260048101829052602401610755565b60048054604080517f5fbbc0d2000000000000000000000000000000000000000000000000000000008152905160009373ffffffffffffffffffffffffffffffffffffffff90931692635fbbc0d292808201926101209290918290030181865afa158015610dd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df491906138a9565b50505050505050509050670de0b6b3a7640000828263ffffffff1664e8d4a51000610e1f919061398e565b610e29919061398e565b610e3391906139d4565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260086020526040902054610e7a906a0100000000000000000000900463ffffffff166201c1386139e8565b610e8a9063ffffffff163a61398e565b610e949190613a05565b949350505050565b60608167ffffffffffffffff811115610eb757610eb7613335565b604051908082528060200260200182016040528015610eea57816020015b6060815260200190600190039081610ed55790505b50905060005b82811015610f8a57610f5a30858584818110610f0e57610f0e613a18565b9050602002810190610f209190613a47565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061229a92505050565b828281518110610f6c57610f6c613a18565b60200260200101819052508080610f8290613ab3565b915050610ef0565b505b92915050565b60606000610fa084846122c6565b90506000815167ffffffffffffffff811115610fbe57610fbe613335565b60405190808252806020026020018201604052801561105157816020015b60408051610140810182526000818301818152606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052610120830182905282528251808401909352808352602080840191909152810191909152815260200190600190039081610fdc5790505b50905060005b825181101561111757604051806040016040528084838151811061107d5761107d613a18565b60200260200101518152602001600a60008685815181106110a0576110a0613a18565b60209081029190910181015160600151825281810192909252604090810160002081518083019092525460ff8082161515835261010090910416151591810191909152905282518390839081106110f9576110f9613a18565b6020026020010181905250808061110f90613ab3565b915050611057565b50949350505050565b6000818152600660205260409020805460ff1615156001148061114557506002810154155b1561117c576040517f21abe57a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600481015461118c90601e613a05565b4310156111c5576040517f07bc6c3e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600181015473ffffffffffffffffffffffffffffffffffffffff166000908152600860205260409020805462010000900467ffffffffffffffff1681600261120c83613aeb565b825467ffffffffffffffff9182166101009390930a92830291909202199091161790555081547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811783556003830154600584015560068301549083015473ffffffffffffffffffffffffffffffffffffffff166112c457825460038401546112bf91610100900473ffffffffffffffffffffffffffffffffffffffff16906112ba908490613a05565b611f59565b611323565b8254600384015460018501546112fc9273ffffffffffffffffffffffffffffffffffffffff9182169261010090910490911690612525565b825461132390610100900473ffffffffffffffffffffffffffffffffffffffff1682611f59565b825460038401546040805187815261010090930473ffffffffffffffffffffffffffffffffffffffff166020840152820152606081018290527fe282fd838bb937af0c0f54e49ba5f86229ed0c90344c3cc4e2135cb673493e699060800160405180910390a150505050565b6113976120b8565b73ffffffffffffffffffffffffffffffffffffffff821660008181526008602090815260409182902080547fffffffffffffffffffffffffffffffffffff00000000ffffffffffffffffffff166a010000000000000000000063ffffffff87169081029190911790915591519182527f9edb52532d26512950c91a14b132f6df3cd06bfb49e795e03e56736121cd24a89101610924565b6114366120b8565b73ffffffffffffffffffffffffffffffffffffffff81166114d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610755565b6114e281612139565b50565b60005a6000848152600a6020908152604080832060069092528220855193945090929091906002908690839061151d5761151d613a18565b602002602001015161152f9190613b2d565b604080518082019091526000808252600160208301529192509081836002811061155b5761155b613a18565b602002015185547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff811661010083151590810291821789559293506000926115c792889260ff9182169116171515146115b55760006125f9565b6115c287600301546116ee565b6125f9565b60018601548654600288015460038901548a5460408051938452602084019290925260ff1615159082015285151560608201526080810184905292935073ffffffffffffffffffffffffffffffffffffffff91821692610100909104909116907f4a6c40516242d2bc8453081e1746087d26dc596dcc95d61f76381accb74699399060a00160405180910390a361165e8588612bb0565b505050505050505050565b60005474010000000000000000000000000000000000000000900460ff1615610a8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610755565b6000610f8c82600261398e565b611771604051806101000160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081525090565b611779611669565b6002600154036117e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610755565b600260015573ffffffffffffffffffffffffffffffffffffffff8481166000818152600860205260409081902090517fcbe230c30000000000000000000000000000000000000000000000000000000081526004810192909252917f0000000000000000000000000000000000000000000000000000000000000000169063cbe230c390602401602060405180830381865afa158015611889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ad9190613b41565b15806118bc5750805461ffff16155b156118f3576040517fc455905500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff8616156000816119195734611923565b6119238734613b5e565b9050600082611932578761193c565b61193c8234613b5e565b905060006119498a610c89565b9050606461195882600a61398e565b61196291906139d4565b61196c9082613b5e565b8310156119a5576040517f0b56cefe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506040517ff6b2a2f100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063f6b2a2f190602401602060405180830381865afa158015611a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5b9190613b71565b905080821015611a9a576040517f022558f400000000000000000000000000000000000000000000000000000000815260048101829052602401610755565b6040517f278b39de00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018a90526000917f00000000000000000000000000000000000000000000000000000000000000009091169063278b39de90604401602060405180830381865afa158015611b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b569190613b71565b905080831115611b78578415611b7457611b74866112ba8386613b5e565b8092505b5050600480546003546040517f279e341500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8d81169482019490945260009392831692635d3b1d3092917f00000000000000000000000000000000000000000000000000000000000000009091169063279e341590602401602060405180830381865afa158015611c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c439190613b8a565b6002548a5460405160e086901b7fffffffff00000000000000000000000000000000000000000000000000000000168152600481019490945267ffffffffffffffff909216602484015261ffff80821660448501526a010000000000000000000090920463ffffffff16606484015262010000900416608482015260a4016020604051808303816000875af1158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190613b71565b905060006040518061010001604052806000151581526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16815260200183815260200184815260200143815260200160008152602001858152509050600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055806006600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e0820151816006015590505086600001600281819054906101000a900467ffffffffffffffff1680929190611ef990613bb4565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505084611f4757611f4773ffffffffffffffffffffffffffffffffffffffff8c16873086612e74565b600180559a9950505050505050505050565b80471015611fc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610755565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461201d576040519150601f19603f3d011682016040523d82523d6000602084013e612022565b606091505b50509050806120b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610755565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6121b6612ed8565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b612233611669565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122013390565b60606122bf8383604051806060016040528060278152602001613c4060279139612f5c565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260076020908152604080832080548251818502810185019093528083526060949383018282801561233257602002820191906000526020600020905b81548152602001906001019080831161231e575b5050835193945050505083811015612348578093505b60008467ffffffffffffffff81111561236357612363613335565b60405190808252806020026020018201604052801561240a57816020015b6123f7604051806101000160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816123815790505b509050841561251c576000825b6124218785613b5e565b811115612519576006600086612438600185613b5e565b8151811061244857612448613a18565b602090810291909101810151825281810192909252604090810160002081516101008082018452825460ff8116151583520473ffffffffffffffffffffffffffffffffffffffff908116948201949094526001820154909316918301919091526002810154606083015260038101546080830152600481015460a0830152600581015460c08301526006015460e082015283518490849081106124ed576124ed613a18565b6020026020010181905250818061250390613ab3565b925050808061251190613bdb565b915050612417565b50505b95945050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526120b39084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613084565b815460009060ff1615156001148061261357506002830154155b1561264a576040517f21abe57a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117845583015473ffffffffffffffffffffffffffffffffffffffff166000818152600860205260409020805467ffffffffffffffff62010000909104169060026126bb83613aeb565b825467ffffffffffffffff9182166101009390930a9283029190920219909116179055506003840154600185015473ffffffffffffffffffffffffffffffffffffffff1615818511156128e5578554610100900473ffffffffffffffffffffffffffffffffffffffff1660006127318488613b5e565b9050600061273f8686613190565b9050600061274d8784613190565b9050600061275b8284613a05565b9050612767818b613b5e565b995060006127758489613b5e565b905060006127838487613b5e565b9050871561279a576127958783611f59565b6127fc565b6127bb73ffffffffffffffffffffffffffffffffffffffff8b168884612525565b6127fc73ffffffffffffffffffffffffffffffffffffffff8b167f000000000000000000000000000000000000000000000000000000000000000087612525565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631f61502389612844576000612846565b865b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff808c1660048301528e16602482015260448101859052606481018790526084016000604051808303818588803b1580156128c057600080fd5b505af11580156128d4573d6000803e3d6000fd5b505050505050505050505050612ba0565b8415612a84578554610100900473ffffffffffffffffffffffffffffffffffffffff1660006129148588613190565b90506129208188613b5e565b9650600061292e8886613b5e565b90508315612945576129408389611f59565b6129a7565b61296673ffffffffffffffffffffffffffffffffffffffff8716848a612525565b6129a773ffffffffffffffffffffffffffffffffffffffff87167f000000000000000000000000000000000000000000000000000000000000000083612525565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d41b8c6f856129ef5760006129f1565b825b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff8a16600482015260248101859052604481018690526064016000604051808303818588803b158015612a6357600080fd5b505af1158015612a77573d6000803e3d6000fd5b5050505050505050612ba0565b80612aca57612aca73ffffffffffffffffffffffffffffffffffffffff84167f000000000000000000000000000000000000000000000000000000000000000084612525565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d41b8c6f82612b12576000612b14565b835b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff8716600482015260248101869052600060448201526064016000604051808303818588803b158015612b8657600080fd5b505af1158015612b9a573d6000803e3d6000fd5b50505050505b5050505060059190910181905590565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015612c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c419190613846565b5050509150506000811215612c54575060005b60048054604080517f5fbbc0d2000000000000000000000000000000000000000000000000000000008152905160009373ffffffffffffffffffffffffffffffffffffffff90931692635fbbc0d292808201926101209290918290030181865afa158015612cc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cea91906138a9565b505050505050505090506000670de0b6b3a7640000838363ffffffff1664e8d4a51000612d17919061398e565b612d21919061398e565b612d2b91906139d4565b90506000816002600301545a612d419088613b5e565b612d4b9190613a05565b612d55903a61398e565b612d5f9190613a05565b90508560060154811115612d7857506006850154612e2a565b6000818760060154612d8a9190613b5e565b8754610100900473ffffffffffffffffffffffffffffffffffffffff16600090815260096020526040812080549293508392909190612dca908490613a05565b909155505060068701829055865460405182815261010090910473ffffffffffffffffffffffffffffffffffffffff16907fab2ddf26d0afffee84a37c11fdb1fe69dc5c541f00f62051ec706e71871638c89060200160405180910390a2505b60018087015473ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604081209091018054839290612e67908490613a05565b9091555050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612ed29085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612577565b50505050565b60005474010000000000000000000000000000000000000000900460ff16610a8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610755565b606073ffffffffffffffffffffffffffffffffffffffff84163b613002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610755565b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161302a9190613c10565b600060405180830381855af49150503d8060008114613065576040519150601f19603f3d011682016040523d82523d6000602084013e61306a565b606091505b509150915061307a8282866131d3565b9695505050505050565b60006130e6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166132269092919063ffffffff16565b8051909150156120b357808060200190518101906131049190613b41565b6120b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610755565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260086020526040812054612710906131c990849061ffff1661398e565b6122bf91906139d4565b606083156131e25750816122bf565b8251156131f25782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107559190613c2c565b6060610e9484846000858573ffffffffffffffffffffffffffffffffffffffff85163b6132af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610755565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516132d89190613c10565b60006040518083038185875af1925050503d8060008114613315576040519150601f19603f3d011682016040523d82523d6000602084013e61331a565b606091505b509150915061332a8282866131d3565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806040838503121561337757600080fd5b8235915060208084013567ffffffffffffffff8082111561339757600080fd5b818601915086601f8301126133ab57600080fd5b8135818111156133bd576133bd613335565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561340057613400613335565b60405291825284820192508381018501918983111561341e57600080fd5b938501935b8285101561343c57843584529385019392850192613423565b8096505050505050509250929050565b60006020828403121561345e57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146114e257600080fd5b60006020828403121561349957600080fd5b81356122bf81613465565b80151581146114e257600080fd5b6000806000606084860312156134c757600080fd5b83356134d2816134a4565b925060208401356134e281613465565b929592945050506040919091013590565b803561ffff8116811461350557600080fd5b919050565b6000806040838503121561351d57600080fd5b823561352881613465565b9150613536602084016134f3565b90509250929050565b60008060006060848603121561355457600080fd5b61355d846134f3565b95602085013595506040909401359392505050565b6000806020838503121561358557600080fd5b823567ffffffffffffffff8082111561359d57600080fd5b818501915085601f8301126135b157600080fd5b8135818111156135c057600080fd5b8660208260051b85010111156135d557600080fd5b60209290920196919550909350505050565b60005b838110156136025781810151838201526020016135ea565b50506000910152565b600081518084526136238160208601602086016135e7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156136c8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526136b685835161360b565b9450928501929085019060010161367c565b5092979650505050505050565b600080604083850312156136e857600080fd5b82356136f381613465565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b828110156137b757815180518051151586528781015173ffffffffffffffffffffffffffffffffffffffff90811689880152878201511687870152606080820151908701526080808201519087015260a0808201519087015260c0808201519087015260e0908101519086015286015180511515610100860152602001511515610120850152610140909301929085019060010161371e565b5091979650505050505050565b63ffffffff811681146114e257600080fd5b600080604083850312156137e957600080fd5b82356137f481613465565b91506020830135613804816137c4565b809150509250929050565b60006020828403121561382157600080fd5b81516122bf81613465565b805169ffffffffffffffffffff8116811461350557600080fd5b600080600080600060a0868803121561385e57600080fd5b6138678661382c565b945060208601519350604086015192506060860151915061388a6080870161382c565b90509295509295909350565b805162ffffff8116811461350557600080fd5b60008060008060008060008060006101208a8c0312156138c857600080fd5b89516138d3816137c4565b60208b01519099506138e4816137c4565b60408b01519098506138f5816137c4565b60608b0151909750613906816137c4565b60808b0151909650613917816137c4565b945061392560a08b01613896565b935061393360c08b01613896565b925061394160e08b01613896565b91506139506101008b01613896565b90509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610f8c57610f8c61395f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826139e3576139e36139a5565b500490565b63ffffffff818116838216019080821115610f8a57610f8a61395f565b80820180821115610f8c57610f8c61395f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613a7c57600080fd5b83018035915067ffffffffffffffff821115613a9757600080fd5b602001915036819003821315613aac57600080fd5b9250929050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613ae457613ae461395f565b5060010190565b600067ffffffffffffffff821680613b0557613b0561395f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b600082613b3c57613b3c6139a5565b500690565b600060208284031215613b5357600080fd5b81516122bf816134a4565b81810381811115610f8c57610f8c61395f565b600060208284031215613b8357600080fd5b5051919050565b600060208284031215613b9c57600080fd5b815167ffffffffffffffff811681146122bf57600080fd5b600067ffffffffffffffff808316818103613bd157613bd161395f565b6001019392505050565b600081613bea57613bea61395f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008251613c228184602087016135e7565b9190910192915050565b6020815260006122bf602083018461360b56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207815c3b79aa55b45bc979fcdb721854fd23f66f036bbdc0715a24e339f29604a64736f6c63430008110033000000000000000000000000999b6d28a9e78c4be13d51469c49585d6d25be5e000000000000000000000000ae975071be8f8ee67addbc1a82488f1c248580670000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802

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

000000000000000000000000999b6d28a9e78c4be13d51469c49585d6d25be5e000000000000000000000000ae975071be8f8ee67addbc1a82488f1c248580670000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802

-----Decoded View---------------
Arg [0] : bankAddress (address): 0x999b6d28a9e78c4be13d51469c49585d6d25be5e
Arg [1] : chainlinkCoordinatorAddress (address): 0xae975071be8f8ee67addbc1a82488f1c24858067
Arg [2] : LINK_ETH_feedAddress (address): 0x5787befdc0ecd210dfa948264631cd53e68f7802

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000999b6d28a9e78c4be13d51469c49585d6d25be5e
Arg [1] : 000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067
Arg [2] : 0000000000000000000000005787befdc0ecd210dfa948264631cd53e68f7802


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