Contract 0xDc9B0Af748272E154cd4cDE7752222328fc1453F

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x0e2d57edafaffbc1ba5079a0edc7b6c2be12696697327f8bd8d53d69303f891dWithdraw248605282022-02-12 17:09:02299 days 1 hr ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.001549645914 42.009485851
0xaaa8af8bdd1b84b1f5611a3e75656c3f44b565b580263a9042daea47cec783f2Raffle248593492022-02-12 16:26:24299 days 2 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.036362283912 71.880688542
0x8b37a13908eccd5e5e5b298ea82d8007c9833b2d8fc4b6145570797bbac73293Raffle248568982022-02-12 14:59:54299 days 4 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.008503386814 30.136434667
0x4d2ef15528b4729f79f331f9c684182413e327b48831517831a89ce8c161f766Raffle247513172022-02-09 22:04:52301 days 20 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.013016310014 30.000000033
0x3451879844fafa5b8a405b075a81ba17f6ea36b9883317c24a10cd6532e0bdb2Raffle247501692022-02-09 21:23:21301 days 21 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.01483371002 30.000000042
0x15048e0f57f5b4cc2babe170911f15fa72b0e2e5e7cfb572062ea94a0dc1401bRaffle247492212022-02-09 20:49:53301 days 22 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.012977910248 30.000000574
0xafee008f2c18d8fd8c30efbb2504792ad73e8f13823b09c1087685e6f89a364aRaffle247488882022-02-09 20:37:09301 days 22 hrs ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  0xdc9b0af748272e154cd4cde7752222328fc1453f0 MATIC0.013623570093 30.000000206
0x371d6061ba19d9d78055d758df2c047a9657d4cab3be50550d6de905b156c8ad0x61010060247445582022-02-09 18:03:11302 days 56 mins ago0x0dee503261fa153bc9372f5b201c56ead3b33721 IN  Create: MintStarterRaffle0 MATIC0.068054743185 30.00011161
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MintStarterRaffle

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : MintStarterRaffle.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

contract MintStarterRaffle is VRFConsumerBase, Ownable {
    bytes32 private immutable _chainLinkKeyHash;
    uint256 private immutable _chainLinkFee;

    event BeginRaffle(bytes32 requestId, bytes32 merkleRoot, uint256 winnersToSelect);
    event FinishRaffle(bytes32 requestId, bytes32 merkleRoot, uint256 randomSeed);

    struct Project {
        bool raffleDone;
        uint16 winnersToSelect;
        uint232 randomSeed;
        uint16[] amounts;
        uint16[] weights;
    }

    // requestId -> merkle root
    mapping(bytes32 => bytes32) public _requestIdToMerkleRoot;

    // merkle root -> project object
    mapping(bytes32 => Project) public _projects;

    constructor(
        address vrfCoordinator,
        address link,
        bytes32 keyHash,
        uint256 fee
    ) VRFConsumerBase(vrfCoordinator, link) {
        _chainLinkKeyHash = keyHash;
        _chainLinkFee = fee;

        // the first raffle: https://polygonscan.com/tx/0x8e7a0d89d430d3ad3e40573cfaffb904d143a69ab463176e6bf21a7d6ac2ef60#eventlog
        //
        // We mistake raffling several times on a project(MerkleRoot), so we must use the first raffle result. 
        // So we hard code it. And update the contract to prevent this from happening again.
        bytes32 firstRaffleMerkleRoot = hex"932516c4211818ee288b6d79df65d83af3e4299b6d5156b3b9009d8dedb19529";
        _projects[firstRaffleMerkleRoot].winnersToSelect = 15;
        _projects[firstRaffleMerkleRoot].randomSeed = 0x000000f8a39078954965227613928b721b462100dced0d323dae4c65b1c2651f;
        _projects[firstRaffleMerkleRoot].raffleDone = true;
        _projects[firstRaffleMerkleRoot].amounts = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 2, 3, 1, 1, 4, 3, 3, 3, 1, 2, 4, 4, 3, 5, 5, 2, 4, 3, 22, 4, 1, 6, 6, 11, 20, 4, 13, 62, 83, 112 ];
        _projects[firstRaffleMerkleRoot].weights = [ 11520, 9960, 9360, 8880, 8640, 7800, 7320, 6240, 6000, 5760, 5280, 5160, 5040, 4920, 4255, 4140, 3450, 3335, 3105, 2875, 2760, 2645, 2530, 2300, 2185, 2070, 1955, 1840, 1725, 1610, 1495, 1380, 1320, 1210, 1100, 990, 880, 770, 660, 550, 440, 400, 300, 200, 100 ];
        require(_projects[firstRaffleMerkleRoot].amounts.length == _projects[firstRaffleMerkleRoot].weights.length);
    }

    modifier amountAndWeightSanityCheck(
        uint16 winnersToSelect,
        uint16[] calldata amounts,
        uint16[] calldata weights
    ) {
        require(winnersToSelect > 0, "MintStarterRaffle: at least produce one winner");
        require(
            amounts.length == weights.length && amounts.length > 0,
            "MintStarterRaffle: invalid amounts and weights"
        );
        uint256 participants = 0;
        for (uint256 i = 0; i < amounts.length; i++) {
            require(amounts[i] > 0, "MintStarterRaffle: amount is less than zero");
            require(weights[i] > 0, "MintStarterRaffle: weight is less than zero");

            participants += amounts[i];
        }
        require(participants > winnersToSelect, "MintStarterRaffle: participants is less than winners");

        _;
    }

    function raffle(
        bytes32 merkleRoot,
        uint16 winnersToSelect,
        uint16[] calldata amounts,
        uint16[] calldata weights
    ) external onlyOwner amountAndWeightSanityCheck(winnersToSelect, amounts, weights) {
        require(LINK.balanceOf(address(this)) >= _chainLinkFee, "MintStarterRaffle: insufficient $LINK balance");
        require(_projects[merkleRoot].winnersToSelect == 0, "MintStarterRaffle: merkleRoot exists");

        bytes32 requestId = requestRandomness(_chainLinkKeyHash, _chainLinkFee);
        _requestIdToMerkleRoot[requestId] = merkleRoot;
        _projects[merkleRoot] = Project({
            raffleDone: false,
            winnersToSelect: winnersToSelect,
            randomSeed: 0,
            amounts: amounts,
            weights: weights
        });

        emit BeginRaffle(requestId, merkleRoot, winnersToSelect);
    }

    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual override {
        require(_requestIdToMerkleRoot[requestId] != 0, "MintStarterRaffle: request id doesn't exist");

        bytes32 merkleRoot = _requestIdToMerkleRoot[requestId];
        delete (_requestIdToMerkleRoot[requestId]);

        _projects[merkleRoot].randomSeed = uint232(randomness);
        _projects[merkleRoot].raffleDone = true;
        emit FinishRaffle(requestId, merkleRoot, uint232(randomness));
    }

    function withdraw(address target, uint256 amount) external onlyOwner {
        if (amount == 0) amount = LINK.balanceOf(address(this));
        LINK.transfer(target, amount);
    }

    function functionCall(address target, bytes memory data) external onlyOwner {
        Address.functionCall(target, data);
    }

    function functionCallWithValue(address target, bytes memory data) external payable onlyOwner {
        Address.functionCallWithValue(target, data, msg.value);
    }

    // View only functions for state checking

    function verifyProof(bytes32 merkleRoot, address account, uint32 idx, uint16 weight, bytes32[] memory proof) external view returns(bool) {
        Project memory project = _projects[merkleRoot];
        require(project.winnersToSelect > 0, "MintStarterRaffle: merkleRoot not exists");
        bytes32 leaf = keccak256(abi.encodePacked(idx, account, weight));
        return MerkleProof.verify(proof, merkleRoot, leaf);
    }

    function getTierInfos(bytes32 merkleRoot) external view returns(uint16[] memory amounts, uint16[] memory weights) {
        Project memory project = _projects[merkleRoot];
        amounts = project.amounts;
        weights = project.weights;
    }

    function getWinners(
        bytes32 merkleRoot,
        uint256 n,
        uint256 skip
    ) external view returns (uint32[] memory) {
        Project memory project = _projects[merkleRoot];
        require(project.winnersToSelect > 0, "MintStarterRaffle: merkleRoot not exists");
        require(project.raffleDone, "MintStarterRaffle: raffle is not finished");

        uint16[] memory amounts = project.amounts;
        uint16[] memory weights = project.weights;

        uint256[] memory culmulativeEntries = new uint256[](amounts.length + 1);
        uint256[] memory culmulativeAmounts = new uint256[](amounts.length + 1);
        for (uint256 i = 1; i < amounts.length + 1; ++i) {
            culmulativeEntries[i] = culmulativeEntries[i - 1] + amounts[i - 1] * weights[i - 1];
            culmulativeAmounts[i] = culmulativeAmounts[i - 1] + amounts[i - 1];
        }

        uint32[] memory winners = new uint32[](n);
        for (uint256 i = 0; i < n; ++i) {
            uint256 raw = uint256(keccak256(abi.encodePacked(project.randomSeed, i + skip))) % uint256(culmulativeEntries[culmulativeEntries.length - 1]);

            uint256 tier = 0;
            for (; tier < culmulativeEntries.length; ++tier) {
                if (raw < culmulativeEntries[tier]) {
                    --tier;
                    break;
                }
            }

            raw -= culmulativeEntries[tier];
            winners[i] = uint32(raw / uint256(weights[tier]) + culmulativeAmounts[tier]);
        }

        return winners;
    }
}

File 2 of 9 : 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 private constant 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 internal immutable LINK;
  address private immutable vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 => uint256) /* keyHash */ /* 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 3 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 4 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 6 of 9 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

File 7 of 9 : 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 8 of 9 : 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));
  }
}

File 9 of 9 : 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
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"address","name":"link","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"winnersToSelect","type":"uint256"}],"name":"BeginRaffle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"randomSeed","type":"uint256"}],"name":"FinishRaffle","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"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"_projects","outputs":[{"internalType":"bool","name":"raffleDone","type":"bool"},{"internalType":"uint16","name":"winnersToSelect","type":"uint16"},{"internalType":"uint232","name":"randomSeed","type":"uint232"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"_requestIdToMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"functionCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"functionCallWithValue","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"getTierInfos","outputs":[{"internalType":"uint16[]","name":"amounts","type":"uint16[]"},{"internalType":"uint16[]","name":"weights","type":"uint16[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"uint256","name":"skip","type":"uint256"}],"name":"getWinners","outputs":[{"internalType":"uint32[]","name":"","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint16","name":"winnersToSelect","type":"uint16"},{"internalType":"uint16[]","name":"amounts","type":"uint16[]"},{"internalType":"uint16[]","name":"weights","type":"uint16[]"}],"name":"raffle","outputs":[],"stateMutability":"nonpayable","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"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint32","name":"idx","type":"uint32"},{"internalType":"uint16","name":"weight","type":"uint16"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"verifyProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b5060405162002973380380620029738339810160408190526200003591620005ee565b6001600160a01b0384811660a052831660805262000053336200044d565b60c082815260e08281527ff8a39078954965227613928b721b462100dced0d323dae4c65b1c2651f000f017f67cf7aaed671a2c9e47a2e8953ce80f6eb2b778b5d0f23004ee4ed321d8f858e55604080516105a08101825260018082526020828101829052928201819052606082018190526080820181905260a0820181905293810184905291820183905261010082018390526101208201839052610140820183905260026101608301819052610180830184905260036101a084018190526101c084018590526101e084018290526102008401819052610220840185905261024084018590526004610260850181905261028085018290526102a085018290526102c085018290526102e085018690526103008501839052610320850181905261034085018190526103608501829052600561038086018190526103a08601526103c08501929092526103e08401829052610400840181905260166104208501526104408401829052610460840194909452600661048084018190526104a0840152600b6104c084015260146104e0840152610500830152600d610520830152603e610540830152605361056083015260706105808301527f932516c4211818ee288b6d79df65d83af3e4299b6d5156b3b9009d8dedb19529600081905292905262000265907f67cf7aaed671a2c9e47a2e8953ce80f6eb2b778b5d0f23004ee4ed321d8f858f90602d6200049f565b50604080516105a081018252612d0081526126e8602080830191909152612490828401526122b060608301526121c06080830152611e7860a0830152611c9860c083015261186060e08301526117706101008301526116806101208301526114a06101408301526114286101608301526113b06101808301526113386101a083015261109f6101c083015261102c6101e0830152610d7a610200830152610d07610220830152610c21610240830152610b3b610260830152610ac8610280830152610a556102a08301526109e26102c08301526108fc6102e08301526108896103008301526108166103208301526107a36103408301526107306103608301526106bd61038083015261064a6103a08301526105d76103c08301526105646103e08301526105286104008301526104ba61042083015261044c6104408301526103de6104608301526103706104808301526103026104a08301526102946104c08301526102266104e08301526101b861050083015261019061052083015261012c61054083015260c8610560830152606461058083015260008481526003909152919091206200041d91600290910190602d6200054e565b5060008181526003602052604090206002810154600190910154146200044257600080fd5b505050505062000636565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805482825590600052602060002090600f016010900481019282156200053c5791602002820160005b838211156200050a57835183826101000a81548161ffff021916908360ff1602179055509260200192600201602081600101049283019260010302620004c9565b80156200053a5782816101000a81549061ffff02191690556002016020816001010492830192600103026200050a565b505b506200054a929150620005ba565b5090565b82805482825590600052602060002090600f016010900481019282156200053c5791602002820160005b838211156200050a57835183826101000a81548161ffff021916908361ffff160217905550926020019260020160208160010104928301926001030262000578565b5b808211156200054a5760008155600101620005bb565b80516001600160a01b0381168114620005e957600080fd5b919050565b600080600080608085870312156200060557600080fd5b6200061085620005d1565b93506200062060208601620005d1565b6040860151606090960151949790965092505050565b60805160a05160c05160e0516122e06200069360003960008181610a780152610c1901526000610bf80152600081816105660152611797015260008181610a9a0152818161146c01528181611517015261176801526122e06000f3fe6080604052600436106100c25760003560e01c8063994566a61161007f578063c1e5ce4211610059578063c1e5ce421461026c578063eb9ef7f71461028c578063f2fde38b146102b9578063f3fef3a3146102d957600080fd5b8063994566a6146101e3578063a0b5ffb01461021e578063a9fd945e1461023e57600080fd5b8063244c32f1146100c75780634a99ece91461014157806352ccd7b314610171578063715018a6146101865780638da5cb5b1461019b57806394985ddd146101c3575b600080fd5b3480156100d357600080fd5b506101136100e2366004611bc4565b60036020526000908152604090205460ff811690610100810461ffff1690630100000090046001600160e81b031683565b60408051931515845261ffff90921660208401526001600160e81b0316908201526060015b60405180910390f35b34801561014d57600080fd5b5061016161015c366004611c52565b6102f9565b6040519015158152602001610138565b61018461017f366004611d41565b6104eb565b005b34801561019257600080fd5b50610184610525565b3480156101a757600080fd5b506001546040516001600160a01b039091168152602001610138565b3480156101cf57600080fd5b506101846101de366004611de7565b61055b565b3480156101ef57600080fd5b506102106101fe366004611bc4565b60026020526000908152604090205481565b604051908152602001610138565b34801561022a57600080fd5b50610184610239366004611d41565b6105e1565b34801561024a57600080fd5b5061025e610259366004611bc4565b610615565b604051610138929190611e48565b34801561027857600080fd5b50610184610287366004611ec2565b610776565b34801561029857600080fd5b506102ac6102a7366004611f4c565b610ded565b6040516101389190611f78565b3480156102c557600080fd5b506101846102d4366004611fc2565b61138d565b3480156102e557600080fd5b506101846102f4366004611fdd565b611428565b6000858152600360209081526040808320815160a081018352815460ff811615158252610100810461ffff1682860152630100000090046001600160e81b031681840152600182018054845181870281018701909552808552869592946060860193909291908301828280156103b657602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161037d5790505b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561043657602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116103fd5790505b50505050508152505090506000816020015161ffff16116104725760405162461bcd60e51b815260040161046990612007565b60405180910390fd5b6040516001600160e01b031960e087901b1660208201526bffffffffffffffffffffffff19606088901b1660248201526001600160f01b031960f086901b166038820152600090603a016040516020818303038152906040528051906020012090506104df848983611593565b98975050505050505050565b6001546001600160a01b031633146105155760405162461bcd60e51b81526004016104699061204f565b6105208282346115a9565b505050565b6001546001600160a01b0316331461054f5760405162461bcd60e51b81526004016104699061204f565b61055960006115d7565b565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105d35760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610469565b6105dd8282611629565b5050565b6001546001600160a01b0316331461060b5760405162461bcd60e51b81526004016104699061204f565b6105208282611722565b6000818152600360209081526040808320815160a081018352815460ff811615158252610100810461ffff1682860152630100000090046001600160e81b0316818401526001820180548451818702810187019095528085526060968796909593949387860193909290918301828280156106d757602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161069e5790505b505050505081526020016002820180548060200260200160405190810160405280929190818152602001828054801561075757602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff168152602001906002019060208260010104928301926001038202915080841161071e5790505b5050505050815250509050806060015192508060800151915050915091565b6001546001600160a01b031633146107a05760405162461bcd60e51b81526004016104699061204f565b848484848460008561ffff16116108105760405162461bcd60e51b815260206004820152602e60248201527f4d696e7453746172746572526166666c653a206174206c656173742070726f6460448201526d3ab1b29037b732903bb4b73732b960911b6064820152608401610469565b828114801561081e57508215155b6108815760405162461bcd60e51b815260206004820152602e60248201527f4d696e7453746172746572526166666c653a20696e76616c696420616d6f756e60448201526d747320616e64207765696768747360901b6064820152608401610469565b6000805b848110156109f25760008686838181106108a1576108a1612084565b90506020020160208101906108b6919061209a565b61ffff161161091b5760405162461bcd60e51b815260206004820152602b60248201527f4d696e7453746172746572526166666c653a20616d6f756e74206973206c657360448201526a73207468616e207a65726f60a81b6064820152608401610469565b600084848381811061092f5761092f612084565b9050602002016020810190610944919061209a565b61ffff16116109a95760405162461bcd60e51b815260206004820152602b60248201527f4d696e7453746172746572526166666c653a20776569676874206973206c657360448201526a73207468616e207a65726f60a81b6064820152608401610469565b8585828181106109bb576109bb612084565b90506020020160208101906109d0919061209a565b6109de9061ffff16836120cb565b9150806109ea816120e3565b915050610885565b508561ffff168111610a635760405162461bcd60e51b815260206004820152603460248201527f4d696e7453746172746572526166666c653a207061727469636970616e7473206044820152736973206c657373207468616e2077696e6e65727360601b6064820152608401610469565b6040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c91906120fe565b1015610b805760405162461bcd60e51b815260206004820152602d60248201527f4d696e7453746172746572526166666c653a20696e73756666696369656e742060448201526c244c494e4b2062616c616e636560981b6064820152608401610469565b60008c815260036020526040902054610100900461ffff1615610bf15760405162461bcd60e51b8152602060048201526024808201527f4d696e7453746172746572526166666c653a206d65726b6c65526f6f742065786044820152636973747360e01b6064820152608401610469565b6000610c3d7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611764565b90508c60026000838152602001908152602001600020819055506040518060a001604052806000151581526020018d61ffff16815260200160006001600160e81b031681526020018c8c808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208c810282810182019093528c82529283019290918d918d91829185019084908082843760009201829052509390945250508f8152600360209081526040918290208451815486840151948701516001600160e81b031663010000000262ffffff61ffff9096166101000262ffff00199315159390931662ffffff1990921691909117919091179390931692909217825560608401518051929350610d6e9260018501929190910190611b06565b5060808201518051610d8a916002840191602090910190611b06565b509050507f449f71f3dbd7931267b394349e0048865bf198338993d1f26f67541e461d4fc8818e8e604051610dd693929190928352602083019190915261ffff16604082015260600190565b60405180910390a150505050505050505050505050565b6000838152600360209081526040808320815160a081018352815460ff811615158252610100810461ffff1682860152630100000090046001600160e81b0316818401526001820180548451818702810187019095528085526060969592948786019390929190830182828015610eab57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610e725790505b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015610f2b57602002820191906000526020600020906000905b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411610ef25790505b50505050508152505090506000816020015161ffff1611610f5e5760405162461bcd60e51b815260040161046990612007565b8051610fbe5760405162461bcd60e51b815260206004820152602960248201527f4d696e7453746172746572526166666c653a20726166666c65206973206e6f7460448201526808199a5b9a5cda195960ba1b6064820152608401610469565b606081015160808201518151600090610fd89060016120cb565b67ffffffffffffffff811115610ff057610ff0611c0b565b604051908082528060200260200182016040528015611019578160200160208202803683370190505b50905060008351600161102c91906120cb565b67ffffffffffffffff81111561104457611044611c0b565b60405190808252806020026020018201604052801561106d578160200160208202803683370190505b50905060015b84516110809060016120cb565b8110156111af5783611093600183612117565b815181106110a3576110a3612084565b6020026020010151856001836110b99190612117565b815181106110c9576110c9612084565b60200260200101516110db919061212e565b61ffff16836110eb600184612117565b815181106110fb576110fb612084565b602002602001015161110d91906120cb565b83828151811061111f5761111f612084565b602090810291909101015284611136600183612117565b8151811061114657611146612084565b602002602001015161ffff16826001836111609190612117565b8151811061117057611170612084565b602002602001015161118291906120cb565b82828151811061119457611194612084565b60209081029190910101526111a8816120e3565b9050611073565b5060008867ffffffffffffffff8111156111cb576111cb611c0b565b6040519080825280602002602001820160405280156111f4578160200160208202803683370190505b50905060005b8981101561137d57600084600186516112139190612117565b8151811061122357611223612084565b602002602001015188604001518b8461123c91906120cb565b60405160189290921b62ffffff19166020830152603d820152605d016040516020818303038152906040528051906020012060001c61127b919061216e565b905060005b85518110156112ca5785818151811061129b5761129b612084565b60200260200101518210156112ba576112b381612182565b90506112ca565b6112c3816120e3565b9050611280565b8581815181106112dc576112dc612084565b6020026020010151826112ef9190612117565b915084818151811061130357611303612084565b602002602001015187828151811061131d5761131d612084565b602002602001015161ffff16836113349190612199565b61133e91906120cb565b84848151811061135057611350612084565b602002602001019063ffffffff16908163ffffffff1681525050505080611376906120e3565b90506111fa565b50955050505050505b9392505050565b6001546001600160a01b031633146113b75760405162461bcd60e51b81526004016104699061204f565b6001600160a01b03811661141c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610469565b611425816115d7565b50565b6001546001600160a01b031633146114525760405162461bcd60e51b81526004016104699061204f565b806114f1576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156114b657600080fd5b505afa1580156114ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ee91906120fe565b90505b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801561155b57600080fd5b505af115801561156f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052091906121ad565b6000826115a085846118ea565b14949350505050565b60606115cf84848460405180606001604052806029815260200161228260299139611996565b949350505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000828152600260205260409020546116985760405162461bcd60e51b815260206004820152602b60248201527f4d696e7453746172746572526166666c653a207265717565737420696420646f60448201526a195cdb89dd08195e1a5cdd60aa1b6064820152608401610469565b60008281526002602090815260408083208054908490558084526003835292819020805462ffff001663010000006001600160e81b03871690810260ff1916919091176001179091558151868152928301849052908201527f54d83cfdfa45c3d3b0810e98f480142bb00c89f2c9403964e72a1acf798aa24d9060600160405180910390a1505050565b606061138683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250611abe565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016117d4929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016118019392919061222b565b602060405180830381600087803b15801561181b57600080fd5b505af115801561182f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185391906121ad565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120868452929091526118ad9060016120cb565b60008581526020818152604091829020929092558051808301879052808201849052815180820383018152606090910190915280519101206115cf565b600081815b845181101561198e57600085828151811061190c5761190c612084565b6020026020010151905080831161194e57604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061197b565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080611986816120e3565b9150506118ef565b509392505050565b6060824710156119f75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610469565b843b611a455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610469565b600080866001600160a01b03168587604051611a619190612252565b60006040518083038185875af1925050503d8060008114611a9e576040519150601f19603f3d011682016040523d82523d6000602084013e611aa3565b606091505b5091509150611ab3828286611acd565b979650505050505050565b60606115cf8484600085611996565b60608315611adc575081611386565b825115611aec5782518084602001fd5b8160405162461bcd60e51b8152600401610469919061226e565b82805482825590600052602060002090600f01601090048101928215611b9f5791602002820160005b83821115611b6f57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611b2f565b8015611b9d5782816101000a81549061ffff0219169055600201602081600101049283019260010302611b6f565b505b50611bab929150611baf565b5090565b5b80821115611bab5760008155600101611bb0565b600060208284031215611bd657600080fd5b5035919050565b80356001600160a01b0381168114611bf457600080fd5b919050565b803561ffff81168114611bf457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611c4a57611c4a611c0b565b604052919050565b600080600080600060a08688031215611c6a57600080fd5b853594506020611c7b818801611bdd565b9450604087013563ffffffff81168114611c9457600080fd5b9350611ca260608801611bf9565b9250608087013567ffffffffffffffff80821115611cbf57600080fd5b818901915089601f830112611cd357600080fd5b813581811115611ce557611ce5611c0b565b8060051b9150611cf6848301611c21565b818152918301840191848101908c841115611d1057600080fd5b938501935b83851015611d2e57843582529385019390850190611d15565b8096505050505050509295509295909350565b60008060408385031215611d5457600080fd5b611d5d83611bdd565b915060208084013567ffffffffffffffff80821115611d7b57600080fd5b818601915086601f830112611d8f57600080fd5b813581811115611da157611da1611c0b565b611db3601f8201601f19168501611c21565b91508082528784828501011115611dc957600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060408385031215611dfa57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015611e3d57815161ffff1687529582019590820190600101611e1d565b509495945050505050565b604081526000611e5b6040830185611e09565b8281036020840152611e6d8185611e09565b95945050505050565b60008083601f840112611e8857600080fd5b50813567ffffffffffffffff811115611ea057600080fd5b6020830191508360208260051b8501011115611ebb57600080fd5b9250929050565b60008060008060008060808789031215611edb57600080fd5b86359550611eeb60208801611bf9565b9450604087013567ffffffffffffffff80821115611f0857600080fd5b611f148a838b01611e76565b90965094506060890135915080821115611f2d57600080fd5b50611f3a89828a01611e76565b979a9699509497509295939492505050565b600080600060608486031215611f6157600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b81811015611fb657835163ffffffff1683529284019291840191600101611f94565b50909695505050505050565b600060208284031215611fd457600080fd5b61138682611bdd565b60008060408385031215611ff057600080fd5b611ff983611bdd565b946020939093013593505050565b60208082526028908201527f4d696e7453746172746572526166666c653a206d65726b6c65526f6f74206e6f604082015267742065786973747360c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156120ac57600080fd5b61138682611bf9565b634e487b7160e01b600052601160045260246000fd5b600082198211156120de576120de6120b5565b500190565b60006000198214156120f7576120f76120b5565b5060010190565b60006020828403121561211057600080fd5b5051919050565b600082821015612129576121296120b5565b500390565b600061ffff8083168185168183048111821515161561214f5761214f6120b5565b02949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261217d5761217d612158565b500690565b600081612191576121916120b5565b506000190190565b6000826121a8576121a8612158565b500490565b6000602082840312156121bf57600080fd5b8151801515811461138657600080fd5b60005b838110156121ea5781810151838201526020016121d2565b838111156121f9576000848401525b50505050565b600081518084526122178160208601602086016121cf565b601f01601f19169290920160200192915050565b60018060a01b0384168152826020820152606060408201526000611e6d60608301846121ff565b600082516122648184602087016121cf565b9190910192915050565b60208152600061138660208301846121ff56fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212209e61381078d0cdd5556865ba25bee64700219a7376815bb9c3d8d0b38793c5cc64736f6c634300080900330000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da00000000000000000000000000000000000000000000000000005af3107a4000

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

0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da00000000000000000000000000000000000000000000000000005af3107a4000

-----Decoded View---------------
Arg [0] : vrfCoordinator (address): 0x3d2341adb2d31f1c5530cdc622016af293177ae0
Arg [1] : link (address): 0xb0897686c545045afc77cf20ec7a532e3120e0f1
Arg [2] : keyHash (bytes32): 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [3] : fee (uint256): 100000000000000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0
Arg [1] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1
Arg [2] : f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [3] : 00000000000000000000000000000000000000000000000000005af3107a4000


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.