ETH Price: $3,097.57 (+0.94%)
Gas: 7 Gwei

Contract

0x372268f6589b3CAc3dE7C79d68CB7C0330e7eb57
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Withdraw Tokens143464132022-03-08 13:17:57855 days ago1646745477IN
0x372268f6...330e7eb57
0 ETH0.0017419130.76122055
Withdraw Tokens143464122022-03-08 13:17:52855 days ago1646745472IN
0x372268f6...330e7eb57
0 ETH0.0016764429.59885008
Withdraw Tokens143464122022-03-08 13:17:52855 days ago1646745472IN
0x372268f6...330e7eb57
0 ETH0.0016764429.59885008
Withdraw Tokens143464102022-03-08 13:17:07855 days ago1646745427IN
0x372268f6...330e7eb57
0 ETH0.0016591429.29327652
Withdraw Tokens143464092022-03-08 13:17:03855 days ago1646745423IN
0x372268f6...330e7eb57
0 ETH0.0015299627.01250805
Withdraw Tokens143464092022-03-08 13:17:03855 days ago1646745423IN
0x372268f6...330e7eb57
0 ETH0.0015296327.01250805
Withdraw Tokens143464092022-03-08 13:17:03855 days ago1646745423IN
0x372268f6...330e7eb57
0 ETH0.0015296327.01250805
Withdraw Tokens143464092022-03-08 13:17:03855 days ago1646745423IN
0x372268f6...330e7eb57
0 ETH0.0015296327.01250805
Withdraw Tokens143464092022-03-08 13:17:03855 days ago1646745423IN
0x372268f6...330e7eb57
0 ETH0.0015293127.01250805
Claim140969412022-01-28 22:44:23893 days ago1643409863IN
0x372268f6...330e7eb57
0 ETH0.01414451156.35003648
Claim140969382022-01-28 22:43:59893 days ago1643409839IN
0x372268f6...330e7eb57
0 ETH0.0177689163.85023739
Claim140967212022-01-28 21:53:19893 days ago1643406799IN
0x372268f6...330e7eb57
0 ETH0.01070349118.31384638
Claim140967182022-01-28 21:52:47893 days ago1643406767IN
0x372268f6...330e7eb57
0 ETH0.01093339127.06897886
Claim140967112022-01-28 21:51:20893 days ago1643406680IN
0x372268f6...330e7eb57
0 ETH0.01256441115.85445278
Claim140967062022-01-28 21:50:30893 days ago1643406630IN
0x372268f6...330e7eb57
0 ETH0.01358462125.30320122
Claim140966792022-01-28 21:44:10893 days ago1643406250IN
0x372268f6...330e7eb57
0 ETH0.0137299127.70698341
Claim140966452022-01-28 21:38:50893 days ago1643405930IN
0x372268f6...330e7eb57
0 ETH0.01598269147.37387689
Claim140966442022-01-28 21:38:38893 days ago1643405918IN
0x372268f6...330e7eb57
0 ETH0.0126319139.59912462
Claim140966422022-01-28 21:38:03893 days ago1643405883IN
0x372268f6...330e7eb57
0 ETH0.01383657127.54723404
Claim140965982022-01-28 21:29:42893 days ago1643405382IN
0x372268f6...330e7eb57
0 ETH0.01252597115.5
Claim140965912022-01-28 21:28:23893 days ago1643405303IN
0x372268f6...330e7eb57
0 ETH0.01066384118.8
Claim140965712022-01-28 21:23:42893 days ago1643405022IN
0x372268f6...330e7eb57
0 ETH0.00947503107.94443707
Claim140965622022-01-28 21:22:32893 days ago1643404952IN
0x372268f6...330e7eb57
0 ETH0.01082492119.67198281
Claim140965512022-01-28 21:19:50893 days ago1643404790IN
0x372268f6...330e7eb57
0 ETH0.01191141131.63386213
Claim140965512022-01-28 21:19:50893 days ago1643404790IN
0x372268f6...330e7eb57
0 ETH0.01203001131.63386213
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pixelvault1155Giveaway

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

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

import '@openzeppelin/contracts/access/Ownable.sol';
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import '@openzeppelin/contracts/security/Pausable.sol';
import "@openzeppelin/contracts/utils/Counters.sol";

/*
* @title Contract for Pixelvault giveaways using Chainlink VRF 
*
* @author Niftydude
*/
contract Pixelvault1155Giveaway is VRFConsumerBase, ERC1155Holder, Ownable, Pausable {
    using Counters for Counters.Counter;
    Counters.Counter private counter; 

    bytes32 internal keyHash;
    uint256 internal fee;

    mapping(uint256 => Giveaway) public giveaways;

    IERC1155 public erc1155Contract;

    event Claimed(uint indexed index, address indexed account, uint amount);

    struct Giveaway {
        uint256 snapshotEntries;
        uint256 amountOfWinners;        
        uint256 randomNumber;
        uint256 tokenId;
        uint256 claimOpen;
        uint256 claimClose;
        bool isFulfilled;
        bool allowDuplicates;
        string entryListIpfsHash;
        address contractAddress;
        mapping(address => uint256) claimed;
        bytes32 merkleRoot;
    }

    constructor(
        address _vrfCoordinator,
        address _linkToken,
        bytes32 _keyHash,
        uint256 _fee
    ) VRFConsumerBase(_vrfCoordinator, _linkToken) {
        keyHash = _keyHash;
        fee = _fee;
    }   

    /**
    * @notice set merkle root for a given draw
    * 
    * @param _merkleRoot the merkle root to verify eligile claims
    */
    function setMerkleRoot(
        bytes32 _merkleRoot, 
        uint256 _drawId
    ) external onlyOwner {
        require(giveaways[_drawId].isFulfilled, "setMerkleRoot: draw not fulfilled");

        giveaways[_drawId].merkleRoot = _merkleRoot;
    } 

    /**
    * @notice return all winning entries for a given draw
    * 
    * @param giveawayId the giveaway id to return winners for
    */
    function getWinners(uint256 giveawayId) external view returns (uint256[] memory) {
        require(giveaways[giveawayId].isFulfilled, "GetWinners: draw not fulfilled");        
        require(giveaways[giveawayId].amountOfWinners > 0, "GetWinners: not a draw");        

        uint256[] memory expandedValues = new uint256[](giveaways[giveawayId].amountOfWinners);
        bool[] memory isNumberPicked = new bool[](giveaways[giveawayId].snapshotEntries);

        uint256 resultIndex;
        uint256 i;
        while (resultIndex < giveaways[giveawayId].amountOfWinners) {
            uint256 number = (uint256(keccak256(abi.encode(giveaways[giveawayId].randomNumber, i))) % giveaways[giveawayId].snapshotEntries) + 1;
            
            if(giveaways[giveawayId].allowDuplicates || !isNumberPicked[number-1]) {
                expandedValues[resultIndex] = number;
                isNumberPicked[number-1] = true;

                resultIndex++;
            }
            i++;
        }

        return expandedValues;
    }

    function withdrawLink() external onlyOwner {
        LINK.transfer(owner(), LINK.balanceOf(address(this)));
    }    

    /**
    * @notice initiate a new draw
    * 
    * @param _snapshotEntries the number of entries in the snapshot
    * @param _amountOfWinners the amount of winners to pick
    * @param _tokenId the token id which can be won
    * @param _contractAddress the contract address of the token
    * @param _entryListIpfsHash ipfs hash pointing to the list of entries
    * @param _allowDuplicates if true, a single entry is allowed to win multiple times
    * 
    */
    function startDraw(
        uint256 _snapshotEntries, 
        uint256 _amountOfWinners, 
        uint256 _tokenId, 
        address _contractAddress, 
        string memory _entryListIpfsHash, 
        bool _allowDuplicates, 
        uint256 _claimOpen, 
        uint256 _claimClose
    ) external onlyOwner returns (bytes32 requestId) {
        require(counter.current() == 0 || giveaways[counter.current()-1].isFulfilled, "Draw: previous draw not fulfilled");    
        require(_amountOfWinners < _snapshotEntries, "Draw: amount of winners must be smaller than number of entries");    
        require(
            LINK.balanceOf(address(this)) >= fee,
            "Not enough LINK - fill contract with faucet"
        );

        Giveaway storage d = giveaways[counter.current()];
        d.snapshotEntries = _snapshotEntries;
        d.amountOfWinners = _amountOfWinners;
        d.tokenId = _tokenId;     
        d.contractAddress = _contractAddress;
        d.entryListIpfsHash = _entryListIpfsHash;
        d.allowDuplicates = _allowDuplicates;
        d.claimOpen = _claimOpen;
        d.claimClose = _claimClose;

        counter.increment();

        return requestRandomness(keyHash, fee);
    }

    /**
    * @notice initiate a new giveaway
    * 
    * @param _tokenId the token id which can be won
    * @param _contractAddress the contract address of the token
    * @param _merkleRoot the merkle root to verify eligile claims
    */
    function startGiveaway(
        uint256 _tokenId, 
        address _contractAddress, 
        bytes32 _merkleRoot, 
        uint256 _claimOpen, 
        uint256 _claimClose
    ) external onlyOwner {
        require(counter.current() == 0 || giveaways[counter.current()-1].isFulfilled, "Giveaway: previous giveaway not fulfilled");    

        Giveaway storage d = giveaways[counter.current()];
        d.tokenId = _tokenId;     
        d.isFulfilled = true;
        d.contractAddress = _contractAddress;
        d.merkleRoot = _merkleRoot;
        d.claimOpen = _claimOpen;
        d.claimClose = _claimClose;

        counter.increment();
    }    

    /**
    * @notice claim tokens
    * 
    * @param amount the amount of tokens to claim
    * @param giveawayId the id of the token to claim
    * @param index the index of the merkle proof
    * @param maxAmount the max amount of tokens sender is eligible to claim
    * @param merkleProof the valid merkle proof of sender for given token id
    */
    function claim(
        uint256 amount,
        uint256 giveawayId,
        uint256 index,
        uint256 maxAmount,
        bytes32[] calldata merkleProof
    ) external whenNotPaused {
        require(giveaways[giveawayId].claimed[msg.sender] + amount <= maxAmount, "Claim: Not allowed to claim given amount");
        require (block.timestamp >= giveaways[giveawayId].claimOpen && block.timestamp <= giveaways[giveawayId].claimClose, "Claim: time window closed");        

        bytes32 node = keccak256(abi.encodePacked(index, msg.sender, maxAmount));
        require(
            MerkleProof.verify(merkleProof, giveaways[giveawayId].merkleRoot, node),
            "MerkleDistributor: Invalid proof."
        );

        giveaways[giveawayId].claimed[msg.sender] = giveaways[giveawayId].claimed[msg.sender] + amount;

        IERC1155(giveaways[giveawayId].contractAddress).safeTransferFrom(address(this), msg.sender, giveaways[giveawayId].tokenId, amount, "");

        emit Claimed(giveaways[giveawayId].tokenId, msg.sender, amount);                
    }  

    /**
    * @notice withdraw ERC1155 tokens from contract
    * 
    * @param _contractAddress the contract address of the token
    * @param _tokenId the id of the token
    * @param _amount the amount of tokens
    */
    function withdrawTokens(address _contractAddress, uint256 _tokenId, uint256 _amount) external onlyOwner {
        IERC1155(_contractAddress).safeTransferFrom(address(this), msg.sender, _tokenId, _amount, "");
    }

    /**
    * @notice pause claims
    */
    function pause() external onlyOwner {
        _pause();
    }

    /**
    * @notice unpause claims
    */
    function unpause() external onlyOwner {
        _unpause();
    }   

    /**
    * @notice emergency function to force fulfillment
    * 
    * @param _giveawayId the id of the giveaway to fulfill
    */
    function forceFulfill(uint256 _giveawayId) external onlyOwner {
        giveaways[_giveawayId].isFulfilled = true;
    }       

    /**
    * @notice edit claim window for a specific giveaway
    * 
    * @param _giveawayId the id of the giveaway to edit
    * @param _claimOpen UNIX opening timestamp 
    * @param _claimClose UNIX closing timestamp 
    */
    function setClaimWindow(uint256 _giveawayId, uint256 _claimOpen, uint256 _claimClose) external onlyOwner {
        require(_giveawayId < counter.current(), "Draw id does not exist");

        giveaways[_giveawayId].claimOpen = _claimOpen;
        giveaways[_giveawayId].claimClose = _claimClose;
    }    

    /**
    * @notice return the number of tokens a given account 
    * has already claimed for a given draw
    * 
    * @param drawId the id of the draw
    * @param userAdress the address of the user
    */
    function getClaimedTokens(uint256 drawId, address userAdress) public view returns (uint256) {
        return giveaways[drawId].claimed[userAdress];
    }              

    /**
     * Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32, uint256 randomness) internal override {
        giveaways[counter.current()-1].randomNumber = randomness;
        giveaways[counter.current()-1].isFulfilled = true;
    }
   
}

File 2 of 15 : 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 15 : 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 15 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

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

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

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

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

        // Check if the computed hash (root) is equal to the provided root
        return computedHash == root;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

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

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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":"_linkToken","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"giveawayId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc1155Contract","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_giveawayId","type":"uint256"}],"name":"forceFulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"drawId","type":"uint256"},{"internalType":"address","name":"userAdress","type":"address"}],"name":"getClaimedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"giveawayId","type":"uint256"}],"name":"getWinners","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"giveaways","outputs":[{"internalType":"uint256","name":"snapshotEntries","type":"uint256"},{"internalType":"uint256","name":"amountOfWinners","type":"uint256"},{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"claimOpen","type":"uint256"},{"internalType":"uint256","name":"claimClose","type":"uint256"},{"internalType":"bool","name":"isFulfilled","type":"bool"},{"internalType":"bool","name":"allowDuplicates","type":"bool"},{"internalType":"string","name":"entryListIpfsHash","type":"string"},{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":"uint256","name":"_giveawayId","type":"uint256"},{"internalType":"uint256","name":"_claimOpen","type":"uint256"},{"internalType":"uint256","name":"_claimClose","type":"uint256"}],"name":"setClaimWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_drawId","type":"uint256"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_snapshotEntries","type":"uint256"},{"internalType":"uint256","name":"_amountOfWinners","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"string","name":"_entryListIpfsHash","type":"string"},{"internalType":"bool","name":"_allowDuplicates","type":"bool"},{"internalType":"uint256","name":"_claimOpen","type":"uint256"},{"internalType":"uint256","name":"_claimClose","type":"uint256"}],"name":"startDraw","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_claimOpen","type":"uint256"},{"internalType":"uint256","name":"_claimClose","type":"uint256"}],"name":"startGiveaway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b506040516200224f3803806200224f8339810160408190526200003491620000ee565b6001600160601b0319606085811b821660a05284901b16608052620000606200005a3390565b6200007f565b6001805460ff60a01b1916905560039190915560045550620001359050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b0381168114620000e957600080fd5b919050565b6000806000806080858703121562000104578384fd5b6200010f85620000d1565b93506200011f60208601620000d1565b6040860151606090960151949790965092505050565b60805160601c60a05160601c6120d26200017d600039600081816112ac01526115210152600081816106c4015281816110060152818161105a01526114f201526120d26000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80637a564970116100b8578063934665671161007c57806393466567146102d057806394985ddd146102e3578063bc197c81146102f6578063ec519ac91461032e578063f23a6e6114610341578063f2fde38b1461036057600080fd5b80637a564970146102715780637c382d0b1461029c5780638456cb59146102af5780638da5cb5b146102b75780638dc654a2146102c857600080fd5b806352aa11b61161010a57806352aa11b6146101fe5780635463c3e8146102115780635c975abb146102245780635f9b417a146102365780636b1426a414610249578063715018a61461026957600080fd5b806301ffc9a7146101475780633e06df3d1461016f5780633f4ba83a1461019957806345dc0af7146101a35780634c1d1fde146101eb575b600080fd5b61015a610155366004611bc6565b610373565b60405190151581526020015b60405180910390f35b61018261017d366004611bee565b6103aa565b6040516101669b9a99989796959493929190611f1d565b6101a161049d565b005b6101dd6101b1366004611c1e565b60008281526005602090815260408083206001600160a01b038516845260090190915290205492915050565b604051908152602001610166565b6101a16101f9366004611b57565b6104da565b6101dd61020c366004611cb9565b61056d565b6101a161021f366004611d5b565b61084e565b600154600160a01b900460ff1661015a565b6101a1610244366004611bee565b610b9f565b61025c610257366004611bee565b610be7565b6040516101669190611ea4565b6101a1610ecb565b600654610284906001600160a01b031681565b6040516001600160a01b039091168152602001610166565b6101a16102aa366004611ba5565b610eff565b6101a1610fa8565b6001546001600160a01b0316610284565b6101a1610fda565b6101a16102de366004611c49565b61115d565b6101a16102f1366004611ba5565b6112a1565b610315610304366004611a4e565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610166565b6101a161033c366004611c8e565b611327565b61031561034f366004611af4565b63f23a6e6160e01b95945050505050565b6101a161036e366004611a34565b6113b9565b60006001600160e01b03198216630271189760e51b14806103a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006860154600787018054969895979496939594929360ff808416946101009094041692919061040490611fec565b80601f016020809104026020016040519081016040528092919081815260200182805461043090611fec565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b505050506008830154600a9093015491926001600160a01b03169190508b565b6001546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c790611ee8565b60405180910390fd5b6104d8611451565b565b6001546001600160a01b031633146105045760405162461bcd60e51b81526004016104c790611ee8565b604051637921219560e11b81526001600160a01b0384169063f242432a90610536903090339087908790600401611e3c565b600060405180830381600087803b15801561055057600080fd5b505af1158015610564573d6000803e3d6000fd5b50505050505050565b6001546000906001600160a01b0316331461059a5760405162461bcd60e51b81526004016104c790611ee8565b60025415806105d557506005600060016105b360025490565b6105bd9190611fd5565b815260208101919091526040016000206006015460ff165b61062b5760405162461bcd60e51b815260206004820152602160248201527f447261773a2070726576696f75732064726177206e6f742066756c66696c6c656044820152601960fa1b60648201526084016104c7565b8888106106a05760405162461bcd60e51b815260206004820152603e60248201527f447261773a20616d6f756e74206f662077696e6e657273206d7573742062652060448201527f736d616c6c6572207468616e206e756d626572206f6620656e7472696573000060648201526084016104c7565b600480546040516370a0823160e01b81523092810192909252906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b15801561070657600080fd5b505afa15801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190611c06565b10156107a05760405162461bcd60e51b815260206004820152602b60248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526a1dda5d1a0819985d58d95d60aa1b60648201526084016104c7565b6000600560006107af60025490565b81526020808201929092526040016000208b8155600181018b9055600381018a90556008810180546001600160a01b0319166001600160a01b038b1617905587519092506108059160078401919089019061187e565b5060068101805461ff0019166101008715150217905560048101849055600581018390556002805460010190556108406003546004546114ee565b9a9950505050505050505050565b600154600160a01b900460ff161561089b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104c7565b600085815260056020908152604080832033845260090190915290205483906108c5908890611fbd565b11156109245760405162461bcd60e51b815260206004820152602860248201527f436c61696d3a204e6f7420616c6c6f77656420746f20636c61696d20676976656044820152671b88185b5bdd5b9d60c21b60648201526084016104c7565b60008581526005602052604090206004015442108015906109575750600085815260056020819052604090912001544211155b6109a35760405162461bcd60e51b815260206004820152601960248201527f436c61696d3a2074696d652077696e646f7720636c6f7365640000000000000060448201526064016104c7565b60408051602081018690526bffffffffffffffffffffffff193360601b169181019190915260548101849052600090607401604051602081830303815290604052805190602001209050610a3b83838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152600560205260409020600a015492508591506116779050565b610a915760405162461bcd60e51b815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f666044820152601760f91b60648201526084016104c7565b6000868152600560209081526040808320338452600901909152902054610ab9908890611fbd565b60008781526005602081815260408084203380865260098201845282862096909655938b905291905260088201546003909201549051637921219560e11b81526001600160a01b039092169263f242432a92610b1c923092918d90600401611e3c565b600060405180830381600087803b158015610b3657600080fd5b505af1158015610b4a573d6000803e3d6000fd5b5050506000878152600560209081526040918290206003015491518a81523393507f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026910160405180910390a350505050505050565b6001546001600160a01b03163314610bc95760405162461bcd60e51b81526004016104c790611ee8565b6000908152600560205260409020600601805460ff19166001179055565b60008181526005602052604090206006015460609060ff16610c4b5760405162461bcd60e51b815260206004820152601e60248201527f47657457696e6e6572733a2064726177206e6f742066756c66696c6c6564000060448201526064016104c7565b600082815260056020526040902060010154610ca25760405162461bcd60e51b815260206004820152601660248201527547657457696e6e6572733a206e6f742061206472617760501b60448201526064016104c7565b60008281526005602052604081206001015467ffffffffffffffff811115610cda57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d03578160200160208202803683370190505b506000848152600560205260408120549192509067ffffffffffffffff811115610d3d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d66578160200160208202803683370190505b5090506000805b600086815260056020526040902060010154821015610ec15760008681526005602090815260408083208054600290910154825193840152908201849052906060016040516020818303038152906040528051906020012060001c610dd29190612042565b610ddd906001611fbd565b600088815260056020526040902060060154909150610100900460ff1680610e34575083610e0c600183611fd5565b81518110610e2a57634e487b7160e01b600052603260045260246000fd5b6020026020010151155b15610eae5780858481518110610e5a57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600184610e728284611fd5565b81518110610e9057634e487b7160e01b600052603260045260246000fd5b9115156020928302919091019091015282610eaa81612027565b9350505b81610eb881612027565b92505050610d6d565b5091949350505050565b6001546001600160a01b03163314610ef55760405162461bcd60e51b81526004016104c790611ee8565b6104d86000611734565b6001546001600160a01b03163314610f295760405162461bcd60e51b81526004016104c790611ee8565b60008181526005602052604090206006015460ff16610f945760405162461bcd60e51b815260206004820152602160248201527f7365744d65726b6c65526f6f743a2064726177206e6f742066756c66696c6c656044820152601960fa1b60648201526084016104c7565b6000908152600560205260409020600a0155565b6001546001600160a01b03163314610fd25760405162461bcd60e51b81526004016104c790611ee8565b6104d8611786565b6001546001600160a01b031633146110045760405162461bcd60e51b81526004016104c790611ee8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6110456001546001600160a01b031690565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156110a457600080fd5b505afa1580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc9190611c06565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561112257600080fd5b505af1158015611136573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115a9190611b89565b50565b6001546001600160a01b031633146111875760405162461bcd60e51b81526004016104c790611ee8565b60025415806111c257506005600060016111a060025490565b6111aa9190611fd5565b815260208101919091526040016000206006015460ff165b6112205760405162461bcd60e51b815260206004820152602960248201527f47697665617761793a2070726576696f7573206769766561776179206e6f7420604482015268199d5b199a5b1b195960ba1b60648201526084016104c7565b60006005600061122f60025490565b815260208101919091526040016000206003810187905560068101805460ff191660011790556008810180546001600160a01b0388166001600160a01b0319909116179055600a810185905560048101849055600581018390559050611299600280546001019055565b505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146113195760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016104c7565b611323828261180e565b5050565b6001546001600160a01b031633146113515760405162461bcd60e51b81526004016104c790611ee8565b600254831061139b5760405162461bcd60e51b8152602060048201526016602482015275111c985dc81a5908191bd95cc81b9bdd08195e1a5cdd60521b60448201526064016104c7565b60009283526005602081905260409093206004810192909255910155565b6001546001600160a01b031633146113e35760405162461bcd60e51b81526004016104c790611ee8565b6001600160a01b0381166114485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c7565b61115a81611734565b600154600160a01b900460ff166114a15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104c7565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f00000000000000000000000000000000000000000000000000000000000000008486600060405160200161155e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161158b93929190611e74565b602060405180830381600087803b1580156115a557600080fd5b505af11580156115b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dd9190611b89565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152611637906001611fbd565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120949350505050565b600081815b85518110156117295760008682815181106116a757634e487b7160e01b600052603260045260246000fd5b602002602001015190508083116116e9576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611716565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061172181612027565b91505061167c565b509092149392505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600154600160a01b900460ff16156117d35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104c7565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114d13390565b8060056000600161181e60025490565b6118289190611fd5565b815260200190815260200160002060020181905550600160056000600161184e60025490565b6118589190611fd5565b81526020810191909152604001600020600601805460ff19169115159190911790555050565b82805461188a90611fec565b90600052602060002090601f0160209004810192826118ac57600085556118f2565b82601f106118c557805160ff19168380011785556118f2565b828001600101855582156118f2579182015b828111156118f25782518255916020019190600101906118d7565b506118fe929150611902565b5090565b5b808211156118fe5760008155600101611903565b600067ffffffffffffffff83111561193157611931612078565b611944601f8401601f1916602001611f8c565b905082815283838301111561195857600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461198657600080fd5b919050565b600082601f83011261199b578081fd5b8135602067ffffffffffffffff8211156119b7576119b7612078565b8160051b6119c6828201611f8c565b8381528281019086840183880185018910156119e0578687fd5b8693505b85841015611a025780358352600193909301929184019184016119e4565b50979650505050505050565b600082601f830112611a1e578081fd5b611a2d83833560208501611917565b9392505050565b600060208284031215611a45578081fd5b611a2d8261196f565b600080600080600060a08688031215611a65578081fd5b611a6e8661196f565b9450611a7c6020870161196f565b9350604086013567ffffffffffffffff80821115611a98578283fd5b611aa489838a0161198b565b94506060880135915080821115611ab9578283fd5b611ac589838a0161198b565b93506080880135915080821115611ada578283fd5b50611ae788828901611a0e565b9150509295509295909350565b600080600080600060a08688031215611b0b578081fd5b611b148661196f565b9450611b226020870161196f565b93506040860135925060608601359150608086013567ffffffffffffffff811115611b4b578182fd5b611ae788828901611a0e565b600080600060608486031215611b6b578283fd5b611b748461196f565b95602085013595506040909401359392505050565b600060208284031215611b9a578081fd5b8151611a2d8161208e565b60008060408385031215611bb7578182fd5b50508035926020909101359150565b600060208284031215611bd7578081fd5b81356001600160e01b031981168114611a2d578182fd5b600060208284031215611bff578081fd5b5035919050565b600060208284031215611c17578081fd5b5051919050565b60008060408385031215611c30578081fd5b82359150611c406020840161196f565b90509250929050565b600080600080600060a08688031215611c60578283fd5b85359450611c706020870161196f565b94979496505050506040830135926060810135926080909101359150565b600080600060608486031215611ca2578081fd5b505081359360208301359350604090920135919050565b600080600080600080600080610100898b031215611cd5578586fd5b883597506020890135965060408901359550611cf360608a0161196f565b9450608089013567ffffffffffffffff811115611d0e578384fd5b8901601f81018b13611d1e578384fd5b611d2d8b823560208401611917565b94505060a0890135611d3e8161208e565b979a969950949793969295929450505060c08201359160e0013590565b60008060008060008060a08789031215611d73578384fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff80821115611da6578384fd5b818901915089601f830112611db9578384fd5b813581811115611dc7578485fd5b8a60208260051b8501011115611ddb578485fd5b6020830194508093505050509295509295509295565b60008151808452815b81811015611e1657602081850181015186830182015201611dfa565b81811115611e275782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b60018060a01b0384168152826020820152606060408201526000611e9b6060830184611df1565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015611edc57835183529284019291840191600101611ec0565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006101608d83528c60208401528b60408401528a60608401528960808401528860a084015287151560c084015286151560e084015280610100840152611f6681840187611df1565b6001600160a01b0395909516610120840152505061014001529998505050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715611fb557611fb5612078565b604052919050565b60008219821115611fd057611fd0612062565b500190565b600082821015611fe757611fe7612062565b500390565b600181811c9082168061200057607f821691505b6020821081141561202157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561203b5761203b612062565b5060010190565b60008261205d57634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461115a57600080fdfea2646970667358221220d2cd994ae3e7ef8449e0011b68809882203d48f0fe09084dd342f9507f42cafc64736f6c63430008040033000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c80637a564970116100b8578063934665671161007c57806393466567146102d057806394985ddd146102e3578063bc197c81146102f6578063ec519ac91461032e578063f23a6e6114610341578063f2fde38b1461036057600080fd5b80637a564970146102715780637c382d0b1461029c5780638456cb59146102af5780638da5cb5b146102b75780638dc654a2146102c857600080fd5b806352aa11b61161010a57806352aa11b6146101fe5780635463c3e8146102115780635c975abb146102245780635f9b417a146102365780636b1426a414610249578063715018a61461026957600080fd5b806301ffc9a7146101475780633e06df3d1461016f5780633f4ba83a1461019957806345dc0af7146101a35780634c1d1fde146101eb575b600080fd5b61015a610155366004611bc6565b610373565b60405190151581526020015b60405180910390f35b61018261017d366004611bee565b6103aa565b6040516101669b9a99989796959493929190611f1d565b6101a161049d565b005b6101dd6101b1366004611c1e565b60008281526005602090815260408083206001600160a01b038516845260090190915290205492915050565b604051908152602001610166565b6101a16101f9366004611b57565b6104da565b6101dd61020c366004611cb9565b61056d565b6101a161021f366004611d5b565b61084e565b600154600160a01b900460ff1661015a565b6101a1610244366004611bee565b610b9f565b61025c610257366004611bee565b610be7565b6040516101669190611ea4565b6101a1610ecb565b600654610284906001600160a01b031681565b6040516001600160a01b039091168152602001610166565b6101a16102aa366004611ba5565b610eff565b6101a1610fa8565b6001546001600160a01b0316610284565b6101a1610fda565b6101a16102de366004611c49565b61115d565b6101a16102f1366004611ba5565b6112a1565b610315610304366004611a4e565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610166565b6101a161033c366004611c8e565b611327565b61031561034f366004611af4565b63f23a6e6160e01b95945050505050565b6101a161036e366004611a34565b6113b9565b60006001600160e01b03198216630271189760e51b14806103a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b600560208190526000918252604090912080546001820154600283015460038401546004850154958501546006860154600787018054969895979496939594929360ff808416946101009094041692919061040490611fec565b80601f016020809104026020016040519081016040528092919081815260200182805461043090611fec565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b505050506008830154600a9093015491926001600160a01b03169190508b565b6001546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c790611ee8565b60405180910390fd5b6104d8611451565b565b6001546001600160a01b031633146105045760405162461bcd60e51b81526004016104c790611ee8565b604051637921219560e11b81526001600160a01b0384169063f242432a90610536903090339087908790600401611e3c565b600060405180830381600087803b15801561055057600080fd5b505af1158015610564573d6000803e3d6000fd5b50505050505050565b6001546000906001600160a01b0316331461059a5760405162461bcd60e51b81526004016104c790611ee8565b60025415806105d557506005600060016105b360025490565b6105bd9190611fd5565b815260208101919091526040016000206006015460ff165b61062b5760405162461bcd60e51b815260206004820152602160248201527f447261773a2070726576696f75732064726177206e6f742066756c66696c6c656044820152601960fa1b60648201526084016104c7565b8888106106a05760405162461bcd60e51b815260206004820152603e60248201527f447261773a20616d6f756e74206f662077696e6e657273206d7573742062652060448201527f736d616c6c6572207468616e206e756d626572206f6620656e7472696573000060648201526084016104c7565b600480546040516370a0823160e01b81523092810192909252906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a082319060240160206040518083038186803b15801561070657600080fd5b505afa15801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190611c06565b10156107a05760405162461bcd60e51b815260206004820152602b60248201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060448201526a1dda5d1a0819985d58d95d60aa1b60648201526084016104c7565b6000600560006107af60025490565b81526020808201929092526040016000208b8155600181018b9055600381018a90556008810180546001600160a01b0319166001600160a01b038b1617905587519092506108059160078401919089019061187e565b5060068101805461ff0019166101008715150217905560048101849055600581018390556002805460010190556108406003546004546114ee565b9a9950505050505050505050565b600154600160a01b900460ff161561089b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104c7565b600085815260056020908152604080832033845260090190915290205483906108c5908890611fbd565b11156109245760405162461bcd60e51b815260206004820152602860248201527f436c61696d3a204e6f7420616c6c6f77656420746f20636c61696d20676976656044820152671b88185b5bdd5b9d60c21b60648201526084016104c7565b60008581526005602052604090206004015442108015906109575750600085815260056020819052604090912001544211155b6109a35760405162461bcd60e51b815260206004820152601960248201527f436c61696d3a2074696d652077696e646f7720636c6f7365640000000000000060448201526064016104c7565b60408051602081018690526bffffffffffffffffffffffff193360601b169181019190915260548101849052600090607401604051602081830303815290604052805190602001209050610a3b83838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152600560205260409020600a015492508591506116779050565b610a915760405162461bcd60e51b815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f666044820152601760f91b60648201526084016104c7565b6000868152600560209081526040808320338452600901909152902054610ab9908890611fbd565b60008781526005602081815260408084203380865260098201845282862096909655938b905291905260088201546003909201549051637921219560e11b81526001600160a01b039092169263f242432a92610b1c923092918d90600401611e3c565b600060405180830381600087803b158015610b3657600080fd5b505af1158015610b4a573d6000803e3d6000fd5b5050506000878152600560209081526040918290206003015491518a81523393507f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026910160405180910390a350505050505050565b6001546001600160a01b03163314610bc95760405162461bcd60e51b81526004016104c790611ee8565b6000908152600560205260409020600601805460ff19166001179055565b60008181526005602052604090206006015460609060ff16610c4b5760405162461bcd60e51b815260206004820152601e60248201527f47657457696e6e6572733a2064726177206e6f742066756c66696c6c6564000060448201526064016104c7565b600082815260056020526040902060010154610ca25760405162461bcd60e51b815260206004820152601660248201527547657457696e6e6572733a206e6f742061206472617760501b60448201526064016104c7565b60008281526005602052604081206001015467ffffffffffffffff811115610cda57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d03578160200160208202803683370190505b506000848152600560205260408120549192509067ffffffffffffffff811115610d3d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d66578160200160208202803683370190505b5090506000805b600086815260056020526040902060010154821015610ec15760008681526005602090815260408083208054600290910154825193840152908201849052906060016040516020818303038152906040528051906020012060001c610dd29190612042565b610ddd906001611fbd565b600088815260056020526040902060060154909150610100900460ff1680610e34575083610e0c600183611fd5565b81518110610e2a57634e487b7160e01b600052603260045260246000fd5b6020026020010151155b15610eae5780858481518110610e5a57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600184610e728284611fd5565b81518110610e9057634e487b7160e01b600052603260045260246000fd5b9115156020928302919091019091015282610eaa81612027565b9350505b81610eb881612027565b92505050610d6d565b5091949350505050565b6001546001600160a01b03163314610ef55760405162461bcd60e51b81526004016104c790611ee8565b6104d86000611734565b6001546001600160a01b03163314610f295760405162461bcd60e51b81526004016104c790611ee8565b60008181526005602052604090206006015460ff16610f945760405162461bcd60e51b815260206004820152602160248201527f7365744d65726b6c65526f6f743a2064726177206e6f742066756c66696c6c656044820152601960fa1b60648201526084016104c7565b6000908152600560205260409020600a0155565b6001546001600160a01b03163314610fd25760405162461bcd60e51b81526004016104c790611ee8565b6104d8611786565b6001546001600160a01b031633146110045760405162461bcd60e51b81526004016104c790611ee8565b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b031663a9059cbb6110456001546001600160a01b031690565b6040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a082319060240160206040518083038186803b1580156110a457600080fd5b505afa1580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc9190611c06565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561112257600080fd5b505af1158015611136573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115a9190611b89565b50565b6001546001600160a01b031633146111875760405162461bcd60e51b81526004016104c790611ee8565b60025415806111c257506005600060016111a060025490565b6111aa9190611fd5565b815260208101919091526040016000206006015460ff165b6112205760405162461bcd60e51b815260206004820152602960248201527f47697665617761793a2070726576696f7573206769766561776179206e6f7420604482015268199d5b199a5b1b195960ba1b60648201526084016104c7565b60006005600061122f60025490565b815260208101919091526040016000206003810187905560068101805460ff191660011790556008810180546001600160a01b0388166001600160a01b0319909116179055600a810185905560048101849055600581018390559050611299600280546001019055565b505050505050565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146113195760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016104c7565b611323828261180e565b5050565b6001546001600160a01b031633146113515760405162461bcd60e51b81526004016104c790611ee8565b600254831061139b5760405162461bcd60e51b8152602060048201526016602482015275111c985dc81a5908191bd95cc81b9bdd08195e1a5cdd60521b60448201526064016104c7565b60009283526005602081905260409093206004810192909255910155565b6001546001600160a01b031633146113e35760405162461bcd60e51b81526004016104c790611ee8565b6001600160a01b0381166114485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c7565b61115a81611734565b600154600160a01b900460ff166114a15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104c7565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79528486600060405160200161155e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161158b93929190611e74565b602060405180830381600087803b1580156115a557600080fd5b505af11580156115b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115dd9190611b89565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152611637906001611fbd565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120949350505050565b600081815b85518110156117295760008682815181106116a757634e487b7160e01b600052603260045260246000fd5b602002602001015190508083116116e9576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611716565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061172181612027565b91505061167c565b509092149392505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600154600160a01b900460ff16156117d35760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104c7565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114d13390565b8060056000600161181e60025490565b6118289190611fd5565b815260200190815260200160002060020181905550600160056000600161184e60025490565b6118589190611fd5565b81526020810191909152604001600020600601805460ff19169115159190911790555050565b82805461188a90611fec565b90600052602060002090601f0160209004810192826118ac57600085556118f2565b82601f106118c557805160ff19168380011785556118f2565b828001600101855582156118f2579182015b828111156118f25782518255916020019190600101906118d7565b506118fe929150611902565b5090565b5b808211156118fe5760008155600101611903565b600067ffffffffffffffff83111561193157611931612078565b611944601f8401601f1916602001611f8c565b905082815283838301111561195857600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461198657600080fd5b919050565b600082601f83011261199b578081fd5b8135602067ffffffffffffffff8211156119b7576119b7612078565b8160051b6119c6828201611f8c565b8381528281019086840183880185018910156119e0578687fd5b8693505b85841015611a025780358352600193909301929184019184016119e4565b50979650505050505050565b600082601f830112611a1e578081fd5b611a2d83833560208501611917565b9392505050565b600060208284031215611a45578081fd5b611a2d8261196f565b600080600080600060a08688031215611a65578081fd5b611a6e8661196f565b9450611a7c6020870161196f565b9350604086013567ffffffffffffffff80821115611a98578283fd5b611aa489838a0161198b565b94506060880135915080821115611ab9578283fd5b611ac589838a0161198b565b93506080880135915080821115611ada578283fd5b50611ae788828901611a0e565b9150509295509295909350565b600080600080600060a08688031215611b0b578081fd5b611b148661196f565b9450611b226020870161196f565b93506040860135925060608601359150608086013567ffffffffffffffff811115611b4b578182fd5b611ae788828901611a0e565b600080600060608486031215611b6b578283fd5b611b748461196f565b95602085013595506040909401359392505050565b600060208284031215611b9a578081fd5b8151611a2d8161208e565b60008060408385031215611bb7578182fd5b50508035926020909101359150565b600060208284031215611bd7578081fd5b81356001600160e01b031981168114611a2d578182fd5b600060208284031215611bff578081fd5b5035919050565b600060208284031215611c17578081fd5b5051919050565b60008060408385031215611c30578081fd5b82359150611c406020840161196f565b90509250929050565b600080600080600060a08688031215611c60578283fd5b85359450611c706020870161196f565b94979496505050506040830135926060810135926080909101359150565b600080600060608486031215611ca2578081fd5b505081359360208301359350604090920135919050565b600080600080600080600080610100898b031215611cd5578586fd5b883597506020890135965060408901359550611cf360608a0161196f565b9450608089013567ffffffffffffffff811115611d0e578384fd5b8901601f81018b13611d1e578384fd5b611d2d8b823560208401611917565b94505060a0890135611d3e8161208e565b979a969950949793969295929450505060c08201359160e0013590565b60008060008060008060a08789031215611d73578384fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff80821115611da6578384fd5b818901915089601f830112611db9578384fd5b813581811115611dc7578485fd5b8a60208260051b8501011115611ddb578485fd5b6020830194508093505050509295509295509295565b60008151808452815b81811015611e1657602081850181015186830182015201611dfa565b81811115611e275782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b60018060a01b0384168152826020820152606060408201526000611e9b6060830184611df1565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015611edc57835183529284019291840191600101611ec0565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006101608d83528c60208401528b60408401528a60608401528960808401528860a084015287151560c084015286151560e084015280610100840152611f6681840187611df1565b6001600160a01b0395909516610120840152505061014001529998505050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715611fb557611fb5612078565b604052919050565b60008219821115611fd057611fd0612062565b500190565b600082821015611fe757611fe7612062565b500390565b600181811c9082168061200057607f821691505b6020821081141561202157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561203b5761203b612062565b5060010190565b60008261205d57634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461115a57600080fdfea2646970667358221220d2cd994ae3e7ef8449e0011b68809882203d48f0fe09084dd342f9507f42cafc64736f6c63430008040033

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

000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

-----Decoded View---------------
Arg [0] : _vrfCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [1] : _linkToken (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [2] : _keyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [3] : _fee (uint256): 2000000000000000000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [1] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [2] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [3] : 0000000000000000000000000000000000000000000000001bc16d674ec80000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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