Contract 0x3af256f4841945fbbf9159289557d7dc5bec4a8f

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7ff96981a5fdf7b5f3b5b60b4aa27b2efb4e4703795723b7c69a76dbbc9de251RCS280853352022-05-08 20:36:1017 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005652856437 30.428837548
0x5b3b156adbde5938e8a759bad0db87c2e3dc279b69fd63394abd547c896af650VRF Random Seed280853022022-05-08 20:35:0017 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.00363475508 30.428837607
0xf5d0bbd86a645da8fd6f54b9e10b6c0e2f389ad80c97d5c2f41eea682dcfb041RCS280852642022-05-08 20:33:4417 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.00565285654 30.428838102
0x2304ef8063695034c457fb78ac5cd2b6fe26b38b6dc8291849d68dd6c5be2750VRF Random Seed280852342022-05-08 20:32:4017 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003634755298 30.428839428
0x7331b4dbba7bec58ceeeb82cf13b899c9e91c73bdefc2e81f8e859a18239278bRCS280851992022-05-08 20:31:3017 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005652856905 30.428840066
0x586339f86d39527969dc66abcf0621bb953d6f1ac6e30190915661758649c804VRF Random Seed280851602022-05-08 20:30:0817 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.0036347553 30.428839448
0xc5ccee2629944bcc4e5f51308e3e512eb34cce79d37693e55b4f4b5229c49750RCS280850812022-05-08 20:27:2617 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005596886892 30.127558324
0xf4c3fe635197123173f0d2d482ee7f3845461c6a3e7695bfb4543c9d8f026430VRF Random Seed280850492022-05-08 20:26:1817 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003598764051 30.127533895
0x9b1b9bd2dd72e8166d1e5de86e022059971df4ca0f752ee466ae5ceccfc42141RCS280849592022-05-08 20:23:1417 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005596907666 30.12767015
0xd509b05107accf92fa9c68f41b0930253243b5d5a981a43007201076f3ba6a8dVRF Random Seed280849202022-05-08 20:21:5217 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003613242987 30.248746246
0xf7e353bc181ab0b90504387e90610d7f90c752ad15908461d43c207fa164548eRCS280848142022-05-08 20:18:1617 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005619400344 30.248746289
0xf45cc55b77b7a92975a7ecb09abd4c7eba24dc38db47c4683d54e32042876073VRF Random Seed280847832022-05-08 20:17:1017 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003724992781 31.184274568
0x8a89afb69c3d7a0d02f99a5dcecdcd26bcabfdeef2bb9843801a5b575f60971fRCS280847272022-05-08 20:15:1417 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005793196241 31.184274579
0xe709bae49db056ee484d3dcceac3d106f2e3c303ecc62d8d95cd8ffad6a9852eVRF Random Seed280846722022-05-08 20:13:2417 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003599061615 30.130024997
0x000b61d6400a13787d2e6babbb37b0a29b05df055bbe4f01fbc092dab44ea809RCS280846282022-05-08 20:11:5217 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.005597345133 30.130024997
0x5a69c920a61f181972394fff771b38718fd51b1bb7d6abe243d8b6a88160dcceVRF Random Seed280845952022-05-08 20:10:4217 days 9 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003599061616 30.130025
0xd4c0c5253351541a416c7a1230bcd0144a2e00cd662a1a005bdc1a9e4f0eacd9RCS280840302022-05-08 19:51:1617 days 10 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.006054610029 32.591442402
0x86dfeb6af549ea712be3ce879f40ff777d601de2af7b1cd6f34c3d3925acf62dVRF Random Seed280839932022-05-08 19:50:0217 days 10 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003933712551 32.931599996
0xfa735de4216ea8221e61585608e37b3a38468595d1a7b1410ae75e489dc6b461RCS280839392022-05-08 19:48:1017 days 10 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.006117783547 32.931499987
0xaba00825c2aa21eb257aa14391d0f2a2f562f3e1bbfad44bf28a9374618544c9VRF Random Seed280838812022-05-08 19:46:1017 days 10 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003933700605 32.931499989
0xa94fd74cc2bf30cf6d514a8c1d46c933f6d7327e6020fdf5d37688ea0d130490RCS280798612022-05-08 17:18:4217 days 12 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.583983341104 183.045015973
0x53d732fbaa44cfbac36309063f2e9d49f2e4c1283e530a7b56aef0c5267ce597VRF Random Seed280796522022-05-08 17:11:0417 days 12 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.020605018188 172.497661708
0x84d42dbafd6a8d771c865cc0bf4aaf10512bf6f3f9e992d054a4d560b828eb36RCS276552052022-04-27 23:28:5728 days 6 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.074235342599 30.070000012
0xd553ffacb60b4fc4ca63673636dc746dea9a7315eccc6653769dca072ec0029eVRF Random Seed276551792022-04-27 23:27:1328 days 6 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.003591891569 30.069999997
0xfba240c75d4159f73d2ae9fb305e6ef969520bae2feac56603a25a4f25312c6bRCS276517062022-04-27 21:16:3528 days 8 hrs ago0x6236434516dcb899687bcf496e76e24e2c45a1c4 IN  0x3af256f4841945fbbf9159289557d7dc5bec4a8f0 MATIC0.074199970478 30.05567207
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RandomCollectorSelector

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : RandomCollectorSelector.sol
// SPDX-License-Identifier: MIT
// dev: @brougkr

pragma solidity ^0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";

contract RandomCollectorSelector is Ownable, VRFConsumerBase
{

    string[] public ipfsGiveawayData;
    uint256[] public randomResults;
    uint256[][] public expandedResults;
    bytes32 internal keyHash;
    uint256 internal fee;
    uint256 public _drawId = 0;
    bool public _VRFResponseStatus;
    address immutable _BRT_MULTISIG = 0xB96E81f80b3AEEf65CB6d0E280b15FD5DBE71937;
    address immutable _linkToken = 0xb0897686c545045aFc77CF20eC7A532E3120E0F1; 
    address immutable _vrfCoordinator = 0x3d2341ADb2D31f1c5530cDC622016af293177AE0; 
    bytes32 immutable _keyHash = 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da; 
    uint256 immutable _fee = 0.0001 ether; 
    mapping (address => bool) public admin;
    event Winners(uint256 randomResult, uint256[] expandedResult);
    event RCS_(uint256 indexed drawID, uint256 numWinners, uint256 snapshotEntries, string ipfshash);
    event randomnessFulfilled(bytes32 requestId, uint256 randomResult);

    constructor() VRFConsumerBase( _vrfCoordinator, _linkToken) 
    {
        keyHash = _keyHash;
        fee = _fee;
        admin[_BRT_MULTISIG] = true;
        admin[0xb4A996956856feE7a3C3DCa4b384E4ef26a7Bc25] = true; // jesse.brightmoments.eth
        admin[0x1040259f6Fe4f1C6ed1044b9Df6a8A4eBD2d3511] = true; // phil.brightmoments.eth
        admin[0x6236434516DcB899687BCf496E76E24E2C45a1c4] = true; // fatkingfred
        admin[0x2596a3df23725F1F2DfaDAf4a132175165aB6744] = true; // brougkr
        transferOwnership(_BRT_MULTISIG);
    }

    /**
     * @dev Emits Chainlink VRF Random Winners
     */
    function RCS(string memory ipfshash, uint256 numWinners, uint256 snapshotEntries) external onlyAdmin
    {
        require(_VRFResponseStatus, "Must Wait Until VRF Random Seed Has Been Returned"); 
        ipfsGiveawayData.push(ipfshash);
        generateWinners(numWinners, _drawId, snapshotEntries);
        _drawId += 1;
        _VRFResponseStatus = false;
        emit RCS_(_drawId, numWinners, snapshotEntries, ipfshash);
    }

    /**
     * @dev Requests Randomness From Chainlink VRF
     */
    function VRFRandomSeed() external onlyAdmin returns (bytes32 requestId) 
    {
        require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK");
        return requestRandomness(keyHash, fee);
    }

    /**
     * @dev Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override 
    { 
        randomResults.push(randomness);
        _VRFResponseStatus = true;
        emit randomnessFulfilled(requestId, randomness);
    }

    /**
     * @dev Generates Winners From VRF Random Seed
     */
    function generateWinners(uint256 numWinners, uint256 drawId, uint256 snapshotEntries) private
    {
        uint256[] memory expandedValues = new uint256[](numWinners);
        for (uint256 i = 0; i < numWinners; i++) 
        {
          expandedValues[i] = (uint256(keccak256(abi.encode(randomResults[drawId], i))) % snapshotEntries) + 1;
        }
        expandedResults.push(expandedValues);
        emit Winners(randomResults[drawId], expandedValues);
    }

    /**
     * @dev Adds Admin
     */
    function __addAdmin(address adminAddress) external onlyOwner { admin[adminAddress] = true; }

    /**
     * @dev Removes Admin
     */
    function __removeAdmin(address adminAddress) external onlyOwner { admin[adminAddress] = false; }
    
    /**
     * @dev Withdraws Link From Contract
     */
    function __withdrawLink() external onlyOwner { LINK.transfer(owner(), LINK.balanceOf(address(this))); }

    /**
     * @dev Withdraws Any Matic Sent To Contract
     */
    function __withdrawMatic() external onlyOwner { payable(msg.sender).transfer(address(this).balance); }

    /**
     * @dev OnlyAdmin Modifier
     */
    modifier onlyAdmin
    {
        require(admin[msg.sender], "Sender Is Not Admin");
        _;
    }
}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @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.
 * *****************************************************************************
 * @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     constuctor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator, _link) 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), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (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. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @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 ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @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.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {

  /**
   * @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 VRFConsumerBase 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 randomness the VRF output
   */
  function fulfillRandomness(
    bytes32 requestId,
    uint256 randomness
  )
    internal
    virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 constant private USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(
    bytes32 _keyHash,
    uint256 _fee
  )
    internal
    returns (
      bytes32 requestId
    )
  {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed  = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface immutable internal LINK;
  address immutable private vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(
    address _vrfCoordinator,
    address _link
  ) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(
    bytes32 requestId,
    uint256 randomness
  )
    external
  {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 4 of 6 : Context.sol
// SPDX-License-Identifier: MIT

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 5 of 6 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {

  function allowance(
    address owner,
    address spender
  )
    external
    view
    returns (
      uint256 remaining
    );

  function approve(
    address spender,
    uint256 value
  )
    external
    returns (
      bool success
    );

  function balanceOf(
    address owner
  )
    external
    view
    returns (
      uint256 balance
    );

  function decimals()
    external
    view
    returns (
      uint8 decimalPlaces
    );

  function decreaseApproval(
    address spender,
    uint256 addedValue
  )
    external
    returns (
      bool success
    );

  function increaseApproval(
    address spender,
    uint256 subtractedValue
  ) external;

  function name()
    external
    view
    returns (
      string memory tokenName
    );

  function symbol()
    external
    view
    returns (
      string memory tokenSymbol
    );

  function totalSupply()
    external
    view
    returns (
      uint256 totalTokensIssued
    );

  function transfer(
    address to,
    uint256 value
  )
    external
    returns (
      bool success
    );

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  )
    external
    returns (
      bool success
    );

  function transferFrom(
    address from,
    address to,
    uint256 value
  )
    external
    returns (
      bool success
    );

}

File 6 of 6 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {

  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  )
    internal
    pure
    returns (
      uint256
    )
  {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(
    bytes32 _keyHash,
    uint256 _vRFInputSeed
  )
    internal
    pure
    returns (
      bytes32
    )
  {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"drawID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numWinners","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"snapshotEntries","type":"uint256"},{"indexed":false,"internalType":"string","name":"ipfshash","type":"string"}],"name":"RCS_","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomResult","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"expandedResult","type":"uint256[]"}],"name":"Winners","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"randomResult","type":"uint256"}],"name":"randomnessFulfilled","type":"event"},{"inputs":[{"internalType":"string","name":"ipfshash","type":"string"},{"internalType":"uint256","name":"numWinners","type":"uint256"},{"internalType":"uint256","name":"snapshotEntries","type":"uint256"}],"name":"RCS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"VRFRandomSeed","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_VRFResponseStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"adminAddress","type":"address"}],"name":"__addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adminAddress","type":"address"}],"name":"__removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"__withdrawMatic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_drawId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"expandedResults","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ipfsGiveawayData","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"randomResults","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610160604052600060075573b96e81f80b3aeef65cb6d0e280b15fd5dbe7193760c05273b0897686c545045afc77cf20ec7a532e3120e0f160e052733d2341adb2d31f1c5530cdc622016af293177ae0610100527ff86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da61012052655af3107a40006101405234801561008f57600080fd5b506101005160e0516100a0336101ae565b6001600160a01b0391821660a0528116608052610120516005556101405160065560c05190811660009081526009602052604081208054600160ff1991821681179092557f8170f8f520cd07a12ec4b78441a609815ca426f04ab8a56f6edfc9497f91048080548216831790557f3ce11dc540fa3f94f53caaf03edc8457144674efc60ca39b486fbe3bdf32223880548216831790557f3c0eaf905ea3ac5cc1c68f8e558f41a5d553a9e7d2407fb3142f776395ea07a48054821683179055732596a3df23725f1f2dfadaf4a132175165ab67449092527fa02a2b64ce3a2396f60ba183bd030159926c9dbce861dac0b11af548e3530b9280549092161790556101a9906101fe565b6102ce565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b0316331461025d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0381166102c25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610254565b6102cb816101ae565b50565b60805160a05160c05160e05161010051610120516101405161135a61033560003960005050600050506000505060005050600050506000818161083a0152610b550152600081816102fc01528181610663015281816106b70152610b26015261135a6000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a61161009757806394985ddd1161006657806394985ddd146102015780639f76922e14610214578063f2fde38b14610227578063f39f629c1461023a57600080fd5b8063715018a6146101c357806379b1f61e146101cb5780638da5cb5b146101d3578063921c426f146101ee57600080fd5b806330d680fc116100d357806330d680fc146101665780634006e224146101705780634778582a1461018d57806363a846f8146101a057600080fd5b80630d57fff814610105578063198e63641461012b578063219be1141461013357806325c86aed14610146575b600080fd5b610118610113366004610fea565b610243565b6040519081526020015b60405180910390f35b610118610280565b61011861014136600461100c565b6103d0565b61015961015436600461100c565b6103f1565b6040516101229190611072565b61016e61049d565b005b60085461017d9060ff1681565b6040519015158152602001610122565b61016e61019b36600461108c565b610526565b61017d6101ae36600461108c565b60096020526000908152604090205460ff1681565b61016e6105a1565b61016e610607565b6000546040516001600160a01b039091168152602001610122565b61016e6101fc36600461108c565b6107b1565b61016e61020f366004610fea565b61082f565b61016e6102223660046110cb565b6108b5565b61016e61023536600461108c565b610a43565b61011860075481565b6004828154811061025357600080fd5b90600052602060002001818154811061026b57600080fd5b90600052602060002001600091509150505481565b3360009081526009602052604081205460ff166102e45760405162461bcd60e51b815260206004820152601360248201527f53656e646572204973204e6f742041646d696e0000000000000000000000000060448201526064015b60405180910390fd5b6006546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f919061118f565b10156103bd5760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768204c494e4b000000000000000000000000000000000060448201526064016102db565b6103cb600554600654610b22565b905090565b600381815481106103e057600080fd5b600091825260209091200154905081565b6002818154811061040157600080fd5b90600052602060002001600091509050805461041c906111a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610448906111a8565b80156104955780601f1061046a57610100808354040283529160200191610495565b820191906000526020600020905b81548152906001019060200180831161047857829003601f168201915b505050505081565b6000546001600160a01b031633146104f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b60405133904780156108fc02916000818181858888f19350505050158015610523573d6000803e3d6000fd5b50565b6000546001600160a01b031633146105805760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b6001600160a01b03166000908152600960205260409020805460ff19169055565b6000546001600160a01b031633146105fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b6106056000610ca5565b565b6000546001600160a01b031633146106615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6106a26000546001600160a01b031690565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a919061118f565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561078d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052391906111e3565b6000546001600160a01b0316331461080b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108a75760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016102db565b6108b18282610d0d565b5050565b3360009081526009602052604090205460ff166109145760405162461bcd60e51b815260206004820152601360248201527f53656e646572204973204e6f742041646d696e0000000000000000000000000060448201526064016102db565b60085460ff1661098c5760405162461bcd60e51b815260206004820152603160248201527f4d757374205761697420556e74696c205652462052616e646f6d20536565642060448201527f486173204265656e2052657475726e656400000000000000000000000000000060648201526084016102db565b6002805460018101825560009190915283516109cf917f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01906020860190610f17565b506109dd8260075483610d8d565b6001600760008282546109f0919061121b565b90915550506008805460ff191690556007546040517f96a57b4b8efc6d3d4c2d731361e0dce58f7f6b5042038877dd78221b8dd0415d90610a3690859085908890611233565b60405180910390a2505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102db565b6001600160a01b038116610b195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102db565b61052381610ca5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001610b92929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610bbf9392919061125b565b6020604051808303816000875af1158015610bde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0291906111e3565b50600083815260016020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a09091019092528151918301919091209387905290829052610c5d9161121b565b600085815260016020526040902055610c9d8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60038054600180820183556000929092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018290556008805460ff1916909117905560408051838152602081018390527fe1097d91d8805b848ba0cb903211ca7f73da0a49d34c157b25ce4a13c25477b5910160405180910390a15050565b60008367ffffffffffffffff811115610da857610da86110b5565b604051908082528060200260200182016040528015610dd1578160200160208202803683370190505b50905060005b84811015610e76578260038581548110610df357610df3611283565b906000526020600020015482604051602001610e19929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c610e3c9190611299565b610e4790600161121b565b828281518110610e5957610e59611283565b602090810291909101015280610e6e816112bb565b915050610dd7565b50600480546001810182556000919091528151610eba917f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01906020840190610f9b565b507f8c35431baa7f35d761d5bbfd2611610b35915a3c91cb5a606d498686115ee16a60038481548110610eef57610eef611283565b906000526020600020015482604051610f099291906112d6565b60405180910390a150505050565b828054610f23906111a8565b90600052602060002090601f016020900481019282610f455760008555610f8b565b82601f10610f5e57805160ff1916838001178555610f8b565b82800160010185558215610f8b579182015b82811115610f8b578251825591602001919060010190610f70565b50610f97929150610fd5565b5090565b828054828255906000526020600020908101928215610f8b5791602002820182811115610f8b578251825591602001919060010190610f70565b5b80821115610f975760008155600101610fd6565b60008060408385031215610ffd57600080fd5b50508035926020909101359150565b60006020828403121561101e57600080fd5b5035919050565b6000815180845260005b8181101561104b5760208185018101518683018201520161102f565b8181111561105d576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006110856020830184611025565b9392505050565b60006020828403121561109e57600080fd5b81356001600160a01b038116811461108557600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156110e057600080fd5b833567ffffffffffffffff808211156110f857600080fd5b818601915086601f83011261110c57600080fd5b81358181111561111e5761111e6110b5565b604051601f8201601f19908116603f01168101908382118183101715611146576111466110b5565b8160405282815289602084870101111561115f57600080fd5b82602086016020830137600060208483010152809750505050505060208401359150604084013590509250925092565b6000602082840312156111a157600080fd5b5051919050565b600181811c908216806111bc57607f821691505b602082108114156111dd57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156111f557600080fd5b8151801515811461108557600080fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561122e5761122e611205565b500190565b8381528260208201526060604082015260006112526060830184611025565b95945050505050565b6001600160a01b03841681528260208201526060604082015260006112526060830184611025565b634e487b7160e01b600052603260045260246000fd5b6000826112b657634e487b7160e01b600052601260045260246000fd5b500690565b60006000198214156112cf576112cf611205565b5060010190565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015611317578451835293830193918301916001016112fb565b509097965050505050505056fea2646970667358221220faae61e199f8986b3fada9cca63824feeaa645975f05bb1e08796366ff190f3d64736f6c634300080b0033

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.