ETH Price: $3,259.63 (+0.32%)
Gas: 2 Gwei

Contract

0xf88abA7982f6f2e9F795Eb12EEdE65C5AeD07ad1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Cancel Raffle178070882023-07-30 16:38:59364 days ago1690735139IN
0xf88abA79...5AeD07ad1
0 ETH0.0060334428.93032885
Change Cancellat...178048952023-07-30 9:15:47364 days ago1690708547IN
0xf88abA79...5AeD07ad1
0 ETH0.0003769215.65507171
Cancel Raffle178019152023-07-29 23:16:35364 days ago1690672595IN
0xf88abA79...5AeD07ad1
0 ETH0.0046339221.2041211
Cancel Raffle178006162023-07-29 18:54:59365 days ago1690656899IN
0xf88abA79...5AeD07ad1
0 ETH0.0030778923.09309973
Cancel Raffle178006142023-07-29 18:54:35365 days ago1690656875IN
0xf88abA79...5AeD07ad1
0 ETH0.0033500325.13495444
Cancel Raffle178006132023-07-29 18:54:23365 days ago1690656863IN
0xf88abA79...5AeD07ad1
0 ETH0.0032017224.02218833
Cancel Raffle178006132023-07-29 18:54:23365 days ago1690656863IN
0xf88abA79...5AeD07ad1
0 ETH0.0032017224.02218833
Give Subscriptio...178006052023-07-29 18:52:47365 days ago1690656767IN
0xf88abA79...5AeD07ad1
0 ETH0.0011507824.22033397
Change Cancellat...178003732023-07-29 18:05:59365 days ago1690653959IN
0xf88abA79...5AeD07ad1
0 ETH0.0007901627.30650783
Toggle Create Ho...178003572023-07-29 18:02:47365 days ago1690653767IN
0xf88abA79...5AeD07ad1
0 ETH0.0008559929.74994635
Change Cancellat...178002702023-07-29 17:45:23365 days ago1690652723IN
0xf88abA79...5AeD07ad1
0 ETH0.0006884926.3296806
Create Raffle Su...178002612023-07-29 17:43:35365 days ago1690652615IN
0xf88abA79...5AeD07ad1
0 ETH0.0089394927.23520811
Create Raffle Op...178001982023-07-29 17:30:47365 days ago1690651847IN
0xf88abA79...5AeD07ad1
0 ETH0.0081641725.15994428
Create Raffle Op...178001852023-07-29 17:28:11365 days ago1690651691IN
0xf88abA79...5AeD07ad1
0 ETH0.0071745323.74747604
Create Raffle Op...178001742023-07-29 17:25:59365 days ago1690651559IN
0xf88abA79...5AeD07ad1
0 ETH0.0135860725.00119387
Create Raffle Op...178001632023-07-29 17:23:47365 days ago1690651427IN
0xf88abA79...5AeD07ad1
0 ETH0.0069529423.01492065
Buy Entry178001522023-07-29 17:21:35365 days ago1690651295IN
0xf88abA79...5AeD07ad1
0.01 ETH0.0052464724.32077354
Create Raffle Op...178001482023-07-29 17:20:47365 days ago1690651247IN
0xf88abA79...5AeD07ad1
0 ETH0.0126233223.85356351
Grant Role178001432023-07-29 17:19:47365 days ago1690651187IN
0xf88abA79...5AeD07ad1
0 ETH0.0011420224.07547475
Set Winner Raffl...177988522023-07-29 13:00:11365 days ago1690635611IN
0xf88abA79...5AeD07ad1
0 ETH0.0032401120.79970586
Buy Entry177988392023-07-29 12:57:35365 days ago1690635455IN
0xf88abA79...5AeD07ad1
0.006 ETH0.0046931219.76920177
Buy Entry177988222023-07-29 12:54:11365 days ago1690635251IN
0xf88abA79...5AeD07ad1
0.002 ETH0.004423520.50577762
Create Raffle Op...177988192023-07-29 12:53:35365 days ago1690635215IN
0xf88abA79...5AeD07ad1
0 ETH0.0085635520.08648359
Give Subscriptio...177987972023-07-29 12:49:11365 days ago1690634951IN
0xf88abA79...5AeD07ad1
0 ETH0.00081917.23750378
Change Cancellat...177987862023-07-29 12:46:59365 days ago1690634819IN
0xf88abA79...5AeD07ad1
0 ETH0.0005544719.15342643
View all transactions

Latest 8 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
178019152023-07-29 23:16:35364 days ago1690672595
0xf88abA79...5AeD07ad1
0.01 ETH
177988562023-07-29 13:00:59365 days ago1690635659
0xf88abA79...5AeD07ad1
0.008 ETH
177986562023-07-29 12:20:59365 days ago1690633259
0xf88abA79...5AeD07ad1
0.005 ETH
177981792023-07-29 10:44:35365 days ago1690627475
0xf88abA79...5AeD07ad1
0.001 ETH
177981792023-07-29 10:44:35365 days ago1690627475
0xf88abA79...5AeD07ad1
0.001 ETH
177981792023-07-29 10:44:35365 days ago1690627475
0xf88abA79...5AeD07ad1
0.001 ETH
177980502023-07-29 10:18:47365 days ago1690625927
0xf88abA79...5AeD07ad1
0.012 ETH
177979232023-07-29 9:52:59365 days ago1690624379
0xf88abA79...5AeD07ad1
0.005 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Rafldex

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : Rafldex.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract Rafldex is
    Ownable,
    ReentrancyGuard,
    VRFConsumerBaseV2,
    ERC721Holder,
    ERC1155Holder
{
    VRFCoordinatorV2Interface COORDINATOR;
    LinkTokenInterface LINKTOKEN;
    address constant vrfCoordinator =
        0x271682DEB8C4E0901D1a1550aD2e64D568E69909;
    address constant link_token_contract =
        0x514910771AF9Ca656af840dff83E8264EcF986CA;
    bytes32 private keyHash =
        0x9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805;

    uint16 private requestConfirmations = 3;
    uint32 private callbackGasLimit = 1000000;
    uint32 private numWords = 1;
    uint64 private subscriptionId = 810; 

    struct RandomResult {
        uint256 randomNumber;
        uint256 nomalizedRandomNumber;
    }
    struct RaffleInfo {
        uint256 id;
        uint256 size;
    }

    mapping(uint256 => RandomResult) public requests;
    mapping(uint256 => RaffleInfo) public chainlinkRaffleInfo;

    event GotSubscription(address _address);
    event CollectionWhitelisted(address _collection, uint256 _rafflesnumber);
    event UserBlacklisted(address _address);
    event AddedTokenPayment(address _address);
    event RequestFulfilled(
        uint256 requestId,
        uint256 randomNumber,
        uint256 indexed raffleId
    );
    event RequestSent(uint256 requestId, uint32 numWords);
    event RaffleCreated(
        uint256 indexed raffleId,
        address[] nftAddress,
        uint256[] nftId
    );
    event RaffleDrawn(
        uint256 indexed raffleId,
        address indexed winner,
        uint256 amountRaised,
        uint256 randomNumber
    );
    event EntryBought(
        uint256 indexed raffleId,
        address indexed buyer,
        uint256 currentSize,
        uint256 numberEntries
    );
    event FreeEntry(
        uint256 indexed raffleId,
        address[] buyer,
        uint256 amount,
        uint256 currentSize
    );
    event RaffleCancelled(uint256 indexed raffleId, uint256 amountRaised);
    event SetWinnerTriggered(uint256 indexed raffleId, uint256 amountRaised);

    struct EntriesBought {
        uint256 currentEntriesLength;
        address player;
    }
    mapping(uint256 => EntriesBought[]) public entriesList;
    mapping(uint256 => mapping(uint256 => address)) public entryToOwner;

    enum STATUS {
        CREATED,
        PENDING_DRAW,
        DRAWING,
        DRAWN,
        CANCELLED
    }
    enum CATEGORY {
        OPERATOR,
        HOLDER,
        SUBSCRIBER
    }

    struct RaffleStruct {
        STATUS status;
        uint256 endTime;
        address[] collateralAddress;
        uint256[] collateralId;
        uint256[] tokenAmount;
        uint256 entriesSupply;
        uint256[] entries;
        uint256 pricePerEntry;
        address winner;
        uint256 randomNumber;
        uint256 amountRaised;
        address creator;
        uint256 platformPercentage;
        address tokenPayment;
        uint256 entriesSold;
        uint256 cancellingDate;
        CATEGORY category;
    }

    RaffleStruct[] public raffles;

    struct RaffleCreationHolder {
        uint256 startTime;
        uint256 endTime;
        uint256 countRaffles;
    }

    mapping(bytes32 => RaffleCreationHolder) public raffleCreationData;
    mapping(address => uint256) public numberRafflesMonthCollection;

    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR");
    bytes32 public constant MODERATOR_ROLE = keccak256("MODERATOR");
    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    address payable private platformWallet =
        payable(0xB6A832c5aD60619d3D77aFE26d79B0b518E6930a);

    uint256 public HOLDER_CREATE_RAFFLE_FEE = 0.01 ether;
    uint256 public HOLDER_CREATE_RAFFLE_FEE_DISCOUNT = 0.005 ether;
    uint256 public CANCELATION_RAFFLE_FEE = 0.02 ether;
    uint256 public SUBSCRIPTION_PRICE = 0.5 ether;
    uint256 public COMMISSION_HOLDERS = 500; //5 %
    uint256 public COMMISSION_HOLDERS_DISCOUNT = 350; //3.5%
    uint256 public COMMISSION_SUBSCRIBERS_DISCOUNT = 150; //1.5%
    uint256 public COMMISSION_SUBSCRIBERS = 300; //3%

    mapping(address => bool) public Subscribers;
    mapping(address => bool) public BlacklistAddresses;
    mapping(bytes32 => bool) public BlacklistNFTs;
    mapping(address => bool) public TokenPaymentAddresses;
    mapping(address => bool) public DiscountTokenPayments;

    bool public createEnabledHolders = false;
    bool public createEnabledSubscribers = false;

    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }
    mapping(bytes32 => RoleData) private _roles;

    constructor() VRFConsumerBaseV2(vrfCoordinator) {
        COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator);
        LINKTOKEN = LinkTokenInterface(link_token_contract);
        _setupRole(OPERATOR_ROLE, msg.sender);
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    modifier onlyRole(bytes32 role, address account) {
        _checkRole(role, account);
        _;
    }

    function createRaffleOperator(
        uint256 _endTime,
        address[] memory _collateralAddress,
        uint256[] memory _collateralId,
        uint256[] memory _tokenAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle
    ) external onlyRole(OPERATOR_ROLE, msg.sender) returns (uint256) {
        require(
            !BlacklistAddresses[msg.sender],
            "User blacklisted can't create raffles."
        );
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(
            _collateralAddress.length == _collateralId.length,
            "Address, IDs need to have same length."
        );
        require(
            _collateralAddress.length == _tokenAmount.length,
            "Address, Token Amounts need to have same length."
        );
        require(_maxEntriesRaffle > 0, "No entries");
        if (_tokenPayment != address(0)) {
            require(
                TokenPaymentAddresses[_tokenPayment],
                "Token Address not added "
            );
        }

        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAddress[i] != address(0), "NFT is null");
            IERC721 nftContract = IERC721(_collateralAddress[i]);
            require(
                msg.sender == nftContract.ownerOf(_collateralId[i]),
                "Only NFT owner can create raffle"
            );
        }
        uint256 _commissionInBasicPoints = 0;

        safeMultipleTransfersFrom(
            msg.sender,
            address(this),
            _collateralAddress,
            _collateralId,
            _tokenAmount
        );

        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralId: _collateralId,
            tokenAmount: _tokenAmount,
            pricePerEntry: _pricePerEntry,
            entriesSupply: _maxEntriesRaffle,
            entries: new uint256[](0),
            winner: address(0),
            randomNumber: 0,
            amountRaised: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            cancellingDate: 0,
            category: CATEGORY.OPERATOR
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;

        emit RaffleCreated(idRaffle, _collateralAddress, _collateralId);
        return idRaffle;
    }

    function createRaffleHolder(
        address createRaffleCollection,
        uint256 createRaffleTokenId,
        uint256 _endTime,
        address[] memory _collateralAddress,
        uint256[] memory _collateralId,
        uint256[] memory _tokenAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle
    ) external payable returns (uint256) {
        require(createEnabledHolders, "Create raffle not set for holders.");

        require(
            !BlacklistAddresses[msg.sender],
            "User blacklisted can't create raffles."
        );
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(
            _collateralAddress.length == _collateralId.length,
            "Address, IDs & Token Amount need to have same length."
        );
        require(
            _collateralAddress.length == _tokenAmount.length,
            "Address, Token Amounts need to have same length."
        );

        require(_maxEntriesRaffle > 0, "No entries");
        if (_tokenPayment != address(0)) {
            require(
                TokenPaymentAddresses[_tokenPayment],
                "Token Address not added "
            );
        }

        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAddress[i] != address(0), "NFT is null");
            IERC721 nftContract = IERC721(_collateralAddress[i]);
            require(
                msg.sender == nftContract.ownerOf(_collateralId[i]),
                "Only NFT owner can create raffle"
            );
        }

        uint256 _commissionInBasicPoints = 0;
        if (DiscountTokenPayments[_tokenPayment]) {
            require(
                msg.value == HOLDER_CREATE_RAFFLE_FEE_DISCOUNT,
                "Invalid funds provided"
            );

            _commissionInBasicPoints = COMMISSION_HOLDERS_DISCOUNT;
        } else {
            require(
                msg.value == HOLDER_CREATE_RAFFLE_FEE,
                "Invalid funds provided"
            );
            _commissionInBasicPoints = COMMISSION_HOLDERS;
        }

        IERC721 createraffleNFT = IERC721(createRaffleCollection);
        require(
            createraffleNFT.ownerOf(createRaffleTokenId) == msg.sender,
            "Not the owner of tokenId"
        );

        bytes32 hash = keccak256(
            abi.encode(createRaffleCollection, createRaffleTokenId)
        );

        require(!BlacklistNFTs[hash], "NFT to create raffle is blacklisted.");

        if (raffleCreationData[hash].endTime > getCurrentTime()) {
            require(
                numberRafflesRemainingPerNFT(
                    createRaffleCollection,
                    createRaffleTokenId
                ) > 0,
                "Created too many raffles with your NFT you hold."
            );
            raffleCreationData[hash].countRaffles++;
        } else {
            raffleCreationData[hash].startTime = getCurrentTime();
            raffleCreationData[hash].endTime = getCurrentTime() + 30 days;
            raffleCreationData[hash].countRaffles = 1;
        }

        safeMultipleTransfersFrom(
            msg.sender,
            address(this),
            _collateralAddress,
            _collateralId,
            _tokenAmount
        );

        platformWallet.transfer(msg.value);

        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralId: _collateralId,
            tokenAmount: _tokenAmount,
            pricePerEntry: _pricePerEntry,
            entriesSupply: _maxEntriesRaffle,
            entries: new uint256[](0),
            winner: address(0),
            randomNumber: 0,
            amountRaised: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            cancellingDate: 0,
            category: CATEGORY.OPERATOR
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;

        emit RaffleCreated(idRaffle, _collateralAddress, _collateralId);

        return idRaffle;
    }

    function createRaffleSubscriber(
        uint256 _endTime,
        address[] memory _collateralAddress,
        uint256[] memory _collateralId,
        uint256[] memory _tokenAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle
    ) external returns (uint256) {
        require(
            !BlacklistAddresses[msg.sender],
            "User blacklisted can't create raffles."
        );
        require(
            createEnabledSubscribers,
            "Create raffle noot set for subscribers."
        );
        require(
            Subscribers[msg.sender],
            "Need to be subscriber to create raffle."
        );
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(
            _collateralAddress.length == _collateralId.length,
            "Address, IDs & Token Amount need to have same length."
        );
        require(
            _collateralAddress.length == _tokenAmount.length,
            "Address, Token Amounts need to have same length."
        );

        require(_maxEntriesRaffle > 0, "No entries");
        if (_tokenPayment != address(0)) {
            require(
                TokenPaymentAddresses[_tokenPayment],
                "Token Address not added "
            );
        }
        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAddress[i] != address(0), "NFT is null");
            IERC721 nftContract = IERC721(_collateralAddress[i]);
            require(
                msg.sender == nftContract.ownerOf(_collateralId[i]),
                "Only NFT owner can create raffle"
            );
        }
        uint256 _commissionInBasicPoints = 0;

        if (DiscountTokenPayments[_tokenPayment]) {
            _commissionInBasicPoints = COMMISSION_SUBSCRIBERS_DISCOUNT;
        } else {
            _commissionInBasicPoints = COMMISSION_SUBSCRIBERS;
        }

        safeMultipleTransfersFrom(
            msg.sender,
            address(this),
            _collateralAddress,
            _collateralId,
            _tokenAmount
        );

        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralId: _collateralId,
            tokenAmount: _tokenAmount,
            pricePerEntry: _pricePerEntry,
            entriesSupply: _maxEntriesRaffle,
            entries: new uint256[](0),
            winner: address(0),
            randomNumber: 0,
            amountRaised: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            cancellingDate: 0,
            category: CATEGORY.OPERATOR
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;

        emit RaffleCreated(idRaffle, _collateralAddress, _collateralId);

        return idRaffle;
    }

    function buyEntry(uint256 _raffleId, uint256 _numberEntries)
        external
        payable
    {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(raffle.endTime > getCurrentTime(), "Raffle Closed on time");
        require(raffle.status == STATUS.CREATED, "Raffle is not in CREATED");
        require(_numberEntries > 0, "Number entries can't be 0");
        require(
            raffle.entriesSold + _numberEntries <=
                raffles[_raffleId].entriesSupply,
            "Raffle has reached max entries"
        );

        if (raffle.tokenPayment == address(0)) {
            require(
                msg.value >= raffle.pricePerEntry * _numberEntries,
                "msg.value must be equal or more than the price"
            );

            raffle.amountRaised += msg.value;
        } else {
            require(
                IERC20(raffle.tokenPayment).balanceOf(msg.sender) >=
                    raffle.pricePerEntry * _numberEntries,
                "Need to have in wallet equal or more than ERC20 Token price"
            );
            IERC20(raffle.tokenPayment).transferFrom(
                msg.sender,
                address(this),
                raffle.pricePerEntry * _numberEntries
            );
            raffle.amountRaised += raffle.pricePerEntry * _numberEntries;
        }
        EntriesBought memory entryBought = EntriesBought({
            player: msg.sender,
            currentEntriesLength: raffle.entriesSold + _numberEntries
        });
        entriesList[_raffleId].push(entryBought);

        for (uint256 i = 0; i < _numberEntries; i++) {
            uint256 entry = raffle.entriesSold + 1 + i;
            raffle.entries.push(entry);
            entryToOwner[_raffleId][entry] = msg.sender;
        }

        raffle.entriesSold = raffle.entriesSold + _numberEntries;

        emit EntryBought(
            _raffleId,
            msg.sender,
            raffles[_raffleId].entriesSold,
            _numberEntries
        );
    }

    function giveBatchEntriesForFree(
        uint256 _raffleId,
        uint256 _numberEntriesPerUser,
        address[] memory _freePlayers
    ) external nonReentrant onlyRole(OPERATOR_ROLE, msg.sender) {
        require(
            raffles[_raffleId].status == STATUS.CREATED,
            "Raffle is not in CREATED"
        );
        require(
            raffles[_raffleId].category == CATEGORY.OPERATOR,
            "Raffle is not in OPERATOR category."
        );
        uint256 freePlayersLength = _freePlayers.length;
        require(
            _numberEntriesPerUser * freePlayersLength <=
                raffles[_raffleId].entriesSupply,
            "Free tickets need to be less than max entries supply."
        );
        uint256 validPlayersCount = 0;
        for (uint256 i = 0; i < freePlayersLength; i++) {
            address entry = _freePlayers[i];
            EntriesBought memory entryBought = EntriesBought({
                player: entry,
                currentEntriesLength: raffles[_raffleId].entriesSold +
                    i +
                    _numberEntriesPerUser
            });
            entriesList[_raffleId].push(entryBought);
            ++validPlayersCount;
        }
        raffles[_raffleId].entriesSold =
            raffles[_raffleId].entriesSold +
            validPlayersCount;
        emit FreeEntry(
            _raffleId,
            _freePlayers,
            freePlayersLength,
            raffles[_raffleId].entriesSold
        );
    }

    function getCurrentTime() public view returns (uint256) {
        return block.timestamp;
    }

    function getSubscription() external payable {
        require(
            msg.value == SUBSCRIPTION_PRICE,
            "msg.value must be equal to the price"
        );
        platformWallet.transfer(msg.value);
        Subscribers[msg.sender] = true;
        emit GotSubscription(msg.sender);
    }

    function giveSubscriptionTo(address _address)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        Subscribers[_address] = true;
        emit GotSubscription(_address);
    }

    function RemoveSubscriptionTo(address _address)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        Subscribers[_address] = false;
    }

    function ChangeSubscriptionFee(uint256 _subscriptionfee)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        SUBSCRIPTION_PRICE = _subscriptionfee;
    }

    function ChangeCancellationFee(uint256 _fee)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        CANCELATION_RAFFLE_FEE = _fee;
    }

    function ChangeSubscriptionId(uint64 _id)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        subscriptionId = _id;
    }

    function ChangecallbackGasLimit(uint32 _number)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        callbackGasLimit = _number;
    }

    function ChangeKeyHash(bytes32 _hash)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        keyHash = _hash;
    }

    function setNumberRafflesCollectionWhitelistedPerMonth(
        address _collection,
        uint256 _rafflesnumber
    ) external onlyRole(OPERATOR_ROLE, msg.sender) {
        numberRafflesMonthCollection[_collection] = _rafflesnumber;
        emit CollectionWhitelisted(_collection, _rafflesnumber);
    }

    function ChangeUserHolderCreateRaffleFee(uint256 _rafflefee)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        HOLDER_CREATE_RAFFLE_FEE = _rafflefee;
    }

    function ChangeUserHolderCreateRaffleFeeDiscount(uint256 _rafflefee)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        HOLDER_CREATE_RAFFLE_FEE_DISCOUNT = _rafflefee;
    }

    function numberRafflesRemainingPerNFT(
        address _collectionaddress,
        uint256 _tokenid
    ) public view returns (uint256) {
        uint256 numberRafflesNFT = 0;
        if (numberRafflesMonthCollection[_collectionaddress] > 0) {
            bytes32 hashNFT = keccak256(
                abi.encode(_collectionaddress, _tokenid)
            );
            numberRafflesNFT =
                numberRafflesMonthCollection[_collectionaddress] -
                raffleCreationData[hashNFT].countRaffles;
        }
        return numberRafflesNFT;
    }

    function changePlatformWalletAddress(address payable _address)
        external
        onlyOwner
    {
        platformWallet = _address;
    }

    function addTokenPayment(address _address, bool _isAdded)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        TokenPaymentAddresses[_address] = _isAdded;
        if (_isAdded == true) {
            emit AddedTokenPayment(_address);
        }
    }

    function addDiscountTokenPayment(address _address, bool _isAdded)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        DiscountTokenPayments[_address] = _isAdded;
    }

    function blacklistAddressOrNot(address _address, bool _isBlacklist)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        BlacklistAddresses[_address] = _isBlacklist;
        if (_isBlacklist == true) {
            emit UserBlacklisted(_address);
        }
    }

    function toggleCreateHoldersEnabled()
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        createEnabledHolders = !createEnabledHolders;
    }

    function toggleCreateSubscribersEnabled()
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        createEnabledSubscribers = !createEnabledSubscribers;
    }

    function blacklistNFTCreateRaffle(
        address _collectionaddress,
        uint256 _tokenid,
        bool _isBlacklist
    ) external onlyRole(OPERATOR_ROLE, msg.sender) {
        bytes32 hashNFT = keccak256(abi.encode(_collectionaddress, _tokenid));
        BlacklistNFTs[hashNFT] = _isBlacklist;
    }

    function getRaffleData(uint256 _raffleId)
        public
        view
        returns (
            uint256 endTime,
            address[] memory collateralAddress,
            uint256[] memory collateralId,
            uint256 entriesSupply,
            uint256 pricePerEntry,
            address winner,
            uint256 randomNumber,
            uint256 amountRaised,
            address creator,
            address tokenPayment,
            uint256 entriesSold,
            uint256 cancellingDate,
            CATEGORY category
        )
    {
        RaffleStruct storage raffle = raffles[_raffleId];

        return (
            raffle.endTime,
            raffle.collateralAddress,
            raffle.collateralId,
            raffle.entriesSupply,
            raffle.pricePerEntry,
            raffle.winner,
            raffle.randomNumber,
            raffle.amountRaised,
            raffle.creator,
            raffle.tokenPayment,
            raffle.entriesSold,
            raffle.cancellingDate,
            raffle.category
        );
    }

    function getWinnerAddressFromRandom(
        uint256 _raffleId,
        uint256 _normalizedRandomNumber
    ) public view returns (address) {
        uint256 cumulativeSum = 0;
        address winner;
        EntriesBought[] storage entries = entriesList[_raffleId];
        for (uint256 i = 0; i < entries.length; i++) {
            cumulativeSum += entries[i].currentEntriesLength;
            if (cumulativeSum >= _normalizedRandomNumber) {
                winner = entries[i].player;
                break;
            }
        }
        require(winner != address(0), "Winner not found");
        return winner;
    }

    function safeMultipleTransfersFrom(
        address from,
        address to,
        address[] memory nftAddresses,
        uint256[] memory nftIds,
        uint256[] memory nftAmounts
    ) internal virtual {
        for (uint256 i = 0; i < nftIds.length; i++) {
            safeTransferFrom(
                from,
                to,
                nftAddresses[i],
                nftIds[i],
                nftAmounts[i],
                ""
            );
        }
    }

    function safeTransferFrom(
        address from,
        address to,
        address tokenAddress,
        uint256 tokenId,
        uint256 tokenAmount,
        bytes memory _data
    ) internal virtual {
        if (tokenAmount == 0) {
            IERC721(tokenAddress).safeTransferFrom(from, to, tokenId, _data);
        } else {
            IERC1155(tokenAddress).safeTransferFrom(
                from,
                to,
                tokenId,
                tokenAmount,
                _data
            );
        }
    }

    function requestRandomWords(uint256 _id, uint256 _entriesSold)
        internal
        returns (uint256 requestId)
    {
        requestId = COORDINATOR.requestRandomWords(
            keyHash,
            subscriptionId,
            requestConfirmations,
            callbackGasLimit,
            numWords
        );

        chainlinkRaffleInfo[requestId] = RaffleInfo({
            id: _id,
            size: _entriesSold
        });
        RaffleStruct storage raffle = raffles[_id];
        raffle.status = STATUS.DRAWING;

        emit RequestSent(requestId, numWords);

        return requestId;
    }

    function requestRandomWordsRetry(uint256 _id)
        external
        onlyOwner
        returns (uint256 requestId)
    {
        RaffleStruct storage raffle = raffles[_id];

        requestId = COORDINATOR.requestRandomWords(
            keyHash,
            subscriptionId,
            requestConfirmations,
            callbackGasLimit,
            numWords
        );

        chainlinkRaffleInfo[requestId] = RaffleInfo({
            id: _id,
            size: raffle.entriesSold
        });
        raffle.status = STATUS.DRAWING;

        emit RequestSent(requestId, numWords);

        return requestId;
    }

    function transferNFTsAndFunds(
        uint256 _raffleId,
        uint256 _normalizedRandomNumber
    ) internal nonReentrant {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(raffle.status == STATUS.DRAWING, "Raffle in wrong status");
        raffle.randomNumber = _normalizedRandomNumber;
        raffle.winner = (raffle.amountRaised == 0)
            ? raffle.creator
            : getWinnerAddressFromRandom(_raffleId, _normalizedRandomNumber);

        safeMultipleTransfersFrom(
            address(this),
            raffle.winner,
            raffle.collateralAddress,
            raffle.collateralId,
            raffle.tokenAmount
        );

        uint256 amountForPlatform = (raffle.amountRaised *
            raffle.platformPercentage) / 10000;
        uint256 amountForSeller = raffle.amountRaised - amountForPlatform;

        if (raffle.tokenPayment == address(0)) {
            (bool sent, ) = raffle.creator.call{value: amountForSeller}("");
            require(sent, "Failed to send Eth");

            (bool sent2, ) = platformWallet.call{value: amountForPlatform}("");
            require(sent2, "Failed send Eth to Platform");
        } else {
            IERC20(raffle.tokenPayment).approve(
                address(this),
                raffle.amountRaised
            );
            bool sent = IERC20(raffle.tokenPayment).transferFrom(
                address(this),
                raffle.creator,
                amountForSeller
            );
            require(sent, "Failed to send ERC20 Token");
            bool sent2 = IERC20(raffle.tokenPayment).transferFrom(
                address(this),
                platformWallet,
                amountForPlatform
            );
            require(sent2, "Failed to send ERC20 Token to platform");
        }
        raffle.status = STATUS.DRAWN;

        emit RaffleDrawn(
            _raffleId,
            raffle.winner,
            raffle.amountRaised,
            raffle.randomNumber
        );
    }

    function extractFundsFromContract(uint256 _raffleId)
        external
        payable
        onlyOwner
    {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(raffle.status != STATUS.CREATED, "Raffle in Created status");
        if (raffle.tokenPayment == address(0)) {
            (bool sent, ) = msg.sender.call{value: raffle.amountRaised}("");
            require(sent, "Failed to send Eth");
        } else {
            IERC20(raffle.tokenPayment).approve(
                address(this),
                raffle.amountRaised
            );

            bool sent = IERC20(raffle.tokenPayment).transferFrom(
                address(this),
                msg.sender,
                raffle.amountRaised
            );
            require(sent, "Failed to send ERC20 Token");
        }
    }

    function fulfillRandomWords(
        uint256 _requestId,
        uint256[] memory _randomWords
    ) internal override {
        uint256 normalizedRandomNumber = (_randomWords[0] %
            chainlinkRaffleInfo[_requestId].size) + 1;
        RaffleStruct storage raffle = raffles[
            chainlinkRaffleInfo[_requestId].id
        ];

        raffle.randomNumber = normalizedRandomNumber;

        RandomResult memory result = RandomResult({
            randomNumber: _randomWords[0],
            nomalizedRandomNumber: normalizedRandomNumber
        });

        requests[chainlinkRaffleInfo[_requestId].id] = result;

        emit RequestFulfilled(
            _requestId,
            normalizedRandomNumber,
            chainlinkRaffleInfo[_requestId].id
        );
        transferNFTsAndFunds(
            chainlinkRaffleInfo[_requestId].id,
            normalizedRandomNumber
        );
    }

    function setWinnerRaffle(uint256 _raffleId) external nonReentrant {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(
            raffle.creator == msg.sender ||
                hasRole(OPERATOR_ROLE, msg.sender) ||
                hasRole(MODERATOR_ROLE, msg.sender),
            "Not raffle creator or Operator."
        );
        require(raffle.status == STATUS.CREATED, "Raffle in wrong status");

        require(
            raffle.endTime <= getCurrentTime() ||
                raffle.entriesSold == raffle.entriesSupply,
            "Raffle still opened or not sold out"
        );
        raffle.status = STATUS.PENDING_DRAW;

        requestRandomWords(_raffleId, raffle.entriesSold);
        emit SetWinnerTriggered(_raffleId, raffle.amountRaised);
    }

    function cancelRaffle(uint256 _raffleId) external payable nonReentrant {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(
            raffle.creator == msg.sender || hasRole(OPERATOR_ROLE, msg.sender),
            "Not raffle creator or Operator."
        );
        require(
            raffle.endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        if (!hasRole(OPERATOR_ROLE, msg.sender) || !Subscribers[msg.sender]) {
            require(
                msg.value == CANCELATION_RAFFLE_FEE,
                "Not cancelation fee value."
            );
        }

        require(raffle.status == STATUS.CREATED, "Wrong status");
        require(
            raffle.entries.length <= 200,
            "Not cancelation when it's more than 200 entries sold."
        );
        if (raffle.entries.length > 0) {
            for (uint256 i = 0; i < raffle.entries.length; i++) {
                uint256 entry = raffle.entries[i];
                address entryOwner = entryToOwner[_raffleId][entry];

                if (entryOwner != address(0)) {
                    if (raffle.tokenPayment == address(0)) {
                        payable(entryOwner).transfer(raffle.pricePerEntry);
                    } else {
                        IERC20(raffle.tokenPayment).approve(
                            address(this),
                            raffle.amountRaised
                        );

                        IERC20(raffle.tokenPayment).transferFrom(
                            address(this),
                            entryOwner,
                            raffle.pricePerEntry
                        );
                    }
                }
            }
        }

        safeMultipleTransfersFrom(
            address(this),
            raffle.creator,
            raffle.collateralAddress,
            raffle.collateralId,
            raffle.tokenAmount
        );

        raffle.status = STATUS.CANCELLED;
        raffle.cancellingDate = block.timestamp;

        emit RaffleCancelled(_raffleId, raffle.amountRaised);
    }

    function getEntriesBought(uint256 _raffleId)
        public
        view
        returns (EntriesBought[] memory)
    {
        return entriesList[_raffleId];
    }

    function getEntriessSold(uint256 _raffleId) public view returns (uint256) {
        return entriesList[_raffleId].length;
    }

    function getRafflesLength() external view returns (uint256) {
        return raffles.length;
    }

    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    function hasRole(bytes32 role, address account)
        public
        view
        virtual
        returns (bool)
    {
        return _roles[role].members[account];
    }

    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    function grantRole(bytes32 role, address account)
        public
        virtual
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        _grantRole(role, account);
    }

    function revokeRole(bytes32 role, address account)
        public
        virtual
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        _revokeRole(role, account);
    }

    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
        }
    }

    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
        }
    }
}

File 2 of 20 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 20 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

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

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

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

  function increaseApproval(address spender, uint256 subtractedValue) external;

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

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

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

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

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

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

File 6 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

File 7 of 20 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 8 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 9 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 10 of 20 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

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

File 11 of 20 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

File 12 of 20 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 13 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 14 of 20 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 15 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 16 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 17 of 20 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

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

File 19 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 20 of 20 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddedTokenPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_rafflesnumber","type":"uint256"}],"name":"CollectionWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"currentSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberEntries","type":"uint256"}],"name":"EntryBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"buyer","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentSize","type":"uint256"}],"name":"FreeEntry","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"GotSubscription","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"}],"name":"RaffleCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nftAddress","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"nftId","type":"uint256[]"}],"name":"RaffleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RaffleDrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"RequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"numWords","type":"uint32"}],"name":"RequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"}],"name":"SetWinnerTriggered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"UserBlacklisted","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"BlacklistAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"BlacklistNFTs","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CANCELATION_RAFFLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_HOLDERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_HOLDERS_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_SUBSCRIBERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_SUBSCRIBERS_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"ChangeCancellationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"ChangeKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_subscriptionfee","type":"uint256"}],"name":"ChangeSubscriptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_id","type":"uint64"}],"name":"ChangeSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rafflefee","type":"uint256"}],"name":"ChangeUserHolderCreateRaffleFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rafflefee","type":"uint256"}],"name":"ChangeUserHolderCreateRaffleFeeDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_number","type":"uint32"}],"name":"ChangecallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"DiscountTokenPayments","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOLDER_CREATE_RAFFLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOLDER_CREATE_RAFFLE_FEE_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MODERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"RemoveSubscriptionTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"SUBSCRIPTION_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"Subscribers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TokenPaymentAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isAdded","type":"bool"}],"name":"addDiscountTokenPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isAdded","type":"bool"}],"name":"addTokenPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isBlacklist","type":"bool"}],"name":"blacklistAddressOrNot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionaddress","type":"address"},{"internalType":"uint256","name":"_tokenid","type":"uint256"},{"internalType":"bool","name":"_isBlacklist","type":"bool"}],"name":"blacklistNFTCreateRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_numberEntries","type":"uint256"}],"name":"buyEntry","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"cancelRaffle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"chainlinkRaffleInfo","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"}],"name":"changePlatformWalletAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createEnabledHolders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createEnabledSubscribers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"createRaffleCollection","type":"address"},{"internalType":"uint256","name":"createRaffleTokenId","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"}],"name":"createRaffleHolder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"}],"name":"createRaffleOperator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"}],"name":"createRaffleSubscriber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"entriesList","outputs":[{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"address","name":"player","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"entryToOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"extractFundsFromContract","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getCurrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"getEntriesBought","outputs":[{"components":[{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"address","name":"player","type":"address"}],"internalType":"struct Rafldex.EntriesBought[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"getEntriessSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"getRaffleData","outputs":[{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address[]","name":"collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"collateralId","type":"uint256[]"},{"internalType":"uint256","name":"entriesSupply","type":"uint256"},{"internalType":"uint256","name":"pricePerEntry","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"uint256","name":"amountRaised","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"tokenPayment","type":"address"},{"internalType":"uint256","name":"entriesSold","type":"uint256"},{"internalType":"uint256","name":"cancellingDate","type":"uint256"},{"internalType":"enum Rafldex.CATEGORY","name":"category","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRafflesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubscription","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_normalizedRandomNumber","type":"uint256"}],"name":"getWinnerAddressFromRandom","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_numberEntriesPerUser","type":"uint256"},{"internalType":"address[]","name":"_freePlayers","type":"address[]"}],"name":"giveBatchEntriesForFree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"giveSubscriptionTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numberRafflesMonthCollection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionaddress","type":"address"},{"internalType":"uint256","name":"_tokenid","type":"uint256"}],"name":"numberRafflesRemainingPerNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"raffleCreationData","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"countRaffles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"raffles","outputs":[{"internalType":"enum Rafldex.STATUS","name":"status","type":"uint8"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"entriesSupply","type":"uint256"},{"internalType":"uint256","name":"pricePerEntry","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"uint256","name":"amountRaised","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"platformPercentage","type":"uint256"},{"internalType":"address","name":"tokenPayment","type":"address"},{"internalType":"uint256","name":"entriesSold","type":"uint256"},{"internalType":"uint256","name":"cancellingDate","type":"uint256"},{"internalType":"enum Rafldex.CATEGORY","name":"category","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"requestRandomWordsRetry","outputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requests","outputs":[{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"uint256","name":"nomalizedRandomNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_rafflesnumber","type":"uint256"}],"name":"setNumberRafflesCollectionWhitelistedPerMonth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setWinnerRaffle","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":[],"name":"toggleCreateHoldersEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleCreateSubscribersEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040527f9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805600455600580546b032a00000001000f424000036001600160901b0319909116179055600d80546001600160a01b03191673b6a832c5ad60619d3d77afe26d79b0b518e6930a179055662386f26fc10000600e556611c37937e08000600f5566470de4df8200006010556706f05b59d3b200006011556101f460125561015e601355609660145561012c601555601b805461ffff19169055348015620000ca57600080fd5b5073271682deb8c4e0901d1a1550ad2e64d568e69909620000eb3362000182565b600180556001600160a01b0316608052600280546001600160a01b031990811673271682deb8c4e0901d1a1550ad2e64d568e69909179091556003805490911673514910771af9ca656af840dff83e8264ecf986ca1790556200016f7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c33620001d2565b6200017c600033620001d2565b6200023e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001de8282620001e2565b5050565b6000828152601c602090815260408083206001600160a01b038516845290915290205460ff16620001de576000828152601c602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b608051615eae620002616000396000818161145401526114960152615eae6000f3fe6080604052600436106104055760003560e01c806388ec392c11610213578063c309b4d411610123578063dadc9b40116100ab578063f2fde38b1161007a578063f2fde38b14610d48578063f369145514610d68578063f5b541a614610d88578063f860cec514610daa578063ff0b906c14610dbf57600080fd5b8063dadc9b4014610cc6578063dd59e92c14610ce6578063e096839b14610d06578063f23a6e6114610d1c57600080fd5b8063d0038ff4116100f2578063d0038ff414610c40578063d3c4d66414610c5a578063d547741f14610c70578063d703ece814610c90578063d85436cc14610ca657600080fd5b8063c309b4d414610ba0578063c402c2ba14610be1578063cb77c14714610bf7578063cf7874a314610c0c57600080fd5b80639ff17fa7116101a6578063af8376de11610175578063af8376de14610afe578063b154003714610b1e578063b66163a914610b3e578063bc0618c314610b5e578063bc197c8114610b7457600080fd5b80639ff17fa714610a89578063a217fddf14610a9c578063aaced47014610ab1578063acbb4eff14610ade57600080fd5b80638fa8a598116101e25780638fa8a59814610a1657806391d1485414610a295780639b479ad314610a495780639dde45da14610a6957600080fd5b806388ec392c1461098f5780638ce3afa7146109af5780638da5cb5b146109c45780638dfc13b6146109f657600080fd5b806346988a40116103195780636cc735d5116102a1578063719c0a1311610270578063719c0a13146108a6578063783e6477146108c6578063797669c9146108f357806381d12c581461092757806388aaf2a91461097057600080fd5b80636cc735d51461082b5780636e650b261461085b5780636fd969031461087b578063715018a61461089157600080fd5b80635d4bc0ce116102e85780635d4bc0ce146107795780635fba3171146107b257806369f26fb0146107c55780636a890cb2146107e55780636bf3f8f6146107fb57600080fd5b806346988a40146106f357806349dd5121146107135780634c72e770146107435780634c86bca11461076357600080fd5b8063295f0d8c1161039c578063308abb091161036b578063308abb09146105e6578063365e36581461061657806339a48216146106435780633fd59149146106635780634169933f1461069c57600080fd5b8063295f0d8c1461057357806329cb924d1461059357806329dd67f9146105a65780632f2ff15d146105c657600080fd5b80631fe543e3116103d85780631fe543e3146104ee57806320c741b31461051057806321f4bd6114610530578063236854961461056057600080fd5b8063013805c51461040a57806301ffc9a71461044c5780630a51d65f1461047c578063150b7a02146104aa575b600080fd5b34801561041657600080fd5b5061042a61042536600461504a565b610dc7565b604080519283526001600160a01b039091166020830152015b60405180910390f35b34801561045857600080fd5b5061046c61046736600461506c565b610e0c565b6040519015158152602001610443565b34801561048857600080fd5b5061049c6104973660046151ee565b610e43565b604051908152602001610443565b3480156104b657600080fd5b506104d56104c5366004615315565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610443565b3480156104fa57600080fd5b5061050e610509366004615380565b611449565b005b34801561051c57600080fd5b5061050e61052b3660046153d4565b6114d1565b34801561053c57600080fd5b5061046c61054b36600461540d565b60196020526000908152604090205460ff1681565b61050e61056e36600461504a565b611518565b34801561057f57600080fd5b5061050e61058e3660046153d4565b611a8d565b34801561059f57600080fd5b504261049c565b3480156105b257600080fd5b5061050e6105c136600461542a565b611b19565b3480156105d257600080fd5b5061050e6105e1366004615443565b611b3a565b3480156105f257600080fd5b5061046c61060136600461540d565b60176020526000908152604090205460ff1681565b34801561062257600080fd5b5061063661063136600461542a565b611b5e565b6040516104439190615468565b34801561064f57600080fd5b5061050e61065e36600461540d565b611be6565b34801561066f57600080fd5b5061068361067e36600461542a565b611c5c565b6040516104439d9c9b9a9998979695949392919061555e565b3480156106a857600080fd5b506106d86106b736600461542a565b600b6020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610443565b3480156106ff57600080fd5b5061049c61070e3660046155f6565b611df4565b34801561071f57600080fd5b5061046c61072e36600461542a565b60186020526000908152604090205460ff1681565b34801561074f57600080fd5b5061050e61075e36600461542a565b611e7b565b34801561076f57600080fd5b5061049c600e5481565b34801561078557600080fd5b5061079961079436600461542a565b611e9c565b6040516104439d9c9b9a99989796959493929190615622565b61050e6107c036600461542a565b611f2a565b3480156107d157600080fd5b5061050e6107e036600461540d565b61248f565b3480156107f157600080fd5b5061049c60115481565b34801561080757600080fd5b5061046c61081636600461540d565b601a6020526000908152604090205460ff1681565b34801561083757600080fd5b5061046c61084636600461540d565b60166020526000908152604090205460ff1681565b34801561086757600080fd5b5061050e61087636600461540d565b6124b9565b34801561088757600080fd5b5061049c60155481565b34801561089d57600080fd5b5061050e6124f6565b3480156108b257600080fd5b5061049c6108c136600461542a565b61250a565b3480156108d257600080fd5b5061049c6108e136600461542a565b60009081526008602052604090205490565b3480156108ff57600080fd5b5061049c7f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa81565b34801561093357600080fd5b5061095b61094236600461542a565b6006602052600090815260409020805460019091015482565b60408051928352602083019190915201610443565b34801561097c57600080fd5b50601b5461046c90610100900460ff1681565b34801561099b57600080fd5b5061050e6109aa36600461542a565b612684565b3480156109bb57600080fd5b50600a5461049c565b3480156109d057600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610443565b348015610a0257600080fd5b5061050e610a113660046156b4565b612881565b61049c610a243660046156da565b6128c1565b348015610a3557600080fd5b5061046c610a44366004615443565b61316c565b348015610a5557600080fd5b5061050e610a643660046157aa565b613197565b348015610a7557600080fd5b5061050e610a843660046157f9565b613527565b61050e610a9736600461542a565b613570565b348015610aa857600080fd5b5061049c600081565b348015610abd57600080fd5b5061049c610acc36600461540d565b600c6020526000908152604090205481565b348015610aea57600080fd5b5061050e610af936600461542a565b6137ee565b348015610b0a57600080fd5b5061050e610b1936600461542a565b61380f565b348015610b2a57600080fd5b5061050e610b39366004615822565b613830565b348015610b4a57600080fd5b5061050e610b5936600461542a565b6138a4565b348015610b6a57600080fd5b5061049c60135481565b348015610b8057600080fd5b506104d5610b8f366004615864565b63bc197c8160e01b95945050505050565b348015610bac57600080fd5b506109de610bbb36600461504a565b60096020908152600092835260408084209091529082529020546001600160a01b031681565b348015610bed57600080fd5b5061049c60105481565b348015610c0357600080fd5b5061050e6138c5565b348015610c1857600080fd5b5061095b610c2736600461542a565b6007602052600090815260409020805460019091015482565b348015610c4c57600080fd5b50601b5461046c9060ff1681565b348015610c6657600080fd5b5061049c60125481565b348015610c7c57600080fd5b5061050e610c8b366004615443565b6138fe565b348015610c9c57600080fd5b5061049c60145481565b348015610cb257600080fd5b5061049c610cc13660046151ee565b613922565b348015610cd257600080fd5b5061050e610ce13660046153d4565b613e79565b348015610cf257600080fd5b5061050e610d013660046155f6565b613efa565b348015610d1257600080fd5b5061049c600f5481565b348015610d2857600080fd5b506104d5610d37366004615911565b63f23a6e6160e01b95945050505050565b348015610d5457600080fd5b5061050e610d6336600461540d565b613f65565b348015610d7457600080fd5b506109de610d8336600461504a565b613fdb565b348015610d9457600080fd5b5061049c600080516020615e5983398151915281565b348015610db657600080fd5b5061050e6140cb565b61050e6140fb565b60086020528160005260406000208181548110610de357600080fd5b6000918252602090912060029091020180546001909101549092506001600160a01b0316905082565b60006001600160e01b03198216630271189760e51b1480610e3d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b3360009081526017602052604081205460ff1615610e7c5760405162461bcd60e51b8152600401610e7390615979565b60405180910390fd5b601b54610100900460ff16610ee35760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610e73565b3360009081526016602052604090205460ff16610f525760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610e73565b428811610f715760405162461bcd60e51b8152600401610e73906159bf565b8551875114610f925760405162461bcd60e51b8152600401610e7390615a03565b8451875114610fb35760405162461bcd60e51b8152600401610e7390615a58565b60008211610fd35760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b0384161561101a576001600160a01b03841660009081526019602052604090205460ff1661101a5760405162461bcd60e51b8152600401610e7390615acc565b60005b875181101561115a5760006001600160a01b031688828151811061104357611043615b03565b60200260200101516001600160a01b0316036110715760405162461bcd60e51b8152600401610e7390615b19565b600088828151811061108557611085615b03565b60200260200101519050806001600160a01b0316636352211e8984815181106110b0576110b0615b03565b60200260200101516040518263ffffffff1660e01b81526004016110d691815260200190565b602060405180830381865afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190615b3e565b6001600160a01b0316336001600160a01b0316146111475760405162461bcd60e51b8152600401610e7390615b5b565b508061115281615ba6565b91505061101d565b506001600160a01b0384166000908152601a602052604081205460ff1615611185575060145461118a565b506015545b61119733308a8a8a6141e2565b6040805161022081018252600080825260208083018d90528284018c9052606083018b9052608083018a905260a0830187905283518281529081019093529160c0820190815260200186815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001838152602001876001600160a01b0316815260200160008152602001600081526020016000600281111561124957611249615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff1916908360048111156112a7576112a7615534565b02179055506020828101516001830155604083015180516112ce9260028501920190614f95565b50606082015180516112ea916003840191602090910190614ffa565b5060808201518051611306916004840191602090910190614ffa565b5060a0820151600582015560c0820151805161132c916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff191660018360028111156113e6576113e6615534565b021790555050600a54600091506113ff90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48b8b604051611433929190615bd2565b60405180910390a29a9950505050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114c35760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610e73565b6114cd8282614270565b5050565b600080516020615e59833981519152336114eb82826143ae565b50506001600160a01b03919091166000908152601a60205260409020805460ff1916911515919091179055565b6000600a838154811061152d5761152d615b03565b906000526020600020906011020190506115444290565b81600101541161158e5760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610e73565b6000815460ff1660048111156115a6576115a6615534565b146115ee5760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610e73565b6000821161163e5760405162461bcd60e51b815260206004820152601960248201527f4e756d62657220656e74726965732063616e27742062652030000000000000006044820152606401610e73565b600a838154811061165157611651615b03565b9060005260206000209060110201600501548282600e01546116739190615c00565b11156116c15760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610e73565b600d8101546001600160a01b0316611768578181600701546116e39190615c13565b3410156117495760405162461bcd60e51b815260206004820152602e60248201527f6d73672e76616c7565206d75737420626520657175616c206f72206d6f72652060448201526d7468616e2074686520707269636560901b6064820152608401610e73565b3481600a01600082825461175d9190615c00565b909155506119109050565b8181600701546117789190615c13565b600d8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e69190615c2a565b101561185a5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610e73565b600d81015460078201546001600160a01b03909116906323b872dd9033903090611885908790615c13565b6040518463ffffffff1660e01b81526004016118a393929190615c43565b6020604051808303816000875af11580156118c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e69190615c67565b508181600701546118f79190615c13565b81600a01600082825461190a9190615c00565b90915550505b600060405180604001604052808484600e015461192d9190615c00565b81523360209182015260008681526008825260408120805460018082018355918352838320855160029092020190815592840151920180546001600160a01b0319166001600160a01b03909316929092179091559091505b838110156119fd5760008184600e015460016119a19190615c00565b6119ab9190615c00565b600685018054600181018255600091825260208083209091018390558882526009815260408083209383529290522080546001600160a01b0319163317905550806119f581615ba6565b915050611985565b508282600e0154611a0e9190615c00565b82600e0181905550336001600160a01b0316847f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654600a8781548110611a5557611a55615b03565b9060005260206000209060110201600e015486604051611a7f929190918252602082015260400190565b60405180910390a350505050565b600080516020615e5983398151915233611aa782826143ae565b6001600160a01b0384166000908152601760205260409020805460ff1916841515908117909155600103611b13576040516001600160a01b03851681527f7f8b7dc89dae85811a7a85800b892b5816ad5d381c856f1b56490f8fc470c9cb906020015b60405180910390a15b50505050565b600080516020615e5983398151915233611b3382826143ae565b5050600455565b600080516020615e5983398151915233611b5482826143ae565b611b138484614407565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611bdb5760008481526020908190206040805180820190915260028502909101805482526001908101546001600160a01b0316828401529083529092019101611b93565b505050509050919050565b600080516020615e5983398151915233611c0082826143ae565b6001600160a01b038316600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1505050565b60006060806000806000806000806000806000806000600a8f81548110611c8557611c85615b03565b9060005260206000209060110201905080600101548160020182600301836005015484600701548560080160009054906101000a90046001600160a01b0316866009015487600a015488600b0160009054906101000a90046001600160a01b031689600d0160009054906101000a90046001600160a01b03168a600e01548b600f01548c60100160009054906101000a900460ff168b805480602002602001604051908101604052809291908181526020018280548015611d6f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611d51575b50505050509b508a805480602002602001604051908101604052809291908181526020018280548015611dc157602002820191906000526020600020905b815481526020019060010190808311611dad575b50505050509a509d509d509d509d509d509d509d509d509d509d509d509d509d505091939597999b9d90929496989a9c50565b6001600160a01b0382166000908152600c6020526040812054819015611e7457604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600b845284812060020154928152600c9093529290912054611e709190615bbf565b9150505b9392505050565b600080516020615e5983398151915233611e9582826143ae565b5050600e55565b600a8181548110611eac57600080fd5b60009182526020909120601190910201805460018201546005830154600784015460088501546009860154600a870154600b880154600c890154600d8a0154600e8b0154600f8c01546010909c015460ff9b8c169d50999b989a97996001600160a01b0397881699969895979485169693959290941693909291168d565b611f32614446565b6000600a8281548110611f4757611f47615b03565b60009182526020909120600b601190920201908101549091506001600160a01b0316331480611f895750611f89600080516020615e598339815191523361316c565b611fd55760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610e73565b42816001015411611ff85760405162461bcd60e51b8152600401610e73906159bf565b612010600080516020615e598339815191523361316c565b158061202c57503360009081526016602052604090205460ff16155b156120825760105434146120825760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610e73565b6000815460ff16600481111561209a5761209a615534565b146120d65760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610e73565b600681015460c810156121495760405162461bcd60e51b815260206004820152603560248201527f4e6f742063616e63656c6174696f6e207768656e2069742773206d6f726520746044820152743430b7101918181032b73a3934b2b99039b7b6321760591b6064820152608401610e73565b6006810154156123125760005b600682015481101561231057600082600601828154811061217957612179615b03565b60009182526020808320909101548683526009825260408084208285529092529120549091506001600160a01b031680156122fb57600d8401546001600160a01b03166121ff5760078401546040516001600160a01b0383169180156108fc02916000818181858888f193505050501580156121f9573d6000803e3d6000fd5b506122fb565b600d840154600a85015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c9190615c67565b50600d84015460078501546040516323b872dd60e01b81526001600160a01b03909216916323b872dd916122b69130918691600401615c43565b6020604051808303816000875af11580156122d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f99190615c67565b505b5050808061230890615ba6565b915050612156565b505b6124363082600b0160009054906101000a90046001600160a01b03168360020180548060200260200160405190810160405280929190818152602001828054801561238657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612368575b5050505050846003018054806020026020016040519081016040528092919081815260200182805480156123d957602002820191906000526020600020905b8154815260200190600101908083116123c5575b50505050508560040180548060200260200160405190810160405280929190818152602001828054801561242c57602002820191906000526020600020905b815481526020019060010190808311612418575b50505050506141e2565b805460ff1916600417815542600f820155600a81015460405190815282907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a25061248c60018055565b50565b61249761449f565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615e59833981519152336124d382826143ae565b50506001600160a01b03166000908152601660205260409020805460ff19169055565b6124fe61449f565b61250860006144f9565b565b600061251461449f565b6000600a838154811061252957612529615b03565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601190930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156125cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f09190615c2a565b604080518082018252858152600e8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529193507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505b919050565b61268c614446565b6000600a82815481106126a1576126a1615b03565b60009182526020909120600b601190920201908101549091506001600160a01b03163314806126e357506126e3600080516020615e598339815191523361316c565b8061271357506127137f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa3361316c565b61275f5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610e73565b6000815460ff16600481111561277757612777615534565b146127bd5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610e73565b4281600101541115806127d75750806005015481600e0154145b61282f5760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610e73565b805460ff19166001178155600e81015461284a908390614549565b50817ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882600a015460405161247a91815260200190565b600080516020615e598339815191523361289b82826143ae565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b601b5460009060ff166129215760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610e73565b3360009081526017602052604090205460ff16156129515760405162461bcd60e51b8152600401610e7390615979565b4288116129705760405162461bcd60e51b8152600401610e73906159bf565b85518751146129915760405162461bcd60e51b8152600401610e7390615a03565b84518751146129b25760405162461bcd60e51b8152600401610e7390615a58565b600082116129d25760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b03841615612a19576001600160a01b03841660009081526019602052604090205460ff16612a195760405162461bcd60e51b8152600401610e7390615acc565b60005b8751811015612b595760006001600160a01b0316888281518110612a4257612a42615b03565b60200260200101516001600160a01b031603612a705760405162461bcd60e51b8152600401610e7390615b19565b6000888281518110612a8457612a84615b03565b60200260200101519050806001600160a01b0316636352211e898481518110612aaf57612aaf615b03565b60200260200101516040518263ffffffff1660e01b8152600401612ad591815260200190565b602060405180830381865afa158015612af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b169190615b3e565b6001600160a01b0316336001600160a01b031614612b465760405162461bcd60e51b8152600401610e7390615b5b565b5080612b5181615ba6565b915050612a1c565b506001600160a01b0384166000908152601a602052604081205460ff1615612bce57600f543414612bc55760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b6044820152606401610e73565b50601354612c1d565b600e543414612c185760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b6044820152606401610e73565b506012545b6040516331a9108f60e11b8152600481018b90528b9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8a9190615b3e565b6001600160a01b031614612ce05760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610e73565b604080516001600160a01b038e1660208201529081018c905260009060600160408051601f1981840301815291815281516020928301206000818152601890935291205490915060ff1615612d835760405162461bcd60e51b8152602060048201526024808201527f4e465420746f2063726561746520726166666c6520697320626c61636b6c69736044820152633a32b21760e11b6064820152608401610e73565b426000828152600b60205260409020600101541115612e35576000612da88e8e611df4565b11612e0e5760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610e73565b6000818152600b60205260408120600201805491612e2b83615ba6565b9190505550612e6f565b426000828152600b602052604090205542612e539062278d00615c00565b6000828152600b60205260409020600180820192909255600201555b612e7c33308c8c8c6141e2565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015612eb5573d6000803e3d6000fd5b506040805161022081018252600080825260208083018f90528284018e9052606083018d9052608083018c905260a0830189905283518281529081019093529160c0820190815260200188815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001858152602001896001600160a01b03168152602001600081526020016000815260200160006002811115612f6857612f68615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff191690836004811115612fc657612fc6615534565b0217905550602082810151600183015560408301518051612fed9260028501920190614f95565b5060608201518051613009916003840191602090910190614ffa565b5060808201518051613025916004840191602090910190614ffa565b5060a0820151600582015560c0820151805161304b916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff1916600183600281111561310557613105615534565b021790555050600a546000915061311e90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613152929190615bd2565b60405180910390a29e9d5050505050505050505050505050565b6000918252601c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61319f614446565b600080516020615e59833981519152336131b982826143ae565b6000600a86815481106131ce576131ce615b03565b600091825260209091206011909102015460ff1660048111156131f3576131f3615534565b1461323b5760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610e73565b6000600a868154811061325057613250615b03565b600091825260209091206010601190920201015460ff16600281111561327857613278615534565b146132d15760405162461bcd60e51b815260206004820152602360248201527f526166666c65206973206e6f7420696e204f50455241544f522063617465676f604482015262393c9760e91b6064820152608401610e73565b8251600a8054879081106132e7576132e7615b03565b90600052602060002090601102016005015481866133059190615c13565b11156133715760405162461bcd60e51b815260206004820152603560248201527f46726565207469636b657473206e65656420746f206265206c65737320746861604482015274371036b0bc1032b73a3934b2b99039bab838363c9760591b6064820152608401610e73565b6000805b8281101561345c57600086828151811061339157613391615b03565b60200260200101519050600060405180604001604052808a85600a8e815481106133bd576133bd615b03565b9060005260206000209060110201600e01546133d99190615c00565b6133e39190615c00565b81526001600160a01b0384811660209283015260008d8152600883526040812080546001808201835591835291849020855160029093020191825592840151920180546001600160a01b03191692909116919091179055905061344584615ba6565b93505050808061345490615ba6565b915050613375565b5080600a888154811061347157613471615b03565b9060005260206000209060110201600e015461348d9190615c00565b600a88815481106134a0576134a0615b03565b9060005260206000209060110201600e0181905550867f4da4f5fab0816c65315b6f5d15f879f96b98661133d7b3787788f291367604fb8684600a8b815481106134ec576134ec615b03565b9060005260206000209060110201600e015460405161350d93929190615c84565b60405180910390a25050505061352260018055565b505050565b600080516020615e598339815191523361354182826143ae565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b61357861449f565b6000600a828154811061358d5761358d615b03565b6000918252602082206011909102019150815460ff1660048111156135b4576135b4615534565b036136015760405162461bcd60e51b815260206004820152601860248201527f526166666c6520696e20437265617465642073746174757300000000000000006044820152606401610e73565b600d8101546001600160a01b03166136a357600a81015460405160009133918381818185875af1925050503d8060008114613658576040519150601f19603f3d011682016040523d82523d6000602084013e61365d565b606091505b50509050806135225760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610e73565b600d810154600a82015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af11580156136fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137209190615c67565b50600d810154600a8201546040516323b872dd60e01b81526000926001600160a01b0316916323b872dd9161375c913091339190600401615c43565b6020604051808303816000875af115801561377b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061379f9190615c67565b9050806135225760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610e73565b600080516020615e598339815191523361380882826143ae565b5050600f55565b600080516020615e598339815191523361382982826143ae565b5050601055565b600080516020615e598339815191523361384a82826143ae565b604080516001600160a01b038716602082015290810185905260009060600160408051808303601f190181529181528151602092830120600090815260189092529020805460ff1916941515949094179093555050505050565b600080516020615e59833981519152336138be82826143ae565b5050601155565b600080516020615e59833981519152336138df82826143ae565b5050601b805461ff001981166101009182900460ff1615909102179055565b600080516020615e598339815191523361391882826143ae565b611b1384846146ba565b6000600080516020615e598339815191523361393e82826143ae565b3360009081526017602052604090205460ff161561396e5760405162461bcd60e51b8152600401610e7390615979565b428a1161398d5760405162461bcd60e51b8152600401610e73906159bf565b87518951146139ed5760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610e73565b8651895114613a0e5760405162461bcd60e51b8152600401610e7390615a58565b60008411613a2e5760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b03861615613a75576001600160a01b03861660009081526019602052604090205460ff16613a755760405162461bcd60e51b8152600401610e7390615acc565b60005b8951811015613bb55760006001600160a01b03168a8281518110613a9e57613a9e615b03565b60200260200101516001600160a01b031603613acc5760405162461bcd60e51b8152600401610e7390615b19565b60008a8281518110613ae057613ae0615b03565b60200260200101519050806001600160a01b0316636352211e8b8481518110613b0b57613b0b615b03565b60200260200101516040518263ffffffff1660e01b8152600401613b3191815260200190565b602060405180830381865afa158015613b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b729190615b3e565b6001600160a01b0316336001600160a01b031614613ba25760405162461bcd60e51b8152600401610e7390615b5b565b5080613bad81615ba6565b915050613a78565b506000613bc533308c8c8c6141e2565b6040805161022081018252600080825260208083018f90528284018e9052606083018d9052608083018c905260a0830189905283518281529081019093529160c0820190815260200188815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001838152602001896001600160a01b03168152602001600081526020016000815260200160006002811115613c7757613c77615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff191690836004811115613cd557613cd5615534565b0217905550602082810151600183015560408301518051613cfc9260028501920190614f95565b5060608201518051613d18916003840191602090910190614ffa565b5060808201518051613d34916004840191602090910190614ffa565b5060a0820151600582015560c08201518051613d5a916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff19166001836002811115613e1457613e14615534565b021790555050600a5460009150613e2d90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613e61929190615bd2565b60405180910390a29c9b505050505050505050505050565b600080516020615e5983398151915233613e9382826143ae565b6001600160a01b0384166000908152601960205260409020805460ff1916841515908117909155600103611b13576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c73390602001611b0a565b600080516020615e5983398151915233613f1482826143ae565b6001600160a01b0384166000818152600c6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d9101611b0a565b613f6d61449f565b6001600160a01b038116613fd25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e73565b61248c816144f9565b600082815260086020526040812081908190815b81548110156140785781818154811061400a5761400a615b03565b906000526020600020906002020160000154846140279190615c00565b93508584106140665781818154811061404257614042615b03565b60009182526020909120600160029092020101546001600160a01b03169250614078565b8061407081615ba6565b915050613fef565b506001600160a01b0382166140c25760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610e73565b50949350505050565b600080516020615e59833981519152336140e582826143ae565b5050601b805460ff19811660ff90911615179055565b60115434146141585760405162461bcd60e51b8152602060048201526024808201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706044820152637269636560e01b6064820152608401610e73565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015614191573d6000803e3d6000fd5b5033600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b60005b825181101561426857614256868686848151811061420557614205615b03565b602002602001015186858151811061421f5761421f615b03565b602002602001015186868151811061423957614239615b03565b6020026020010151604051806020016040528060008152506146f7565b8061426081615ba6565b9150506141e5565b505050505050565b60008281526007602052604081206001015482518390839061429457614294615b03565b60200260200101516142a69190615cbf565b6142b1906001615c00565b600084815260076020526040812054600a8054939450919281106142d7576142d7615b03565b90600052602060002090601102019050818160090181905550600060405180604001604052808560008151811061431057614310615b03565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a26000858152600760205260409020546143a790846147d6565b5050505050565b6143b8828261316c565b6114cd576143c581614de8565b6143d0836020614dfa565b6040516020016143e1929190615cf7565b60408051601f198184030181529082905262461bcd60e51b8252610e7391600401615d98565b614411828261316c565b6114cd576000828152601c602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6002600154036144985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e73565b6002600155565b6000546001600160a01b031633146125085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e73565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156145db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145ff9190615c2a565b604080518082018252858152602080820186815260008581526007909252928120915182559151600190910155600a805492935090918590811061464557614645615b03565b600091825260209091206011909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6146c4828261316c565b156114cd576000828152601c602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b8160000361476857604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614731908990899088908790600401615dab565b600060405180830381600087803b15801561474b57600080fd5b505af115801561475f573d6000803e3d6000fd5b50505050614268565b604051637921219560e11b81526001600160a01b0385169063f242432a9061479c9089908990889088908890600401615de8565b600060405180830381600087803b1580156147b657600080fd5b505af11580156147ca573d6000803e3d6000fd5b50505050505050505050565b6147de614446565b6000600a83815481106147f3576147f3615b03565b6000918252602090912060119091020190506002815460ff16600481111561481d5761481d615534565b146148635760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610e73565b60098101829055600a810154156148835761487e8383613fdb565b614892565b600b8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b03929092169182179055600282018054604080516020808402820181019092528281526149bc94309490939192909190830182828015612386576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311612368575050505050846003018054806020026020016040519081016040528092919081815260200182805480156123d957602002820191906000526020600020908154815260200190600101908083116123c55750505050508560040180548060200260200160405190810160405280929190818152602001828054801561242c57602002820191906000526020600020908154815260200190600101908083116124185750505050506141e2565b600061271082600c015483600a01546149d59190615c13565b6149df9190615e2d565b905060008183600a01546149f39190615bbf565b600d8401549091506001600160a01b0316614b4c57600b8301546040516000916001600160a01b03169083908381818185875af1925050503d8060008114614a57576040519150601f19603f3d011682016040523d82523d6000602084013e614a5c565b606091505b5050905080614aa25760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610e73565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614aef576040519150601f19603f3d011682016040523d82523d6000602084013e614af4565b606091505b5050905080614b455760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610e73565b5050614d7a565b600d830154600a84015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bc99190615c67565b50600d830154600b8401546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614c0892309216908790600401615c43565b6020604051808303816000875af1158015614c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c4b9190615c67565b905080614c9a5760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610e73565b600d8085015490546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614cd692309216908990600401615c43565b6020604051808303816000875af1158015614cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d199190615c67565b905080614d775760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610e73565b50505b825460ff191660031783556008830154600a84015460098501546040805192835260208301919091526001600160a01b039092169187917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a35050506114cd60018055565b6060610e3d6001600160a01b03831660145b60606000614e09836002615c13565b614e14906002615c00565b6001600160401b03811115614e2b57614e2b615096565b6040519080825280601f01601f191660200182016040528015614e55576020820181803683370190505b509050600360fc1b81600081518110614e7057614e70615b03565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614e9f57614e9f615b03565b60200101906001600160f81b031916908160001a9053506000614ec3846002615c13565b614ece906001615c00565b90505b6001811115614f46576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614f0257614f02615b03565b1a60f81b828281518110614f1857614f18615b03565b60200101906001600160f81b031916908160001a90535060049490941c93614f3f81615e41565b9050614ed1565b508315611e745760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e73565b828054828255906000526020600020908101928215614fea579160200282015b82811115614fea57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614fb5565b50614ff6929150615035565b5090565b828054828255906000526020600020908101928215614fea579160200282015b82811115614fea57825182559160200191906001019061501a565b5b80821115614ff65760008155600101615036565b6000806040838503121561505d57600080fd5b50508035926020909101359150565b60006020828403121561507e57600080fd5b81356001600160e01b031981168114611e7457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156150d4576150d4615096565b604052919050565b60006001600160401b038211156150f5576150f5615096565b5060051b60200190565b6001600160a01b038116811461248c57600080fd5b803561267f816150ff565b600082601f83011261513057600080fd5b81356020615145615140836150dc565b6150ac565b82815260059290921b8401810191818101908684111561516457600080fd5b8286015b8481101561518857803561517b816150ff565b8352918301918301615168565b509695505050505050565b600082601f8301126151a457600080fd5b813560206151b4615140836150dc565b82815260059290921b840181019181810190868411156151d357600080fd5b8286015b8481101561518857803583529183019183016151d7565b600080600080600080600060e0888a03121561520957600080fd5b8735965060208801356001600160401b038082111561522757600080fd5b6152338b838c0161511f565b975060408a013591508082111561524957600080fd5b6152558b838c01615193565b965060608a013591508082111561526b57600080fd5b506152788a828b01615193565b9450506080880135615289816150ff565b9699959850939692959460a0840135945060c09093013592915050565b600082601f8301126152b757600080fd5b81356001600160401b038111156152d0576152d0615096565b6152e3601f8201601f19166020016150ac565b8181528460208386010111156152f857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561532b57600080fd5b8435615336816150ff565b93506020850135615346816150ff565b92506040850135915060608501356001600160401b0381111561536857600080fd5b615374878288016152a6565b91505092959194509250565b6000806040838503121561539357600080fd5b8235915060208301356001600160401b038111156153b057600080fd5b6153bc85828601615193565b9150509250929050565b801515811461248c57600080fd5b600080604083850312156153e757600080fd5b82356153f2816150ff565b91506020830135615402816153c6565b809150509250929050565b60006020828403121561541f57600080fd5b8135611e74816150ff565b60006020828403121561543c57600080fd5b5035919050565b6000806040838503121561545657600080fd5b823591506020830135615402816150ff565b602080825282518282018190526000919060409081850190868401855b828110156154b3578151805185528601516001600160a01b0316868501529284019290850190600101615485565b5091979650505050505050565b600081518084526020808501945080840160005b838110156154f95781516001600160a01b0316875295820195908201906001016154d4565b509495945050505050565b600081518084526020808501945080840160005b838110156154f957815187529582019590820190600101615518565b634e487b7160e01b600052602160045260246000fd5b6003811061555a5761555a615534565b9052565b8d81526101a0602082015260006155796101a083018f6154c0565b828103604084015261558b818f615504565b9150508b60608301528a608083015260018060a01b03808b1660a08401528960c08401528860e08401528088166101008401528087166101208401525084610140830152836101608301526155e461018083018461554a565b9e9d5050505050505050505050505050565b6000806040838503121561560957600080fd5b8235615614816150ff565b946020939093013593505050565b6101a0810160058f1061563757615637615534565b8e82528d60208301528c60408301528b606083015260018060a01b038b1660808301528960a08301528860c083015261567b60e08301896001600160a01b03169052565b866101008301526156986101208301876001600160a01b03169052565b84610140830152836101608301526155e461018083018461554a565b6000602082840312156156c657600080fd5b813563ffffffff81168114611e7457600080fd5b60008060008060008060008060006101208a8c0312156156f957600080fd5b6157028a615114565b985060208a0135975060408a0135965060608a01356001600160401b038082111561572c57600080fd5b6157388d838e0161511f565b975060808c013591508082111561574e57600080fd5b61575a8d838e01615193565b965060a08c013591508082111561577057600080fd5b5061577d8c828d01615193565b94505061578c60c08b01615114565b925060e08a013591506101008a013590509295985092959850929598565b6000806000606084860312156157bf57600080fd5b833592506020840135915060408401356001600160401b038111156157e357600080fd5b6157ef8682870161511f565b9150509250925092565b60006020828403121561580b57600080fd5b81356001600160401b0381168114611e7457600080fd5b60008060006060848603121561583757600080fd5b8335615842816150ff565b9250602084013591506040840135615859816153c6565b809150509250925092565b600080600080600060a0868803121561587c57600080fd5b8535615887816150ff565b94506020860135615897816150ff565b935060408601356001600160401b03808211156158b357600080fd5b6158bf89838a01615193565b945060608801359150808211156158d557600080fd5b6158e189838a01615193565b935060808801359150808211156158f757600080fd5b50615904888289016152a6565b9150509295509295909350565b600080600080600060a0868803121561592957600080fd5b8535615934816150ff565b94506020860135615944816150ff565b9350604086013592506060860135915060808601356001600160401b0381111561596d57600080fd5b615904888289016152a6565b60208082526026908201527f5573657220626c61636b6c69737465642063616e27742063726561746520726160408201526533333632b99760d11b606082015260800190565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b600060208284031215615b5057600080fd5b8151611e74816150ff565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201615bb857615bb8615b90565b5060010190565b81810381811115610e3d57610e3d615b90565b604081526000615be560408301856154c0565b8281036020840152615bf78185615504565b95945050505050565b80820180821115610e3d57610e3d615b90565b8082028115828204841417610e3d57610e3d615b90565b600060208284031215615c3c57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615c7957600080fd5b8151611e74816153c6565b606081526000615c9760608301866154c0565b60208301949094525060400152919050565b634e487b7160e01b600052601260045260246000fd5b600082615cce57615cce615ca9565b500690565b60005b83811015615cee578181015183820152602001615cd6565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615d2f816017850160208801615cd3565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d60816028840160208801615cd3565b01602801949350505050565b60008151808452615d84816020860160208601615cd3565b601f01601f19169290920160200192915050565b602081526000611e746020830184615d6c565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615dde90830184615d6c565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615e2290830184615d6c565b979650505050505050565b600082615e3c57615e3c615ca9565b500490565b600081615e5057615e50615b90565b50600019019056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220a507efa707be68fd7878faf5b0e78584cf666902719fdd9b39e57b164bb9279a64736f6c63430008120033

Deployed Bytecode

0x6080604052600436106104055760003560e01c806388ec392c11610213578063c309b4d411610123578063dadc9b40116100ab578063f2fde38b1161007a578063f2fde38b14610d48578063f369145514610d68578063f5b541a614610d88578063f860cec514610daa578063ff0b906c14610dbf57600080fd5b8063dadc9b4014610cc6578063dd59e92c14610ce6578063e096839b14610d06578063f23a6e6114610d1c57600080fd5b8063d0038ff4116100f2578063d0038ff414610c40578063d3c4d66414610c5a578063d547741f14610c70578063d703ece814610c90578063d85436cc14610ca657600080fd5b8063c309b4d414610ba0578063c402c2ba14610be1578063cb77c14714610bf7578063cf7874a314610c0c57600080fd5b80639ff17fa7116101a6578063af8376de11610175578063af8376de14610afe578063b154003714610b1e578063b66163a914610b3e578063bc0618c314610b5e578063bc197c8114610b7457600080fd5b80639ff17fa714610a89578063a217fddf14610a9c578063aaced47014610ab1578063acbb4eff14610ade57600080fd5b80638fa8a598116101e25780638fa8a59814610a1657806391d1485414610a295780639b479ad314610a495780639dde45da14610a6957600080fd5b806388ec392c1461098f5780638ce3afa7146109af5780638da5cb5b146109c45780638dfc13b6146109f657600080fd5b806346988a40116103195780636cc735d5116102a1578063719c0a1311610270578063719c0a13146108a6578063783e6477146108c6578063797669c9146108f357806381d12c581461092757806388aaf2a91461097057600080fd5b80636cc735d51461082b5780636e650b261461085b5780636fd969031461087b578063715018a61461089157600080fd5b80635d4bc0ce116102e85780635d4bc0ce146107795780635fba3171146107b257806369f26fb0146107c55780636a890cb2146107e55780636bf3f8f6146107fb57600080fd5b806346988a40146106f357806349dd5121146107135780634c72e770146107435780634c86bca11461076357600080fd5b8063295f0d8c1161039c578063308abb091161036b578063308abb09146105e6578063365e36581461061657806339a48216146106435780633fd59149146106635780634169933f1461069c57600080fd5b8063295f0d8c1461057357806329cb924d1461059357806329dd67f9146105a65780632f2ff15d146105c657600080fd5b80631fe543e3116103d85780631fe543e3146104ee57806320c741b31461051057806321f4bd6114610530578063236854961461056057600080fd5b8063013805c51461040a57806301ffc9a71461044c5780630a51d65f1461047c578063150b7a02146104aa575b600080fd5b34801561041657600080fd5b5061042a61042536600461504a565b610dc7565b604080519283526001600160a01b039091166020830152015b60405180910390f35b34801561045857600080fd5b5061046c61046736600461506c565b610e0c565b6040519015158152602001610443565b34801561048857600080fd5b5061049c6104973660046151ee565b610e43565b604051908152602001610443565b3480156104b657600080fd5b506104d56104c5366004615315565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610443565b3480156104fa57600080fd5b5061050e610509366004615380565b611449565b005b34801561051c57600080fd5b5061050e61052b3660046153d4565b6114d1565b34801561053c57600080fd5b5061046c61054b36600461540d565b60196020526000908152604090205460ff1681565b61050e61056e36600461504a565b611518565b34801561057f57600080fd5b5061050e61058e3660046153d4565b611a8d565b34801561059f57600080fd5b504261049c565b3480156105b257600080fd5b5061050e6105c136600461542a565b611b19565b3480156105d257600080fd5b5061050e6105e1366004615443565b611b3a565b3480156105f257600080fd5b5061046c61060136600461540d565b60176020526000908152604090205460ff1681565b34801561062257600080fd5b5061063661063136600461542a565b611b5e565b6040516104439190615468565b34801561064f57600080fd5b5061050e61065e36600461540d565b611be6565b34801561066f57600080fd5b5061068361067e36600461542a565b611c5c565b6040516104439d9c9b9a9998979695949392919061555e565b3480156106a857600080fd5b506106d86106b736600461542a565b600b6020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610443565b3480156106ff57600080fd5b5061049c61070e3660046155f6565b611df4565b34801561071f57600080fd5b5061046c61072e36600461542a565b60186020526000908152604090205460ff1681565b34801561074f57600080fd5b5061050e61075e36600461542a565b611e7b565b34801561076f57600080fd5b5061049c600e5481565b34801561078557600080fd5b5061079961079436600461542a565b611e9c565b6040516104439d9c9b9a99989796959493929190615622565b61050e6107c036600461542a565b611f2a565b3480156107d157600080fd5b5061050e6107e036600461540d565b61248f565b3480156107f157600080fd5b5061049c60115481565b34801561080757600080fd5b5061046c61081636600461540d565b601a6020526000908152604090205460ff1681565b34801561083757600080fd5b5061046c61084636600461540d565b60166020526000908152604090205460ff1681565b34801561086757600080fd5b5061050e61087636600461540d565b6124b9565b34801561088757600080fd5b5061049c60155481565b34801561089d57600080fd5b5061050e6124f6565b3480156108b257600080fd5b5061049c6108c136600461542a565b61250a565b3480156108d257600080fd5b5061049c6108e136600461542a565b60009081526008602052604090205490565b3480156108ff57600080fd5b5061049c7f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa81565b34801561093357600080fd5b5061095b61094236600461542a565b6006602052600090815260409020805460019091015482565b60408051928352602083019190915201610443565b34801561097c57600080fd5b50601b5461046c90610100900460ff1681565b34801561099b57600080fd5b5061050e6109aa36600461542a565b612684565b3480156109bb57600080fd5b50600a5461049c565b3480156109d057600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610443565b348015610a0257600080fd5b5061050e610a113660046156b4565b612881565b61049c610a243660046156da565b6128c1565b348015610a3557600080fd5b5061046c610a44366004615443565b61316c565b348015610a5557600080fd5b5061050e610a643660046157aa565b613197565b348015610a7557600080fd5b5061050e610a843660046157f9565b613527565b61050e610a9736600461542a565b613570565b348015610aa857600080fd5b5061049c600081565b348015610abd57600080fd5b5061049c610acc36600461540d565b600c6020526000908152604090205481565b348015610aea57600080fd5b5061050e610af936600461542a565b6137ee565b348015610b0a57600080fd5b5061050e610b1936600461542a565b61380f565b348015610b2a57600080fd5b5061050e610b39366004615822565b613830565b348015610b4a57600080fd5b5061050e610b5936600461542a565b6138a4565b348015610b6a57600080fd5b5061049c60135481565b348015610b8057600080fd5b506104d5610b8f366004615864565b63bc197c8160e01b95945050505050565b348015610bac57600080fd5b506109de610bbb36600461504a565b60096020908152600092835260408084209091529082529020546001600160a01b031681565b348015610bed57600080fd5b5061049c60105481565b348015610c0357600080fd5b5061050e6138c5565b348015610c1857600080fd5b5061095b610c2736600461542a565b6007602052600090815260409020805460019091015482565b348015610c4c57600080fd5b50601b5461046c9060ff1681565b348015610c6657600080fd5b5061049c60125481565b348015610c7c57600080fd5b5061050e610c8b366004615443565b6138fe565b348015610c9c57600080fd5b5061049c60145481565b348015610cb257600080fd5b5061049c610cc13660046151ee565b613922565b348015610cd257600080fd5b5061050e610ce13660046153d4565b613e79565b348015610cf257600080fd5b5061050e610d013660046155f6565b613efa565b348015610d1257600080fd5b5061049c600f5481565b348015610d2857600080fd5b506104d5610d37366004615911565b63f23a6e6160e01b95945050505050565b348015610d5457600080fd5b5061050e610d6336600461540d565b613f65565b348015610d7457600080fd5b506109de610d8336600461504a565b613fdb565b348015610d9457600080fd5b5061049c600080516020615e5983398151915281565b348015610db657600080fd5b5061050e6140cb565b61050e6140fb565b60086020528160005260406000208181548110610de357600080fd5b6000918252602090912060029091020180546001909101549092506001600160a01b0316905082565b60006001600160e01b03198216630271189760e51b1480610e3d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b3360009081526017602052604081205460ff1615610e7c5760405162461bcd60e51b8152600401610e7390615979565b60405180910390fd5b601b54610100900460ff16610ee35760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610e73565b3360009081526016602052604090205460ff16610f525760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610e73565b428811610f715760405162461bcd60e51b8152600401610e73906159bf565b8551875114610f925760405162461bcd60e51b8152600401610e7390615a03565b8451875114610fb35760405162461bcd60e51b8152600401610e7390615a58565b60008211610fd35760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b0384161561101a576001600160a01b03841660009081526019602052604090205460ff1661101a5760405162461bcd60e51b8152600401610e7390615acc565b60005b875181101561115a5760006001600160a01b031688828151811061104357611043615b03565b60200260200101516001600160a01b0316036110715760405162461bcd60e51b8152600401610e7390615b19565b600088828151811061108557611085615b03565b60200260200101519050806001600160a01b0316636352211e8984815181106110b0576110b0615b03565b60200260200101516040518263ffffffff1660e01b81526004016110d691815260200190565b602060405180830381865afa1580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111179190615b3e565b6001600160a01b0316336001600160a01b0316146111475760405162461bcd60e51b8152600401610e7390615b5b565b508061115281615ba6565b91505061101d565b506001600160a01b0384166000908152601a602052604081205460ff1615611185575060145461118a565b506015545b61119733308a8a8a6141e2565b6040805161022081018252600080825260208083018d90528284018c9052606083018b9052608083018a905260a0830187905283518281529081019093529160c0820190815260200186815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001838152602001876001600160a01b0316815260200160008152602001600081526020016000600281111561124957611249615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff1916908360048111156112a7576112a7615534565b02179055506020828101516001830155604083015180516112ce9260028501920190614f95565b50606082015180516112ea916003840191602090910190614ffa565b5060808201518051611306916004840191602090910190614ffa565b5060a0820151600582015560c0820151805161132c916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff191660018360028111156113e6576113e6615534565b021790555050600a54600091506113ff90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48b8b604051611433929190615bd2565b60405180910390a29a9950505050505050505050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146114c35760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610e73565b6114cd8282614270565b5050565b600080516020615e59833981519152336114eb82826143ae565b50506001600160a01b03919091166000908152601a60205260409020805460ff1916911515919091179055565b6000600a838154811061152d5761152d615b03565b906000526020600020906011020190506115444290565b81600101541161158e5760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610e73565b6000815460ff1660048111156115a6576115a6615534565b146115ee5760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610e73565b6000821161163e5760405162461bcd60e51b815260206004820152601960248201527f4e756d62657220656e74726965732063616e27742062652030000000000000006044820152606401610e73565b600a838154811061165157611651615b03565b9060005260206000209060110201600501548282600e01546116739190615c00565b11156116c15760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610e73565b600d8101546001600160a01b0316611768578181600701546116e39190615c13565b3410156117495760405162461bcd60e51b815260206004820152602e60248201527f6d73672e76616c7565206d75737420626520657175616c206f72206d6f72652060448201526d7468616e2074686520707269636560901b6064820152608401610e73565b3481600a01600082825461175d9190615c00565b909155506119109050565b8181600701546117789190615c13565b600d8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e69190615c2a565b101561185a5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610e73565b600d81015460078201546001600160a01b03909116906323b872dd9033903090611885908790615c13565b6040518463ffffffff1660e01b81526004016118a393929190615c43565b6020604051808303816000875af11580156118c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e69190615c67565b508181600701546118f79190615c13565b81600a01600082825461190a9190615c00565b90915550505b600060405180604001604052808484600e015461192d9190615c00565b81523360209182015260008681526008825260408120805460018082018355918352838320855160029092020190815592840151920180546001600160a01b0319166001600160a01b03909316929092179091559091505b838110156119fd5760008184600e015460016119a19190615c00565b6119ab9190615c00565b600685018054600181018255600091825260208083209091018390558882526009815260408083209383529290522080546001600160a01b0319163317905550806119f581615ba6565b915050611985565b508282600e0154611a0e9190615c00565b82600e0181905550336001600160a01b0316847f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654600a8781548110611a5557611a55615b03565b9060005260206000209060110201600e015486604051611a7f929190918252602082015260400190565b60405180910390a350505050565b600080516020615e5983398151915233611aa782826143ae565b6001600160a01b0384166000908152601760205260409020805460ff1916841515908117909155600103611b13576040516001600160a01b03851681527f7f8b7dc89dae85811a7a85800b892b5816ad5d381c856f1b56490f8fc470c9cb906020015b60405180910390a15b50505050565b600080516020615e5983398151915233611b3382826143ae565b5050600455565b600080516020615e5983398151915233611b5482826143ae565b611b138484614407565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611bdb5760008481526020908190206040805180820190915260028502909101805482526001908101546001600160a01b0316828401529083529092019101611b93565b505050509050919050565b600080516020615e5983398151915233611c0082826143ae565b6001600160a01b038316600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1505050565b60006060806000806000806000806000806000806000600a8f81548110611c8557611c85615b03565b9060005260206000209060110201905080600101548160020182600301836005015484600701548560080160009054906101000a90046001600160a01b0316866009015487600a015488600b0160009054906101000a90046001600160a01b031689600d0160009054906101000a90046001600160a01b03168a600e01548b600f01548c60100160009054906101000a900460ff168b805480602002602001604051908101604052809291908181526020018280548015611d6f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611d51575b50505050509b508a805480602002602001604051908101604052809291908181526020018280548015611dc157602002820191906000526020600020905b815481526020019060010190808311611dad575b50505050509a509d509d509d509d509d509d509d509d509d509d509d509d509d505091939597999b9d90929496989a9c50565b6001600160a01b0382166000908152600c6020526040812054819015611e7457604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600b845284812060020154928152600c9093529290912054611e709190615bbf565b9150505b9392505050565b600080516020615e5983398151915233611e9582826143ae565b5050600e55565b600a8181548110611eac57600080fd5b60009182526020909120601190910201805460018201546005830154600784015460088501546009860154600a870154600b880154600c890154600d8a0154600e8b0154600f8c01546010909c015460ff9b8c169d50999b989a97996001600160a01b0397881699969895979485169693959290941693909291168d565b611f32614446565b6000600a8281548110611f4757611f47615b03565b60009182526020909120600b601190920201908101549091506001600160a01b0316331480611f895750611f89600080516020615e598339815191523361316c565b611fd55760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610e73565b42816001015411611ff85760405162461bcd60e51b8152600401610e73906159bf565b612010600080516020615e598339815191523361316c565b158061202c57503360009081526016602052604090205460ff16155b156120825760105434146120825760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610e73565b6000815460ff16600481111561209a5761209a615534565b146120d65760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610e73565b600681015460c810156121495760405162461bcd60e51b815260206004820152603560248201527f4e6f742063616e63656c6174696f6e207768656e2069742773206d6f726520746044820152743430b7101918181032b73a3934b2b99039b7b6321760591b6064820152608401610e73565b6006810154156123125760005b600682015481101561231057600082600601828154811061217957612179615b03565b60009182526020808320909101548683526009825260408084208285529092529120549091506001600160a01b031680156122fb57600d8401546001600160a01b03166121ff5760078401546040516001600160a01b0383169180156108fc02916000818181858888f193505050501580156121f9573d6000803e3d6000fd5b506122fb565b600d840154600a85015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c9190615c67565b50600d84015460078501546040516323b872dd60e01b81526001600160a01b03909216916323b872dd916122b69130918691600401615c43565b6020604051808303816000875af11580156122d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f99190615c67565b505b5050808061230890615ba6565b915050612156565b505b6124363082600b0160009054906101000a90046001600160a01b03168360020180548060200260200160405190810160405280929190818152602001828054801561238657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612368575b5050505050846003018054806020026020016040519081016040528092919081815260200182805480156123d957602002820191906000526020600020905b8154815260200190600101908083116123c5575b50505050508560040180548060200260200160405190810160405280929190818152602001828054801561242c57602002820191906000526020600020905b815481526020019060010190808311612418575b50505050506141e2565b805460ff1916600417815542600f820155600a81015460405190815282907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a25061248c60018055565b50565b61249761449f565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615e59833981519152336124d382826143ae565b50506001600160a01b03166000908152601660205260409020805460ff19169055565b6124fe61449f565b61250860006144f9565b565b600061251461449f565b6000600a838154811061252957612529615b03565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601190930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156125cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f09190615c2a565b604080518082018252858152600e8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529193507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505b919050565b61268c614446565b6000600a82815481106126a1576126a1615b03565b60009182526020909120600b601190920201908101549091506001600160a01b03163314806126e357506126e3600080516020615e598339815191523361316c565b8061271357506127137f58c8e11deab7910e89bf18a1168c6e6ef28748f00fd3094549459f01cec5e0aa3361316c565b61275f5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610e73565b6000815460ff16600481111561277757612777615534565b146127bd5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610e73565b4281600101541115806127d75750806005015481600e0154145b61282f5760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610e73565b805460ff19166001178155600e81015461284a908390614549565b50817ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882600a015460405161247a91815260200190565b600080516020615e598339815191523361289b82826143ae565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b601b5460009060ff166129215760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610e73565b3360009081526017602052604090205460ff16156129515760405162461bcd60e51b8152600401610e7390615979565b4288116129705760405162461bcd60e51b8152600401610e73906159bf565b85518751146129915760405162461bcd60e51b8152600401610e7390615a03565b84518751146129b25760405162461bcd60e51b8152600401610e7390615a58565b600082116129d25760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b03841615612a19576001600160a01b03841660009081526019602052604090205460ff16612a195760405162461bcd60e51b8152600401610e7390615acc565b60005b8751811015612b595760006001600160a01b0316888281518110612a4257612a42615b03565b60200260200101516001600160a01b031603612a705760405162461bcd60e51b8152600401610e7390615b19565b6000888281518110612a8457612a84615b03565b60200260200101519050806001600160a01b0316636352211e898481518110612aaf57612aaf615b03565b60200260200101516040518263ffffffff1660e01b8152600401612ad591815260200190565b602060405180830381865afa158015612af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b169190615b3e565b6001600160a01b0316336001600160a01b031614612b465760405162461bcd60e51b8152600401610e7390615b5b565b5080612b5181615ba6565b915050612a1c565b506001600160a01b0384166000908152601a602052604081205460ff1615612bce57600f543414612bc55760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b6044820152606401610e73565b50601354612c1d565b600e543414612c185760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b6044820152606401610e73565b506012545b6040516331a9108f60e11b8152600481018b90528b9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8a9190615b3e565b6001600160a01b031614612ce05760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610e73565b604080516001600160a01b038e1660208201529081018c905260009060600160408051601f1981840301815291815281516020928301206000818152601890935291205490915060ff1615612d835760405162461bcd60e51b8152602060048201526024808201527f4e465420746f2063726561746520726166666c6520697320626c61636b6c69736044820152633a32b21760e11b6064820152608401610e73565b426000828152600b60205260409020600101541115612e35576000612da88e8e611df4565b11612e0e5760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610e73565b6000818152600b60205260408120600201805491612e2b83615ba6565b9190505550612e6f565b426000828152600b602052604090205542612e539062278d00615c00565b6000828152600b60205260409020600180820192909255600201555b612e7c33308c8c8c6141e2565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015612eb5573d6000803e3d6000fd5b506040805161022081018252600080825260208083018f90528284018e9052606083018d9052608083018c905260a0830189905283518281529081019093529160c0820190815260200188815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001858152602001896001600160a01b03168152602001600081526020016000815260200160006002811115612f6857612f68615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff191690836004811115612fc657612fc6615534565b0217905550602082810151600183015560408301518051612fed9260028501920190614f95565b5060608201518051613009916003840191602090910190614ffa565b5060808201518051613025916004840191602090910190614ffa565b5060a0820151600582015560c0820151805161304b916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff1916600183600281111561310557613105615534565b021790555050600a546000915061311e90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613152929190615bd2565b60405180910390a29e9d5050505050505050505050505050565b6000918252601c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61319f614446565b600080516020615e59833981519152336131b982826143ae565b6000600a86815481106131ce576131ce615b03565b600091825260209091206011909102015460ff1660048111156131f3576131f3615534565b1461323b5760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610e73565b6000600a868154811061325057613250615b03565b600091825260209091206010601190920201015460ff16600281111561327857613278615534565b146132d15760405162461bcd60e51b815260206004820152602360248201527f526166666c65206973206e6f7420696e204f50455241544f522063617465676f604482015262393c9760e91b6064820152608401610e73565b8251600a8054879081106132e7576132e7615b03565b90600052602060002090601102016005015481866133059190615c13565b11156133715760405162461bcd60e51b815260206004820152603560248201527f46726565207469636b657473206e65656420746f206265206c65737320746861604482015274371036b0bc1032b73a3934b2b99039bab838363c9760591b6064820152608401610e73565b6000805b8281101561345c57600086828151811061339157613391615b03565b60200260200101519050600060405180604001604052808a85600a8e815481106133bd576133bd615b03565b9060005260206000209060110201600e01546133d99190615c00565b6133e39190615c00565b81526001600160a01b0384811660209283015260008d8152600883526040812080546001808201835591835291849020855160029093020191825592840151920180546001600160a01b03191692909116919091179055905061344584615ba6565b93505050808061345490615ba6565b915050613375565b5080600a888154811061347157613471615b03565b9060005260206000209060110201600e015461348d9190615c00565b600a88815481106134a0576134a0615b03565b9060005260206000209060110201600e0181905550867f4da4f5fab0816c65315b6f5d15f879f96b98661133d7b3787788f291367604fb8684600a8b815481106134ec576134ec615b03565b9060005260206000209060110201600e015460405161350d93929190615c84565b60405180910390a25050505061352260018055565b505050565b600080516020615e598339815191523361354182826143ae565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b61357861449f565b6000600a828154811061358d5761358d615b03565b6000918252602082206011909102019150815460ff1660048111156135b4576135b4615534565b036136015760405162461bcd60e51b815260206004820152601860248201527f526166666c6520696e20437265617465642073746174757300000000000000006044820152606401610e73565b600d8101546001600160a01b03166136a357600a81015460405160009133918381818185875af1925050503d8060008114613658576040519150601f19603f3d011682016040523d82523d6000602084013e61365d565b606091505b50509050806135225760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610e73565b600d810154600a82015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af11580156136fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137209190615c67565b50600d810154600a8201546040516323b872dd60e01b81526000926001600160a01b0316916323b872dd9161375c913091339190600401615c43565b6020604051808303816000875af115801561377b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061379f9190615c67565b9050806135225760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610e73565b600080516020615e598339815191523361380882826143ae565b5050600f55565b600080516020615e598339815191523361382982826143ae565b5050601055565b600080516020615e598339815191523361384a82826143ae565b604080516001600160a01b038716602082015290810185905260009060600160408051808303601f190181529181528151602092830120600090815260189092529020805460ff1916941515949094179093555050505050565b600080516020615e59833981519152336138be82826143ae565b5050601155565b600080516020615e59833981519152336138df82826143ae565b5050601b805461ff001981166101009182900460ff1615909102179055565b600080516020615e598339815191523361391882826143ae565b611b1384846146ba565b6000600080516020615e598339815191523361393e82826143ae565b3360009081526017602052604090205460ff161561396e5760405162461bcd60e51b8152600401610e7390615979565b428a1161398d5760405162461bcd60e51b8152600401610e73906159bf565b87518951146139ed5760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610e73565b8651895114613a0e5760405162461bcd60e51b8152600401610e7390615a58565b60008411613a2e5760405162461bcd60e51b8152600401610e7390615aa8565b6001600160a01b03861615613a75576001600160a01b03861660009081526019602052604090205460ff16613a755760405162461bcd60e51b8152600401610e7390615acc565b60005b8951811015613bb55760006001600160a01b03168a8281518110613a9e57613a9e615b03565b60200260200101516001600160a01b031603613acc5760405162461bcd60e51b8152600401610e7390615b19565b60008a8281518110613ae057613ae0615b03565b60200260200101519050806001600160a01b0316636352211e8b8481518110613b0b57613b0b615b03565b60200260200101516040518263ffffffff1660e01b8152600401613b3191815260200190565b602060405180830381865afa158015613b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b729190615b3e565b6001600160a01b0316336001600160a01b031614613ba25760405162461bcd60e51b8152600401610e7390615b5b565b5080613bad81615ba6565b915050613a78565b506000613bc533308c8c8c6141e2565b6040805161022081018252600080825260208083018f90528284018e9052606083018d9052608083018c905260a0830189905283518281529081019093529160c0820190815260200188815260200160006001600160a01b031681526020016000815260200160008152602001336001600160a01b03168152602001838152602001896001600160a01b03168152602001600081526020016000815260200160006002811115613c7757613c77615534565b9052600a805460018181018355600092909252825160119091027fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805493945084939092839160ff191690836004811115613cd557613cd5615534565b0217905550602082810151600183015560408301518051613cfc9260028501920190614f95565b5060608201518051613d18916003840191602090910190614ffa565b5060808201518051613d34916004840191602090910190614ffa565b5060a0820151600582015560c08201518051613d5a916006840191602090910190614ffa565b5060e082015160078201556101008201516008820180546001600160a01b039283166001600160a01b0319918216179091556101208401516009840155610140840151600a840155610160840151600b84018054918416918316919091179055610180840151600c8401556101a0840151600d840180549190931691161790556101c0820151600e8201556101e0820151600f82015561020082015160108201805460ff19166001836002811115613e1457613e14615534565b021790555050600a5460009150613e2d90600190615bbf565b9050807ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613e61929190615bd2565b60405180910390a29c9b505050505050505050505050565b600080516020615e5983398151915233613e9382826143ae565b6001600160a01b0384166000908152601960205260409020805460ff1916841515908117909155600103611b13576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c73390602001611b0a565b600080516020615e5983398151915233613f1482826143ae565b6001600160a01b0384166000818152600c6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d9101611b0a565b613f6d61449f565b6001600160a01b038116613fd25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e73565b61248c816144f9565b600082815260086020526040812081908190815b81548110156140785781818154811061400a5761400a615b03565b906000526020600020906002020160000154846140279190615c00565b93508584106140665781818154811061404257614042615b03565b60009182526020909120600160029092020101546001600160a01b03169250614078565b8061407081615ba6565b915050613fef565b506001600160a01b0382166140c25760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610e73565b50949350505050565b600080516020615e59833981519152336140e582826143ae565b5050601b805460ff19811660ff90911615179055565b60115434146141585760405162461bcd60e51b8152602060048201526024808201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706044820152637269636560e01b6064820152608401610e73565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015614191573d6000803e3d6000fd5b5033600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b60005b825181101561426857614256868686848151811061420557614205615b03565b602002602001015186858151811061421f5761421f615b03565b602002602001015186868151811061423957614239615b03565b6020026020010151604051806020016040528060008152506146f7565b8061426081615ba6565b9150506141e5565b505050505050565b60008281526007602052604081206001015482518390839061429457614294615b03565b60200260200101516142a69190615cbf565b6142b1906001615c00565b600084815260076020526040812054600a8054939450919281106142d7576142d7615b03565b90600052602060002090601102019050818160090181905550600060405180604001604052808560008151811061431057614310615b03565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a26000858152600760205260409020546143a790846147d6565b5050505050565b6143b8828261316c565b6114cd576143c581614de8565b6143d0836020614dfa565b6040516020016143e1929190615cf7565b60408051601f198184030181529082905262461bcd60e51b8252610e7391600401615d98565b614411828261316c565b6114cd576000828152601c602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6002600154036144985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e73565b6002600155565b6000546001600160a01b031633146125085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e73565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156145db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145ff9190615c2a565b604080518082018252858152602080820186815260008581526007909252928120915182559151600190910155600a805492935090918590811061464557614645615b03565b600091825260209091206011909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6146c4828261316c565b156114cd576000828152601c602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b8160000361476857604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614731908990899088908790600401615dab565b600060405180830381600087803b15801561474b57600080fd5b505af115801561475f573d6000803e3d6000fd5b50505050614268565b604051637921219560e11b81526001600160a01b0385169063f242432a9061479c9089908990889088908890600401615de8565b600060405180830381600087803b1580156147b657600080fd5b505af11580156147ca573d6000803e3d6000fd5b50505050505050505050565b6147de614446565b6000600a83815481106147f3576147f3615b03565b6000918252602090912060119091020190506002815460ff16600481111561481d5761481d615534565b146148635760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610e73565b60098101829055600a810154156148835761487e8383613fdb565b614892565b600b8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b03929092169182179055600282018054604080516020808402820181019092528281526149bc94309490939192909190830182828015612386576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311612368575050505050846003018054806020026020016040519081016040528092919081815260200182805480156123d957602002820191906000526020600020908154815260200190600101908083116123c55750505050508560040180548060200260200160405190810160405280929190818152602001828054801561242c57602002820191906000526020600020908154815260200190600101908083116124185750505050506141e2565b600061271082600c015483600a01546149d59190615c13565b6149df9190615e2d565b905060008183600a01546149f39190615bbf565b600d8401549091506001600160a01b0316614b4c57600b8301546040516000916001600160a01b03169083908381818185875af1925050503d8060008114614a57576040519150601f19603f3d011682016040523d82523d6000602084013e614a5c565b606091505b5050905080614aa25760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610e73565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614aef576040519150601f19603f3d011682016040523d82523d6000602084013e614af4565b606091505b5050905080614b455760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610e73565b5050614d7a565b600d830154600a84015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bc99190615c67565b50600d830154600b8401546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614c0892309216908790600401615c43565b6020604051808303816000875af1158015614c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c4b9190615c67565b905080614c9a5760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610e73565b600d8085015490546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614cd692309216908990600401615c43565b6020604051808303816000875af1158015614cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d199190615c67565b905080614d775760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610e73565b50505b825460ff191660031783556008830154600a84015460098501546040805192835260208301919091526001600160a01b039092169187917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a35050506114cd60018055565b6060610e3d6001600160a01b03831660145b60606000614e09836002615c13565b614e14906002615c00565b6001600160401b03811115614e2b57614e2b615096565b6040519080825280601f01601f191660200182016040528015614e55576020820181803683370190505b509050600360fc1b81600081518110614e7057614e70615b03565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614e9f57614e9f615b03565b60200101906001600160f81b031916908160001a9053506000614ec3846002615c13565b614ece906001615c00565b90505b6001811115614f46576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614f0257614f02615b03565b1a60f81b828281518110614f1857614f18615b03565b60200101906001600160f81b031916908160001a90535060049490941c93614f3f81615e41565b9050614ed1565b508315611e745760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e73565b828054828255906000526020600020908101928215614fea579160200282015b82811115614fea57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614fb5565b50614ff6929150615035565b5090565b828054828255906000526020600020908101928215614fea579160200282015b82811115614fea57825182559160200191906001019061501a565b5b80821115614ff65760008155600101615036565b6000806040838503121561505d57600080fd5b50508035926020909101359150565b60006020828403121561507e57600080fd5b81356001600160e01b031981168114611e7457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156150d4576150d4615096565b604052919050565b60006001600160401b038211156150f5576150f5615096565b5060051b60200190565b6001600160a01b038116811461248c57600080fd5b803561267f816150ff565b600082601f83011261513057600080fd5b81356020615145615140836150dc565b6150ac565b82815260059290921b8401810191818101908684111561516457600080fd5b8286015b8481101561518857803561517b816150ff565b8352918301918301615168565b509695505050505050565b600082601f8301126151a457600080fd5b813560206151b4615140836150dc565b82815260059290921b840181019181810190868411156151d357600080fd5b8286015b8481101561518857803583529183019183016151d7565b600080600080600080600060e0888a03121561520957600080fd5b8735965060208801356001600160401b038082111561522757600080fd5b6152338b838c0161511f565b975060408a013591508082111561524957600080fd5b6152558b838c01615193565b965060608a013591508082111561526b57600080fd5b506152788a828b01615193565b9450506080880135615289816150ff565b9699959850939692959460a0840135945060c09093013592915050565b600082601f8301126152b757600080fd5b81356001600160401b038111156152d0576152d0615096565b6152e3601f8201601f19166020016150ac565b8181528460208386010111156152f857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561532b57600080fd5b8435615336816150ff565b93506020850135615346816150ff565b92506040850135915060608501356001600160401b0381111561536857600080fd5b615374878288016152a6565b91505092959194509250565b6000806040838503121561539357600080fd5b8235915060208301356001600160401b038111156153b057600080fd5b6153bc85828601615193565b9150509250929050565b801515811461248c57600080fd5b600080604083850312156153e757600080fd5b82356153f2816150ff565b91506020830135615402816153c6565b809150509250929050565b60006020828403121561541f57600080fd5b8135611e74816150ff565b60006020828403121561543c57600080fd5b5035919050565b6000806040838503121561545657600080fd5b823591506020830135615402816150ff565b602080825282518282018190526000919060409081850190868401855b828110156154b3578151805185528601516001600160a01b0316868501529284019290850190600101615485565b5091979650505050505050565b600081518084526020808501945080840160005b838110156154f95781516001600160a01b0316875295820195908201906001016154d4565b509495945050505050565b600081518084526020808501945080840160005b838110156154f957815187529582019590820190600101615518565b634e487b7160e01b600052602160045260246000fd5b6003811061555a5761555a615534565b9052565b8d81526101a0602082015260006155796101a083018f6154c0565b828103604084015261558b818f615504565b9150508b60608301528a608083015260018060a01b03808b1660a08401528960c08401528860e08401528088166101008401528087166101208401525084610140830152836101608301526155e461018083018461554a565b9e9d5050505050505050505050505050565b6000806040838503121561560957600080fd5b8235615614816150ff565b946020939093013593505050565b6101a0810160058f1061563757615637615534565b8e82528d60208301528c60408301528b606083015260018060a01b038b1660808301528960a08301528860c083015261567b60e08301896001600160a01b03169052565b866101008301526156986101208301876001600160a01b03169052565b84610140830152836101608301526155e461018083018461554a565b6000602082840312156156c657600080fd5b813563ffffffff81168114611e7457600080fd5b60008060008060008060008060006101208a8c0312156156f957600080fd5b6157028a615114565b985060208a0135975060408a0135965060608a01356001600160401b038082111561572c57600080fd5b6157388d838e0161511f565b975060808c013591508082111561574e57600080fd5b61575a8d838e01615193565b965060a08c013591508082111561577057600080fd5b5061577d8c828d01615193565b94505061578c60c08b01615114565b925060e08a013591506101008a013590509295985092959850929598565b6000806000606084860312156157bf57600080fd5b833592506020840135915060408401356001600160401b038111156157e357600080fd5b6157ef8682870161511f565b9150509250925092565b60006020828403121561580b57600080fd5b81356001600160401b0381168114611e7457600080fd5b60008060006060848603121561583757600080fd5b8335615842816150ff565b9250602084013591506040840135615859816153c6565b809150509250925092565b600080600080600060a0868803121561587c57600080fd5b8535615887816150ff565b94506020860135615897816150ff565b935060408601356001600160401b03808211156158b357600080fd5b6158bf89838a01615193565b945060608801359150808211156158d557600080fd5b6158e189838a01615193565b935060808801359150808211156158f757600080fd5b50615904888289016152a6565b9150509295509295909350565b600080600080600060a0868803121561592957600080fd5b8535615934816150ff565b94506020860135615944816150ff565b9350604086013592506060860135915060808601356001600160401b0381111561596d57600080fd5b615904888289016152a6565b60208082526026908201527f5573657220626c61636b6c69737465642063616e27742063726561746520726160408201526533333632b99760d11b606082015260800190565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b600060208284031215615b5057600080fd5b8151611e74816150ff565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201615bb857615bb8615b90565b5060010190565b81810381811115610e3d57610e3d615b90565b604081526000615be560408301856154c0565b8281036020840152615bf78185615504565b95945050505050565b80820180821115610e3d57610e3d615b90565b8082028115828204841417610e3d57610e3d615b90565b600060208284031215615c3c57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615c7957600080fd5b8151611e74816153c6565b606081526000615c9760608301866154c0565b60208301949094525060400152919050565b634e487b7160e01b600052601260045260246000fd5b600082615cce57615cce615ca9565b500690565b60005b83811015615cee578181015183820152602001615cd6565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615d2f816017850160208801615cd3565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d60816028840160208801615cd3565b01602801949350505050565b60008151808452615d84816020860160208601615cd3565b601f01601f19169290920160200192915050565b602081526000611e746020830184615d6c565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615dde90830184615d6c565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615e2290830184615d6c565b979650505050505050565b600082615e3c57615e3c615ca9565b500490565b600081615e5057615e50615b90565b50600019019056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220a507efa707be68fd7878faf5b0e78584cf666902719fdd9b39e57b164bb9279a64736f6c63430008120033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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