ETH Price: $3,336.55 (-1.21%)

Contract

0xAFFF04FbFe54Cc985E25493A8F9D7114012D6d6F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Prize127640312021-07-04 23:32:211267 days ago1625441541IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0013175110
Transfer123135102021-04-26 3:32:001337 days ago1619407920IN
0xAFFF04Fb...4012D6d6F
0.002 ETH0.0010550
Claim Prize120144482021-03-11 1:52:411383 days ago1615427561IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0141359280.00000145
Claim Prize119938492021-03-07 21:42:031386 days ago1615153323IN
0xAFFF04Fb...4012D6d6F
0 ETH0.01399669108
Claim Prize119880542021-03-07 0:10:411387 days ago1615075841IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0173039192
Claim Prize119727172021-03-04 15:53:451389 days ago1614873225IN
0xAFFF04Fb...4012D6d6F
0 ETH0.02055371102
Claim Prize119710942021-03-04 9:44:151390 days ago1614851055IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0070998484
Claim Prize119703092021-03-04 7:02:051390 days ago1614841325IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0281258382
Claim Prize119689242021-03-04 1:51:401390 days ago1614822700IN
0xAFFF04Fb...4012D6d6F
0 ETH0.01064977126
Claim Prize119668102021-03-03 17:59:271390 days ago1614794367IN
0xAFFF04Fb...4012D6d6F
0 ETH0.01737033133
Claim Prize119641002021-03-03 8:07:461391 days ago1614758866IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0079461994
Claim Prize119621202021-03-03 0:31:311391 days ago1614731491IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0168312389
Claim Prize119618472021-03-02 23:30:501391 days ago1614727850IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0204059262.11
Claim Prize119613602021-03-02 21:46:071391 days ago1614721567IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0246967272
Claim Prize119605652021-03-02 18:51:051391 days ago1614711065IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0083676799
Claim Prize119594252021-03-02 14:41:121391 days ago1614696072IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0388372178
Claim Prize119594002021-03-02 14:36:261391 days ago1614695786IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0286534587.5
Claim Prize119569672021-03-02 5:35:571392 days ago1614663357IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0773144369
Claim Prize119510822021-03-01 7:50:341393 days ago1614585034IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0332137575
Claim Prize119510782021-03-01 7:49:211393 days ago1614584961IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0108327781
Claim Prize119492242021-03-01 0:57:121393 days ago1614560232IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0122977470
Claim Prize119470502021-02-28 16:59:461393 days ago1614531586IN
0xAFFF04Fb...4012D6d6F
0 ETH0.00862124102
Claim Prize119461262021-02-28 13:34:311393 days ago1614519271IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0067627280
Claim Prize119453562021-02-28 10:51:011394 days ago1614509461IN
0xAFFF04Fb...4012D6d6F
0 ETH0.0141378480
Claim Prize119411872021-02-27 19:21:181394 days ago1614453678IN
0xAFFF04Fb...4012D6d6F
0 ETH0.00870576103
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:
RafflesContract

Compiler Version
v0.7.4+commit.3f05b770

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 5 : RafflesContract.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.7.4;
pragma experimental ABIEncoderV2;

/*************/
/* Aavegotchi raffles contract
/* Authors: Nick Mudge (mudgen) and Daniel Mathieu (coderdan)
/*************/

import "./interfaces/IERC1155.sol";
import "./chainlink/LinkTokenInterface.sol";
import "./interfaces/IERC173.sol";
import "./interfaces/IERC165.sol";

// All state variables are accessed through this struct
// To avoid name clashes and make clear a variable is a state variable
// state variable access starts with "s." which accesses variables in this struct
struct AppStorage {
    // IERC165
    mapping(bytes4 => bool) supportedInterfaces;
    Raffle[] raffles;
    // Nonces for VRF keyHash from which randomness has been requested.
    // Must stay in sync with VRFCoordinator[_keyHash][this]
    // keyHash => nonce
    mapping(bytes32 => uint256) nonces;
    mapping(bytes32 => uint256) requestIdToRaffleId;
    bytes32 keyHash;
    uint96 fee;
    address contractOwner;
}

struct Raffle {
    // associates ticket address and ticketId to raffleItems
    // if raffleItemIndexes == 0, then raffle item does not exist
    // This means all raffleItemIndexes have been incremented by 1
    // ticketAddress => (ticketId => index + 1)
    mapping(address => mapping(uint256 => uint256)) raffleItemIndexes;
    RaffleItem[] raffleItems;
    // maps what tickets entrants have entered into the raffle
    // entrant => tickets
    mapping(address => Entry[]) entries;
    // the addresses of people who have entered tickets into the raffle
    address[] entrants;
    // vrf randomness
    uint256 randomNumber;
    // requested vrf random number
    bool randomNumberPending;
    // date in timestamp seconds when a raffle ends
    uint256 raffleEnd;
}

// The minimum rangeStart is 0
// The maximum rangeEnd is raffleItem.totalEntered
// rangeEnd - rangeStart == number of ticket entered for raffle item by a entrant entry
struct Entry {
    uint24 raffleItemIndex; // Which raffle item is entered into the raffleEnd
    // used to prevent users from claiming prizes more than once
    bool prizesClaimed;
    uint112 rangeStart; // Raffle number. Value is between 0 and raffleItem.totalEntered - 1
    uint112 rangeEnd; // Raffle number. Value is between 1 and raffleItem.totalEntered
}

struct RaffleItemPrize {
    address prizeAddress; // ERC1155 token contract
    uint96 prizeQuantity; // Number of ERC1155 tokens
    uint256 prizeId; // ERC1155 token type
}

// Ticket numbers are numbers between 0 and raffleItem.totalEntered - 1 inclusive.
struct RaffleItem {
    address ticketAddress; // ERC1155 token contract
    uint256 ticketId; // ERC1155 token type
    uint256 totalEntered; // Total number of ERC1155 tokens entered into raffle for this raffle item
    RaffleItemPrize[] raffleItemPrizes; // Prizes that can be won for this raffle item
}

contract RafflesContract is IERC173, IERC165 {
    // State variables are prefixed with s.
    AppStorage internal s;
    // Immutable values are prefixed with im_ to easily identify them in code
    LinkTokenInterface internal immutable im_link;
    address internal immutable im_vrfCoordinator;

    bytes4 internal constant ERC1155_ACCEPTED = 0xf23a6e61; // Return value from `onERC1155Received` call if a contract accepts receipt (i.e `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`).
    event RaffleStarted(uint256 indexed raffleId, uint256 raffleEnd, RaffleItemInput[] raffleItems);
    event RaffleTicketsEntered(uint256 indexed raffleId, address entrant, TicketItemIO[] ticketItems);
    event RaffleRandomNumber(uint256 indexed raffleId, uint256 randomNumber);
    event RaffleClaimPrize(uint256 indexed raffleId, address entrant, address prizeAddress, uint256 prizeId, uint256 prizeQuantity);

    constructor(
        address _contractOwner,
        address _vrfCoordinator,
        address _link,
        bytes32 _keyHash,
        uint256 _fee
    ) {
        s.contractOwner = _contractOwner;
        im_vrfCoordinator = _vrfCoordinator;
        im_link = LinkTokenInterface(_link);
        s.keyHash = _keyHash; //0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4;
        s.fee = uint96(_fee);

        // adding ERC165 data
        s.supportedInterfaces[type(IERC165).interfaceId] = true;
        s.supportedInterfaces[type(IERC173).interfaceId] = true;
        // skip raffle 0
        s.raffles.push();
    }

    function supportsInterface(bytes4 _interfaceId) external view override returns (bool) {
        return s.supportedInterfaces[_interfaceId];
    }

    // VRF Functionality ////////////////////////////////////////////////////////////////
    function nonces(bytes32 _keyHash) external view returns (uint256 nonce_) {
        nonce_ = s.nonces[_keyHash];
    }

    /**
     * @notice requestRandomness initiates a request for VRF output given _seed
     *
     * @dev See "SECURITY CONSIDERATIONS" above for more information on _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.
     *
     * @param _keyHash ID of public key against which randomness is generated
     * @param _fee The amount of LINK to send with the request
     * @param _seed seed mixed into the input of the VRF
     *
     * @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,
        uint256 _seed
    ) internal returns (bytes32 requestId) {
        im_link.transferAndCall(im_vrfCoordinator, _fee, abi.encode(_keyHash, _seed));
        // 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.
        // So the seed doesn't actually do anything and is left over from an old API.
        uint256 vRFSeed = makeVRFInputSeed(_keyHash, _seed, address(this), s.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.
        s.nonces[_keyHash]++;
        return makeRequestId(_keyHash, vRFSeed);
    }

    /**
     * @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));
    }

    function drawRandomNumber(uint256 _raffleId) external {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        require(raffle.raffleEnd < block.timestamp, "Raffle: Raffle time has not expired");
        require(raffle.randomNumber == 0, "Raffle: Random number already generated");
        require(raffle.randomNumberPending == false || msg.sender == s.contractOwner, "Raffle: Random number is pending");
        raffle.randomNumberPending = true;
        // Use Chainlink VRF to generate random number
        require(im_link.balanceOf(address(this)) >= s.fee, "Not enough LINK");
        bytes32 requestId = requestRandomness(s.keyHash, s.fee, 0);
        s.requestIdToRaffleId[requestId] = _raffleId;
    }

    // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRFproof.
    /**
     * @notice Callback function used by VRF Coordinator
     * @dev This is where you do something with randomness!
     * @dev The VRF Coordinator will only send this function verified responses.
     * @dev The VRF Coordinator will not pass randomness that could not be verified.
     */
    function rawFulfillRandomness(bytes32 _requestId, uint256 _randomness) external {
        require(msg.sender == im_vrfCoordinator, "Only VRFCoordinator can fulfill");
        uint256 raffleId = s.requestIdToRaffleId[_requestId];
        require(raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[raffleId];
        require(raffle.raffleEnd < block.timestamp, "Raffle: Raffle time has not expired");
        require(raffle.randomNumber == 0, "Raffle: Random number already generated");
        s.raffles[raffleId].randomNumber = _randomness;
        raffle.randomNumberPending = false;
        emit RaffleRandomNumber(raffleId, _randomness);
    }

    // Change the fee amount that is paid for VRF random numbers
    function changeVRFFee(uint256 _newFee, bytes32 _keyHash) external {
        require(msg.sender == s.contractOwner, "Raffle: Must be contract owner");
        s.fee = uint96(_newFee);
        s.keyHash = _keyHash;
    }

    // Remove the LINK tokens from this contract that are used to pay for VRF random number fees
    function removeLinkTokens(address _to, uint256 _value) external {
        require(msg.sender == s.contractOwner, "Raffle: Must be contract owner");
        im_link.transfer(_to, _value);
    }

    function linkBalance() external view returns (uint256 linkBalance_) {
        linkBalance_ = im_link.balanceOf(address(this));
    }

    /////////////////////////////////////////////////////////////////////////////////////

    function owner() external view override returns (address) {
        return s.contractOwner;
    }

    function transferOwnership(address _newContractOwner) external override {
        address previousOwner = s.contractOwner;
        require(msg.sender == previousOwner, "Raffle: Must be contract owner");
        s.contractOwner = _newContractOwner;
        emit OwnershipTransferred(previousOwner, _newContractOwner);
    }

    // structs with IO at the end of their name mean they are only used for
    // arguments and/or return values of functions
    struct RaffleItemInput {
        address ticketAddress;
        uint256 ticketId;
        RaffleItemPrizeIO[] raffleItemPrizes;
    }
    struct RaffleItemPrizeIO {
        address prizeAddress;
        uint256 prizeId;
        uint256 prizeQuantity;
    }

    /**
     * @notice Starts a raffle
     * @dev The _raffleItems argument tells what ERC1155 tickets can be entered for what ERC1155 prizes.
     * The _raffleItems get stored in the raffleItems state variable
     * The raffle prizes that can be won are transferred into this contract.
     * @param _raffleDuration How long a raffle goes for, in seconds
     * @param _raffleItems What tickets to enter for what prizes
     */
    function startRaffle(uint256 _raffleDuration, RaffleItemInput[] calldata _raffleItems) external {
        require(msg.sender == s.contractOwner, "Raffle: Must be contract owner");
        require(_raffleDuration >= 3600, "Raffle: _raffleDuration must be greater than 1 hour");
        uint256 raffleEnd = block.timestamp + _raffleDuration;
        require(_raffleItems.length > 0, "Raffle: No raffle items");
        uint256 raffleId = s.raffles.length;
        emit RaffleStarted(raffleId, raffleEnd, _raffleItems);
        Raffle storage raffle = s.raffles.push();
        raffle.raffleEnd = raffleEnd;
        for (uint256 i; i < _raffleItems.length; i++) {
            RaffleItemInput calldata raffleItemInput = _raffleItems[i];
            require(raffleItemInput.raffleItemPrizes.length > 0, "Raffle: No prizes");
            // ticketAddress is ERC1155 contract address of tickets
            // ticketId is the ERC1155 type id, which type is it
            require(
                // The index is one greater than actual index.  If index is 0 it means the value does not exist yet.
                raffle.raffleItemIndexes[raffleItemInput.ticketAddress][raffleItemInput.ticketId] == 0,
                "Raffle: Raffle item already using ticketAddress and ticketId"
            );
            // A raffle item is a ticketAddress, ticketId and what prizes can be won.
            RaffleItem storage raffleItem = raffle.raffleItems.push();
            // The index is one greater than actual index.  If index is 0 it means the value does not exist yet.
            raffle.raffleItemIndexes[raffleItemInput.ticketAddress][raffleItemInput.ticketId] = raffle.raffleItems.length;
            raffleItem.ticketAddress = raffleItemInput.ticketAddress;
            raffleItem.ticketId = raffleItemInput.ticketId;
            for (uint256 j; j < raffleItemInput.raffleItemPrizes.length; j++) {
                RaffleItemPrizeIO calldata raffleItemPrizeIO = raffleItemInput.raffleItemPrizes[j];
                raffleItem.raffleItemPrizes.push(
                    RaffleItemPrize(raffleItemPrizeIO.prizeAddress, uint96(raffleItemPrizeIO.prizeQuantity), raffleItemPrizeIO.prizeId)
                );
                IERC1155(raffleItemPrizeIO.prizeAddress).safeTransferFrom(
                    msg.sender,
                    address(this),
                    raffleItemPrizeIO.prizeId,
                    raffleItemPrizeIO.prizeQuantity,
                    abi.encode(raffleId)
                );
            }
        }
    }

    /**
        @notice Handle the receipt of a single ERC1155 token type.
        @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated.        
        This function MUST return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61) if it accepts the transfer.
        This function MUST revert if it rejects the transfer.
        Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.
        @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)"))`
    */
    function onERC1155Received(
        address _operator,
        address _from,
        uint256 _id,
        uint256 _value,
        bytes calldata _data
    ) external view returns (bytes4) {
        _operator; // silence not used warning
        _from; // silence not used warning
        _id; // silence not used warning
        _value; // silence not used warning
        require(_data.length == 32, "Raffle: Data of the wrong size sent on transfer");
        uint256 raffleId = abi.decode(_data, (uint256));
        require(raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[raffleId];
        uint256 raffleEnd = raffle.raffleEnd;
        require(raffleEnd > block.timestamp, "Raffle: Can't accept transfer for expired raffle");
        return ERC1155_ACCEPTED;
    }

    struct RaffleIO {
        uint256 raffleId;
        uint256 raffleEnd;
        bool isOpen;
    }

    /**
     * @notice Get simple raffle information
     */
    function getRaffles() external view returns (RaffleIO[] memory raffles_) {
        raffles_ = new RaffleIO[](s.raffles.length);
        for (uint256 i; i < s.raffles.length; i++) {
            uint256 raffleEnd = s.raffles[i].raffleEnd;
            raffles_[i].raffleId = i;
            raffles_[i].raffleEnd = raffleEnd;
            raffles_[i].isOpen = raffleEnd > block.timestamp;
        }
    }

    /**
     * @notice Get total number of raffles that exist.
     */
    function raffleSupply() external view returns (uint256 raffleSupply_) {
        raffleSupply_ = s.raffles.length;
    }

    struct RaffleItemOutput {
        address ticketAddress;
        uint256 ticketId;
        uint256 totalEntered;
        RaffleItemPrizeIO[] raffleItemPrizes;
    }

    /**
     * @notice Get simple raffle info and all the raffle items in the raffle.
     * @param _raffleId Which raffle to get info about.
     */
    function raffleInfo(uint256 _raffleId)
        external
        view
        returns (
            uint256 raffleEnd_,
            RaffleItemOutput[] memory raffleItems_,
            uint256 randomNumber_
        )
    {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        raffleEnd_ = raffle.raffleEnd;
        if (raffle.randomNumberPending == true) {
            randomNumber_ = 1;
        } else {
            randomNumber_ = raffle.randomNumber;
        }
        // Loop over and get all the raffle itmes, which includes ERC1155 tickets and ERC1155 prizes
        raffleItems_ = new RaffleItemOutput[](raffle.raffleItems.length);
        for (uint256 i; i < raffle.raffleItems.length; i++) {
            RaffleItem storage raffleItem = raffle.raffleItems[i];
            raffleItems_[i].ticketAddress = raffleItem.ticketAddress;
            raffleItems_[i].ticketId = raffleItem.ticketId;
            raffleItems_[i].totalEntered = raffleItem.totalEntered;
            raffleItems_[i].raffleItemPrizes = new RaffleItemPrizeIO[](raffleItem.raffleItemPrizes.length);
            for (uint256 j; j < raffleItem.raffleItemPrizes.length; j++) {
                RaffleItemPrize storage raffleItemPrize = raffleItem.raffleItemPrizes[j];
                raffleItems_[i].raffleItemPrizes[j].prizeAddress = raffleItemPrize.prizeAddress;
                raffleItems_[i].raffleItemPrizes[j].prizeId = raffleItemPrize.prizeId;
                raffleItems_[i].raffleItemPrizes[j].prizeQuantity = raffleItemPrize.prizeQuantity;
            }
        }
    }

    struct EntryIO {
        address ticketAddress; // ERC1155 contract address
        uint256 ticketId; // ERC1155 type id
        uint256 ticketQuantity; // Number of ERC1155 tokens
        uint256 rangeStart;
        uint256 rangeEnd;
        uint256 raffleItemIndex;
        bool prizesClaimed;
    }

    /**
     * @notice Get get ticket info for a single entrant (address)
     * @param _raffleId Which raffle to get ticket stats about
     * @param _entrant Who to get stats about
     */
    function getEntries(uint256 _raffleId, address _entrant) external view returns (EntryIO[] memory entries_) {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        entries_ = new EntryIO[](raffle.entries[_entrant].length);
        for (uint256 i; i < raffle.entries[_entrant].length; i++) {
            Entry memory entry = raffle.entries[_entrant][i];
            RaffleItem storage raffleItem = raffle.raffleItems[entry.raffleItemIndex];
            entries_[i].ticketAddress = raffleItem.ticketAddress;
            entries_[i].ticketId = raffleItem.ticketId;
            entries_[i].ticketQuantity = entry.rangeEnd - entry.rangeStart;
            entries_[i].rangeStart = entry.rangeStart;
            entries_[i].rangeEnd = entry.rangeEnd;
            entries_[i].raffleItemIndex = entry.raffleItemIndex;
            entries_[i].prizesClaimed = entry.prizesClaimed;
        }
    }

    struct TicketStatsIO {
        address ticketAddress; // ERC1155 contract address
        uint256 ticketId; // ERC1155 type id
        uint256 numberOfEntrants; // number of unique addresses that entered tickets
        uint256 totalEntered; // Number of ERC1155 tokens
    }

    /**
     * @notice Returns what tickets have been entered, by how many addresses, and how many ERC1155 tickets entered
     * @dev It is possible for this function to run out of gas when called off-chain if there are very many users (Infura has gas limit for off-chain calls)
     * @param _raffleId Which raffle to get info about
     */
    function ticketStats(uint256 _raffleId) external view returns (TicketStatsIO[] memory ticketStats_) {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        ticketStats_ = new TicketStatsIO[](raffle.raffleItems.length);
        // loop through raffle items
        for (uint256 i; i < raffle.raffleItems.length; i++) {
            RaffleItem storage raffleItem = raffle.raffleItems[i];
            ticketStats_[i].ticketAddress = raffleItem.ticketAddress;
            ticketStats_[i].ticketId = raffleItem.ticketId;
            ticketStats_[i].totalEntered = raffleItem.totalEntered;
            // count the number of users that have ticketd for the raffle item
            for (uint256 j; j < raffle.entrants.length; j++) {
                address entrant = raffle.entrants[j];
                for (uint256 k; k < raffle.entries[entrant].length; k++) {
                    if (i == raffle.entries[entrant][k].raffleItemIndex) {
                        ticketStats_[i].numberOfEntrants++;
                        break;
                    }
                }
            }
        }
    }

    struct TicketItemIO {
        address ticketAddress; // ERC1155 contract address (entry ticket), not prize
        uint256 ticketId; // ERC1155 type id
        uint256 ticketQuantity; // Number of ERC1155 tokens
    }

    /**
     * @notice Enter ERC1155 tokens for raffle prizes
     * @dev Creates a new entry in the userEntries array
     * @param _raffleId Which raffle to ticket in
     * @param _ticketItems The ERC1155 tokens to ticket
     */
    function enterTickets(uint256 _raffleId, TicketItemIO[] calldata _ticketItems) external {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        require(_ticketItems.length > 0, "Raffle: No tickets");
        Raffle storage raffle = s.raffles[_raffleId];
        require(raffle.raffleEnd > block.timestamp, "Raffle: Raffle time has expired");
        emit RaffleTicketsEntered(_raffleId, msg.sender, _ticketItems);
        // Collect unique entrant addresses
        if (raffle.entries[msg.sender].length == 0) {
            raffle.entrants.push(msg.sender);
        }
        for (uint256 i; i < _ticketItems.length; i++) {
            TicketItemIO calldata ticketItem = _ticketItems[i];
            require(ticketItem.ticketQuantity > 0, "Raffle: Ticket quantity cannot be zero");
            // get the raffle item
            uint256 raffleItemIndex = raffle.raffleItemIndexes[ticketItem.ticketAddress][ticketItem.ticketId];
            require(raffleItemIndex > 0, "Raffle: Raffle item doesn't exist for this raffle");
            raffleItemIndex--;
            RaffleItem storage raffleItem = raffle.raffleItems[raffleItemIndex];
            uint256 totalEntered = raffleItem.totalEntered;
            // Create a range of unique numbers for ticket ids
            raffle.entries[msg.sender].push(
                Entry(uint24(raffleItemIndex), false, uint112(totalEntered), uint112(totalEntered + ticketItem.ticketQuantity))
            );
            // update the total quantity of tickets that have been entered for this raffle item
            raffleItem.totalEntered = totalEntered + ticketItem.ticketQuantity;
            // transfer the ERC1155 tokens to ticket to this contract
            IERC1155(ticketItem.ticketAddress).safeTransferFrom(
                msg.sender,
                address(this),
                ticketItem.ticketId,
                ticketItem.ticketQuantity,
                abi.encode(_raffleId)
            );
        }
    }

    // Get the unique addresses of entrants in a raffle
    function getEntrants(uint256 _raffleId) external view returns (address[] memory entrants_) {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        entrants_ = raffle.entrants;
    }

    /* This struct information can be gotten from the return results of the winners function */
    struct ticketWinIO {
        uint256 entryIndex; // index into a user's array of tickets (which staking attempt won)
        PrizesWinIO[] prizes;
    }

    // Ticket numbers are numbers between 0 and raffleItem.totalEntered - 1 inclusive.
    // Winning ticket numbers are ticket numbers that won one or more prizes
    // Prize numbers are numbers between 0 and raffleItemPrize.prizeQuanity - 1 inclusive.
    // Prize numbers are used to calculate ticket numbers
    // Winning prize numbers are prize numbers used to calculate winning ticket numbers
    struct PrizesWinIO {
        uint256 raffleItemPrizeIndex; // index into the raffleItemPrizes array (which prize was won)
        uint256[] winningPrizeNumbers; // ticket numbers between 0 and raffleItem.totalEntered that won
    }

    /**
     * @notice Claim prizes won
     * @dev All items in _wins are verified as actually won by the address that calls this function and reverts otherwise.
     * @dev Each entrant address can only claim prizes once, so be sure to include all entries and prizes won.
     * @dev Prizes are transfered to the address that calls this function.
     * @dev Due to the possibility that an entrant does not claim all the prizes he/she won or the gas cost is too high,
     * the contractOwner can claim prizes for an entrant. This needs to be used with care so that contractOwner does not
     * accidentally claim prizes for an entrant that have already been claimed for or by the entrant.
     * @param _entrant The entrant that won the prizes
     * @param _raffleId The raffle that prizes were won in.
     * @param _wins Contains only winning entries and prizes that were won.
     */
    function claimPrize(
        uint256 _raffleId,
        address _entrant,
        ticketWinIO[] calldata _wins
    ) external {
        require(_raffleId < s.raffles.length, "Raffle: Raffle does not exist");
        Raffle storage raffle = s.raffles[_raffleId];
        uint256 randomNumber = raffle.randomNumber;
        require(randomNumber > 0, "Raffle: Random number not generated yet");
        // contractOwner can claim prizes for the entrant.  Prizes are only transferred to the entrant
        require(msg.sender == _entrant || msg.sender == s.contractOwner, "Raffle: Not claimed by owner or contractOwner");
        // Logic:
        // 1. Loop through wins
        // 2. Verify provided entryIndex exists and is not a duplicate
        // 3. Loop through prizes
        // 4. Verify provided prize exists and is not a duplicate
        // 5. Loop through winning prize numbers
        // 6. Verify winning prize number exists and is not a duplicate
        // 7. Verify that winning prize number actually won
        // 8. Transfer prizes to winner
        //--------------------------------------------
        // lastValue serves two purposes:
        // 1. Ensures that a value is less than the length of an array
        // 2. Prevents duplicates. Subsequent values must be lesser
        // lastValue gets reused by inner loops
        uint256 lastValue = raffle.entries[_entrant].length;
        for (uint256 i; i < _wins.length; i++) {
            ticketWinIO calldata win = _wins[i];
            // Serves two purposes: 1. Ensure is less than raffle.entries[_entrant].length. 2. prevents duplicates
            require(win.entryIndex < lastValue, "Raffle: User entry does not exist or is not lesser than last value");
            Entry memory entry = raffle.entries[_entrant][win.entryIndex];
            require(entry.prizesClaimed == false, "Raffles: Entry prizes have already been claimed");
            raffle.entries[_entrant][win.entryIndex].prizesClaimed = true;
            // total number of tickets that have been entered for a raffle item
            uint256 totalEntered = raffle.raffleItems[entry.raffleItemIndex].totalEntered;
            lastValue = raffle.raffleItems[entry.raffleItemIndex].raffleItemPrizes.length;
            for (uint256 j; j < win.prizes.length; j++) {
                PrizesWinIO calldata prize = win.prizes[j];
                // Serves two purposes: 1. Ensure is less than raffleItemPrizes.length. 2. prevents duplicates
                require(prize.raffleItemPrizeIndex < lastValue, "Raffle: Raffle prize type does not exist or is not lesser than last value");
                RaffleItemPrize memory raffleItemPrize = raffle.raffleItems[entry.raffleItemIndex].raffleItemPrizes[prize.raffleItemPrizeIndex];
                lastValue = raffleItemPrize.prizeQuantity;
                for (uint256 k; k < prize.winningPrizeNumbers.length; k++) {
                    uint256 prizeNumber = prize.winningPrizeNumbers[k];
                    // Serves two purposes: 1. Ensure is less than raffleItemPrize.prizeQuantity. 2. prevents duplicates
                    require(prizeNumber < lastValue, "Raffle: prizeNumber does not exist or is not lesser than last value");
                    uint256 winningTicketNumber = uint256(
                        keccak256(abi.encodePacked(randomNumber, entry.raffleItemIndex, prize.raffleItemPrizeIndex, prizeNumber))
                    ) % totalEntered;
                    require(winningTicketNumber >= entry.rangeStart && winningTicketNumber < entry.rangeEnd, "Raffle: Did not win prize");
                    lastValue = prizeNumber;
                }
                emit RaffleClaimPrize(_raffleId, _entrant, raffleItemPrize.prizeAddress, raffleItemPrize.prizeId, prize.winningPrizeNumbers.length);
                IERC1155(raffleItemPrize.prizeAddress).safeTransferFrom(
                    address(this),
                    _entrant,
                    raffleItemPrize.prizeId,
                    prize.winningPrizeNumbers.length,
                    ""
                );
                lastValue = prize.raffleItemPrizeIndex;
            }
            lastValue = win.entryIndex;
        }
    }
}

File 2 of 5 : IERC1155.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.7.4;

/**
    @title ERC-1155 Multi Token Standard
    @dev See https://eips.ethereum.org/EIPS/eip-1155
    Note: The ERC-165 identifier for this interface is 0xd9b67a26.
 */
/* is ERC165 */
interface IERC1155 {
    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
        The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender).
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_id` argument MUST be the token type being transferred.
        The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).        
    */
    event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);

    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).      
        The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender).
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_ids` argument MUST be the list of tokens being transferred.
        The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).                
    */
    event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);

    /**
        @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled).        
    */
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    /**
        @dev MUST emit when the URI is updated for a token ID.
        URIs are defined in RFC 3986.
        The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
    */
    event URI(string _value, uint256 indexed _id);

    /**
        @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if balance of holder for token `_id` is lower than the `_value` sent.
        MUST revert on any other error.
        MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard).
        After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).        
        @param _from    Source address
        @param _to      Target address
        @param _id      ID of the token type
        @param _value   Transfer amount
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
    */
    function safeTransferFrom(
        address _from,
        address _to,
        uint256 _id,
        uint256 _value,
        bytes calldata _data
    ) external;

    /**
        @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if length of `_ids` is not the same as length of `_values`.
        MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient.
        MUST revert on any other error.        
        MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard).
        Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc).
        After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).                      
        @param _from    Source address
        @param _to      Target address
        @param _ids     IDs of each token type (order and length must match _values array)
        @param _values  Transfer amounts per token type (order and length must match _ids array)
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`
    */
    function safeBatchTransferFrom(
        address _from,
        address _to,
        uint256[] calldata _ids,
        uint256[] calldata _values,
        bytes calldata _data
    ) external;

    /**
        @notice Get the balance of an account's tokens.
        @param _owner  The address of the token holder
        @param _id     ID of the token
        @return        The _owner's balance of the token type requested
     */
    function balanceOf(address _owner, uint256 _id) external view returns (uint256);

    /**
        @notice Get the balance of multiple account/token pairs
        @param _owners The addresses of the token holders
        @param _ids    ID of the tokens
        @return        The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair)
     */
    function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);

    /**
        @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
        @dev MUST emit the ApprovalForAll event on success.
        @param _operator  Address to add to the set of authorized operators
        @param _approved  True if the operator is approved, false to revoke approval
    */
    function setApprovalForAll(address _operator, bool _approved) external;

    /**
        @notice Queries the approval status of an operator for a given owner.
        @param _owner     The owner of the tokens
        @param _operator  Address of authorized operator
        @return           True if the operator is approved, false if not
    */
    function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

File 3 of 5 : LinkTokenInterface.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.7.4;

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 4 of 5 : IERC173.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.4;

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

File 5 of 5 : IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.4;

interface IERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceId The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_contractOwner","type":"address"},{"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"entrant","type":"address"},{"indexed":false,"internalType":"address","name":"prizeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prizeQuantity","type":"uint256"}],"name":"RaffleClaimPrize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RaffleRandomNumber","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"raffleEnd","type":"uint256"},{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"components":[{"internalType":"address","name":"prizeAddress","type":"address"},{"internalType":"uint256","name":"prizeId","type":"uint256"},{"internalType":"uint256","name":"prizeQuantity","type":"uint256"}],"internalType":"struct RafflesContract.RaffleItemPrizeIO[]","name":"raffleItemPrizes","type":"tuple[]"}],"indexed":false,"internalType":"struct RafflesContract.RaffleItemInput[]","name":"raffleItems","type":"tuple[]"}],"name":"RaffleStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"entrant","type":"address"},{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"ticketQuantity","type":"uint256"}],"indexed":false,"internalType":"struct RafflesContract.TicketItemIO[]","name":"ticketItems","type":"tuple[]"}],"name":"RaffleTicketsEntered","type":"event"},{"inputs":[{"internalType":"uint256","name":"_newFee","type":"uint256"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"changeVRFFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"address","name":"_entrant","type":"address"},{"components":[{"internalType":"uint256","name":"entryIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"raffleItemPrizeIndex","type":"uint256"},{"internalType":"uint256[]","name":"winningPrizeNumbers","type":"uint256[]"}],"internalType":"struct RafflesContract.PrizesWinIO[]","name":"prizes","type":"tuple[]"}],"internalType":"struct RafflesContract.ticketWinIO[]","name":"_wins","type":"tuple[]"}],"name":"claimPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"drawRandomNumber","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"ticketQuantity","type":"uint256"}],"internalType":"struct RafflesContract.TicketItemIO[]","name":"_ticketItems","type":"tuple[]"}],"name":"enterTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"getEntrants","outputs":[{"internalType":"address[]","name":"entrants_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"address","name":"_entrant","type":"address"}],"name":"getEntries","outputs":[{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"ticketQuantity","type":"uint256"},{"internalType":"uint256","name":"rangeStart","type":"uint256"},{"internalType":"uint256","name":"rangeEnd","type":"uint256"},{"internalType":"uint256","name":"raffleItemIndex","type":"uint256"},{"internalType":"bool","name":"prizesClaimed","type":"bool"}],"internalType":"struct RafflesContract.EntryIO[]","name":"entries_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRaffles","outputs":[{"components":[{"internalType":"uint256","name":"raffleId","type":"uint256"},{"internalType":"uint256","name":"raffleEnd","type":"uint256"},{"internalType":"bool","name":"isOpen","type":"bool"}],"internalType":"struct RafflesContract.RaffleIO[]","name":"raffles_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"linkBalance","outputs":[{"internalType":"uint256","name":"linkBalance_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"nonce_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"raffleInfo","outputs":[{"internalType":"uint256","name":"raffleEnd_","type":"uint256"},{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"totalEntered","type":"uint256"},{"components":[{"internalType":"address","name":"prizeAddress","type":"address"},{"internalType":"uint256","name":"prizeId","type":"uint256"},{"internalType":"uint256","name":"prizeQuantity","type":"uint256"}],"internalType":"struct RafflesContract.RaffleItemPrizeIO[]","name":"raffleItemPrizes","type":"tuple[]"}],"internalType":"struct RafflesContract.RaffleItemOutput[]","name":"raffleItems_","type":"tuple[]"},{"internalType":"uint256","name":"randomNumber_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"raffleSupply","outputs":[{"internalType":"uint256","name":"raffleSupply_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"removeLinkTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleDuration","type":"uint256"},{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"components":[{"internalType":"address","name":"prizeAddress","type":"address"},{"internalType":"uint256","name":"prizeId","type":"uint256"},{"internalType":"uint256","name":"prizeQuantity","type":"uint256"}],"internalType":"struct RafflesContract.RaffleItemPrizeIO[]","name":"raffleItemPrizes","type":"tuple[]"}],"internalType":"struct RafflesContract.RaffleItemInput[]","name":"_raffleItems","type":"tuple[]"}],"name":"startRaffle","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":"uint256","name":"_raffleId","type":"uint256"}],"name":"ticketStats","outputs":[{"components":[{"internalType":"address","name":"ticketAddress","type":"address"},{"internalType":"uint256","name":"ticketId","type":"uint256"},{"internalType":"uint256","name":"numberOfEntrants","type":"uint256"},{"internalType":"uint256","name":"totalEntered","type":"uint256"}],"internalType":"struct RafflesContract.TicketStatsIO[]","name":"ticketStats_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newContractOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b5060405162003ce738038062003ce783398101604081905262000034916200011a565b60058054606095861b6001600160601b031990811660a0529490951b84166080526004929092556001600160601b039081166001600160a01b039095166c010000000000000000000000000293169290921716919091179055600060208190527f67be87c3ff9960ca1e9cfac5cab2ff4747269cf9ed20c9b7306235ac35a491c5805460ff1990811660019081179092557feddca8dd33b41bff4f2689af38c5006161c5d608c330f99c8fe70d8b11b59a40805490911682179055805481018155905262000176565b80516001600160a01b03811681146200011557600080fd5b919050565b600080600080600060a0868803121562000132578081fd5b6200013d86620000fd565b94506200014d60208701620000fd565b93506200015d60408701620000fd565b6060870151608090970151959894975095949392505050565b60805160601c60a05160601c613b33620001b4600039806111fa528061248a5250806104b4528061109e5280611bcf528061244e5250613b336000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806396b566c4116100cd578063c26ecefa11610081578063f23a6e6111610066578063f23a6e61146102c2578063f2fde38b146102e2578063fbea56e0146102f557610151565b8063c26ecefa146102a7578063ec9fabb7146102af57610151565b8063a18723c5116100b2578063a18723c514610250578063abc00bb414610265578063bf30d7901461028557610151565b806396b566c41461021d5780639e317f121461023d57610151565b8063599d127a11610124578063781f653e11610109578063781f653e146101e25780638da5cb5b146101f557806394985ddd1461020a57610151565b8063599d127a146101ba578063761e99f0146101cf57610151565b806301ffc9a714610156578063339a64031461017f5780634e3347c71461019457806357b0ef44146101a7575b600080fd5b610169610164366004612933565b610315565b6040516101769190612f52565b60405180910390f35b61019261018d3660046128fa565b610350565b005b6101926101a2366004612a0e565b61058e565b6101926101b53660046129b6565b610a04565b6101c2611014565b6040516101769190613767565b6101926101dd3660046128b1565b61101a565b6101926101f0366004612912565b61112c565b6101fd6111b6565b6040516101769190612bfc565b610192610218366004612912565b6111e2565b61023061022b36600461298b565b61135c565b6040516101769190612dfd565b6101c261024b3660046128fa565b611685565b610258611697565b6040516101769190612e97565b6102786102733660046128fa565b61178c565b6040516101769190612da3565b6102986102933660046128fa565b611843565b604051610176939291906138b6565b6101c2611b8f565b6101926102bd366004612a58565b611c59565b6102d56102d0366004612810565b612059565b6040516101769190612f8e565b6101926102f03660046127ef565b612125565b6103086103033660046128fa565b6121e0565b6040516101769190612ee5565b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020819052604090205460ff165b919050565b600154811061037a5760405162461bcd60e51b81526004016103719061304f565b60405180910390fd5b600080600101828154811061038b57fe5b90600052602060002090600702019050428160060154106103be5760405162461bcd60e51b8152600401610371906132ae565b6004810154156103e05760405162461bcd60e51b815260040161037190613650565b600581015460ff16158061041b57506005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633145b6104375760405162461bcd60e51b815260040161037190613279565b600580820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055546040517f70a082310000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff9091169073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906104e9903090600401612bfc565b60206040518083038186803b15801561050157600080fd5b505afa158015610515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105399190612973565b10156105575760405162461bcd60e51b815260040161037190613151565b600454600554600091610578916bffffffffffffffffffffffff168361244a565b6000908152600360205260409020929092555050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146105d55760405162461bcd60e51b8152600401610371906136ad565b610e108310156105f75760405162461bcd60e51b815260040161037190613086565b428301816106175760405162461bcd60e51b815260040161037190612fbb565b60015460405181907fb44ac0470da898b318be8ceeafb224dd8540bb2200607aa1b4def46f9dd9de889061065090859088908890613770565b60405180910390a260018054808201825560009182526007027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfc81018490557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601905b848110156109fb57368686838181106106c857fe5b90506020028101906106da9190613aca565b905060006106eb6040830183613a28565b90501161070a5760405162461bcd60e51b815260040161037190613242565b82600061071a60208401846127ef565b73ffffffffffffffffffffffffffffffffffffffff168152602080820192909252604090810160009081208484013582529092529020541561076e5760405162461bcd60e51b81526004016103719061339f565b60018084018054918201808255600091825260208083206004909402909301929091869161079e908601866127ef565b73ffffffffffffffffffffffffffffffffffffffff1681526020808201929092526040908101600090812086840180358352935220919091556107e190836127ef565b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff919091161781556020820135600182015560005b61083b6040840184613a28565b90508110156109f057366108526040850185613a28565b8381811061085c57fe5b905060600201905082600301604051806060016040528083600001602081019061088691906127ef565b73ffffffffffffffffffffffffffffffffffffffff90811682526bffffffffffffffffffffffff6040808701358216602080860191909152878101803595830195909552865460018181018955600098895297829020875160029092020180549288015190941674010000000000000000000000000000000000000000029085167fffffffffffffffffffffffff000000000000000000000000000000000000000090921691909117909316929092178155920151919092015561094a90826127ef565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a3330846020013585604001358c6040516020016109829190613767565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016109b1959493929190612c1d565b600060405180830381600087803b1580156109cb57600080fd5b505af11580156109df573d6000803e3d6000fd5b50506001909301925061082e915050565b5050506001016106b3565b50505050505050565b6001548410610a255760405162461bcd60e51b81526004016103719061304f565b6000806001018581548110610a3657fe5b9060005260206000209060070201905060008160040154905060008111610a6f5760405162461bcd60e51b815260040161037190613188565b3373ffffffffffffffffffffffffffffffffffffffff86161480610aba57506005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633145b610ad65760405162461bcd60e51b8152600401610371906133fc565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600283016020526040812054905b8481101561100a5736868683818110610b1557fe5b9050602002810190610b279190613a8d565b905080358311610b495760405162461bcd60e51b8152600401610371906136e4565b610b51612610565b73ffffffffffffffffffffffffffffffffffffffff89166000908152600287016020526040902080548335908110610b8557fe5b600091825260209182902060408051608081018252929091015462ffffff8116835260ff6301000000820416158015948401949094526dffffffffffffffffffffffffffff6401000000008204811692840192909252720100000000000000000000000000000000000090041660608201529150610c155760405162461bcd60e51b815260040161037190613513565b73ffffffffffffffffffffffffffffffffffffffff8916600090815260028701602052604090208054600191908435908110610c4d57fe5b6000918252602082200180549215156301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff909316929092179091558151600188018054909162ffffff16908110610ca557fe5b906000526020600020906004020160020154905086600101826000015162ffffff1681548110610cd157fe5b6000918252602082206003600490920201015495505b610cf460208501856139c3565b9050811015610ffb5736610d0b60208601866139c3565b83818110610d1557fe5b9050602002810190610d279190613a8d565b905080358711610d495760405162461bcd60e51b815260040161037190613459565b610d51612637565b89600101856000015162ffffff1681548110610d6957fe5b9060005260206000209060040201600301826000013581548110610d8957fe5b60009182526020808320604080516060810182526002909402909101805473ffffffffffffffffffffffffffffffffffffffff811685526bffffffffffffffffffffffff74010000000000000000000000000000000000000000909104169284018390526001015490830152995091505b610e0760208401846139c3565b9050811015610eef576000610e1f60208501856139c3565b83818110610e2957fe5b905060200201359050898110610e515760405162461bcd60e51b8152600401610371906135cd565b86516040516000918891610e6e918f918935908790602001612bbc565b6040516020818303038152906040528051906020012060001c81610e8e57fe5b06905087604001516dffffffffffffffffffffffffffff168110158015610ec8575087606001516dffffffffffffffffffffffffffff1681105b610ee45760405162461bcd60e51b81526004016103719061311a565b509850600101610dfa565b508d7f61dd2cf3e9f248b4453e8abb61b6ad73c53cf482d1c506f868a3885f533233cf8e83600001518460400151868060200190610f2d91906139c3565b604051610f3d9594939250612ccd565b60405180910390a2806000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a308f8460400151868060200190610f7c91906139c3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152610fb89594939250600401612d03565b600060405180830381600087803b158015610fd257600080fd5b505af1158015610fe6573d6000803e3d6000fd5b5050923598505060019092019150610ce79050565b50509035925050600101610b00565b5050505050505050565b60015490565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146110615760405162461bcd60e51b8152600401610371906136ad565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906110d59085908590600401612d48565b602060405180830381600087803b1580156110ef57600080fd5b505af1158015611103573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112791906128da565b505050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146111735760405162461bcd60e51b8152600401610371906136ad565b600580547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff9390931692909217909155600455565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146112375760405162461bcd60e51b815260040161037190613368565b60008281526003602052604090205460015481106112675760405162461bcd60e51b81526004016103719061304f565b600080600101828154811061127857fe5b90600052602060002090600702019050428160060154106112ab5760405162461bcd60e51b8152600401610371906132ae565b6004810154156112cd5760405162461bcd60e51b815260040161037190613650565b82600060010183815481106112de57fe5b60009182526020909120600460079092020101556005810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405182907f37e68548bed90aa11745696116f838a60b0bba40fc3f77a139aee9e3b828a08e9061134e908690613767565b60405180910390a250505050565b60015460609083106113805760405162461bcd60e51b81526004016103719061304f565b600080600101848154811061139157fe5b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff871684526002600790930201918201905260409091205490915067ffffffffffffffff811180156113e057600080fd5b5060405190808252806020026020018201604052801561141a57816020015b611407612657565b8152602001906001900390816113ff5790505b50915060005b73ffffffffffffffffffffffffffffffffffffffff8416600090815260028301602052604090205481101561167d57611457612610565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600284016020526040902080548390811061148a57fe5b6000918252602080832060408051608081018252939091015462ffffff811680855260ff63010000008304161515938501939093526dffffffffffffffffffffffffffff64010000000082048116928501929092527201000000000000000000000000000000000000900416606083015260018601805492945091811061150d57fe5b600091825260209091206004909102018054865191925073ffffffffffffffffffffffffffffffffffffffff169086908590811061154757fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff90911690526001810154855186908590811061157f57fe5b6020026020010151602001818152505081604001518260600151036dffffffffffffffffffffffffffff168584815181106115b657fe5b6020026020010151604001818152505081604001516dffffffffffffffffffffffffffff168584815181106115e757fe5b6020026020010151606001818152505081606001516dffffffffffffffffffffffffffff1685848151811061161857fe5b60200260200101516080018181525050816000015162ffffff1685848151811061163e57fe5b602002602001015160a0018181525050816020015185848151811061165f57fe5b602090810291909101015190151560c0909101525050600101611420565b505092915050565b60009081526002602052604090205490565b60015460609067ffffffffffffffff811180156116b357600080fd5b506040519080825280602002602001820160405280156116ed57816020015b6116da6126ac565b8152602001906001900390816116d25790505b50905060005b60015481101561178857600080600101828154811061170e57fe5b90600052602060002090600702016006015490508183838151811061172f57fe5b602002602001015160000181815250508083838151811061174c57fe5b6020026020010151602001818152505042811183838151811061176b57fe5b6020908102919091010151901515604090910152506001016116f3565b5090565b60015460609082106117b05760405162461bcd60e51b81526004016103719061304f565b60008060010183815481106117c157fe5b906000526020600020906007020190508060030180548060200260200160405190810160405280929190818152602001828054801561183657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161180b575b5050505050915050919050565b6001546000906060908290841061186c5760405162461bcd60e51b81526004016103719061304f565b600080600101858154811061187d57fe5b60009182526020909120600660079092020190810154600582015490955090915060ff161515600114156118b457600191506118bc565b806004015491505b600181015467ffffffffffffffff811180156118d757600080fd5b5060405190808252806020026020018201604052801561191157816020015b6118fe6126cf565b8152602001906001900390816118f65790505b50925060005b6001820154811015611b8657600082600101828154811061193457fe5b600091825260209091206004909102018054865191925073ffffffffffffffffffffffffffffffffffffffff169086908490811061196e57fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff9091169052600181015485518690849081106119a657fe5b6020026020010151602001818152505080600201548583815181106119c757fe5b602090810291909101015160400152600381015467ffffffffffffffff811180156119f157600080fd5b50604051908082528060200260200182016040528015611a2b57816020015b611a1861270d565b815260200190600190039081611a105790505b50858381518110611a3857fe5b60200260200101516060018190525060005b6003820154811015611b7c576000826003018281548110611a6757fe5b600091825260209091206002909102018054885191925073ffffffffffffffffffffffffffffffffffffffff1690889086908110611aa157fe5b6020026020010151606001518381518110611ab857fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260018101548751889086908110611af057fe5b6020026020010151606001518381518110611b0757fe5b602090810291909101810151015280548751740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff1690889086908110611b4d57fe5b6020026020010151606001518381518110611b6457fe5b60209081029190910101516040015250600101611a4a565b5050600101611917565b50509193909250565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190611c04903090600401612bfc565b60206040518083038186803b158015611c1c57600080fd5b505afa158015611c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c549190612973565b905090565b6001548310611c7a5760405162461bcd60e51b81526004016103719061304f565b80611c975760405162461bcd60e51b8152600401610371906130e3565b6000806001018481548110611ca857fe5b9060005260206000209060070201905042816006015411611cdb5760405162461bcd60e51b8152600401610371906134dc565b837f11bafd320b20b453e37e76ddd7d80347a86411bafe26e90624da8a8dcdcdd429338585604051611d0f93929190612c6d565b60405180910390a2336000908152600282016020526040902054611d6d57600381018054600181018255600091825260209091200180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b60005b828110156120525736848483818110611d8557fe5b90506060020190506000816040013511611db15760405162461bcd60e51b81526004016103719061330b565b60008381611dc260208501856127ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360200135815260200190815260200160002054905060008111611e345760405162461bcd60e51b8152600401610371906131e5565b8080600190039150506000846001018281548110611e4e57fe5b6000918252602080832060026004909302018281018054338652938a0183526040808620815160808101835262ffffff808b1682528187018981526dffffffffffffffffffffffffffff808a16848701908152958e01358a01808216606086019081528654600181018855968d529b8a90209451949095018054925196519b51821672010000000000000000000000000000000000000271ffffffffffffffffffffffffffffffffffff9c909216640100000000027fffffffffffffffffffffffffffff0000000000000000000000000000ffffffff9715156301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff969095167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000909416939093179490941692909217949094169390931797909716919091179095559390935591925090611fa9908501856127ef565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a3330876020013588604001358e604051602001611fe19190613767565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401612010959493929190612c1d565b600060405180830381600087803b15801561202a57600080fd5b505af115801561203e573d6000803e3d6000fd5b505060019096019550611d70945050505050565b5050505050565b60006020821461207b5760405162461bcd60e51b815260040161037190613570565b6000612089838501856128fa565b60015490915081106120ad5760405162461bcd60e51b81526004016103719061304f565b60008060010182815481106120be57fe5b906000526020600020906007020190506000816006015490504281116120f65760405162461bcd60e51b815260040161037190612ff2565b507ff23a6e61000000000000000000000000000000000000000000000000000000009998505050505050505050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633811461216d5760405162461bcd60e51b8152600401610371906136ad565b600580546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff85811691820292909217909255604051908316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60015460609082106122045760405162461bcd60e51b81526004016103719061304f565b600080600101838154811061221557fe5b90600052602060002090600702019050806001018054905067ffffffffffffffff8111801561224357600080fd5b5060405190808252806020026020018201604052801561227d57816020015b61226a612744565b8152602001906001900390816122625790505b50915060005b60018201548110156124435760008260010182815481106122a057fe5b600091825260209091206004909102018054855191925073ffffffffffffffffffffffffffffffffffffffff16908590849081106122da57fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff90911690526001810154845185908490811061231257fe5b60200260200101516020018181525050806002015484838151811061233357fe5b6020026020010151606001818152505060005b600384015481101561243957600084600301828154811061236357fe5b600091825260208220015473ffffffffffffffffffffffffffffffffffffffff1691505b73ffffffffffffffffffffffffffffffffffffffff8216600090815260028701602052604090205481101561242f5773ffffffffffffffffffffffffffffffffffffffff8216600090815260028701602052604090208054829081106123e957fe5b60009182526020909120015462ffffff168514156124275786858151811061240d57fe5b60209081029190910101516040018051600101905261242f565b600101612387565b5050600101612346565b5050600101612283565b5050919050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634000aea07f00000000000000000000000000000000000000000000000000000000000000008587866040516020016124bd929190612bae565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016124ea93929190612d6e565b602060405180830381600087803b15801561250457600080fd5b505af1158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c91906128da565b5060008481526002602052604081205461255b90869085903090612585565b600086815260026020526040902080546001019055905061257c85826125dd565b95945050505050565b60008484848460405160200161259e9493929190612f5d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b600082826040516020016125f2929190612bae565b60405160208183030381529060405280519060200120905092915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604080516060810182526000808252602082018190529181019190915290565b6040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b604051806060016040528060008152602001600081526020016000151581525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001606081525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461034b57600080fd5b60008083601f8401126127b7578182fd5b50813567ffffffffffffffff8111156127ce578182fd5b60208301915083602080830285010111156127e857600080fd5b9250929050565b600060208284031215612800578081fd5b61280982612782565b9392505050565b60008060008060008060a08789031215612828578182fd5b61283187612782565b955061283f60208801612782565b94506040870135935060608701359250608087013567ffffffffffffffff80821115612869578384fd5b818901915089601f83011261287c578384fd5b81358181111561288a578485fd5b8a602082850101111561289b578485fd5b6020830194508093505050509295509295509295565b600080604083850312156128c3578182fd5b6128cc83612782565b946020939093013593505050565b6000602082840312156128eb578081fd5b81518015158114612809578182fd5b60006020828403121561290b578081fd5b5035919050565b60008060408385031215612924578182fd5b50508035926020909101359150565b600060208284031215612944578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612809578182fd5b600060208284031215612984578081fd5b5051919050565b6000806040838503121561299d578182fd5b823591506129ad60208401612782565b90509250929050565b600080600080606085870312156129cb578384fd5b843593506129db60208601612782565b9250604085013567ffffffffffffffff8111156129f6578283fd5b612a02878288016127a6565b95989497509550505050565b600080600060408486031215612a22578283fd5b83359250602084013567ffffffffffffffff811115612a3f578283fd5b612a4b868287016127a6565b9497909650939450505050565b600080600060408486031215612a6c578283fd5b83359250602084013567ffffffffffffffff80821115612a8a578384fd5b818601915086601f830112612a9d578384fd5b813581811115612aab578485fd5b876020606083028501011115612abf578485fd5b6020830194508093505050509250925092565b600082845260208401935081815b84811015612b0557612af28683612b78565b6060958601959190910190600101612ae0565b5093949350505050565b60008151808452815b81811015612b3457602081850181015186830182015201612b18565b81811115612b455782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff612b9682612782565b16825260208181013590830152604090810135910152565b918252602082015260400190565b93845260e89290921b7fffffff00000000000000000000000000000000000000000000000000000000001660208401526023830152604382015260630190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015283606083015260a06080830152612c6260a0830184612b0f565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820181905281018290526000606080830185835b86811015612cc057612cb08383612b78565b9183019190830190600101612c9e565b5090979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff94851681529290931660208301526040820152606081019190915260800190565b73ffffffffffffffffffffffffffffffffffffffff94851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff851682528360208301526060604083015261257c6060830184612b0f565b6020808252825182820181905260009190848201906040850190845b81811015612df157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612dbf565b50909695505050505050565b602080825282518282018190526000919060409081850190868401855b82811015612e8a578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c09081015115159085015260e09093019290850190600101612e1a565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b82811015612e8a57815180518552868101518786015285015115158585015260609093019290850190600101612eb4565b602080825282518282018190526000919060409081850190868401855b82811015612e8a578151805173ffffffffffffffffffffffffffffffffffffffff168552868101518786015285810151868601526060908101519085015260809093019290850190600101612f02565b901515815260200190565b938452602084019290925273ffffffffffffffffffffffffffffffffffffffff166040830152606082015260800190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b60208082526017908201527f526166666c653a204e6f20726166666c65206974656d73000000000000000000604082015260600190565b60208082526030908201527f526166666c653a2043616e277420616363657074207472616e7366657220666f60408201527f72206578706972656420726166666c6500000000000000000000000000000000606082015260800190565b6020808252601d908201527f526166666c653a20526166666c6520646f6573206e6f74206578697374000000604082015260600190565b60208082526033908201527f526166666c653a205f726166666c654475726174696f6e206d7573742062652060408201527f67726561746572207468616e203120686f757200000000000000000000000000606082015260800190565b60208082526012908201527f526166666c653a204e6f207469636b6574730000000000000000000000000000604082015260600190565b60208082526019908201527f526166666c653a20446964206e6f742077696e207072697a6500000000000000604082015260600190565b6020808252600f908201527f4e6f7420656e6f756768204c494e4b0000000000000000000000000000000000604082015260600190565b60208082526027908201527f526166666c653a2052616e646f6d206e756d626572206e6f742067656e65726160408201527f7465642079657400000000000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f526166666c653a20526166666c65206974656d20646f65736e2774206578697360408201527f7420666f72207468697320726166666c65000000000000000000000000000000606082015260800190565b60208082526011908201527f526166666c653a204e6f207072697a6573000000000000000000000000000000604082015260600190565b6020808252818101527f526166666c653a2052616e646f6d206e756d6265722069732070656e64696e67604082015260600190565b60208082526023908201527f526166666c653a20526166666c652074696d6520686173206e6f74206578706960408201527f7265640000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f526166666c653a205469636b6574207175616e746974792063616e6e6f74206260408201527f65207a65726f0000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c00604082015260600190565b6020808252603c908201527f526166666c653a20526166666c65206974656d20616c7265616479207573696e60408201527f67207469636b65744164647265737320616e64207469636b6574496400000000606082015260800190565b6020808252602d908201527f526166666c653a204e6f7420636c61696d6564206279206f776e6572206f722060408201527f636f6e74726163744f776e657200000000000000000000000000000000000000606082015260800190565b60208082526049908201527f526166666c653a20526166666c65207072697a65207479706520646f6573206e60408201527f6f74206578697374206f72206973206e6f74206c6573736572207468616e206c60608201527f6173742076616c75650000000000000000000000000000000000000000000000608082015260a00190565b6020808252601f908201527f526166666c653a20526166666c652074696d6520686173206578706972656400604082015260600190565b6020808252602f908201527f526166666c65733a20456e747279207072697a6573206861766520616c72656160408201527f6479206265656e20636c61696d65640000000000000000000000000000000000606082015260800190565b6020808252602f908201527f526166666c653a2044617461206f66207468652077726f6e672073697a65207360408201527f656e74206f6e207472616e736665720000000000000000000000000000000000606082015260800190565b60208082526043908201527f526166666c653a207072697a654e756d62657220646f6573206e6f742065786960408201527f7374206f72206973206e6f74206c6573736572207468616e206c61737420766160608201527f6c75650000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526027908201527f526166666c653a2052616e646f6d206e756d62657220616c726561647920676560408201527f6e65726174656400000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f526166666c653a204d75737420626520636f6e7472616374206f776e65720000604082015260600190565b60208082526042908201527f526166666c653a205573657220656e74727920646f6573206e6f74206578697360408201527f74206f72206973206e6f74206c6573736572207468616e206c6173742076616c60608201527f7565000000000000000000000000000000000000000000000000000000000000608082015260a00190565b90815260200190565b83815260406020808301829052828201849052600091906060908185018682028601830188865b898110156138a6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa089840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18c36030181126137f7578889fd5b8b0173ffffffffffffffffffffffffffffffffffffffff61381782612782565b1684528581013586850152878101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe182360301811261385557898afd5b8101803567ffffffffffffffff81111561386d578a8bfd5b888102360383131561387d578a8bfd5b888a870152613891898701828a8501612ad2565b96880196955050509185019150600101613797565b50909a9950505050505050505050565b600060608083018684526020828186015281875180845260809350838701915083838202880101838a01875b838110156139aa578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528151805173ffffffffffffffffffffffffffffffffffffffff9081168552878201518886015260408083015181870152918a01518a86018a905280518a8701819052908901928c929160a08801905b808510156139935785518051851683528c8101518d84015283015183830152948b019460019490940193908d0190613960565b50988a0198965050509287019250506001016138e2565b5050809650505050505050826040830152949350505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139f7578283fd5b83018035915067ffffffffffffffff821115613a11578283fd5b60209081019250810236038213156127e857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613a5c578283fd5b83018035915067ffffffffffffffff821115613a76578283fd5b60200191506060810236038213156127e857600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112613ac0578182fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112613ac0578182fdfea264697066735822122053ca43fa82d249b9cacb13d0e163fa6731313fc650b840e0f78c40c849bb96f664736f6c63430007040033000000000000000000000000819c3fc356bb319035f9d2886fac9e57df0343f5000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101515760003560e01c806396b566c4116100cd578063c26ecefa11610081578063f23a6e6111610066578063f23a6e61146102c2578063f2fde38b146102e2578063fbea56e0146102f557610151565b8063c26ecefa146102a7578063ec9fabb7146102af57610151565b8063a18723c5116100b2578063a18723c514610250578063abc00bb414610265578063bf30d7901461028557610151565b806396b566c41461021d5780639e317f121461023d57610151565b8063599d127a11610124578063781f653e11610109578063781f653e146101e25780638da5cb5b146101f557806394985ddd1461020a57610151565b8063599d127a146101ba578063761e99f0146101cf57610151565b806301ffc9a714610156578063339a64031461017f5780634e3347c71461019457806357b0ef44146101a7575b600080fd5b610169610164366004612933565b610315565b6040516101769190612f52565b60405180910390f35b61019261018d3660046128fa565b610350565b005b6101926101a2366004612a0e565b61058e565b6101926101b53660046129b6565b610a04565b6101c2611014565b6040516101769190613767565b6101926101dd3660046128b1565b61101a565b6101926101f0366004612912565b61112c565b6101fd6111b6565b6040516101769190612bfc565b610192610218366004612912565b6111e2565b61023061022b36600461298b565b61135c565b6040516101769190612dfd565b6101c261024b3660046128fa565b611685565b610258611697565b6040516101769190612e97565b6102786102733660046128fa565b61178c565b6040516101769190612da3565b6102986102933660046128fa565b611843565b604051610176939291906138b6565b6101c2611b8f565b6101926102bd366004612a58565b611c59565b6102d56102d0366004612810565b612059565b6040516101769190612f8e565b6101926102f03660046127ef565b612125565b6103086103033660046128fa565b6121e0565b6040516101769190612ee5565b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020819052604090205460ff165b919050565b600154811061037a5760405162461bcd60e51b81526004016103719061304f565b60405180910390fd5b600080600101828154811061038b57fe5b90600052602060002090600702019050428160060154106103be5760405162461bcd60e51b8152600401610371906132ae565b6004810154156103e05760405162461bcd60e51b815260040161037190613650565b600581015460ff16158061041b57506005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633145b6104375760405162461bcd60e51b815260040161037190613279565b600580820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055546040517f70a082310000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff9091169073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a08231906104e9903090600401612bfc565b60206040518083038186803b15801561050157600080fd5b505afa158015610515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105399190612973565b10156105575760405162461bcd60e51b815260040161037190613151565b600454600554600091610578916bffffffffffffffffffffffff168361244a565b6000908152600360205260409020929092555050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146105d55760405162461bcd60e51b8152600401610371906136ad565b610e108310156105f75760405162461bcd60e51b815260040161037190613086565b428301816106175760405162461bcd60e51b815260040161037190612fbb565b60015460405181907fb44ac0470da898b318be8ceeafb224dd8540bb2200607aa1b4def46f9dd9de889061065090859088908890613770565b60405180910390a260018054808201825560009182526007027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfc81018490557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601905b848110156109fb57368686838181106106c857fe5b90506020028101906106da9190613aca565b905060006106eb6040830183613a28565b90501161070a5760405162461bcd60e51b815260040161037190613242565b82600061071a60208401846127ef565b73ffffffffffffffffffffffffffffffffffffffff168152602080820192909252604090810160009081208484013582529092529020541561076e5760405162461bcd60e51b81526004016103719061339f565b60018084018054918201808255600091825260208083206004909402909301929091869161079e908601866127ef565b73ffffffffffffffffffffffffffffffffffffffff1681526020808201929092526040908101600090812086840180358352935220919091556107e190836127ef565b81547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff919091161781556020820135600182015560005b61083b6040840184613a28565b90508110156109f057366108526040850185613a28565b8381811061085c57fe5b905060600201905082600301604051806060016040528083600001602081019061088691906127ef565b73ffffffffffffffffffffffffffffffffffffffff90811682526bffffffffffffffffffffffff6040808701358216602080860191909152878101803595830195909552865460018181018955600098895297829020875160029092020180549288015190941674010000000000000000000000000000000000000000029085167fffffffffffffffffffffffff000000000000000000000000000000000000000090921691909117909316929092178155920151919092015561094a90826127ef565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a3330846020013585604001358c6040516020016109829190613767565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016109b1959493929190612c1d565b600060405180830381600087803b1580156109cb57600080fd5b505af11580156109df573d6000803e3d6000fd5b50506001909301925061082e915050565b5050506001016106b3565b50505050505050565b6001548410610a255760405162461bcd60e51b81526004016103719061304f565b6000806001018581548110610a3657fe5b9060005260206000209060070201905060008160040154905060008111610a6f5760405162461bcd60e51b815260040161037190613188565b3373ffffffffffffffffffffffffffffffffffffffff86161480610aba57506005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633145b610ad65760405162461bcd60e51b8152600401610371906133fc565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600283016020526040812054905b8481101561100a5736868683818110610b1557fe5b9050602002810190610b279190613a8d565b905080358311610b495760405162461bcd60e51b8152600401610371906136e4565b610b51612610565b73ffffffffffffffffffffffffffffffffffffffff89166000908152600287016020526040902080548335908110610b8557fe5b600091825260209182902060408051608081018252929091015462ffffff8116835260ff6301000000820416158015948401949094526dffffffffffffffffffffffffffff6401000000008204811692840192909252720100000000000000000000000000000000000090041660608201529150610c155760405162461bcd60e51b815260040161037190613513565b73ffffffffffffffffffffffffffffffffffffffff8916600090815260028701602052604090208054600191908435908110610c4d57fe5b6000918252602082200180549215156301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff909316929092179091558151600188018054909162ffffff16908110610ca557fe5b906000526020600020906004020160020154905086600101826000015162ffffff1681548110610cd157fe5b6000918252602082206003600490920201015495505b610cf460208501856139c3565b9050811015610ffb5736610d0b60208601866139c3565b83818110610d1557fe5b9050602002810190610d279190613a8d565b905080358711610d495760405162461bcd60e51b815260040161037190613459565b610d51612637565b89600101856000015162ffffff1681548110610d6957fe5b9060005260206000209060040201600301826000013581548110610d8957fe5b60009182526020808320604080516060810182526002909402909101805473ffffffffffffffffffffffffffffffffffffffff811685526bffffffffffffffffffffffff74010000000000000000000000000000000000000000909104169284018390526001015490830152995091505b610e0760208401846139c3565b9050811015610eef576000610e1f60208501856139c3565b83818110610e2957fe5b905060200201359050898110610e515760405162461bcd60e51b8152600401610371906135cd565b86516040516000918891610e6e918f918935908790602001612bbc565b6040516020818303038152906040528051906020012060001c81610e8e57fe5b06905087604001516dffffffffffffffffffffffffffff168110158015610ec8575087606001516dffffffffffffffffffffffffffff1681105b610ee45760405162461bcd60e51b81526004016103719061311a565b509850600101610dfa565b508d7f61dd2cf3e9f248b4453e8abb61b6ad73c53cf482d1c506f868a3885f533233cf8e83600001518460400151868060200190610f2d91906139c3565b604051610f3d9594939250612ccd565b60405180910390a2806000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a308f8460400151868060200190610f7c91906139c3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b168152610fb89594939250600401612d03565b600060405180830381600087803b158015610fd257600080fd5b505af1158015610fe6573d6000803e3d6000fd5b5050923598505060019092019150610ce79050565b50509035925050600101610b00565b5050505050505050565b60015490565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146110615760405162461bcd60e51b8152600401610371906136ad565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca169063a9059cbb906110d59085908590600401612d48565b602060405180830381600087803b1580156110ef57600080fd5b505af1158015611103573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112791906128da565b505050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633146111735760405162461bcd60e51b8152600401610371906136ad565b600580547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff9390931692909217909155600455565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1690565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146112375760405162461bcd60e51b815260040161037190613368565b60008281526003602052604090205460015481106112675760405162461bcd60e51b81526004016103719061304f565b600080600101828154811061127857fe5b90600052602060002090600702019050428160060154106112ab5760405162461bcd60e51b8152600401610371906132ae565b6004810154156112cd5760405162461bcd60e51b815260040161037190613650565b82600060010183815481106112de57fe5b60009182526020909120600460079092020101556005810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405182907f37e68548bed90aa11745696116f838a60b0bba40fc3f77a139aee9e3b828a08e9061134e908690613767565b60405180910390a250505050565b60015460609083106113805760405162461bcd60e51b81526004016103719061304f565b600080600101848154811061139157fe5b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff871684526002600790930201918201905260409091205490915067ffffffffffffffff811180156113e057600080fd5b5060405190808252806020026020018201604052801561141a57816020015b611407612657565b8152602001906001900390816113ff5790505b50915060005b73ffffffffffffffffffffffffffffffffffffffff8416600090815260028301602052604090205481101561167d57611457612610565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600284016020526040902080548390811061148a57fe5b6000918252602080832060408051608081018252939091015462ffffff811680855260ff63010000008304161515938501939093526dffffffffffffffffffffffffffff64010000000082048116928501929092527201000000000000000000000000000000000000900416606083015260018601805492945091811061150d57fe5b600091825260209091206004909102018054865191925073ffffffffffffffffffffffffffffffffffffffff169086908590811061154757fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff90911690526001810154855186908590811061157f57fe5b6020026020010151602001818152505081604001518260600151036dffffffffffffffffffffffffffff168584815181106115b657fe5b6020026020010151604001818152505081604001516dffffffffffffffffffffffffffff168584815181106115e757fe5b6020026020010151606001818152505081606001516dffffffffffffffffffffffffffff1685848151811061161857fe5b60200260200101516080018181525050816000015162ffffff1685848151811061163e57fe5b602002602001015160a0018181525050816020015185848151811061165f57fe5b602090810291909101015190151560c0909101525050600101611420565b505092915050565b60009081526002602052604090205490565b60015460609067ffffffffffffffff811180156116b357600080fd5b506040519080825280602002602001820160405280156116ed57816020015b6116da6126ac565b8152602001906001900390816116d25790505b50905060005b60015481101561178857600080600101828154811061170e57fe5b90600052602060002090600702016006015490508183838151811061172f57fe5b602002602001015160000181815250508083838151811061174c57fe5b6020026020010151602001818152505042811183838151811061176b57fe5b6020908102919091010151901515604090910152506001016116f3565b5090565b60015460609082106117b05760405162461bcd60e51b81526004016103719061304f565b60008060010183815481106117c157fe5b906000526020600020906007020190508060030180548060200260200160405190810160405280929190818152602001828054801561183657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161180b575b5050505050915050919050565b6001546000906060908290841061186c5760405162461bcd60e51b81526004016103719061304f565b600080600101858154811061187d57fe5b60009182526020909120600660079092020190810154600582015490955090915060ff161515600114156118b457600191506118bc565b806004015491505b600181015467ffffffffffffffff811180156118d757600080fd5b5060405190808252806020026020018201604052801561191157816020015b6118fe6126cf565b8152602001906001900390816118f65790505b50925060005b6001820154811015611b8657600082600101828154811061193457fe5b600091825260209091206004909102018054865191925073ffffffffffffffffffffffffffffffffffffffff169086908490811061196e57fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff9091169052600181015485518690849081106119a657fe5b6020026020010151602001818152505080600201548583815181106119c757fe5b602090810291909101015160400152600381015467ffffffffffffffff811180156119f157600080fd5b50604051908082528060200260200182016040528015611a2b57816020015b611a1861270d565b815260200190600190039081611a105790505b50858381518110611a3857fe5b60200260200101516060018190525060005b6003820154811015611b7c576000826003018281548110611a6757fe5b600091825260209091206002909102018054885191925073ffffffffffffffffffffffffffffffffffffffff1690889086908110611aa157fe5b6020026020010151606001518381518110611ab857fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260018101548751889086908110611af057fe5b6020026020010151606001518381518110611b0757fe5b602090810291909101810151015280548751740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff1690889086908110611b4d57fe5b6020026020010151606001518381518110611b6457fe5b60209081029190910101516040015250600101611a4a565b5050600101611917565b50509193909250565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a0823190611c04903090600401612bfc565b60206040518083038186803b158015611c1c57600080fd5b505afa158015611c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c549190612973565b905090565b6001548310611c7a5760405162461bcd60e51b81526004016103719061304f565b80611c975760405162461bcd60e51b8152600401610371906130e3565b6000806001018481548110611ca857fe5b9060005260206000209060070201905042816006015411611cdb5760405162461bcd60e51b8152600401610371906134dc565b837f11bafd320b20b453e37e76ddd7d80347a86411bafe26e90624da8a8dcdcdd429338585604051611d0f93929190612c6d565b60405180910390a2336000908152600282016020526040902054611d6d57600381018054600181018255600091825260209091200180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b60005b828110156120525736848483818110611d8557fe5b90506060020190506000816040013511611db15760405162461bcd60e51b81526004016103719061330b565b60008381611dc260208501856127ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360200135815260200190815260200160002054905060008111611e345760405162461bcd60e51b8152600401610371906131e5565b8080600190039150506000846001018281548110611e4e57fe5b6000918252602080832060026004909302018281018054338652938a0183526040808620815160808101835262ffffff808b1682528187018981526dffffffffffffffffffffffffffff808a16848701908152958e01358a01808216606086019081528654600181018855968d529b8a90209451949095018054925196519b51821672010000000000000000000000000000000000000271ffffffffffffffffffffffffffffffffffff9c909216640100000000027fffffffffffffffffffffffffffff0000000000000000000000000000ffffffff9715156301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffff969095167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000909416939093179490941692909217949094169390931797909716919091179095559390935591925090611fa9908501856127ef565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a3330876020013588604001358e604051602001611fe19190613767565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401612010959493929190612c1d565b600060405180830381600087803b15801561202a57600080fd5b505af115801561203e573d6000803e3d6000fd5b505060019096019550611d70945050505050565b5050505050565b60006020821461207b5760405162461bcd60e51b815260040161037190613570565b6000612089838501856128fa565b60015490915081106120ad5760405162461bcd60e51b81526004016103719061304f565b60008060010182815481106120be57fe5b906000526020600020906007020190506000816006015490504281116120f65760405162461bcd60e51b815260040161037190612ff2565b507ff23a6e61000000000000000000000000000000000000000000000000000000009998505050505050505050565b6005546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1633811461216d5760405162461bcd60e51b8152600401610371906136ad565b600580546bffffffffffffffffffffffff166c0100000000000000000000000073ffffffffffffffffffffffffffffffffffffffff85811691820292909217909255604051908316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60015460609082106122045760405162461bcd60e51b81526004016103719061304f565b600080600101838154811061221557fe5b90600052602060002090600702019050806001018054905067ffffffffffffffff8111801561224357600080fd5b5060405190808252806020026020018201604052801561227d57816020015b61226a612744565b8152602001906001900390816122625790505b50915060005b60018201548110156124435760008260010182815481106122a057fe5b600091825260209091206004909102018054855191925073ffffffffffffffffffffffffffffffffffffffff16908590849081106122da57fe5b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff90911690526001810154845185908490811061231257fe5b60200260200101516020018181525050806002015484838151811061233357fe5b6020026020010151606001818152505060005b600384015481101561243957600084600301828154811061236357fe5b600091825260208220015473ffffffffffffffffffffffffffffffffffffffff1691505b73ffffffffffffffffffffffffffffffffffffffff8216600090815260028701602052604090205481101561242f5773ffffffffffffffffffffffffffffffffffffffff8216600090815260028701602052604090208054829081106123e957fe5b60009182526020909120015462ffffff168514156124275786858151811061240d57fe5b60209081029190910101516040018051600101905261242f565b600101612387565b5050600101612346565b5050600101612283565b5050919050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79528587866040516020016124bd929190612bae565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016124ea93929190612d6e565b602060405180830381600087803b15801561250457600080fd5b505af1158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c91906128da565b5060008481526002602052604081205461255b90869085903090612585565b600086815260026020526040902080546001019055905061257c85826125dd565b95945050505050565b60008484848460405160200161259e9493929190612f5d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b600082826040516020016125f2929190612bae565b60405160208183030381529060405280519060200120905092915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604080516060810182526000808252602082018190529181019190915290565b6040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581525090565b604051806060016040528060008152602001600081526020016000151581525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001606081525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461034b57600080fd5b60008083601f8401126127b7578182fd5b50813567ffffffffffffffff8111156127ce578182fd5b60208301915083602080830285010111156127e857600080fd5b9250929050565b600060208284031215612800578081fd5b61280982612782565b9392505050565b60008060008060008060a08789031215612828578182fd5b61283187612782565b955061283f60208801612782565b94506040870135935060608701359250608087013567ffffffffffffffff80821115612869578384fd5b818901915089601f83011261287c578384fd5b81358181111561288a578485fd5b8a602082850101111561289b578485fd5b6020830194508093505050509295509295509295565b600080604083850312156128c3578182fd5b6128cc83612782565b946020939093013593505050565b6000602082840312156128eb578081fd5b81518015158114612809578182fd5b60006020828403121561290b578081fd5b5035919050565b60008060408385031215612924578182fd5b50508035926020909101359150565b600060208284031215612944578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612809578182fd5b600060208284031215612984578081fd5b5051919050565b6000806040838503121561299d578182fd5b823591506129ad60208401612782565b90509250929050565b600080600080606085870312156129cb578384fd5b843593506129db60208601612782565b9250604085013567ffffffffffffffff8111156129f6578283fd5b612a02878288016127a6565b95989497509550505050565b600080600060408486031215612a22578283fd5b83359250602084013567ffffffffffffffff811115612a3f578283fd5b612a4b868287016127a6565b9497909650939450505050565b600080600060408486031215612a6c578283fd5b83359250602084013567ffffffffffffffff80821115612a8a578384fd5b818601915086601f830112612a9d578384fd5b813581811115612aab578485fd5b876020606083028501011115612abf578485fd5b6020830194508093505050509250925092565b600082845260208401935081815b84811015612b0557612af28683612b78565b6060958601959190910190600101612ae0565b5093949350505050565b60008151808452815b81811015612b3457602081850181015186830182015201612b18565b81811115612b455782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff612b9682612782565b16825260208181013590830152604090810135910152565b918252602082015260400190565b93845260e89290921b7fffffff00000000000000000000000000000000000000000000000000000000001660208401526023830152604382015260630190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015283606083015260a06080830152612c6260a0830184612b0f565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815260406020820181905281018290526000606080830185835b86811015612cc057612cb08383612b78565b9183019190830190600101612c9e565b5090979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff94851681529290931660208301526040820152606081019190915260800190565b73ffffffffffffffffffffffffffffffffffffffff94851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b600073ffffffffffffffffffffffffffffffffffffffff851682528360208301526060604083015261257c6060830184612b0f565b6020808252825182820181905260009190848201906040850190845b81811015612df157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612dbf565b50909695505050505050565b602080825282518282018190526000919060409081850190868401855b82811015612e8a578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c09081015115159085015260e09093019290850190600101612e1a565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b82811015612e8a57815180518552868101518786015285015115158585015260609093019290850190600101612eb4565b602080825282518282018190526000919060409081850190868401855b82811015612e8a578151805173ffffffffffffffffffffffffffffffffffffffff168552868101518786015285810151868601526060908101519085015260809093019290850190600101612f02565b901515815260200190565b938452602084019290925273ffffffffffffffffffffffffffffffffffffffff166040830152606082015260800190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b60208082526017908201527f526166666c653a204e6f20726166666c65206974656d73000000000000000000604082015260600190565b60208082526030908201527f526166666c653a2043616e277420616363657074207472616e7366657220666f60408201527f72206578706972656420726166666c6500000000000000000000000000000000606082015260800190565b6020808252601d908201527f526166666c653a20526166666c6520646f6573206e6f74206578697374000000604082015260600190565b60208082526033908201527f526166666c653a205f726166666c654475726174696f6e206d7573742062652060408201527f67726561746572207468616e203120686f757200000000000000000000000000606082015260800190565b60208082526012908201527f526166666c653a204e6f207469636b6574730000000000000000000000000000604082015260600190565b60208082526019908201527f526166666c653a20446964206e6f742077696e207072697a6500000000000000604082015260600190565b6020808252600f908201527f4e6f7420656e6f756768204c494e4b0000000000000000000000000000000000604082015260600190565b60208082526027908201527f526166666c653a2052616e646f6d206e756d626572206e6f742067656e65726160408201527f7465642079657400000000000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f526166666c653a20526166666c65206974656d20646f65736e2774206578697360408201527f7420666f72207468697320726166666c65000000000000000000000000000000606082015260800190565b60208082526011908201527f526166666c653a204e6f207072697a6573000000000000000000000000000000604082015260600190565b6020808252818101527f526166666c653a2052616e646f6d206e756d6265722069732070656e64696e67604082015260600190565b60208082526023908201527f526166666c653a20526166666c652074696d6520686173206e6f74206578706960408201527f7265640000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f526166666c653a205469636b6574207175616e746974792063616e6e6f74206260408201527f65207a65726f0000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c00604082015260600190565b6020808252603c908201527f526166666c653a20526166666c65206974656d20616c7265616479207573696e60408201527f67207469636b65744164647265737320616e64207469636b6574496400000000606082015260800190565b6020808252602d908201527f526166666c653a204e6f7420636c61696d6564206279206f776e6572206f722060408201527f636f6e74726163744f776e657200000000000000000000000000000000000000606082015260800190565b60208082526049908201527f526166666c653a20526166666c65207072697a65207479706520646f6573206e60408201527f6f74206578697374206f72206973206e6f74206c6573736572207468616e206c60608201527f6173742076616c75650000000000000000000000000000000000000000000000608082015260a00190565b6020808252601f908201527f526166666c653a20526166666c652074696d6520686173206578706972656400604082015260600190565b6020808252602f908201527f526166666c65733a20456e747279207072697a6573206861766520616c72656160408201527f6479206265656e20636c61696d65640000000000000000000000000000000000606082015260800190565b6020808252602f908201527f526166666c653a2044617461206f66207468652077726f6e672073697a65207360408201527f656e74206f6e207472616e736665720000000000000000000000000000000000606082015260800190565b60208082526043908201527f526166666c653a207072697a654e756d62657220646f6573206e6f742065786960408201527f7374206f72206973206e6f74206c6573736572207468616e206c61737420766160608201527f6c75650000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526027908201527f526166666c653a2052616e646f6d206e756d62657220616c726561647920676560408201527f6e65726174656400000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f526166666c653a204d75737420626520636f6e7472616374206f776e65720000604082015260600190565b60208082526042908201527f526166666c653a205573657220656e74727920646f6573206e6f74206578697360408201527f74206f72206973206e6f74206c6573736572207468616e206c6173742076616c60608201527f7565000000000000000000000000000000000000000000000000000000000000608082015260a00190565b90815260200190565b83815260406020808301829052828201849052600091906060908185018682028601830188865b898110156138a6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa089840301845281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18c36030181126137f7578889fd5b8b0173ffffffffffffffffffffffffffffffffffffffff61381782612782565b1684528581013586850152878101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe182360301811261385557898afd5b8101803567ffffffffffffffff81111561386d578a8bfd5b888102360383131561387d578a8bfd5b888a870152613891898701828a8501612ad2565b96880196955050509185019150600101613797565b50909a9950505050505050505050565b600060608083018684526020828186015281875180845260809350838701915083838202880101838a01875b838110156139aa578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800185528151805173ffffffffffffffffffffffffffffffffffffffff9081168552878201518886015260408083015181870152918a01518a86018a905280518a8701819052908901928c929160a08801905b808510156139935785518051851683528c8101518d84015283015183830152948b019460019490940193908d0190613960565b50988a0198965050509287019250506001016138e2565b5050809650505050505050826040830152949350505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139f7578283fd5b83018035915067ffffffffffffffff821115613a11578283fd5b60209081019250810236038213156127e857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613a5c578283fd5b83018035915067ffffffffffffffff821115613a76578283fd5b60200191506060810236038213156127e857600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112613ac0578182fd5b9190910192915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112613ac0578182fdfea264697066735822122053ca43fa82d249b9cacb13d0e163fa6731313fc650b840e0f78c40c849bb96f664736f6c63430007040033

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

000000000000000000000000819c3fc356bb319035f9d2886fac9e57df0343f5000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

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

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000819c3fc356bb319035f9d2886fac9e57df0343f5
Arg [1] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [2] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [3] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [4] : 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.