ETH Price: $2,288.03 (+3.38%)

Contract

0xCf612DB8d890f474031D8d7F3E39788D36f08774
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Cancel PVP179364222023-08-17 18:48:11566 days ago1692298091IN
0xCf612DB8...D36f08774
0 ETH0.0020781129.44670849
Create PVP179363462023-08-17 18:32:59566 days ago1692297179IN
0xCf612DB8...D36f08774
0 ETH0.006854434.10457872
Cancel PVP179363322023-08-17 18:30:11566 days ago1692297011IN
0xCf612DB8...D36f08774
0 ETH0.0024174334.25491744
Cancel PVP179363052023-08-17 18:24:35566 days ago1692296675IN
0xCf612DB8...D36f08774
0 ETH0.0033605437.94140393
Cancel PVP179363012023-08-17 18:23:47566 days ago1692296627IN
0xCf612DB8...D36f08774
0 ETH0.0033767935.670604
Cancel PVP179363002023-08-17 18:23:35566 days ago1692296615IN
0xCf612DB8...D36f08774
0 ETH0.0025609636.28863072
Cancel PVP179362982023-08-17 18:23:11566 days ago1692296591IN
0xCf612DB8...D36f08774
0 ETH0.0033030636.09351048
Create PVP179351832023-08-17 14:37:59566 days ago1692283079IN
0xCf612DB8...D36f08774
0.25 ETH0.0050431538.11332867
Cancel PVP179351802023-08-17 14:37:23566 days ago1692283043IN
0xCf612DB8...D36f08774
0 ETH0.0036177739.38099193
Cancel PVP179349912023-08-17 13:59:35566 days ago1692280775IN
0xCf612DB8...D36f08774
0 ETH0.003866340.99398256
Create PVP179349282023-08-17 13:46:35566 days ago1692279995IN
0xCf612DB8...D36f08774
0 ETH0.0069149537.04137783
Cancel PVP179347622023-08-17 13:13:11566 days ago1692277991IN
0xCf612DB8...D36f08774
0 ETH0.0021008322.27491446
Enter PVP179346132023-08-17 12:43:23566 days ago1692276203IN
0xCf612DB8...D36f08774
0 ETH0.0045005223.7790803
Enter PVP179322092023-08-17 4:39:23567 days ago1692247163IN
0xCf612DB8...D36f08774
0 ETH0.0035085618.53793226
Create PVP179310302023-08-17 0:41:23567 days ago1692232883IN
0xCf612DB8...D36f08774
0 ETH0.0051151327.40201017
Create PVP179309052023-08-17 0:16:11567 days ago1692231371IN
0xCf612DB8...D36f08774
0 ETH0.0051617827.65015026
Enter PVP179306582023-08-16 23:26:11567 days ago1692228371IN
0xCf612DB8...D36f08774
0 ETH0.0070102837.03970925
Enter PVP179305782023-08-16 23:10:11567 days ago1692227411IN
0xCf612DB8...D36f08774
0.3 ETH0.0056898336.70840103
Create PVP179305672023-08-16 23:07:59567 days ago1692227279IN
0xCf612DB8...D36f08774
0.3 ETH0.0050962938.51493185
Enter PVP179305582023-08-16 23:06:11567 days ago1692227171IN
0xCf612DB8...D36f08774
0 ETH0.0067271835.54394674
Create PVP179305572023-08-16 23:05:59567 days ago1692227159IN
0xCf612DB8...D36f08774
0 ETH0.0066787235.77594385
Create PVP179305562023-08-16 23:05:47567 days ago1692227147IN
0xCf612DB8...D36f08774
0.6 ETH0.0047516435.91026676
Create PVP179305502023-08-16 23:04:35567 days ago1692227075IN
0xCf612DB8...D36f08774
0 ETH0.0064754434.68702646
Enter PVP179305422023-08-16 23:02:59567 days ago1692226979IN
0xCf612DB8...D36f08774
0 ETH0.0067090735.44825763
Create PVP179305322023-08-16 23:00:59567 days ago1692226859IN
0xCf612DB8...D36f08774
0 ETH0.0076067540.74711129
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
179363012023-08-17 18:23:47566 days ago1692296627
0xCf612DB8...D36f08774
0.25 ETH
179351802023-08-17 14:37:23566 days ago1692283043
0xCf612DB8...D36f08774
0.6 ETH
179305822023-08-16 23:10:59567 days ago1692227459
0xCf612DB8...D36f08774
0.03 ETH
179305822023-08-16 23:10:59567 days ago1692227459
0xCf612DB8...D36f08774
0.57 ETH
179292342023-08-16 18:40:11567 days ago1692211211
0xCf612DB8...D36f08774
0.05 ETH
179292342023-08-16 18:40:11567 days ago1692211211
0xCf612DB8...D36f08774
0.95 ETH
179282622023-08-16 15:24:11567 days ago1692199451
0xCf612DB8...D36f08774
0.05 ETH
179282622023-08-16 15:24:11567 days ago1692199451
0xCf612DB8...D36f08774
0.95 ETH
179280052023-08-16 14:32:23567 days ago1692196343
0xCf612DB8...D36f08774
0.1 ETH
179280052023-08-16 14:32:23567 days ago1692196343
0xCf612DB8...D36f08774
1.9 ETH
179275062023-08-16 12:51:11567 days ago1692190271
0xCf612DB8...D36f08774
0.1 ETH
179275062023-08-16 12:51:11567 days ago1692190271
0xCf612DB8...D36f08774
1.9 ETH
179274642023-08-16 12:42:47567 days ago1692189767
0xCf612DB8...D36f08774
0.05 ETH
179274642023-08-16 12:42:47567 days ago1692189767
0xCf612DB8...D36f08774
0.95 ETH
179274332023-08-16 12:36:35567 days ago1692189395
0xCf612DB8...D36f08774
0.1 ETH
179274332023-08-16 12:36:35567 days ago1692189395
0xCf612DB8...D36f08774
1.9 ETH
179273422023-08-16 12:18:23567 days ago1692188303
0xCf612DB8...D36f08774
0.05 ETH
179273422023-08-16 12:18:23567 days ago1692188303
0xCf612DB8...D36f08774
0.95 ETH
179273102023-08-16 12:11:59567 days ago1692187919
0xCf612DB8...D36f08774
0.08 ETH
179273102023-08-16 12:11:59567 days ago1692187919
0xCf612DB8...D36f08774
1.52 ETH
179272482023-08-16 11:59:35567 days ago1692187175
0xCf612DB8...D36f08774
0.02 ETH
179272482023-08-16 11:59:35567 days ago1692187175
0xCf612DB8...D36f08774
0.38 ETH
179272212023-08-16 11:54:11567 days ago1692186851
0xCf612DB8...D36f08774
0.025 ETH
179272212023-08-16 11:54:11567 days ago1692186851
0xCf612DB8...D36f08774
0.475 ETH
179244712023-08-16 2:39:47568 days ago1692153587
0xCf612DB8...D36f08774
0.01 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DebaucheryPVP

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : DebaucheryPVP.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol';
import '@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';

contract DebaucheryPVP is Context, Ownable, VRFConsumerBaseV2 {
  using SafeERC20 for IERC20;

  address public constant EXCESS = 0x0a7D7B118c57e956E5C2Ca9e0f1b4AA1D2aAA9c3;

  uint256 public createFee;
  uint256 public enterFee;

  VRFCoordinatorV2Interface _clCoordinator;
  uint64 _clSubId;
  bytes32 _clKeyHash;
  uint16 _clBlocks = 3;
  uint32 _clCallbackLimit = 300000;

  uint256 public latestGameNumber;
  // game number => current pvps idx
  mapping(uint256 => uint256) _gameNumberIdx;
  // VRF request ID => game number
  mapping(uint256 => uint256) _settleInfo;
  // game number => VRF request ID
  mapping(uint256 => uint256) _settleInfReqIdIdx;

  struct PVP {
    uint256 gameNumber;
    address p1;
    address p2;
    address forceP2;
    address pvpToken;
    uint256 pvpAmount;
  }
  PVP[] public pvps;

  event Create(
    uint256 indexed gameNumber,
    address p1,
    address pvpToken,
    uint256 amount
  );
  event Cancel(uint256 indexed gameNumber, address requestor, address p1);
  event Enter(
    uint256 indexed gameNumber,
    uint256 requestId,
    address p1,
    address p2,
    address pvpToken,
    uint256 pvpAmount
  );
  event Settle(
    uint256 indexed gameNumber,
    uint256 requestId,
    address p1,
    address p2,
    address pvpToken,
    uint256 pvpAmount,
    address winner,
    uint256 amountWon
  );

  constructor(
    address _coordinator,
    uint64 _subId,
    bytes32 _keyHash
  ) VRFConsumerBaseV2(_coordinator) {
    _clCoordinator = VRFCoordinatorV2Interface(_coordinator);
    _clSubId = _subId;
    _clKeyHash = _keyHash;
  }

  function createPVP(
    address _pvpToken,
    uint256 _pvpAmount,
    address _forceP2
  ) external payable {
    if (_pvpToken == address(0)) {
      require(msg.value == _pvpAmount + createFee, 'ETH');
    } else {
      require(msg.value == createFee, 'ETH');
      require(_pvpToken == EXCESS, 'TOKEN');
      IERC20 token = IERC20(_pvpToken);
      token.safeTransferFrom(_msgSender(), address(this), _pvpAmount);
    }
    _processFee(createFee);
    latestGameNumber++;
    _gameNumberIdx[latestGameNumber] = pvps.length;
    pvps.push(
      PVP({
        gameNumber: latestGameNumber,
        p1: _msgSender(),
        p2: address(0),
        forceP2: _forceP2,
        pvpToken: _pvpToken,
        pvpAmount: _pvpAmount
      })
    );
    emit Create(latestGameNumber, _msgSender(), _pvpToken, _pvpAmount);
  }

  function cancelPVP(uint256 _gameNumber) external {
    require(_settleInfReqIdIdx[_gameNumber] == 0, 'SETTLING');

    uint256 _idx = _gameNumberIdx[_gameNumber];
    PVP memory _pvp = pvps[_idx];
    require(_pvp.p1 == _msgSender() || owner() == _msgSender(), 'AUTH');
    _removePVP(_gameNumber);

    if (_pvp.pvpToken == address(0)) {
      uint256 _balBefore = address(this).balance;
      (bool success, ) = payable(_pvp.p1).call{ value: _pvp.pvpAmount }('');
      require(success, 'ETH');
      require(address(this).balance >= _balBefore - _pvp.pvpAmount, 'MEV');
    } else {
      IERC20(_pvp.pvpToken).safeTransfer(_pvp.p1, _pvp.pvpAmount);
    }
    emit Cancel(_gameNumber, _msgSender(), _pvp.p1);
  }

  function enterPVP(uint256 _gameNumber) external payable {
    require(_settleInfReqIdIdx[_gameNumber] == 0, 'SETTLING');
    uint256 _idx = _gameNumberIdx[_gameNumber];
    PVP storage _pvp = pvps[_idx];
    require(
      _pvp.gameNumber == _gameNumber && _pvp.p1 != _msgSender(),
      'VALIDATION'
    );
    require(
      _pvp.forceP2 == address(0) || _pvp.forceP2 == _msgSender(),
      'REQPLAYER2'
    );

    _pvp.p2 = _msgSender();

    if (_pvp.pvpToken == address(0)) {
      require(msg.value == _pvp.pvpAmount + enterFee, 'ETH');
    } else {
      require(msg.value == enterFee, 'ETH');
      IERC20(_pvp.pvpToken).safeTransferFrom(
        _msgSender(),
        address(this),
        _pvp.pvpAmount
      );
    }
    _processFee(enterFee);
    uint256 _requestId = _clCoordinator.requestRandomWords(
      _clKeyHash,
      _clSubId,
      _clBlocks,
      _clCallbackLimit,
      uint16(1)
    );
    _settleInfo[_requestId] = _gameNumber;
    _settleInfReqIdIdx[_gameNumber] = _requestId;
    emit Enter(
      _gameNumber,
      _requestId,
      _pvp.p1,
      _pvp.p2,
      _pvp.pvpToken,
      _pvp.pvpAmount
    );
  }

  function fulfillRandomWords(
    uint256 _requestId,
    uint256[] memory _randomWords
  ) internal override {
    uint256 _randomNumber = _randomWords[0];
    uint256 _gameNumber = _settleInfo[_requestId];
    uint256 _idx = _gameNumberIdx[_gameNumber];
    PVP memory _pvp = pvps[_idx];
    _removePVP(_gameNumber);

    uint256 _totalAmount = _pvp.pvpAmount * 2;
    uint256 _winAmount = (_totalAmount * 95) / 100;
    uint256 _adminAmount = _totalAmount - _winAmount;

    address _winner = _randomNumber % 2 == 0 ? _pvp.p1 : _pvp.p2;
    if (_pvp.pvpToken == address(0)) {
      uint256 _balBefore = address(this).balance;
      (bool success, ) = payable(_winner).call{ value: _winAmount }('');
      (bool success2, ) = payable(owner()).call{ value: _adminAmount }('');
      require(success && success2, 'ETH');
      require(address(this).balance >= _balBefore - _totalAmount, 'MEV');
    } else {
      IERC20(_pvp.pvpToken).safeTransfer(_winner, _winAmount);
      IERC20(_pvp.pvpToken).safeTransfer(owner(), _adminAmount);
    }

    emit Settle(
      _gameNumber,
      _requestId,
      _pvp.p1,
      _pvp.p2,
      _pvp.pvpToken,
      _pvp.pvpAmount,
      _winner,
      _winAmount
    );
  }

  function _processFee(uint256 _wei) internal {
    if (_wei == 0) {
      return;
    }
    (bool _s, ) = payable(owner()).call{ value: _wei }('');
    require(_s, 'FEE');
  }

  function _removePVP(uint256 _gameNumber) internal {
    uint256 _idx = _gameNumberIdx[_gameNumber];
    _gameNumberIdx[pvps[pvps.length - 1].gameNumber] = _idx;
    pvps[_idx] = pvps[pvps.length - 1];
    pvps.pop();
  }

  function getPVPsNum() external view returns (uint256) {
    return pvps.length;
  }

  function getPVPs() external view returns (PVP[] memory) {
    return pvps;
  }

  function setCreateFee(uint256 _wei) external onlyOwner {
    createFee = _wei;
  }

  function setEnterFee(uint256 _wei) external onlyOwner {
    enterFee = _wei;
  }

  function setClSubId(uint64 _subId) external onlyOwner {
    _clSubId = _subId;
  }

  function setClNumBlocks(uint16 _blocks) external onlyOwner {
    _clBlocks = _blocks;
  }

  function setClCallbackGasLimit(uint32 _gas) external onlyOwner {
    _clCallbackLimit = _gas;
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 4 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 6 of 10 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 7 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 9 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_coordinator","type":"address"},{"internalType":"uint64","name":"_subId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gameNumber","type":"uint256"},{"indexed":false,"internalType":"address","name":"requestor","type":"address"},{"indexed":false,"internalType":"address","name":"p1","type":"address"}],"name":"Cancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gameNumber","type":"uint256"},{"indexed":false,"internalType":"address","name":"p1","type":"address"},{"indexed":false,"internalType":"address","name":"pvpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gameNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"address","name":"p1","type":"address"},{"indexed":false,"internalType":"address","name":"p2","type":"address"},{"indexed":false,"internalType":"address","name":"pvpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"pvpAmount","type":"uint256"}],"name":"Enter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gameNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"address","name":"p1","type":"address"},{"indexed":false,"internalType":"address","name":"p2","type":"address"},{"indexed":false,"internalType":"address","name":"pvpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"pvpAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountWon","type":"uint256"}],"name":"Settle","type":"event"},{"inputs":[],"name":"EXCESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameNumber","type":"uint256"}],"name":"cancelPVP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pvpToken","type":"address"},{"internalType":"uint256","name":"_pvpAmount","type":"uint256"},{"internalType":"address","name":"_forceP2","type":"address"}],"name":"createPVP","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"enterFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gameNumber","type":"uint256"}],"name":"enterPVP","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getPVPs","outputs":[{"components":[{"internalType":"uint256","name":"gameNumber","type":"uint256"},{"internalType":"address","name":"p1","type":"address"},{"internalType":"address","name":"p2","type":"address"},{"internalType":"address","name":"forceP2","type":"address"},{"internalType":"address","name":"pvpToken","type":"address"},{"internalType":"uint256","name":"pvpAmount","type":"uint256"}],"internalType":"struct DebaucheryPVP.PVP[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPVPsNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestGameNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pvps","outputs":[{"internalType":"uint256","name":"gameNumber","type":"uint256"},{"internalType":"address","name":"p1","type":"address"},{"internalType":"address","name":"p2","type":"address"},{"internalType":"address","name":"forceP2","type":"address"},{"internalType":"address","name":"pvpToken","type":"address"},{"internalType":"uint256","name":"pvpAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_gas","type":"uint32"}],"name":"setClCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_blocks","type":"uint16"}],"name":"setClNumBlocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subId","type":"uint64"}],"name":"setClSubId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wei","type":"uint256"}],"name":"setCreateFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wei","type":"uint256"}],"name":"setEnterFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040526005805465ffffffffffff1916640493e0000317905534801562000026575f80fd5b5060405162001ced38038062001ced8339810160408190526200004991620000eb565b8262000055336200009c565b6001600160a01b03908116608052600380546001600160401b03909416600160a01b026001600160e01b031990941694909116939093179190911790915560045562000144565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f805f60608486031215620000fe575f80fd5b83516001600160a01b038116811462000115575f80fd5b60208501519093506001600160401b038116811462000132575f80fd5b80925050604084015190509250925092565b608051611b89620001645f395f8181610448015261048a0152611b895ff3fe608060405260043610610110575f3560e01c80638da5cb5b1161009d578063ca5a0f8011610062578063ca5a0f8014610307578063e3f68b4114610328578063ed8b7d581461033d578063f2fde38b14610350578063f3a75a341461036f575f80fd5b80638da5cb5b1461025d578063a16a57291461028d578063aa1cd049146102b4578063b2db919b146102d3578063b46d7a2f146102e8575f80fd5b80631fe543e3116100e35780631fe543e3146101d9578063303edbfb146101f85780634684a5e91461020b578063629148491461022a578063715018a614610249575f80fd5b8063016879c6146101145780630bb521531461017657806316310c4d1461019957806317cca908146101ba575b5f80fd5b34801561011f575f80fd5b5061013361012e366004611791565b610383565b604080519687526001600160a01b039586166020880152938516938601939093529083166060850152909116608083015260a082015260c0015b60405180910390f35b348015610181575f80fd5b5061018b60025481565b60405190815260200161016d565b3480156101a4575f80fd5b506101b86101b33660046117a8565b6103db565b005b3480156101c5575f80fd5b506101b86101d43660046117d2565b610407565b3480156101e4575f80fd5b506101b86101f336600461180d565b61043d565b6101b86102063660046118ed565b6104ca565b348015610216575f80fd5b506101b8610225366004611926565b61078e565b348015610235575f80fd5b506101b8610244366004611791565b6107ae565b348015610254575f80fd5b506101b86107bb565b348015610268575f80fd5b505f546001600160a01b03165b6040516001600160a01b03909116815260200161016d565b348015610298575f80fd5b50610275730a7d7b118c57e956e5c2ca9e0f1b4aa1d2aaa9c381565b3480156102bf575f80fd5b506101b86102ce366004611791565b6107ce565b3480156102de575f80fd5b5061018b60015481565b3480156102f3575f80fd5b506101b8610302366004611791565b610a60565b348015610312575f80fd5b5061031b610a6d565b60405161016d9190611947565b348015610333575f80fd5b5061018b60065481565b6101b861034b366004611791565b610b12565b34801561035b575f80fd5b506101b861036a3660046119d0565b610e2c565b34801561037a575f80fd5b50600a5461018b565b600a8181548110610392575f80fd5b5f9182526020909120600690910201805460018201546002830154600384015460048501546005909501549395506001600160a01b039283169491831693908316929091169086565b6103e3610ea5565b6005805463ffffffff909216620100000265ffffffff000019909216919091179055565b61040f610ea5565b6003805467ffffffffffffffff909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104bc5760405163073e64fd60e21b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6104c68282610efe565b5050565b6001600160a01b038316610508576001546104e590836119fd565b34146105035760405162461bcd60e51b81526004016104b390611a16565b610595565b60015434146105295760405162461bcd60e51b81526004016104b390611a16565b6001600160a01b038316730a7d7b118c57e956e5c2ca9e0f1b4aa1d2aaa9c31461057d5760405162461bcd60e51b81526020600482015260056024820152642a27a5a2a760d91b60448201526064016104b3565b826105936001600160a01b03821633308661122e565b505b6105a060015461129f565b60068054905f6105af83611a33565b9091555050600a8054600680545f908152600760209081526040808320859055805160c08101825284548152339281018381529181018481526001600160a01b03898116606084019081528c82166080850190815260a085018d815260018b018c559a90975292519787027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a881019890985592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a9880180546001600160a01b031990811692861692909217905590517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa88018054831691851691909117905590517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab87018054831691841691909117905592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ac8601805490941691161790915592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ad9092019190915554907ff03c0794e29ab9041701d90faa819fd394c96b5d374215f11d7dd03839606d5e90604080516001600160a01b039283168152918716602083015281018590526060015b60405180910390a2505050565b610796610ea5565b6005805461ffff191661ffff92909216919091179055565b6107b6610ea5565b600155565b6107c3610ea5565b6107cc5f61132f565b565b5f81815260096020526040902054156108145760405162461bcd60e51b8152602060048201526008602482015267534554544c494e4760c01b60448201526064016104b3565b5f81815260076020526040812054600a80549192918390811061083957610839611a4b565b5f9182526020918290206040805160c08101825260069093029091018054835260018101546001600160a01b039081169484019490945260028101548416918301919091526003810154831660608301526004810154909216608082015260059091015460a082015290506108ab3390565b6001600160a01b031681602001516001600160a01b031614806108d757505f546001600160a01b031633145b61090c5760405162461bcd60e51b81526004016104b390602080825260049082015263082aaa8960e31b604082015260600190565b6109158361137e565b60808101516001600160a01b03166109eb57602081015160a082015160405147925f926001600160a01b03909116918381818185875af1925050503d805f811461097a576040519150601f19603f3d011682016040523d82523d5f602084013e61097f565b606091505b50509050806109a05760405162461bcd60e51b81526004016104b390611a16565b60a08301516109af9083611a5f565b4710156109e45760405162461bcd60e51b815260206004820152600360248201526226a2ab60e91b60448201526064016104b3565b5050610a15565b610a1581602001518260a0015183608001516001600160a01b03166114ff9092919063ffffffff16565b827f789f8a0b90cb5b009f91a043ae5e1b06674fc2ec6262b58971b87220683951503383602001516040516107819291906001600160a01b0392831681529116602082015260400190565b610a68610ea5565b600255565b6060600a805480602002602001604051908101604052809291908181526020015f905b82821015610b09575f8481526020908190206040805160c08101825260068602909201805483526001808201546001600160a01b03908116858701526002830154811693850193909352600382015483166060850152600482015490921660808401526005015460a08301529083529092019101610a90565b50505050905090565b5f8181526009602052604090205415610b585760405162461bcd60e51b8152602060048201526008602482015267534554544c494e4760c01b60448201526064016104b3565b5f81815260076020526040812054600a805491929183908110610b7d57610b7d611a4b565b905f5260205f209060060201905082815f0154148015610baa575060018101546001600160a01b03163314155b610be35760405162461bcd60e51b815260206004820152600a6024820152692b20a624a220aa24a7a760b11b60448201526064016104b3565b60038101546001600160a01b03161580610c09575060038101546001600160a01b031633145b610c425760405162461bcd60e51b815260206004820152600a6024820152692922a8a82620aca2a91960b11b60448201526064016104b3565b6002810180546001600160a01b0319163317905560048101546001600160a01b0316610c9d576002548160050154610c7a91906119fd565b3414610c985760405162461bcd60e51b81526004016104b390611a16565b610cde565b6002543414610cbe5760405162461bcd60e51b81526004016104b390611a16565b610cde33600583015460048401546001600160a01b03169190309061122e565b610ce960025461129f565b600354600480546005546040516305d3b1d360e41b815292830191909152600160a01b830467ffffffffffffffff16602483015261ffff8116604483015262010000900463ffffffff166064820152600160848201525f916001600160a01b031690635d3b1d309060a4016020604051808303815f875af1158015610d70573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d949190611a72565b5f8181526008602090815260408083208890558783526009825291829020839055600185015460028601546004870154600588015485518781526001600160a01b0394851695810195909552918316848601529190911660608301526080820152905191925085917f10e64a238aa2168f823dd383833198cd4b8871890fc553146bac46be353c8b859181900360a00190a250505050565b610e34610ea5565b6001600160a01b038116610e995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b3565b610ea28161132f565b50565b5f546001600160a01b031633146107cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b3565b5f815f81518110610f1157610f11611a4b565b6020908102919091018101515f858152600883526040808220548083526007909452812054600a8054939550909283908110610f4f57610f4f611a4b565b5f9182526020918290206040805160c08101825260069093029091018054835260018101546001600160a01b039081169484019490945260028101548416918301919091526003810154831660608301526004810154909216608082015260059091015460a08201529050610fc38361137e565b5f8160a001516002610fd59190611a89565b90505f6064610fe583605f611a89565b610fef9190611ab4565b90505f610ffc8284611a5f565b90505f61100a600289611ac7565b1561101957846040015161101f565b84602001515b60808601519091506001600160a01b03166111565760405147905f906001600160a01b0384169086908381818185875af1925050503d805f811461107e576040519150601f19603f3d011682016040523d82523d5f602084013e611083565b606091505b505090505f6110995f546001600160a01b031690565b6001600160a01b0316856040515f6040518083038185875af1925050503d805f81146110e0576040519150601f19603f3d011682016040523d82523d5f602084013e6110e5565b606091505b505090508180156110f35750805b61110f5760405162461bcd60e51b81526004016104b390611a16565b6111198784611a5f565b47101561114e5760405162461bcd60e51b815260206004820152600360248201526226a2ab60e91b60448201526064016104b3565b505050611198565b608085015161116f906001600160a01b031682856114ff565b6111986111835f546001600160a01b031690565b60808701516001600160a01b031690846114ff565b867f7ebf4410bddac83d61968eb9cea63282d1c4443cc5b7d757b083543ba59e4ee68b8760200151886040015189608001518a60a00151878a60405161121a97969594939291909687526001600160a01b03958616602088015293851660408701529184166060860152608085015290911660a083015260c082015260e00190565b60405180910390a250505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526112999085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611534565b50505050565b805f036112a95750565b5f80546040516001600160a01b039091169083908381818185875af1925050503d805f81146112f3576040519150601f19603f3d011682016040523d82523d5f602084013e6112f8565b606091505b50509050806104c65760405162461bcd60e51b815260206004820152600360248201526246454560e81b60448201526064016104b3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f818152600760208190526040822054600a805491938493929091906113a690600190611a5f565b815481106113b6576113b6611a4b565b5f91825260208083206006909202909101548352820192909252604001902055600a80546113e690600190611a5f565b815481106113f6576113f6611a4b565b905f5260205f209060060201600a828154811061141557611415611a4b565b5f9182526020909120825460069092020190815560018083015490820180546001600160a01b03199081166001600160a01b0393841617909155600280850154908401805483169184169190911790556003808501549084018054831691841691909117905560048085015490840180549092169216919091179055600591820154910155600a8054806114ab576114ab611ada565b5f8281526020812060065f19909301928302018181556001810180546001600160a01b0319908116909155600282018054821690556003820180548216905560048201805490911690556005015590555050565b6040516001600160a01b03831660248201526044810182905261152f90849063a9059cbb60e01b90606401611262565b505050565b5f611588826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116079092919063ffffffff16565b905080515f14806115a85750808060200190518101906115a89190611aee565b61152f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b3565b606061161584845f8561161d565b949350505050565b60608247101561167e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b3565b5f80866001600160a01b031685876040516116999190611b2f565b5f6040518083038185875af1925050503d805f81146116d3576040519150601f19603f3d011682016040523d82523d5f602084013e6116d8565b606091505b50915091506116e9878383876116f4565b979650505050505050565b606083156117625782515f0361175b576001600160a01b0385163b61175b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b3565b5081611615565b61161583838151156117775781518083602001fd5b8060405162461bcd60e51b81526004016104b39190611b4a565b5f602082840312156117a1575f80fd5b5035919050565b5f602082840312156117b8575f80fd5b813563ffffffff811681146117cb575f80fd5b9392505050565b5f602082840312156117e2575f80fd5b813567ffffffffffffffff811681146117cb575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561181e575f80fd5b8235915060208084013567ffffffffffffffff8082111561183d575f80fd5b818601915086601f830112611850575f80fd5b813581811115611862576118626117f9565b8060051b604051601f19603f83011681018181108582111715611887576118876117f9565b6040529182528482019250838101850191898311156118a4575f80fd5b938501935b828510156118c2578435845293850193928501926118a9565b8096505050505050509250929050565b80356001600160a01b03811681146118e8575f80fd5b919050565b5f805f606084860312156118ff575f80fd5b611908846118d2565b92506020840135915061191d604085016118d2565b90509250925092565b5f60208284031215611936575f80fd5b813561ffff811681146117cb575f80fd5b602080825282518282018190525f919060409081850190868401855b828110156119c357815180518552868101516001600160a01b0390811688870152868201518116878701526060808301518216908701526080808301519091169086015260a0908101519085015260c09093019290850190600101611963565b5091979650505050505050565b5f602082840312156119e0575f80fd5b6117cb826118d2565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611a1057611a106119e9565b92915050565b60208082526003908201526208aa8960eb1b604082015260600190565b5f60018201611a4457611a446119e9565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b81810381811115611a1057611a106119e9565b5f60208284031215611a82575f80fd5b5051919050565b8082028115828204841417611a1057611a106119e9565b634e487b7160e01b5f52601260045260245ffd5b5f82611ac257611ac2611aa0565b500490565b5f82611ad557611ad5611aa0565b500690565b634e487b7160e01b5f52603160045260245ffd5b5f60208284031215611afe575f80fd5b815180151581146117cb575f80fd5b5f5b83811015611b27578181015183820152602001611b0f565b50505f910152565b5f8251611b40818460208701611b0d565b9190910192915050565b602081525f8251806020840152611b68816040850160208701611b0d565b601f01601f1916919091016040019291505056fea164736f6c6343000814000a000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000003338af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef

Deployed Bytecode

0x608060405260043610610110575f3560e01c80638da5cb5b1161009d578063ca5a0f8011610062578063ca5a0f8014610307578063e3f68b4114610328578063ed8b7d581461033d578063f2fde38b14610350578063f3a75a341461036f575f80fd5b80638da5cb5b1461025d578063a16a57291461028d578063aa1cd049146102b4578063b2db919b146102d3578063b46d7a2f146102e8575f80fd5b80631fe543e3116100e35780631fe543e3146101d9578063303edbfb146101f85780634684a5e91461020b578063629148491461022a578063715018a614610249575f80fd5b8063016879c6146101145780630bb521531461017657806316310c4d1461019957806317cca908146101ba575b5f80fd5b34801561011f575f80fd5b5061013361012e366004611791565b610383565b604080519687526001600160a01b039586166020880152938516938601939093529083166060850152909116608083015260a082015260c0015b60405180910390f35b348015610181575f80fd5b5061018b60025481565b60405190815260200161016d565b3480156101a4575f80fd5b506101b86101b33660046117a8565b6103db565b005b3480156101c5575f80fd5b506101b86101d43660046117d2565b610407565b3480156101e4575f80fd5b506101b86101f336600461180d565b61043d565b6101b86102063660046118ed565b6104ca565b348015610216575f80fd5b506101b8610225366004611926565b61078e565b348015610235575f80fd5b506101b8610244366004611791565b6107ae565b348015610254575f80fd5b506101b86107bb565b348015610268575f80fd5b505f546001600160a01b03165b6040516001600160a01b03909116815260200161016d565b348015610298575f80fd5b50610275730a7d7b118c57e956e5c2ca9e0f1b4aa1d2aaa9c381565b3480156102bf575f80fd5b506101b86102ce366004611791565b6107ce565b3480156102de575f80fd5b5061018b60015481565b3480156102f3575f80fd5b506101b8610302366004611791565b610a60565b348015610312575f80fd5b5061031b610a6d565b60405161016d9190611947565b348015610333575f80fd5b5061018b60065481565b6101b861034b366004611791565b610b12565b34801561035b575f80fd5b506101b861036a3660046119d0565b610e2c565b34801561037a575f80fd5b50600a5461018b565b600a8181548110610392575f80fd5b5f9182526020909120600690910201805460018201546002830154600384015460048501546005909501549395506001600160a01b039283169491831693908316929091169086565b6103e3610ea5565b6005805463ffffffff909216620100000265ffffffff000019909216919091179055565b61040f610ea5565b6003805467ffffffffffffffff909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146104bc5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091660248201526044015b60405180910390fd5b6104c68282610efe565b5050565b6001600160a01b038316610508576001546104e590836119fd565b34146105035760405162461bcd60e51b81526004016104b390611a16565b610595565b60015434146105295760405162461bcd60e51b81526004016104b390611a16565b6001600160a01b038316730a7d7b118c57e956e5c2ca9e0f1b4aa1d2aaa9c31461057d5760405162461bcd60e51b81526020600482015260056024820152642a27a5a2a760d91b60448201526064016104b3565b826105936001600160a01b03821633308661122e565b505b6105a060015461129f565b60068054905f6105af83611a33565b9091555050600a8054600680545f908152600760209081526040808320859055805160c08101825284548152339281018381529181018481526001600160a01b03898116606084019081528c82166080850190815260a085018d815260018b018c559a90975292519787027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a881019890985592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a9880180546001600160a01b031990811692861692909217905590517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2aa88018054831691851691909117905590517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ab87018054831691841691909117905592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ac8601805490941691161790915592517fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2ad9092019190915554907ff03c0794e29ab9041701d90faa819fd394c96b5d374215f11d7dd03839606d5e90604080516001600160a01b039283168152918716602083015281018590526060015b60405180910390a2505050565b610796610ea5565b6005805461ffff191661ffff92909216919091179055565b6107b6610ea5565b600155565b6107c3610ea5565b6107cc5f61132f565b565b5f81815260096020526040902054156108145760405162461bcd60e51b8152602060048201526008602482015267534554544c494e4760c01b60448201526064016104b3565b5f81815260076020526040812054600a80549192918390811061083957610839611a4b565b5f9182526020918290206040805160c08101825260069093029091018054835260018101546001600160a01b039081169484019490945260028101548416918301919091526003810154831660608301526004810154909216608082015260059091015460a082015290506108ab3390565b6001600160a01b031681602001516001600160a01b031614806108d757505f546001600160a01b031633145b61090c5760405162461bcd60e51b81526004016104b390602080825260049082015263082aaa8960e31b604082015260600190565b6109158361137e565b60808101516001600160a01b03166109eb57602081015160a082015160405147925f926001600160a01b03909116918381818185875af1925050503d805f811461097a576040519150601f19603f3d011682016040523d82523d5f602084013e61097f565b606091505b50509050806109a05760405162461bcd60e51b81526004016104b390611a16565b60a08301516109af9083611a5f565b4710156109e45760405162461bcd60e51b815260206004820152600360248201526226a2ab60e91b60448201526064016104b3565b5050610a15565b610a1581602001518260a0015183608001516001600160a01b03166114ff9092919063ffffffff16565b827f789f8a0b90cb5b009f91a043ae5e1b06674fc2ec6262b58971b87220683951503383602001516040516107819291906001600160a01b0392831681529116602082015260400190565b610a68610ea5565b600255565b6060600a805480602002602001604051908101604052809291908181526020015f905b82821015610b09575f8481526020908190206040805160c08101825260068602909201805483526001808201546001600160a01b03908116858701526002830154811693850193909352600382015483166060850152600482015490921660808401526005015460a08301529083529092019101610a90565b50505050905090565b5f8181526009602052604090205415610b585760405162461bcd60e51b8152602060048201526008602482015267534554544c494e4760c01b60448201526064016104b3565b5f81815260076020526040812054600a805491929183908110610b7d57610b7d611a4b565b905f5260205f209060060201905082815f0154148015610baa575060018101546001600160a01b03163314155b610be35760405162461bcd60e51b815260206004820152600a6024820152692b20a624a220aa24a7a760b11b60448201526064016104b3565b60038101546001600160a01b03161580610c09575060038101546001600160a01b031633145b610c425760405162461bcd60e51b815260206004820152600a6024820152692922a8a82620aca2a91960b11b60448201526064016104b3565b6002810180546001600160a01b0319163317905560048101546001600160a01b0316610c9d576002548160050154610c7a91906119fd565b3414610c985760405162461bcd60e51b81526004016104b390611a16565b610cde565b6002543414610cbe5760405162461bcd60e51b81526004016104b390611a16565b610cde33600583015460048401546001600160a01b03169190309061122e565b610ce960025461129f565b600354600480546005546040516305d3b1d360e41b815292830191909152600160a01b830467ffffffffffffffff16602483015261ffff8116604483015262010000900463ffffffff166064820152600160848201525f916001600160a01b031690635d3b1d309060a4016020604051808303815f875af1158015610d70573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d949190611a72565b5f8181526008602090815260408083208890558783526009825291829020839055600185015460028601546004870154600588015485518781526001600160a01b0394851695810195909552918316848601529190911660608301526080820152905191925085917f10e64a238aa2168f823dd383833198cd4b8871890fc553146bac46be353c8b859181900360a00190a250505050565b610e34610ea5565b6001600160a01b038116610e995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b3565b610ea28161132f565b50565b5f546001600160a01b031633146107cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b3565b5f815f81518110610f1157610f11611a4b565b6020908102919091018101515f858152600883526040808220548083526007909452812054600a8054939550909283908110610f4f57610f4f611a4b565b5f9182526020918290206040805160c08101825260069093029091018054835260018101546001600160a01b039081169484019490945260028101548416918301919091526003810154831660608301526004810154909216608082015260059091015460a08201529050610fc38361137e565b5f8160a001516002610fd59190611a89565b90505f6064610fe583605f611a89565b610fef9190611ab4565b90505f610ffc8284611a5f565b90505f61100a600289611ac7565b1561101957846040015161101f565b84602001515b60808601519091506001600160a01b03166111565760405147905f906001600160a01b0384169086908381818185875af1925050503d805f811461107e576040519150601f19603f3d011682016040523d82523d5f602084013e611083565b606091505b505090505f6110995f546001600160a01b031690565b6001600160a01b0316856040515f6040518083038185875af1925050503d805f81146110e0576040519150601f19603f3d011682016040523d82523d5f602084013e6110e5565b606091505b505090508180156110f35750805b61110f5760405162461bcd60e51b81526004016104b390611a16565b6111198784611a5f565b47101561114e5760405162461bcd60e51b815260206004820152600360248201526226a2ab60e91b60448201526064016104b3565b505050611198565b608085015161116f906001600160a01b031682856114ff565b6111986111835f546001600160a01b031690565b60808701516001600160a01b031690846114ff565b867f7ebf4410bddac83d61968eb9cea63282d1c4443cc5b7d757b083543ba59e4ee68b8760200151886040015189608001518a60a00151878a60405161121a97969594939291909687526001600160a01b03958616602088015293851660408701529184166060860152608085015290911660a083015260c082015260e00190565b60405180910390a250505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526112999085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611534565b50505050565b805f036112a95750565b5f80546040516001600160a01b039091169083908381818185875af1925050503d805f81146112f3576040519150601f19603f3d011682016040523d82523d5f602084013e6112f8565b606091505b50509050806104c65760405162461bcd60e51b815260206004820152600360248201526246454560e81b60448201526064016104b3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f818152600760208190526040822054600a805491938493929091906113a690600190611a5f565b815481106113b6576113b6611a4b565b5f91825260208083206006909202909101548352820192909252604001902055600a80546113e690600190611a5f565b815481106113f6576113f6611a4b565b905f5260205f209060060201600a828154811061141557611415611a4b565b5f9182526020909120825460069092020190815560018083015490820180546001600160a01b03199081166001600160a01b0393841617909155600280850154908401805483169184169190911790556003808501549084018054831691841691909117905560048085015490840180549092169216919091179055600591820154910155600a8054806114ab576114ab611ada565b5f8281526020812060065f19909301928302018181556001810180546001600160a01b0319908116909155600282018054821690556003820180548216905560048201805490911690556005015590555050565b6040516001600160a01b03831660248201526044810182905261152f90849063a9059cbb60e01b90606401611262565b505050565b5f611588826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116079092919063ffffffff16565b905080515f14806115a85750808060200190518101906115a89190611aee565b61152f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104b3565b606061161584845f8561161d565b949350505050565b60608247101561167e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104b3565b5f80866001600160a01b031685876040516116999190611b2f565b5f6040518083038185875af1925050503d805f81146116d3576040519150601f19603f3d011682016040523d82523d5f602084013e6116d8565b606091505b50915091506116e9878383876116f4565b979650505050505050565b606083156117625782515f0361175b576001600160a01b0385163b61175b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104b3565b5081611615565b61161583838151156117775781518083602001fd5b8060405162461bcd60e51b81526004016104b39190611b4a565b5f602082840312156117a1575f80fd5b5035919050565b5f602082840312156117b8575f80fd5b813563ffffffff811681146117cb575f80fd5b9392505050565b5f602082840312156117e2575f80fd5b813567ffffffffffffffff811681146117cb575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561181e575f80fd5b8235915060208084013567ffffffffffffffff8082111561183d575f80fd5b818601915086601f830112611850575f80fd5b813581811115611862576118626117f9565b8060051b604051601f19603f83011681018181108582111715611887576118876117f9565b6040529182528482019250838101850191898311156118a4575f80fd5b938501935b828510156118c2578435845293850193928501926118a9565b8096505050505050509250929050565b80356001600160a01b03811681146118e8575f80fd5b919050565b5f805f606084860312156118ff575f80fd5b611908846118d2565b92506020840135915061191d604085016118d2565b90509250925092565b5f60208284031215611936575f80fd5b813561ffff811681146117cb575f80fd5b602080825282518282018190525f919060409081850190868401855b828110156119c357815180518552868101516001600160a01b0390811688870152868201518116878701526060808301518216908701526080808301519091169086015260a0908101519085015260c09093019290850190600101611963565b5091979650505050505050565b5f602082840312156119e0575f80fd5b6117cb826118d2565b634e487b7160e01b5f52601160045260245ffd5b80820180821115611a1057611a106119e9565b92915050565b60208082526003908201526208aa8960eb1b604082015260600190565b5f60018201611a4457611a446119e9565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b81810381811115611a1057611a106119e9565b5f60208284031215611a82575f80fd5b5051919050565b8082028115828204841417611a1057611a106119e9565b634e487b7160e01b5f52601260045260245ffd5b5f82611ac257611ac2611aa0565b500490565b5f82611ad557611ad5611aa0565b500690565b634e487b7160e01b5f52603160045260245ffd5b5f60208284031215611afe575f80fd5b815180151581146117cb575f80fd5b5f5b83811015611b27578181015183820152602001611b0f565b50505f910152565b5f8251611b40818460208701611b0d565b9190910192915050565b602081525f8251806020840152611b68816040850160208701611b0d565b601f01601f1916919091016040019291505056fea164736f6c6343000814000a

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

000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990900000000000000000000000000000000000000000000000000000000000003338af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef

-----Decoded View---------------
Arg [0] : _coordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [1] : _subId (uint64): 819
Arg [2] : _keyHash (bytes32): 0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000333
Arg [2] : 8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.