ETH Price: $3,413.45 (+1.75%)

Contract

0xB09B88ac29Dd39B4a719650C44aC787Fa2D2D7a3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Winner Raffl...189012132023-12-30 22:10:11362 days ago1703974211IN
0xB09B88ac...Fa2D2D7a3
0 ETH0.0024199715.4864585
Buy Entry189011612023-12-30 21:59:47362 days ago1703973587IN
0xB09B88ac...Fa2D2D7a3
0.02 ETH0.0017471214.24025406
Buy Entry189011512023-12-30 21:57:47362 days ago1703973467IN
0xB09B88ac...Fa2D2D7a3
0.0075 ETH0.0019354415.77524703
Buy Entry189011162023-12-30 21:50:47362 days ago1703973047IN
0xB09B88ac...Fa2D2D7a3
0.025 ETH0.0018896313.51773066
Buy Entry189011052023-12-30 21:48:35362 days ago1703972915IN
0xB09B88ac...Fa2D2D7a3
0.0505 ETH0.0020079214.3639774
Buy Entry189010852023-12-30 21:44:35362 days ago1703972675IN
0xB09B88ac...Fa2D2D7a3
0.025 ETH0.0018678813.36217715
Buy Entry189000282023-12-30 18:11:11362 days ago1703959871IN
0xB09B88ac...Fa2D2D7a3
0.04 ETH0.0030932225.21195135
Buy Entry188992812023-12-30 15:40:47362 days ago1703950847IN
0xB09B88ac...Fa2D2D7a3
0.015 ETH0.0030692721.95645513
Buy Entry188983622023-12-30 12:34:47363 days ago1703939687IN
0xB09B88ac...Fa2D2D7a3
0.0015 ETH0.0022088115.80109509
Buy Entry188976052023-12-30 10:00:11363 days ago1703930411IN
0xB09B88ac...Fa2D2D7a3
0.0005 ETH0.0007059112.88425957
Buy Entry188945402023-12-29 23:38:11363 days ago1703893091IN
0xB09B88ac...Fa2D2D7a3
0.01 ETH0.0021023217.13538891
Buy Entry188937492023-12-29 20:57:47363 days ago1703883467IN
0xB09B88ac...Fa2D2D7a3
0.002 ETH0.0025666318.36074491
Buy Entry188932022023-12-29 19:06:59363 days ago1703876819IN
0xB09B88ac...Fa2D2D7a3
0.06 ETH0.0029084720.80617194
Buy Entry188882062023-12-29 2:16:23364 days ago1703816183IN
0xB09B88ac...Fa2D2D7a3
0.005 ETH0.0022945918.70251435
Buy Entry188844202023-12-28 13:31:35364 days ago1703770295IN
0xB09B88ac...Fa2D2D7a3
0.0065 ETH0.0049681140.49352882
Buy Entry188825312023-12-28 7:09:11365 days ago1703747351IN
0xB09B88ac...Fa2D2D7a3
0.0025 ETH0.0035856725.65063878
Buy Entry188741512023-12-27 2:52:47366 days ago1703645567IN
0xB09B88ac...Fa2D2D7a3
0.006 ETH0.0020425614.61300731
Buy Entry188738452023-12-27 1:50:47366 days ago1703641847IN
0xB09B88ac...Fa2D2D7a3
0.0025 ETH0.0018655313.34533868
Buy Entry188734642023-12-27 0:33:47366 days ago1703637227IN
0xB09B88ac...Fa2D2D7a3
0.005 ETH0.0019018613.60523335
Buy Entry188716422023-12-26 18:26:11366 days ago1703615171IN
0xB09B88ac...Fa2D2D7a3
0.05 ETH0.0033398623.89219596
Buy Entry188716082023-12-26 18:19:23366 days ago1703614763IN
0xB09B88ac...Fa2D2D7a3
0.007 ETH0.0038401127.47081664
Buy Entry188706572023-12-26 15:06:23366 days ago1703603183IN
0xB09B88ac...Fa2D2D7a3
0.0005 ETH0.0039226828.06149422
Buy Entry188669342023-12-26 2:36:35367 days ago1703558195IN
0xB09B88ac...Fa2D2D7a3
0.0005 ETH0.00211315.11566712
Buy Entry188661312023-12-25 23:54:59367 days ago1703548499IN
0xB09B88ac...Fa2D2D7a3
0.0005 ETH0.0018800213.44901562
Buy Entry188617352023-12-25 9:03:23368 days ago1703495003IN
0xB09B88ac...Fa2D2D7a3
0.022 ETH0.0022490616.08902529
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
189012172023-12-30 22:10:59362 days ago1703974259
0xB09B88ac...Fa2D2D7a3
0.01884 ETH
189012172023-12-30 22:10:59362 days ago1703974259
0xB09B88ac...Fa2D2D7a3
0.60916 ETH
186582852023-11-26 20:40:59396 days ago1701031259
0xB09B88ac...Fa2D2D7a3
0.019375 ETH
186582852023-11-26 20:40:59396 days ago1701031259
0xB09B88ac...Fa2D2D7a3
0.368125 ETH
185309302023-11-09 0:51:11414 days ago1699491071
0xB09B88ac...Fa2D2D7a3
0.00469 ETH
185309302023-11-09 0:51:11414 days ago1699491071
0xB09B88ac...Fa2D2D7a3
0.03 ETH
185152822023-11-06 20:20:59416 days ago1699302059
0xB09B88ac...Fa2D2D7a3
0.005 ETH
185152822023-11-06 20:20:59416 days ago1699302059
0xB09B88ac...Fa2D2D7a3
0.095 ETH
184990292023-11-04 13:40:59418 days ago1699105259
0xB09B88ac...Fa2D2D7a3
0.0017385 ETH
184990292023-11-04 13:40:59418 days ago1699105259
0xB09B88ac...Fa2D2D7a3
0.0562115 ETH
184680902023-10-31 5:40:59423 days ago1698730859
0xB09B88ac...Fa2D2D7a3
0.00345321 ETH
184680902023-10-31 5:40:59423 days ago1698730859
0xB09B88ac...Fa2D2D7a3
0.11165379 ETH
184670562023-10-31 2:10:59423 days ago1698718259
0xB09B88ac...Fa2D2D7a3
0.0035 ETH
184670562023-10-31 2:10:59423 days ago1698718259
0xB09B88ac...Fa2D2D7a3
0.0665 ETH
184643272023-10-30 17:01:47423 days ago1698685307
0xB09B88ac...Fa2D2D7a3
0.024 ETH
184643272023-10-30 17:01:47423 days ago1698685307
0xB09B88ac...Fa2D2D7a3
0.456 ETH
184615692023-10-30 7:44:47424 days ago1698651887
0xB09B88ac...Fa2D2D7a3
0.0345 ETH
184615692023-10-30 7:44:47424 days ago1698651887
0xB09B88ac...Fa2D2D7a3
0.6555 ETH
184472722023-10-28 7:40:59426 days ago1698478859
0xB09B88ac...Fa2D2D7a3
0.008 ETH
184472722023-10-28 7:40:59426 days ago1698478859
0xB09B88ac...Fa2D2D7a3
0.152 ETH
184454502023-10-28 1:33:59426 days ago1698456839
0xB09B88ac...Fa2D2D7a3
0.001656 ETH
184454502023-10-28 1:33:59426 days ago1698456839
0xB09B88ac...Fa2D2D7a3
0.053544 ETH
184443582023-10-27 21:54:35426 days ago1698443675
0xB09B88ac...Fa2D2D7a3
0.0033 ETH
184443582023-10-27 21:54:35426 days ago1698443675
0xB09B88ac...Fa2D2D7a3
0.0627 ETH
184383912023-10-27 1:53:59427 days ago1698371639
0xB09B88ac...Fa2D2D7a3
0.02 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RafldexV2_4

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : RafldexV2_4.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 RafldexV2_4 is
    Ownable,
    ReentrancyGuard,
    VRFConsumerBaseV2,
    ERC721Holder,
    ERC1155Holder
{
    VRFCoordinatorV2Interface COORDINATOR;
    LinkTokenInterface LINKTOKEN;
    address constant vrfCoordinator =
        0x271682DEB8C4E0901D1a1550aD2e64D568E69909;
    address constant link_token_contract =
        0x514910771AF9Ca656af840dff83E8264EcF986CA;
    bytes32 private keyHash =
        0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef;

    uint16 private requestConfirmations = 3;
    uint32 private callbackGasLimit = 2500000;
    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 RaffleSetNotToCancel(uint256 indexed raffleId, address creator);

    event RaffleCancelled(uint256 indexed raffleId, uint256 amountRaised);
    event SetWinnerTriggered(uint256 indexed raffleId, uint256 amountRaised);

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

    enum STATUS {
        CREATED,
        PENDING_DRAW,
        DRAWING,
        DRAWN,
        CANCELLED
    }

    struct RaffleStruct {
        STATUS status;
        uint256 endTime;
        address[] collateralAddress;
        uint256[] collateralId;
        uint256[] tokenAmount;
        uint256 entriesSupply;
        uint256 pricePerEntry;
        uint256 maxEntriesUser;
        address winner;
        uint256 randomNumber;
        address creator;
        uint256 platformPercentage;
        address tokenPayment;
        uint256 entriesSold;
        bool canCancel;
    }

    RaffleStruct[] public raffles;

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

    mapping(bytes32 => RaffleCreationHolder) public raffleCreationData;
    mapping(address => uint256) public numberRafflesMonthCollection;
    mapping(bytes32 => uint256) public entriesInfo;
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR");
    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    address payable private platformWallet =
        payable(0x2300Ae69d7D1Ea0457aD79e822422888e3Ee3e87);

    uint256 public CHAINLINK_RAFFLE_FEE = 0.015 ether;
    uint256 public HOLDER_CREATE_RAFFLE_FEE = 0.02 ether;
    uint256 public HOLDER_CREATE_RAFFLE_FEE_DISCOUNT = 0.01 ether;
    uint256 public CANCELATION_RAFFLE_FEE_BASE = 0.03 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 = 300; //3%
    uint256 public COMMISSION_SUBSCRIBERS_DISCOUNT = 150; //1.5%

    mapping(address => bool) public Subscribers;
    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,
        uint256 _maxEntriesUser
    ) external onlyRole(OPERATOR_ROLE, msg.sender) returns (uint256) {
        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");
        require(
            _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle,
            "Min entries user > 0 and <= max entries raffle"
        );

        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");
            if (_tokenAmount[i] == 0) {
                IERC721 nftContract = IERC721(_collateralAddress[i]);
                require(
                    msg.sender == nftContract.ownerOf(_collateralId[i]),
                    "Only NFT owner can create raffle"
                );
            } else {
                IERC1155 nftContract = IERC1155(_collateralAddress[i]);
                require(
                    nftContract.balanceOf(msg.sender, _collateralId[i]) >=
                        _tokenAmount[i],
                    "Dont have enough amount."
                );
            }
        }
        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,
            maxEntriesUser: _maxEntriesUser,
            winner: address(0),
            randomNumber: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            canCancel: true
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;

        EntriesBought memory entryBought = EntriesBought({
            player: address(0),
            currentEntriesLength: 0,
            entries: 0
        });
        entriesList[idRaffle].push(entryBought);

        delete entriesList[idRaffle][0];

        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,
        uint256 _maxEntriesUser
    ) external payable nonReentrant returns (uint256) {
        require(createEnabledHolders, "Create raffle not set for holders.");

        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");
        require(
            _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle,
            "Min entries user > 0 and <= max entries raffle"
        );
        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");
            if (_tokenAmount[i] == 0) {
                IERC721 nftContract = IERC721(_collateralAddress[i]);
                require(
                    msg.sender == nftContract.ownerOf(_collateralId[i]),
                    "Only NFT owner can create raffle"
                );
            } else {
                IERC1155 nftContract = IERC1155(_collateralAddress[i]);
                require(
                    nftContract.balanceOf(msg.sender, _collateralId[i]) >=
                        _tokenAmount[i],
                    "Dont have enough amount."
                );
            }
        }

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

            _commissionInBasicPoints = COMMISSION_HOLDERS_DISCOUNT;
        } else {
            require(
                msg.value >= HOLDER_CREATE_RAFFLE_FEE + CHAINLINK_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)
        );

        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,
            maxEntriesUser: _maxEntriesUser,
            winner: address(0),
            randomNumber: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            canCancel: true
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;

        EntriesBought memory entryBought = EntriesBought({
            player: address(0),
            currentEntriesLength: 0,
            entries: 0
        });
        entriesList[idRaffle].push(entryBought);
        delete entriesList[idRaffle][0];

        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,
        uint256 _maxEntriesUser
    ) external payable nonReentrant returns (uint256) {
        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(msg.value >= CHAINLINK_RAFFLE_FEE, "Invalid funds provided");

        require(_maxEntriesRaffle > 0, "No entries");
        require(
            _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle,
            "Min entries user > 0 and <= max entries raffle"
        );

        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");
            if (_tokenAmount[i] == 0) {
                IERC721 nftContract = IERC721(_collateralAddress[i]);
                require(
                    msg.sender == nftContract.ownerOf(_collateralId[i]),
                    "Only NFT owner can create raffle"
                );
            } else {
                IERC1155 nftContract = IERC1155(_collateralAddress[i]);
                require(
                    nftContract.balanceOf(msg.sender, _collateralId[i]) >=
                        _tokenAmount[i],
                    "Dont have enough amount."
                );
            }
        }
        uint256 _commissionInBasicPoints = 0;

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

        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,
            maxEntriesUser: _maxEntriesUser,
            winner: address(0),
            randomNumber: 0,
            creator: msg.sender,
            platformPercentage: _commissionInBasicPoints,
            tokenPayment: _tokenPayment,
            entriesSold: 0,
            canCancel: true
        });

        raffles.push(raffle);

        uint256 idRaffle = raffles.length - 1;
        EntriesBought memory entryBought = EntriesBought({
            player: address(0),
            currentEntriesLength: 0,
            entries: 0
        });
        entriesList[idRaffle].push(entryBought);
        delete entriesList[idRaffle][0];
        emit RaffleCreated(idRaffle, _collateralAddress, _collateralId);

        return idRaffle;
    }

    function buyEntry(
        uint256 _raffleId,
        uint256 _numberEntries,
        address _user
    ) 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 && _numberEntries <= raffle.maxEntriesUser,
            "Number entries can't be 0 or more than max entries per user."
        );
        require(_user != address(0), "Address cant't be null address");
        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 to the price"
            );
        } 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
            );
        }

        bytes32 hash = keccak256(abi.encode(msg.sender, _raffleId));
        require(
            entriesInfo[hash] + _numberEntries <= raffle.maxEntriesUser,
            "Max entries user reached."
        );

        entriesInfo[hash] += _numberEntries;
        EntriesBought memory entryBought = EntriesBought({
            player: _user,
            currentEntriesLength: uint256(raffle.entriesSold + _numberEntries),
            entries: _numberEntries
        });
        entriesList[_raffleId].push(entryBought);
        raffle.entriesSold += _numberEntries;

        emit EntryBought(_raffleId, _user, raffle.entriesSold, _numberEntries);
    }

    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 giveorRemoveSubscriptionTo(
        address[] memory _addresses,
        bool _isSubscriber
    ) external onlyRole(OPERATOR_ROLE, msg.sender) {
        for (uint256 i = 0; i < _addresses.length; i++) {
            Subscribers[_addresses[i]] = _isSubscriber;
            if (_isSubscriber == true) {
                emit GotSubscription(_addresses[i]);
            }
        }
    }

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

    function ChangeCancellationFeeBase(uint256 _fee)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        CANCELATION_RAFFLE_FEE_BASE = _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 getEntriesBought(uint256 _raffleId)
        public
        view
        returns (EntriesBought[] memory)
    {
        return entriesList[_raffleId];
    }

    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 toggleCreateHoldersEnabled()
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        createEnabledHolders = !createEnabledHolders;
    }

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

    function getWinnerAddressFromRandom(
        uint256 _raffleId,
        uint256 _normalizedRandomNumber
    ) public view returns (address) {
        address winner;
        EntriesBought[] storage entries = entriesList[_raffleId];
        for (uint256 i = 0; i < entries.length; i++) {
            uint256 entriesIndex = entries[i].currentEntriesLength;
            if (entriesIndex >= _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
        onlyRole(OPERATOR_ROLE, msg.sender)
        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.entriesSold == 0)
            ? raffle.creator
            : getWinnerAddressFromRandom(_raffleId, _normalizedRandomNumber);

        safeMultipleTransfersFrom(
            address(this),
            raffle.winner,
            raffle.collateralAddress,
            raffle.collateralId,
            raffle.tokenAmount
        );
        uint256 amountRaised = raffle.entriesSold * raffle.pricePerEntry;
        uint256 amountForPlatform = (amountRaised * raffle.platformPercentage) /
            10000;
        uint256 amountForSeller = 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), 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,
            amountRaised,
            raffle.randomNumber
        );
    }

    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),
            "Not raffle creator or operator."
        );
        if (hasRole(OPERATOR_ROLE, msg.sender)) {
            require(
                raffle.entriesSold == raffle.entriesSupply ||
                    raffle.endTime <= getCurrentTime(),
                "Raffle still opened or not sold out"
            );
        }
        require(raffle.status == STATUS.CREATED, "Raffle in wrong status");
        raffle.status = STATUS.PENDING_DRAW;
        uint256 entriesSold = raffle.entriesSold;
        uint256 amountRaised = entriesSold * raffle.pricePerEntry;
        if (entriesSold == 0) {
            raffle.status = STATUS.DRAWING;
            transferNFTsAndFunds(_raffleId, raffle.randomNumber);
        } else {
            requestRandomWords(_raffleId, entriesSold);
        }
        emit SetWinnerTriggered(_raffleId, amountRaised);
    }

    function setWinnerRaffleEmergency(uint256 _raffleId)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        //function in case that chainlink vrf2 doesnt work
        RaffleStruct storage raffle = raffles[_raffleId];
        require(raffle.status == STATUS.DRAWING, "Raffle in wrong status");

        uint256 entriesSold = raffle.entriesSold;

        bytes32 baseHash = keccak256(
            abi.encodePacked(
                block.number,
                block.timestamp,
                block.gaslimit,
                block.coinbase
            )
        );
        uint256 normalizedRandomNumber = (uint256(baseHash) % entriesSold) + 1;

        raffle.randomNumber = normalizedRandomNumber;
        transferNFTsAndFunds(_raffleId, normalizedRandomNumber);
    }

    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."
        );
        require(raffle.status == STATUS.CREATED, "Wrong status");

        if (!hasRole(OPERATOR_ROLE, msg.sender)) {
            require(raffle.canCancel, "User Can't cancel");
            if (raffle.entriesSold == 0) {
                require(msg.value == 0, "Not cancelation fee value.");
            } else {
                require(
                    msg.value >= CANCELATION_RAFFLE_FEE_BASE,
                    "Not cancelation fee value."
                );
                platformWallet.transfer(CANCELATION_RAFFLE_FEE_BASE);
            }
        }

        uint256 txLength = entriesList[_raffleId].length;
        require(
            txLength <= 200,
            "Not cancelation available when it's more than 200 txs."
        );

        uint256 amountRaised = raffle.entriesSold * raffle.pricePerEntry;

        if (raffle.tokenPayment == address(0)) {
            for (uint256 i = 0; i < txLength; i++) {
                address user = entriesList[_raffleId][i].player;
                if (user != address(0)) {
                    uint256 amountToSend = raffle.pricePerEntry *
                        entriesList[_raffleId][i].entries;
                    payable(user).transfer(amountToSend);
                }
            }
        } else {
            IERC20(raffle.tokenPayment).approve(address(this), amountRaised);
            for (uint256 i = 0; i < txLength; i++) {
                address user = entriesList[_raffleId][i].player;
                if (user != address(0)) {
                    uint256 amountToSend = raffle.pricePerEntry *
                        entriesList[_raffleId][i].entries;
                    IERC20(raffle.tokenPayment).transferFrom(
                        address(this),
                        user,
                        amountToSend
                    );
                }
            }
        }

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

        raffle.status = STATUS.CANCELLED;
        emit RaffleCancelled(_raffleId, amountRaised);
    }

    function setRaffleToNotCancel(uint256 _raffleId) external nonReentrant {
        RaffleStruct storage raffle = raffles[_raffleId];
        require(raffle.creator == msg.sender, "Not raffle creator.");
        if (raffle.canCancel == true) {
            raffle.canCancel = false;
            emit RaffleSetNotToCancel(_raffleId, msg.sender);
        }
    }

    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":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":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"}],"name":"RaffleSetNotToCancel","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":[],"name":"CANCELATION_RAFFLE_FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHAINLINK_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":"ChangeCancellationFeeBase","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":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_numberEntries","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"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"},{"internalType":"uint256","name":"_maxEntriesUser","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"},{"internalType":"uint256","name":"_maxEntriesUser","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"},{"internalType":"uint256","name":"_maxEntriesUser","type":"uint256"}],"name":"createRaffleSubscriber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"entriesInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"entriesList","outputs":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"uint256","name":"entries","type":"uint256"}],"stateMutability":"view","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":"address","name":"player","type":"address"},{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"uint256","name":"entries","type":"uint256"}],"internalType":"struct RafldexV2_4.EntriesBought[]","name":"","type":"tuple[]"}],"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":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"_isSubscriber","type":"bool"}],"name":"giveorRemoveSubscriptionTo","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 RafldexV2_4.STATUS","name":"status","type":"uint8"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"entriesSupply","type":"uint256"},{"internalType":"uint256","name":"pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"maxEntriesUser","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"randomNumber","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":"bool","name":"canCancel","type":"bool"}],"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":"setRaffleToNotCancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setWinnerRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setWinnerRaffleEmergency","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"}]

60a06040527f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef600455600580546b032a00000001002625a000036001600160901b0319909116179055600d80546001600160a01b031916732300ae69d7d1ea0457ad79e822422888e3ee3e8717905566354a6ba7a18000600e5566470de4df820000600f55662386f26fc10000601055666a94d74f4300006011556706f05b59d3b200006012556101f460135561015e60145561012c6015556096601655601a805461ffff19169055348015620000d557600080fd5b5073271682deb8c4e0901d1a1550ad2e64d568e69909620000f6336200018d565b600180556001600160a01b0316608052600280546001600160a01b031990811673271682deb8c4e0901d1a1550ad2e64d568e69909179091556003805490911673514910771af9ca656af840dff83e8264ecf986ca1790556200017a7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c33620001dd565b62000187600033620001dd565b62000249565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001e98282620001ed565b5050565b6000828152601b602090815260408083206001600160a01b038516845290915290205460ff16620001e9576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b608051615c516200026c60003960008181611448015261148a0152615c516000f3fe6080604052600436106103ad5760003560e01c806388aaf2a9116101e7578063cf482ee91161010d578063e096839b116100a0578063f36914551161006f578063f369145514610baa578063f5b541a614610bca578063f860cec514610bec578063ff0b906c14610c0157600080fd5b8063e096839b14610b35578063ead5c7bd14610b4b578063f23a6e6114610b5e578063f2fde38b14610b8a57600080fd5b8063d547741f116100dc578063d547741f14610abf578063d703ece814610adf578063dadc9b4014610af5578063dd59e92c14610b1557600080fd5b8063cf482ee914610a48578063cf7874a314610a5b578063d0038ff414610a8f578063d3c4d66414610aa957600080fd5b8063a79bdca411610185578063b66163a911610154578063b66163a9146109d1578063bc0618c3146109f1578063bc197c8114610a07578063cb77c14714610a3357600080fd5b8063a79bdca41461095b578063aaced47014610971578063acbb4eff1461099e578063b26a78c5146109be57600080fd5b80638dfc13b6116101c15780638dfc13b6146108e657806391d14854146109065780639dde45da14610926578063a217fddf1461094657600080fd5b806388aaf2a91461087557806388ec392c146108945780638da5cb5b146108b457600080fd5b80634c72e770116102d75780636a890cb21161026a578063715018a611610239578063715018a6146107d7578063719c0a13146107ec57806381d12c581461080c5780638354a49c1461085557600080fd5b80636a890cb21461074b5780636bf3f8f6146107615780636cc735d5146107915780636fd96903146107c157600080fd5b8063581343c4116102a6578063581343c4146106c05780635d4bc0ce146106e05780635fba31711461071857806369f26fb01461072b57600080fd5b80634c72e7701461063d5780634c86bca11461065d57806350aa9dda1461067357806353e53a871461069357600080fd5b806321f4bd611161034f5780632f2ff15d1161031e5780632f2ff15d14610579578063365e3658146105995780634169933f146105c657806346988a401461061d57600080fd5b806321f4bd611461050057806329cb924d1461053057806329dd67f9146105435780632bb022b71461056357600080fd5b80630f5e812e1161038b5780630f5e812e1461045a578063150b7a021461047c5780631fe543e3146104c057806320c741b3146104e057600080fd5b8063013805c5146103b257806301a6e623146103fc57806301ffc9a71461042a575b600080fd5b3480156103be57600080fd5b506103d26103cd366004614dcc565b610c09565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b34801561040857600080fd5b5061041c610417366004614f4b565b610c55565b6040519081526020016103f3565b34801561043657600080fd5b5061044a610445366004615008565b611323565b60405190151581526020016103f3565b34801561046657600080fd5b5061047a610475366004615032565b61135a565b005b34801561048857600080fd5b506104a76104973660046150ba565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103f3565b3480156104cc57600080fd5b5061047a6104db366004615125565b61143d565b3480156104ec57600080fd5b5061047a6104fb366004615179565b6114c5565b34801561050c57600080fd5b5061044a61051b3660046151b2565b60186020526000908152604090205460ff1681565b34801561053c57600080fd5b504261041c565b34801561054f57600080fd5b5061047a61055e366004615032565b61150c565b34801561056f57600080fd5b5061041c60115481565b34801561058557600080fd5b5061047a6105943660046151cf565b61152d565b3480156105a557600080fd5b506105b96105b4366004615032565b611557565b6040516103f391906151f4565b3480156105d257600080fd5b506106026105e1366004615032565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103f3565b34801561062957600080fd5b5061041c610638366004615256565b6115ec565b34801561064957600080fd5b5061047a610658366004615032565b611673565b34801561066957600080fd5b5061041c600f5481565b34801561067f57600080fd5b5061047a61068e366004615282565b611694565b34801561069f57600080fd5b5061041c6106ae366004615032565b600c6020526000908152604090205481565b3480156106cc57600080fd5b5061047a6106db366004615032565b611786565b3480156106ec57600080fd5b506107006106fb366004615032565b61187f565b6040516103f39c9b9a999897969594939291906152de565b61047a610726366004615032565b611905565b34801561073757600080fd5b5061047a6107463660046151b2565b612010565b34801561075757600080fd5b5061041c60125481565b34801561076d57600080fd5b5061044a61077c3660046151b2565b60196020526000908152604090205460ff1681565b34801561079d57600080fd5b5061044a6107ac3660046151b2565b60176020526000908152604090205460ff1681565b3480156107cd57600080fd5b5061041c60155481565b3480156107e357600080fd5b5061047a61203a565b3480156107f857600080fd5b5061041c610807366004615032565b61204e565b34801561081857600080fd5b50610840610827366004615032565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103f3565b34801561086157600080fd5b5061047a610870366004615032565b6121db565b34801561088157600080fd5b50601a5461044a90610100900460ff1681565b3480156108a057600080fd5b5061047a6108af366004615032565b6121fc565b3480156108c057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103f3565b3480156108f257600080fd5b5061047a610901366004615390565b6123f5565b34801561091257600080fd5b5061044a6109213660046151cf565b612435565b34801561093257600080fd5b5061047a6109413660046153b6565b612460565b34801561095257600080fd5b5061041c600081565b34801561096757600080fd5b5061041c600e5481565b34801561097d57600080fd5b5061041c61098c3660046151b2565b600b6020526000908152604090205481565b3480156109aa57600080fd5b5061047a6109b9366004615032565b6124a9565b61047a6109cc3660046153df565b6124ca565b3480156109dd57600080fd5b5061047a6109ec366004615032565b612a8b565b3480156109fd57600080fd5b5061041c60145481565b348015610a1357600080fd5b506104a7610a22366004615418565b63bc197c8160e01b95945050505050565b348015610a3f57600080fd5b5061047a612aac565b61041c610a563660046154c5565b612ae5565b348015610a6757600080fd5b50610840610a76366004615032565b6007602052600090815260409020805460019091015482565b348015610a9b57600080fd5b50601a5461044a9060ff1681565b348015610ab557600080fd5b5061041c60135481565b348015610acb57600080fd5b5061047a610ada3660046151cf565b613473565b348015610aeb57600080fd5b5061041c60165481565b348015610b0157600080fd5b5061047a610b10366004615179565b613497565b348015610b2157600080fd5b5061047a610b30366004615256565b613522565b348015610b4157600080fd5b5061041c60105481565b61041c610b59366004614f4b565b61358d565b348015610b6a57600080fd5b506104a7610b793660046155a0565b63f23a6e6160e01b95945050505050565b348015610b9657600080fd5b5061047a610ba53660046151b2565b613d57565b348015610bb657600080fd5b506108ce610bc5366004614dcc565b613dcd565b348015610bd657600080fd5b5061041c600080516020615bfc83398151915281565b348015610bf857600080fd5b5061047a613eb1565b61047a613ee1565b60086020528160005260406000208181548110610c2557600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b6000600080516020615bfc83398151915233610c718282613f8c565b428b11610c995760405162461bcd60e51b8152600401610c9090615608565b60405180910390fd5b88518a5114610cf95760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c90565b87518a5114610d1a5760405162461bcd60e51b8152600401610c909061564c565b60008511610d3a5760405162461bcd60e51b8152600401610c909061569c565b600084118015610d4a5750848411155b610d665760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03871615610dad576001600160a01b03871660009081526018602052604090205460ff16610dad5760405162461bcd60e51b8152600401610c909061570e565b60005b8a518110156110065760006001600160a01b03168b8281518110610dd657610dd6615745565b60200260200101516001600160a01b031603610e045760405162461bcd60e51b8152600401610c909061575b565b888181518110610e1657610e16615745565b6020026020010151600003610f015760008b8281518110610e3957610e39615745565b60200260200101519050806001600160a01b0316636352211e8c8481518110610e6457610e64615745565b60200260200101516040518263ffffffff1660e01b8152600401610e8a91815260200190565b602060405180830381865afa158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190615780565b6001600160a01b0316336001600160a01b031614610efb5760405162461bcd60e51b8152600401610c909061579d565b50610ff4565b60008b8281518110610f1557610f15615745565b60200260200101519050898281518110610f3157610f31615745565b6020026020010151816001600160a01b031662fdd58e338e8681518110610f5a57610f5a615745565b60200260200101516040518363ffffffff1660e01b8152600401610f939291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610fb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd491906157d2565b1015610ff25760405162461bcd60e51b8152600401610c90906157eb565b505b80610ffe81615838565b915050610db0565b50600061101633308d8d8d613fe5565b604080516101e0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890526000610100820181905261012082018190523361014083015261016082018590526001600160a01b038c166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156110f4576110f46152c8565b021790555060208281015160018301556040830151805161111b9260028501920190614d17565b5060608201518051611137916003840191602090910190614d7c565b5060808201518051611153916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff19169115159190911790555460009061121790600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261129c5761129c615745565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611309929190615864565b60405180910390a2509d9c50505050505050505050505050565b60006001600160e01b03198216630271189760e51b148061135457506301ffc9a760e01b6001600160e01b03198316145b92915050565b611362614073565b60006009828154811061137757611377615745565b60009182526020909120600a600f90920201908101549091506001600160a01b031633146113dd5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c90565b600e81015460ff16151560010361143057600e8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b5061143a60018055565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b75760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610c90565b6114c182826140cc565b5050565b600080516020615bfc833981519152336114df8282613f8c565b50506001600160a01b03919091166000908152601960205260409020805460ff1916911515919091179055565b600080516020615bfc833981519152336115268282613f8c565b5050600455565b600080516020615bfc833981519152336115478282613f8c565b6115518484614203565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156115e1576000848152602090819020604080516060810182526003860290920180546001600160a01b031683526001808201548486015260029091015491830191909152908352909201910161158c565b505050509050919050565b6001600160a01b0382166000908152600b602052604081205481901561166c57604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b90935292909120546116689190615851565b9150505b9392505050565b600080516020615bfc8339815191523361168d8282613f8c565b5050600f55565b600080516020615bfc833981519152336116ae8282613f8c565b60005b845181101561177f5783601760008784815181106116d1576116d1615745565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905583151560010361176d577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e7385828151811061174057611740615745565b602002602001015160405161176491906001600160a01b0391909116815260200190565b60405180910390a15b8061177781615838565b9150506116b1565b5050505050565b600080516020615bfc833981519152336117a08282613f8c565b6000600984815481106117b5576117b5615745565b60009182526020909120600f9091020190506002815460ff1660048111156117df576117df6152c8565b146117fc5760405162461bcd60e51b8152600401610c90906158e8565b600d810154604080514360208083019190915242828401524560608084019190915241901b6bffffffffffffffffffffffff1916608083015282518083036074018152609490920190925280519101206000611858838361592e565b611863906001615942565b6009850181905590506118768782614242565b50505050505050565b6009818154811061188f57600080fd5b60009182526020909120600f909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e909b015460ff9a8b169c50989a9799969895976001600160a01b039586169794969386169592949190921692168c565b61190d614073565b60006009828154811061192257611922615745565b60009182526020909120600a600f90920201908101549091506001600160a01b03163314806119645750611964600080516020615bfc83398151915233612435565b6119b05760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c90565b428160010154116119d35760405162461bcd60e51b8152600401610c9090615608565b6000815460ff1660048111156119eb576119eb6152c8565b14611a275760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c90565b611a3f600080516020615bfc83398151915233612435565b611b7a57600e81015460ff16611a8b5760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c90565b80600d0154600003611aea573415611ae55760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c90565b611b7a565b601154341015611b3c5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c90565b600d546011546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611b78573d6000803e3d6000fd5b505b60008281526008602052604090205460c8811115611bf95760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610c90565b6000826006015483600d0154611c0f9190615955565b600c8401549091506001600160a01b0316611d075760005b82811015611d01576000858152600860205260408120805483908110611c4f57611c4f615745565b60009182526020909120600390910201546001600160a01b031690508015611cee576000868152600860205260408120805484908110611c9157611c91615745565b9060005260206000209060030201600201548660060154611cb29190615955565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611ceb573d6000803e3d6000fd5b50505b5080611cf981615838565b915050611c27565b50611e9f565b600c83015460405163095ea7b360e01b8152306004820152602481018390526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015611d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7e919061596c565b5060005b82811015611e9d576000858152600860205260408120805483908110611daa57611daa615745565b60009182526020909120600390910201546001600160a01b031690508015611e8a576000868152600860205260408120805484908110611dec57611dec615745565b9060005260206000209060030201600201548660060154611e0d9190615955565b600c8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611e4490309086908690600401615989565b6020604051808303816000875af1158015611e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e87919061596c565b50505b5080611e9581615838565b915050611d82565b505b611fc33084600a0160009054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611f1357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611ef5575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611f6657602002820191906000526020600020905b815481526020019060010190808311611f52575b505050505087600401805480602002602001604051908101604052809291908181526020018280548015611fb957602002820191906000526020600020905b815481526020019060010190808311611fa5575b5050505050613fe5565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a250505061143a60018055565b612018614833565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b612042614833565b61204c600061488d565b565b6000600080516020615bfc8339815191523361206a8282613f8c565b60006009858154811061207f5761207f615745565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152600f90930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015612122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214691906157d2565b604080518082018252878152600d8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b600080516020615bfc833981519152336121f58282613f8c565b5050601155565b612204614073565b60006009828154811061221957612219615745565b60009182526020909120600a600f90920201908101549091506001600160a01b031633148061225b575061225b600080516020615bfc83398151915233612435565b6122a75760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610c90565b6122bf600080516020615bfc83398151915233612435565b1561233657806005015481600d015414806122de575042816001015411155b6123365760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610c90565b6000815460ff16600481111561234e5761234e6152c8565b1461236b5760405162461bcd60e51b8152600401610c90906158e8565b805460ff19166001178155600d810154600682015460009061238d9083615955565b9050816000036123b757825460ff1916600217835560098301546123b2908590614242565b6123c3565b6123c184836148dd565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611ffc91815260200190565b600080516020615bfc8339815191523361240f8282613f8c565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615bfc8339815191523361247a8282613f8c565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b600080516020615bfc833981519152336124c38282613f8c565b5050601055565b6000600984815481106124df576124df615745565b90600052602060002090600f020190506124f64290565b8160010154116125405760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c90565b6000815460ff166004811115612558576125586152c8565b146125a55760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610c90565b6000831180156125b9575080600701548311155b61262b5760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610c90565b6001600160a01b0382166126815760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c90565b6009848154811061269457612694615745565b90600052602060002090600f0201600501548382600d01546126b69190615942565b11156127045760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c90565b600c8101546001600160a01b0316612749578281600601546127269190615955565b34146127445760405162461bcd60e51b8152600401610c90906159ad565b6128c9565b8281600601546127599190615955565b600c8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156127a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c791906157d2565b101561283b5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610c90565b600c81015460068201546001600160a01b03909116906323b872dd9033903090612866908890615955565b6040518463ffffffff1660e01b815260040161288493929190615989565b6020604051808303816000875af11580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c7919061596c565b505b60408051336020820152908101859052600090606001604051602081830303815290604052805190602001209050816007015484600c60008481526020019081526020016000205461291b9190615942565b11156129695760405162461bcd60e51b815260206004820152601960248201527f4d617820656e7472696573207573657220726561636865642e000000000000006044820152606401610c90565b6000818152600c602052604081208054869290612987908490615942565b9250508190555060006040518060600160405280856001600160a01b031681526020018685600d01546129ba9190615942565b815260209081018790526000888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508792909190612a33908490615942565b9091555050600d83015460408051918252602082018790526001600160a01b0386169188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b600080516020615bfc83398151915233612aa58282613f8c565b5050601255565b600080516020615bfc83398151915233612ac68282613f8c565b5050601a805461ff001981166101009182900460ff1615909102179055565b6000612aef614073565b601a5460ff16612b4c5760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c90565b428911612b6b5760405162461bcd60e51b8152600401610c9090615608565b8651885114612b8c5760405162461bcd60e51b8152600401610c90906159f1565b8551885114612bad5760405162461bcd60e51b8152600401610c909061564c565b60008311612bcd5760405162461bcd60e51b8152600401610c909061569c565b600082118015612bdd5750828211155b612bf95760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03851615612c40576001600160a01b03851660009081526018602052604090205460ff16612c405760405162461bcd60e51b8152600401610c909061570e565b60005b8851811015612e995760006001600160a01b0316898281518110612c6957612c69615745565b60200260200101516001600160a01b031603612c975760405162461bcd60e51b8152600401610c909061575b565b868181518110612ca957612ca9615745565b6020026020010151600003612d94576000898281518110612ccc57612ccc615745565b60200260200101519050806001600160a01b0316636352211e8a8481518110612cf757612cf7615745565b60200260200101516040518263ffffffff1660e01b8152600401612d1d91815260200190565b602060405180830381865afa158015612d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5e9190615780565b6001600160a01b0316336001600160a01b031614612d8e5760405162461bcd60e51b8152600401610c909061579d565b50612e87565b6000898281518110612da857612da8615745565b60200260200101519050878281518110612dc457612dc4615745565b6020026020010151816001600160a01b031662fdd58e338c8681518110612ded57612ded615745565b60200260200101516040518363ffffffff1660e01b8152600401612e269291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015612e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6791906157d2565b1015612e855760405162461bcd60e51b8152600401610c90906157eb565b505b80612e9181615838565b915050612c43565b506001600160a01b03851660009081526019602052604081205460ff1615612ef357600e54601054612ecb9190615942565b341015612eea5760405162461bcd60e51b8152600401610c9090615a46565b50601454612f27565b600e54600f54612f039190615942565b341015612f225760405162461bcd60e51b8152600401610c9090615a46565b506013545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f949190615780565b6001600160a01b031614612fea5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c90565b604080516001600160a01b038f1660208201529081018d90526000906060016040516020818303038152906040528051906020012090506130284290565b6000828152600a602052604090206001015411156130d957600061304c8f8f6115ec565b116130b25760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c90565b6000818152600a602052604081206002018054916130cf83615838565b9190505550613113565b426000828152600a6020526040902055426130f79062278d00615942565b6000828152600a60205260409020600180820192909255600201555b61312033308d8d8d613fe5565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613159573d6000803e3d6000fd5b50604080516101e0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890526000610100820181905261012082018190523361014083015261016082018790526001600160a01b038c166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613238576132386152c8565b021790555060208281015160018301556040830151805161325f9260028501920190614d17565b506060820151805161327b916003840191602090910190614d7c565b5060808201518051613297916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff19169115159190911790555460009061335b90600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926133e0576133e0615745565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f60405161344d929190615864565b60405180910390a25094505050505061346560018055565b9a9950505050505050505050565b600080516020615bfc8339815191523361348d8282613f8c565b6115518484614a4e565b600080516020615bfc833981519152336134b18282613f8c565b6001600160a01b0384166000908152601860205260409020805460ff1916841515908117909155600103611551576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c733906020015b60405180910390a150505050565b600080516020615bfc8339815191523361353c8282613f8c565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d9101613514565b6000613597614073565b601a54610100900460ff166135fe5760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c90565b3360009081526017602052604090205460ff1661366d5760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610c90565b42891161368c5760405162461bcd60e51b8152600401610c9090615608565b86518851146136ad5760405162461bcd60e51b8152600401610c90906159f1565b85518851146136ce5760405162461bcd60e51b8152600401610c909061564c565b600e543410156136f05760405162461bcd60e51b8152600401610c9090615a46565b600083116137105760405162461bcd60e51b8152600401610c909061569c565b6000821180156137205750828211155b61373c5760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03851615613783576001600160a01b03851660009081526018602052604090205460ff166137835760405162461bcd60e51b8152600401610c909061570e565b60005b88518110156139dc5760006001600160a01b03168982815181106137ac576137ac615745565b60200260200101516001600160a01b0316036137da5760405162461bcd60e51b8152600401610c909061575b565b8681815181106137ec576137ec615745565b60200260200101516000036138d757600089828151811061380f5761380f615745565b60200260200101519050806001600160a01b0316636352211e8a848151811061383a5761383a615745565b60200260200101516040518263ffffffff1660e01b815260040161386091815260200190565b602060405180830381865afa15801561387d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138a19190615780565b6001600160a01b0316336001600160a01b0316146138d15760405162461bcd60e51b8152600401610c909061579d565b506139ca565b60008982815181106138eb576138eb615745565b6020026020010151905087828151811061390757613907615745565b6020026020010151816001600160a01b031662fdd58e338c868151811061393057613930615745565b60200260200101516040518363ffffffff1660e01b81526004016139699291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139aa91906157d2565b10156139c85760405162461bcd60e51b8152600401610c90906157eb565b505b806139d481615838565b915050613786565b506001600160a01b03851660009081526019602052604081205460ff1615613a075750601654613a0c565b506015545b613a1933308b8b8b613fe5565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613a52573d6000803e3d6000fd5b50604080516101e0810190915260009080828152602081018d9052604081018c9052606081018b9052608081018a905260a0810187905260c0810188905260e081018690526000610100820181905261012082018190523361014083015261016082018590526001600160a01b038a166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613b3157613b316152c8565b0217905550602082810151600183015560408301518051613b589260028501920190614d17565b5060608201518051613b74916003840191602090910190614d7c565b5060808201518051613b90916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff191691151591909117905554600090613c5490600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b03909216919091178155915192820192909255935160029094019390935583815282549394509092613cd957613cd9615745565b60009182526020822060039091020180546001600160a01b0319168155600181018290556002015560405182907ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a490613d35908f908f90615864565b60405180910390a25092505050613d4b60018055565b98975050505050505050565b613d5f614833565b6001600160a01b038116613dc45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c90565b61143a8161488d565b60008281526008602052604081208190815b8154811015613e5f576000828281548110613dfc57613dfc615745565b9060005260206000209060030201600101549050858110613e4c57828281548110613e2957613e29615745565b60009182526020909120600390910201546001600160a01b03169350613e5f9050565b5080613e5781615838565b915050613ddf565b506001600160a01b038216613ea95760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c90565b509392505050565b600080516020615bfc83398151915233613ecb8282613f8c565b5050601a805460ff19811660ff90911615179055565b6012543414613f025760405162461bcd60e51b8152600401610c90906159ad565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613f3b573d6000803e3d6000fd5b5033600081815260176020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b613f968282612435565b6114c157613fa381614a8b565b613fae836020614a9d565b604051602001613fbf929190615a9a565b60408051601f198184030181529082905262461bcd60e51b8252610c9091600401615b3b565b60005b825181101561406b57614059868686848151811061400857614008615745565b602002602001015186858151811061402257614022615745565b602002602001015186868151811061403c5761403c615745565b602002602001015160405180602001604052806000815250614c38565b8061406381615838565b915050613fe8565b505050505050565b6002600154036140c55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c90565b6002600155565b6000828152600760205260408120600101548251839083906140f0576140f0615745565b6020026020010151614102919061592e565b61410d906001615942565b600084815260076020526040812054600980549394509192811061413357614133615745565b90600052602060002090600f02019050818160090181905550600060405180604001604052808560008151811061416c5761416c615745565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a260008581526007602052604090205461177f9084614242565b61420d8282612435565b6114c1576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b61424a614073565b60006009838154811061425f5761425f615745565b60009182526020909120600f9091020190506002815460ff166004811115614289576142896152c8565b146142a65760405162461bcd60e51b8152600401610c90906158e8565b60098101829055600d810154156142c6576142c18383613dcd565b6142d5565b600a8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b03929092169182179055600282018054604080516020808402820181019092528281526144039430949093919290919083018282801561435557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614337575b5050505050846003018054806020026020016040519081016040528092919081815260200182805480156143a857602002820191906000526020600020905b815481526020019060010190808311614394575b505050505085600401805480602002602001604051908101604052809291908181526020018280548015611fb95760200282019190600052602060002090815481526020019060010190808311611fa5575050505050613fe5565b6000816006015482600d01546144199190615955565b9050600061271083600b0154836144309190615955565b61443a9190615b4e565b905060006144488284615851565b600c8501549091506001600160a01b03166145a157600a8401546040516000916001600160a01b03169083908381818185875af1925050503d80600081146144ac576040519150601f19603f3d011682016040523d82523d6000602084013e6144b1565b606091505b50509050806144f75760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c90565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614544576040519150601f19603f3d011682016040523d82523d6000602084013e614549565b606091505b505090508061459a5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c90565b50506147c9565b600c84015460405163095ea7b360e01b8152306004820152602481018590526001600160a01b039091169063095ea7b3906044016020604051808303816000875af11580156145f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614618919061596c565b50600c840154600a8501546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd9261465792309216908790600401615989565b6020604051808303816000875af1158015614676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061469a919061596c565b9050806146e95760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c90565b600c850154600d546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd9261472592309216908990600401615989565b6020604051808303816000875af1158015614744573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614768919061596c565b9050806147c65760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c90565b50505b835460ff19166003178455600884015460098501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a3505050506114c160018055565b6000546001600160a01b0316331461204c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c90565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af115801561496f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061499391906157d2565b604080518082018252858152602080820186815260008581526007909252928120915182559151600190910155600980549293509091859081106149d9576149d9615745565b60009182526020909120600f909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b614a588282612435565b156114c1576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113546001600160a01b03831660145b60606000614aac836002615955565b614ab7906002615942565b6001600160401b03811115614ace57614ace614dee565b6040519080825280601f01601f191660200182016040528015614af8576020820181803683370190505b509050600360fc1b81600081518110614b1357614b13615745565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614b4257614b42615745565b60200101906001600160f81b031916908160001a9053506000614b66846002615955565b614b71906001615942565b90505b6001811115614be9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614ba557614ba5615745565b1a60f81b828281518110614bbb57614bbb615745565b60200101906001600160f81b031916908160001a90535060049490941c93614be281615b62565b9050614b74565b50831561166c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c90565b81600003614ca957604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614c72908990899088908790600401615b79565b600060405180830381600087803b158015614c8c57600080fd5b505af1158015614ca0573d6000803e3d6000fd5b5050505061406b565b604051637921219560e11b81526001600160a01b0385169063f242432a90614cdd9089908990889088908890600401615bb6565b600060405180830381600087803b158015614cf757600080fd5b505af1158015614d0b573d6000803e3d6000fd5b50505050505050505050565b828054828255906000526020600020908101928215614d6c579160200282015b82811115614d6c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614d37565b50614d78929150614db7565b5090565b828054828255906000526020600020908101928215614d6c579160200282015b82811115614d6c578251825591602001919060010190614d9c565b5b80821115614d785760008155600101614db8565b60008060408385031215614ddf57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614e2c57614e2c614dee565b604052919050565b60006001600160401b03821115614e4d57614e4d614dee565b5060051b60200190565b6001600160a01b038116811461143a57600080fd5b8035614e7781614e57565b919050565b600082601f830112614e8d57600080fd5b81356020614ea2614e9d83614e34565b614e04565b82815260059290921b84018101918181019086841115614ec157600080fd5b8286015b84811015614ee5578035614ed881614e57565b8352918301918301614ec5565b509695505050505050565b600082601f830112614f0157600080fd5b81356020614f11614e9d83614e34565b82815260059290921b84018101918181019086841115614f3057600080fd5b8286015b84811015614ee55780358352918301918301614f34565b600080600080600080600080610100898b031215614f6857600080fd5b8835975060208901356001600160401b0380821115614f8657600080fd5b614f928c838d01614e7c565b985060408b0135915080821115614fa857600080fd5b614fb48c838d01614ef0565b975060608b0135915080821115614fca57600080fd5b50614fd78b828c01614ef0565b955050614fe660808a01614e6c565b979a969950949793969560a0850135955060c08501359460e001359350915050565b60006020828403121561501a57600080fd5b81356001600160e01b03198116811461166c57600080fd5b60006020828403121561504457600080fd5b5035919050565b600082601f83011261505c57600080fd5b81356001600160401b0381111561507557615075614dee565b615088601f8201601f1916602001614e04565b81815284602083860101111561509d57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156150d057600080fd5b84356150db81614e57565b935060208501356150eb81614e57565b92506040850135915060608501356001600160401b0381111561510d57600080fd5b6151198782880161504b565b91505092959194509250565b6000806040838503121561513857600080fd5b8235915060208301356001600160401b0381111561515557600080fd5b61516185828601614ef0565b9150509250929050565b801515811461143a57600080fd5b6000806040838503121561518c57600080fd5b823561519781614e57565b915060208301356151a78161516b565b809150509250929050565b6000602082840312156151c457600080fd5b813561166c81614e57565b600080604083850312156151e257600080fd5b8235915060208301356151a781614e57565b602080825282518282018190526000919060409081850190868401855b8281101561524957815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101615211565b5091979650505050505050565b6000806040838503121561526957600080fd5b823561527481614e57565b946020939093013593505050565b6000806040838503121561529557600080fd5b82356001600160401b038111156152ab57600080fd5b6152b785828601614e7c565b92505060208301356151a78161516b565b634e487b7160e01b600052602160045260246000fd5b610180810160058e1061530157634e487b7160e01b600052602160045260246000fd5b8d82528c60208301528b60408301528a606083015289608083015261533160a083018a6001600160a01b03169052565b8760c083015261534c60e08301886001600160a01b03169052565b856101008301526153696101208301866001600160a01b03169052565b8361014083015261537f61016083018415159052565b9d9c50505050505050505050505050565b6000602082840312156153a257600080fd5b813563ffffffff8116811461166c57600080fd5b6000602082840312156153c857600080fd5b81356001600160401b038116811461166c57600080fd5b6000806000606084860312156153f457600080fd5b8335925060208401359150604084013561540d81614e57565b809150509250925092565b600080600080600060a0868803121561543057600080fd5b853561543b81614e57565b9450602086013561544b81614e57565b935060408601356001600160401b038082111561546757600080fd5b61547389838a01614ef0565b9450606088013591508082111561548957600080fd5b61549589838a01614ef0565b935060808801359150808211156154ab57600080fd5b506154b88882890161504b565b9150509295509295909350565b6000806000806000806000806000806101408b8d0312156154e557600080fd5b6154ee8b614e6c565b995060208b0135985060408b0135975060608b01356001600160401b038082111561551857600080fd5b6155248e838f01614e7c565b985060808d013591508082111561553a57600080fd5b6155468e838f01614ef0565b975060a08d013591508082111561555c57600080fd5b506155698d828e01614ef0565b95505061557860c08c01614e6c565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b600080600080600060a086880312156155b857600080fd5b85356155c381614e57565b945060208601356155d381614e57565b9350604086013592506060860135915060808601356001600160401b038111156155fc57600080fd5b6154b88882890161504b565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b60006020828403121561579257600080fd5b815161166c81614e57565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b6000602082840312156157e457600080fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001820161584a5761584a615822565b5060010190565b8181038181111561135457611354615822565b604080825283519082018190526000906020906060840190828701845b828110156158a65781516001600160a01b031684529284019290840190600101615881565b5050508381038285015284518082528583019183019060005b818110156158db578351835292840192918401916001016158bf565b5090979650505050505050565b602080825260169082015275526166666c6520696e2077726f6e672073746174757360501b604082015260600190565b634e487b7160e01b600052601260045260246000fd5b60008261593d5761593d615918565b500690565b8082018082111561135457611354615822565b808202811582820484141761135457611354615822565b60006020828403121561597e57600080fd5b815161166c8161516b565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b83811015615a91578181015183820152602001615a79565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615ad2816017850160208801615a76565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b03816028840160208801615a76565b01602801949350505050565b60008151808452615b27816020860160208601615a76565b601f01601f19169290920160200192915050565b60208152600061166c6020830184615b0f565b600082615b5d57615b5d615918565b500490565b600081615b7157615b71615822565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615bac90830184615b0f565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615bf090830184615b0f565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca26469706673582212209c4ed6ba7358af26f320c9b010355bc96cde3612b67544ec5203dc8e6c24d96364736f6c63430008120033

Deployed Bytecode

0x6080604052600436106103ad5760003560e01c806388aaf2a9116101e7578063cf482ee91161010d578063e096839b116100a0578063f36914551161006f578063f369145514610baa578063f5b541a614610bca578063f860cec514610bec578063ff0b906c14610c0157600080fd5b8063e096839b14610b35578063ead5c7bd14610b4b578063f23a6e6114610b5e578063f2fde38b14610b8a57600080fd5b8063d547741f116100dc578063d547741f14610abf578063d703ece814610adf578063dadc9b4014610af5578063dd59e92c14610b1557600080fd5b8063cf482ee914610a48578063cf7874a314610a5b578063d0038ff414610a8f578063d3c4d66414610aa957600080fd5b8063a79bdca411610185578063b66163a911610154578063b66163a9146109d1578063bc0618c3146109f1578063bc197c8114610a07578063cb77c14714610a3357600080fd5b8063a79bdca41461095b578063aaced47014610971578063acbb4eff1461099e578063b26a78c5146109be57600080fd5b80638dfc13b6116101c15780638dfc13b6146108e657806391d14854146109065780639dde45da14610926578063a217fddf1461094657600080fd5b806388aaf2a91461087557806388ec392c146108945780638da5cb5b146108b457600080fd5b80634c72e770116102d75780636a890cb21161026a578063715018a611610239578063715018a6146107d7578063719c0a13146107ec57806381d12c581461080c5780638354a49c1461085557600080fd5b80636a890cb21461074b5780636bf3f8f6146107615780636cc735d5146107915780636fd96903146107c157600080fd5b8063581343c4116102a6578063581343c4146106c05780635d4bc0ce146106e05780635fba31711461071857806369f26fb01461072b57600080fd5b80634c72e7701461063d5780634c86bca11461065d57806350aa9dda1461067357806353e53a871461069357600080fd5b806321f4bd611161034f5780632f2ff15d1161031e5780632f2ff15d14610579578063365e3658146105995780634169933f146105c657806346988a401461061d57600080fd5b806321f4bd611461050057806329cb924d1461053057806329dd67f9146105435780632bb022b71461056357600080fd5b80630f5e812e1161038b5780630f5e812e1461045a578063150b7a021461047c5780631fe543e3146104c057806320c741b3146104e057600080fd5b8063013805c5146103b257806301a6e623146103fc57806301ffc9a71461042a575b600080fd5b3480156103be57600080fd5b506103d26103cd366004614dcc565b610c09565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b34801561040857600080fd5b5061041c610417366004614f4b565b610c55565b6040519081526020016103f3565b34801561043657600080fd5b5061044a610445366004615008565b611323565b60405190151581526020016103f3565b34801561046657600080fd5b5061047a610475366004615032565b61135a565b005b34801561048857600080fd5b506104a76104973660046150ba565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103f3565b3480156104cc57600080fd5b5061047a6104db366004615125565b61143d565b3480156104ec57600080fd5b5061047a6104fb366004615179565b6114c5565b34801561050c57600080fd5b5061044a61051b3660046151b2565b60186020526000908152604090205460ff1681565b34801561053c57600080fd5b504261041c565b34801561054f57600080fd5b5061047a61055e366004615032565b61150c565b34801561056f57600080fd5b5061041c60115481565b34801561058557600080fd5b5061047a6105943660046151cf565b61152d565b3480156105a557600080fd5b506105b96105b4366004615032565b611557565b6040516103f391906151f4565b3480156105d257600080fd5b506106026105e1366004615032565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103f3565b34801561062957600080fd5b5061041c610638366004615256565b6115ec565b34801561064957600080fd5b5061047a610658366004615032565b611673565b34801561066957600080fd5b5061041c600f5481565b34801561067f57600080fd5b5061047a61068e366004615282565b611694565b34801561069f57600080fd5b5061041c6106ae366004615032565b600c6020526000908152604090205481565b3480156106cc57600080fd5b5061047a6106db366004615032565b611786565b3480156106ec57600080fd5b506107006106fb366004615032565b61187f565b6040516103f39c9b9a999897969594939291906152de565b61047a610726366004615032565b611905565b34801561073757600080fd5b5061047a6107463660046151b2565b612010565b34801561075757600080fd5b5061041c60125481565b34801561076d57600080fd5b5061044a61077c3660046151b2565b60196020526000908152604090205460ff1681565b34801561079d57600080fd5b5061044a6107ac3660046151b2565b60176020526000908152604090205460ff1681565b3480156107cd57600080fd5b5061041c60155481565b3480156107e357600080fd5b5061047a61203a565b3480156107f857600080fd5b5061041c610807366004615032565b61204e565b34801561081857600080fd5b50610840610827366004615032565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103f3565b34801561086157600080fd5b5061047a610870366004615032565b6121db565b34801561088157600080fd5b50601a5461044a90610100900460ff1681565b3480156108a057600080fd5b5061047a6108af366004615032565b6121fc565b3480156108c057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103f3565b3480156108f257600080fd5b5061047a610901366004615390565b6123f5565b34801561091257600080fd5b5061044a6109213660046151cf565b612435565b34801561093257600080fd5b5061047a6109413660046153b6565b612460565b34801561095257600080fd5b5061041c600081565b34801561096757600080fd5b5061041c600e5481565b34801561097d57600080fd5b5061041c61098c3660046151b2565b600b6020526000908152604090205481565b3480156109aa57600080fd5b5061047a6109b9366004615032565b6124a9565b61047a6109cc3660046153df565b6124ca565b3480156109dd57600080fd5b5061047a6109ec366004615032565b612a8b565b3480156109fd57600080fd5b5061041c60145481565b348015610a1357600080fd5b506104a7610a22366004615418565b63bc197c8160e01b95945050505050565b348015610a3f57600080fd5b5061047a612aac565b61041c610a563660046154c5565b612ae5565b348015610a6757600080fd5b50610840610a76366004615032565b6007602052600090815260409020805460019091015482565b348015610a9b57600080fd5b50601a5461044a9060ff1681565b348015610ab557600080fd5b5061041c60135481565b348015610acb57600080fd5b5061047a610ada3660046151cf565b613473565b348015610aeb57600080fd5b5061041c60165481565b348015610b0157600080fd5b5061047a610b10366004615179565b613497565b348015610b2157600080fd5b5061047a610b30366004615256565b613522565b348015610b4157600080fd5b5061041c60105481565b61041c610b59366004614f4b565b61358d565b348015610b6a57600080fd5b506104a7610b793660046155a0565b63f23a6e6160e01b95945050505050565b348015610b9657600080fd5b5061047a610ba53660046151b2565b613d57565b348015610bb657600080fd5b506108ce610bc5366004614dcc565b613dcd565b348015610bd657600080fd5b5061041c600080516020615bfc83398151915281565b348015610bf857600080fd5b5061047a613eb1565b61047a613ee1565b60086020528160005260406000208181548110610c2557600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b6000600080516020615bfc83398151915233610c718282613f8c565b428b11610c995760405162461bcd60e51b8152600401610c9090615608565b60405180910390fd5b88518a5114610cf95760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c90565b87518a5114610d1a5760405162461bcd60e51b8152600401610c909061564c565b60008511610d3a5760405162461bcd60e51b8152600401610c909061569c565b600084118015610d4a5750848411155b610d665760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03871615610dad576001600160a01b03871660009081526018602052604090205460ff16610dad5760405162461bcd60e51b8152600401610c909061570e565b60005b8a518110156110065760006001600160a01b03168b8281518110610dd657610dd6615745565b60200260200101516001600160a01b031603610e045760405162461bcd60e51b8152600401610c909061575b565b888181518110610e1657610e16615745565b6020026020010151600003610f015760008b8281518110610e3957610e39615745565b60200260200101519050806001600160a01b0316636352211e8c8481518110610e6457610e64615745565b60200260200101516040518263ffffffff1660e01b8152600401610e8a91815260200190565b602060405180830381865afa158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190615780565b6001600160a01b0316336001600160a01b031614610efb5760405162461bcd60e51b8152600401610c909061579d565b50610ff4565b60008b8281518110610f1557610f15615745565b60200260200101519050898281518110610f3157610f31615745565b6020026020010151816001600160a01b031662fdd58e338e8681518110610f5a57610f5a615745565b60200260200101516040518363ffffffff1660e01b8152600401610f939291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610fb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd491906157d2565b1015610ff25760405162461bcd60e51b8152600401610c90906157eb565b505b80610ffe81615838565b915050610db0565b50600061101633308d8d8d613fe5565b604080516101e0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890526000610100820181905261012082018190523361014083015261016082018590526001600160a01b038c166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156110f4576110f46152c8565b021790555060208281015160018301556040830151805161111b9260028501920190614d17565b5060608201518051611137916003840191602090910190614d7c565b5060808201518051611153916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff19169115159190911790555460009061121790600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261129c5761129c615745565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611309929190615864565b60405180910390a2509d9c50505050505050505050505050565b60006001600160e01b03198216630271189760e51b148061135457506301ffc9a760e01b6001600160e01b03198316145b92915050565b611362614073565b60006009828154811061137757611377615745565b60009182526020909120600a600f90920201908101549091506001600160a01b031633146113dd5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c90565b600e81015460ff16151560010361143057600e8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b5061143a60018055565b50565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146114b75760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610c90565b6114c182826140cc565b5050565b600080516020615bfc833981519152336114df8282613f8c565b50506001600160a01b03919091166000908152601960205260409020805460ff1916911515919091179055565b600080516020615bfc833981519152336115268282613f8c565b5050600455565b600080516020615bfc833981519152336115478282613f8c565b6115518484614203565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156115e1576000848152602090819020604080516060810182526003860290920180546001600160a01b031683526001808201548486015260029091015491830191909152908352909201910161158c565b505050509050919050565b6001600160a01b0382166000908152600b602052604081205481901561166c57604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b90935292909120546116689190615851565b9150505b9392505050565b600080516020615bfc8339815191523361168d8282613f8c565b5050600f55565b600080516020615bfc833981519152336116ae8282613f8c565b60005b845181101561177f5783601760008784815181106116d1576116d1615745565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905583151560010361176d577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e7385828151811061174057611740615745565b602002602001015160405161176491906001600160a01b0391909116815260200190565b60405180910390a15b8061177781615838565b9150506116b1565b5050505050565b600080516020615bfc833981519152336117a08282613f8c565b6000600984815481106117b5576117b5615745565b60009182526020909120600f9091020190506002815460ff1660048111156117df576117df6152c8565b146117fc5760405162461bcd60e51b8152600401610c90906158e8565b600d810154604080514360208083019190915242828401524560608084019190915241901b6bffffffffffffffffffffffff1916608083015282518083036074018152609490920190925280519101206000611858838361592e565b611863906001615942565b6009850181905590506118768782614242565b50505050505050565b6009818154811061188f57600080fd5b60009182526020909120600f909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e909b015460ff9a8b169c50989a9799969895976001600160a01b039586169794969386169592949190921692168c565b61190d614073565b60006009828154811061192257611922615745565b60009182526020909120600a600f90920201908101549091506001600160a01b03163314806119645750611964600080516020615bfc83398151915233612435565b6119b05760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c90565b428160010154116119d35760405162461bcd60e51b8152600401610c9090615608565b6000815460ff1660048111156119eb576119eb6152c8565b14611a275760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c90565b611a3f600080516020615bfc83398151915233612435565b611b7a57600e81015460ff16611a8b5760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c90565b80600d0154600003611aea573415611ae55760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c90565b611b7a565b601154341015611b3c5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c90565b600d546011546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611b78573d6000803e3d6000fd5b505b60008281526008602052604090205460c8811115611bf95760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610c90565b6000826006015483600d0154611c0f9190615955565b600c8401549091506001600160a01b0316611d075760005b82811015611d01576000858152600860205260408120805483908110611c4f57611c4f615745565b60009182526020909120600390910201546001600160a01b031690508015611cee576000868152600860205260408120805484908110611c9157611c91615745565b9060005260206000209060030201600201548660060154611cb29190615955565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611ceb573d6000803e3d6000fd5b50505b5080611cf981615838565b915050611c27565b50611e9f565b600c83015460405163095ea7b360e01b8152306004820152602481018390526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015611d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7e919061596c565b5060005b82811015611e9d576000858152600860205260408120805483908110611daa57611daa615745565b60009182526020909120600390910201546001600160a01b031690508015611e8a576000868152600860205260408120805484908110611dec57611dec615745565b9060005260206000209060030201600201548660060154611e0d9190615955565b600c8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611e4490309086908690600401615989565b6020604051808303816000875af1158015611e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e87919061596c565b50505b5080611e9581615838565b915050611d82565b505b611fc33084600a0160009054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611f1357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611ef5575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611f6657602002820191906000526020600020905b815481526020019060010190808311611f52575b505050505087600401805480602002602001604051908101604052809291908181526020018280548015611fb957602002820191906000526020600020905b815481526020019060010190808311611fa5575b5050505050613fe5565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a250505061143a60018055565b612018614833565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b612042614833565b61204c600061488d565b565b6000600080516020615bfc8339815191523361206a8282613f8c565b60006009858154811061207f5761207f615745565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152600f90930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015612122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061214691906157d2565b604080518082018252878152600d8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b600080516020615bfc833981519152336121f58282613f8c565b5050601155565b612204614073565b60006009828154811061221957612219615745565b60009182526020909120600a600f90920201908101549091506001600160a01b031633148061225b575061225b600080516020615bfc83398151915233612435565b6122a75760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610c90565b6122bf600080516020615bfc83398151915233612435565b1561233657806005015481600d015414806122de575042816001015411155b6123365760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610c90565b6000815460ff16600481111561234e5761234e6152c8565b1461236b5760405162461bcd60e51b8152600401610c90906158e8565b805460ff19166001178155600d810154600682015460009061238d9083615955565b9050816000036123b757825460ff1916600217835560098301546123b2908590614242565b6123c3565b6123c184836148dd565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611ffc91815260200190565b600080516020615bfc8339815191523361240f8282613f8c565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615bfc8339815191523361247a8282613f8c565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b600080516020615bfc833981519152336124c38282613f8c565b5050601055565b6000600984815481106124df576124df615745565b90600052602060002090600f020190506124f64290565b8160010154116125405760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c90565b6000815460ff166004811115612558576125586152c8565b146125a55760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610c90565b6000831180156125b9575080600701548311155b61262b5760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610c90565b6001600160a01b0382166126815760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c90565b6009848154811061269457612694615745565b90600052602060002090600f0201600501548382600d01546126b69190615942565b11156127045760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c90565b600c8101546001600160a01b0316612749578281600601546127269190615955565b34146127445760405162461bcd60e51b8152600401610c90906159ad565b6128c9565b8281600601546127599190615955565b600c8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156127a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c791906157d2565b101561283b5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610c90565b600c81015460068201546001600160a01b03909116906323b872dd9033903090612866908890615955565b6040518463ffffffff1660e01b815260040161288493929190615989565b6020604051808303816000875af11580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c7919061596c565b505b60408051336020820152908101859052600090606001604051602081830303815290604052805190602001209050816007015484600c60008481526020019081526020016000205461291b9190615942565b11156129695760405162461bcd60e51b815260206004820152601960248201527f4d617820656e7472696573207573657220726561636865642e000000000000006044820152606401610c90565b6000818152600c602052604081208054869290612987908490615942565b9250508190555060006040518060600160405280856001600160a01b031681526020018685600d01546129ba9190615942565b815260209081018790526000888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508792909190612a33908490615942565b9091555050600d83015460408051918252602082018790526001600160a01b0386169188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b600080516020615bfc83398151915233612aa58282613f8c565b5050601255565b600080516020615bfc83398151915233612ac68282613f8c565b5050601a805461ff001981166101009182900460ff1615909102179055565b6000612aef614073565b601a5460ff16612b4c5760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c90565b428911612b6b5760405162461bcd60e51b8152600401610c9090615608565b8651885114612b8c5760405162461bcd60e51b8152600401610c90906159f1565b8551885114612bad5760405162461bcd60e51b8152600401610c909061564c565b60008311612bcd5760405162461bcd60e51b8152600401610c909061569c565b600082118015612bdd5750828211155b612bf95760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03851615612c40576001600160a01b03851660009081526018602052604090205460ff16612c405760405162461bcd60e51b8152600401610c909061570e565b60005b8851811015612e995760006001600160a01b0316898281518110612c6957612c69615745565b60200260200101516001600160a01b031603612c975760405162461bcd60e51b8152600401610c909061575b565b868181518110612ca957612ca9615745565b6020026020010151600003612d94576000898281518110612ccc57612ccc615745565b60200260200101519050806001600160a01b0316636352211e8a8481518110612cf757612cf7615745565b60200260200101516040518263ffffffff1660e01b8152600401612d1d91815260200190565b602060405180830381865afa158015612d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5e9190615780565b6001600160a01b0316336001600160a01b031614612d8e5760405162461bcd60e51b8152600401610c909061579d565b50612e87565b6000898281518110612da857612da8615745565b60200260200101519050878281518110612dc457612dc4615745565b6020026020010151816001600160a01b031662fdd58e338c8681518110612ded57612ded615745565b60200260200101516040518363ffffffff1660e01b8152600401612e269291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015612e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6791906157d2565b1015612e855760405162461bcd60e51b8152600401610c90906157eb565b505b80612e9181615838565b915050612c43565b506001600160a01b03851660009081526019602052604081205460ff1615612ef357600e54601054612ecb9190615942565b341015612eea5760405162461bcd60e51b8152600401610c9090615a46565b50601454612f27565b600e54600f54612f039190615942565b341015612f225760405162461bcd60e51b8152600401610c9090615a46565b506013545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f949190615780565b6001600160a01b031614612fea5760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c90565b604080516001600160a01b038f1660208201529081018d90526000906060016040516020818303038152906040528051906020012090506130284290565b6000828152600a602052604090206001015411156130d957600061304c8f8f6115ec565b116130b25760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c90565b6000818152600a602052604081206002018054916130cf83615838565b9190505550613113565b426000828152600a6020526040902055426130f79062278d00615942565b6000828152600a60205260409020600180820192909255600201555b61312033308d8d8d613fe5565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613159573d6000803e3d6000fd5b50604080516101e0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890526000610100820181905261012082018190523361014083015261016082018790526001600160a01b038c166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613238576132386152c8565b021790555060208281015160018301556040830151805161325f9260028501920190614d17565b506060820151805161327b916003840191602090910190614d7c565b5060808201518051613297916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff19169115159190911790555460009061335b90600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926133e0576133e0615745565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f60405161344d929190615864565b60405180910390a25094505050505061346560018055565b9a9950505050505050505050565b600080516020615bfc8339815191523361348d8282613f8c565b6115518484614a4e565b600080516020615bfc833981519152336134b18282613f8c565b6001600160a01b0384166000908152601860205260409020805460ff1916841515908117909155600103611551576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c733906020015b60405180910390a150505050565b600080516020615bfc8339815191523361353c8282613f8c565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d9101613514565b6000613597614073565b601a54610100900460ff166135fe5760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c90565b3360009081526017602052604090205460ff1661366d5760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610c90565b42891161368c5760405162461bcd60e51b8152600401610c9090615608565b86518851146136ad5760405162461bcd60e51b8152600401610c90906159f1565b85518851146136ce5760405162461bcd60e51b8152600401610c909061564c565b600e543410156136f05760405162461bcd60e51b8152600401610c9090615a46565b600083116137105760405162461bcd60e51b8152600401610c909061569c565b6000821180156137205750828211155b61373c5760405162461bcd60e51b8152600401610c90906156c0565b6001600160a01b03851615613783576001600160a01b03851660009081526018602052604090205460ff166137835760405162461bcd60e51b8152600401610c909061570e565b60005b88518110156139dc5760006001600160a01b03168982815181106137ac576137ac615745565b60200260200101516001600160a01b0316036137da5760405162461bcd60e51b8152600401610c909061575b565b8681815181106137ec576137ec615745565b60200260200101516000036138d757600089828151811061380f5761380f615745565b60200260200101519050806001600160a01b0316636352211e8a848151811061383a5761383a615745565b60200260200101516040518263ffffffff1660e01b815260040161386091815260200190565b602060405180830381865afa15801561387d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138a19190615780565b6001600160a01b0316336001600160a01b0316146138d15760405162461bcd60e51b8152600401610c909061579d565b506139ca565b60008982815181106138eb576138eb615745565b6020026020010151905087828151811061390757613907615745565b6020026020010151816001600160a01b031662fdd58e338c868151811061393057613930615745565b60200260200101516040518363ffffffff1660e01b81526004016139699291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139aa91906157d2565b10156139c85760405162461bcd60e51b8152600401610c90906157eb565b505b806139d481615838565b915050613786565b506001600160a01b03851660009081526019602052604081205460ff1615613a075750601654613a0c565b506015545b613a1933308b8b8b613fe5565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613a52573d6000803e3d6000fd5b50604080516101e0810190915260009080828152602081018d9052604081018c9052606081018b9052608081018a905260a0810187905260c0810188905260e081018690526000610100820181905261012082018190523361014083015261016082018590526001600160a01b038a166101808301526101a0820181905260016101c090920182905260098054808401825591528251600f9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613b3157613b316152c8565b0217905550602082810151600183015560408301518051613b589260028501920190614d17565b5060608201518051613b74916003840191602090910190614d7c565b5060808201518051613b90916004840191602090910190614d7c565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c090920151600e909101805460ff191691151591909117905554600090613c5490600190615851565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b03909216919091178155915192820192909255935160029094019390935583815282549394509092613cd957613cd9615745565b60009182526020822060039091020180546001600160a01b0319168155600181018290556002015560405182907ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a490613d35908f908f90615864565b60405180910390a25092505050613d4b60018055565b98975050505050505050565b613d5f614833565b6001600160a01b038116613dc45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c90565b61143a8161488d565b60008281526008602052604081208190815b8154811015613e5f576000828281548110613dfc57613dfc615745565b9060005260206000209060030201600101549050858110613e4c57828281548110613e2957613e29615745565b60009182526020909120600390910201546001600160a01b03169350613e5f9050565b5080613e5781615838565b915050613ddf565b506001600160a01b038216613ea95760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c90565b509392505050565b600080516020615bfc83398151915233613ecb8282613f8c565b5050601a805460ff19811660ff90911615179055565b6012543414613f025760405162461bcd60e51b8152600401610c90906159ad565b600d546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613f3b573d6000803e3d6000fd5b5033600081815260176020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b613f968282612435565b6114c157613fa381614a8b565b613fae836020614a9d565b604051602001613fbf929190615a9a565b60408051601f198184030181529082905262461bcd60e51b8252610c9091600401615b3b565b60005b825181101561406b57614059868686848151811061400857614008615745565b602002602001015186858151811061402257614022615745565b602002602001015186868151811061403c5761403c615745565b602002602001015160405180602001604052806000815250614c38565b8061406381615838565b915050613fe8565b505050505050565b6002600154036140c55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c90565b6002600155565b6000828152600760205260408120600101548251839083906140f0576140f0615745565b6020026020010151614102919061592e565b61410d906001615942565b600084815260076020526040812054600980549394509192811061413357614133615745565b90600052602060002090600f02019050818160090181905550600060405180604001604052808560008151811061416c5761416c615745565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a260008581526007602052604090205461177f9084614242565b61420d8282612435565b6114c1576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b61424a614073565b60006009838154811061425f5761425f615745565b60009182526020909120600f9091020190506002815460ff166004811115614289576142896152c8565b146142a65760405162461bcd60e51b8152600401610c90906158e8565b60098101829055600d810154156142c6576142c18383613dcd565b6142d5565b600a8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b03929092169182179055600282018054604080516020808402820181019092528281526144039430949093919290919083018282801561435557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614337575b5050505050846003018054806020026020016040519081016040528092919081815260200182805480156143a857602002820191906000526020600020905b815481526020019060010190808311614394575b505050505085600401805480602002602001604051908101604052809291908181526020018280548015611fb95760200282019190600052602060002090815481526020019060010190808311611fa5575050505050613fe5565b6000816006015482600d01546144199190615955565b9050600061271083600b0154836144309190615955565b61443a9190615b4e565b905060006144488284615851565b600c8501549091506001600160a01b03166145a157600a8401546040516000916001600160a01b03169083908381818185875af1925050503d80600081146144ac576040519150601f19603f3d011682016040523d82523d6000602084013e6144b1565b606091505b50509050806144f75760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c90565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614544576040519150601f19603f3d011682016040523d82523d6000602084013e614549565b606091505b505090508061459a5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c90565b50506147c9565b600c84015460405163095ea7b360e01b8152306004820152602481018590526001600160a01b039091169063095ea7b3906044016020604051808303816000875af11580156145f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614618919061596c565b50600c840154600a8501546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd9261465792309216908790600401615989565b6020604051808303816000875af1158015614676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061469a919061596c565b9050806146e95760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c90565b600c850154600d546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd9261472592309216908990600401615989565b6020604051808303816000875af1158015614744573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614768919061596c565b9050806147c65760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c90565b50505b835460ff19166003178455600884015460098501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a3505050506114c160018055565b6000546001600160a01b0316331461204c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c90565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af115801561496f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061499391906157d2565b604080518082018252858152602080820186815260008581526007909252928120915182559151600190910155600980549293509091859081106149d9576149d9615745565b60009182526020909120600f909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b614a588282612435565b156114c1576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113546001600160a01b03831660145b60606000614aac836002615955565b614ab7906002615942565b6001600160401b03811115614ace57614ace614dee565b6040519080825280601f01601f191660200182016040528015614af8576020820181803683370190505b509050600360fc1b81600081518110614b1357614b13615745565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614b4257614b42615745565b60200101906001600160f81b031916908160001a9053506000614b66846002615955565b614b71906001615942565b90505b6001811115614be9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614ba557614ba5615745565b1a60f81b828281518110614bbb57614bbb615745565b60200101906001600160f81b031916908160001a90535060049490941c93614be281615b62565b9050614b74565b50831561166c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c90565b81600003614ca957604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614c72908990899088908790600401615b79565b600060405180830381600087803b158015614c8c57600080fd5b505af1158015614ca0573d6000803e3d6000fd5b5050505061406b565b604051637921219560e11b81526001600160a01b0385169063f242432a90614cdd9089908990889088908890600401615bb6565b600060405180830381600087803b158015614cf757600080fd5b505af1158015614d0b573d6000803e3d6000fd5b50505050505050505050565b828054828255906000526020600020908101928215614d6c579160200282015b82811115614d6c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614d37565b50614d78929150614db7565b5090565b828054828255906000526020600020908101928215614d6c579160200282015b82811115614d6c578251825591602001919060010190614d9c565b5b80821115614d785760008155600101614db8565b60008060408385031215614ddf57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614e2c57614e2c614dee565b604052919050565b60006001600160401b03821115614e4d57614e4d614dee565b5060051b60200190565b6001600160a01b038116811461143a57600080fd5b8035614e7781614e57565b919050565b600082601f830112614e8d57600080fd5b81356020614ea2614e9d83614e34565b614e04565b82815260059290921b84018101918181019086841115614ec157600080fd5b8286015b84811015614ee5578035614ed881614e57565b8352918301918301614ec5565b509695505050505050565b600082601f830112614f0157600080fd5b81356020614f11614e9d83614e34565b82815260059290921b84018101918181019086841115614f3057600080fd5b8286015b84811015614ee55780358352918301918301614f34565b600080600080600080600080610100898b031215614f6857600080fd5b8835975060208901356001600160401b0380821115614f8657600080fd5b614f928c838d01614e7c565b985060408b0135915080821115614fa857600080fd5b614fb48c838d01614ef0565b975060608b0135915080821115614fca57600080fd5b50614fd78b828c01614ef0565b955050614fe660808a01614e6c565b979a969950949793969560a0850135955060c08501359460e001359350915050565b60006020828403121561501a57600080fd5b81356001600160e01b03198116811461166c57600080fd5b60006020828403121561504457600080fd5b5035919050565b600082601f83011261505c57600080fd5b81356001600160401b0381111561507557615075614dee565b615088601f8201601f1916602001614e04565b81815284602083860101111561509d57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156150d057600080fd5b84356150db81614e57565b935060208501356150eb81614e57565b92506040850135915060608501356001600160401b0381111561510d57600080fd5b6151198782880161504b565b91505092959194509250565b6000806040838503121561513857600080fd5b8235915060208301356001600160401b0381111561515557600080fd5b61516185828601614ef0565b9150509250929050565b801515811461143a57600080fd5b6000806040838503121561518c57600080fd5b823561519781614e57565b915060208301356151a78161516b565b809150509250929050565b6000602082840312156151c457600080fd5b813561166c81614e57565b600080604083850312156151e257600080fd5b8235915060208301356151a781614e57565b602080825282518282018190526000919060409081850190868401855b8281101561524957815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101615211565b5091979650505050505050565b6000806040838503121561526957600080fd5b823561527481614e57565b946020939093013593505050565b6000806040838503121561529557600080fd5b82356001600160401b038111156152ab57600080fd5b6152b785828601614e7c565b92505060208301356151a78161516b565b634e487b7160e01b600052602160045260246000fd5b610180810160058e1061530157634e487b7160e01b600052602160045260246000fd5b8d82528c60208301528b60408301528a606083015289608083015261533160a083018a6001600160a01b03169052565b8760c083015261534c60e08301886001600160a01b03169052565b856101008301526153696101208301866001600160a01b03169052565b8361014083015261537f61016083018415159052565b9d9c50505050505050505050505050565b6000602082840312156153a257600080fd5b813563ffffffff8116811461166c57600080fd5b6000602082840312156153c857600080fd5b81356001600160401b038116811461166c57600080fd5b6000806000606084860312156153f457600080fd5b8335925060208401359150604084013561540d81614e57565b809150509250925092565b600080600080600060a0868803121561543057600080fd5b853561543b81614e57565b9450602086013561544b81614e57565b935060408601356001600160401b038082111561546757600080fd5b61547389838a01614ef0565b9450606088013591508082111561548957600080fd5b61549589838a01614ef0565b935060808801359150808211156154ab57600080fd5b506154b88882890161504b565b9150509295509295909350565b6000806000806000806000806000806101408b8d0312156154e557600080fd5b6154ee8b614e6c565b995060208b0135985060408b0135975060608b01356001600160401b038082111561551857600080fd5b6155248e838f01614e7c565b985060808d013591508082111561553a57600080fd5b6155468e838f01614ef0565b975060a08d013591508082111561555c57600080fd5b506155698d828e01614ef0565b95505061557860c08c01614e6c565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b600080600080600060a086880312156155b857600080fd5b85356155c381614e57565b945060208601356155d381614e57565b9350604086013592506060860135915060808601356001600160401b038111156155fc57600080fd5b6154b88882890161504b565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b60006020828403121561579257600080fd5b815161166c81614e57565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b6000602082840312156157e457600080fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001820161584a5761584a615822565b5060010190565b8181038181111561135457611354615822565b604080825283519082018190526000906020906060840190828701845b828110156158a65781516001600160a01b031684529284019290840190600101615881565b5050508381038285015284518082528583019183019060005b818110156158db578351835292840192918401916001016158bf565b5090979650505050505050565b602080825260169082015275526166666c6520696e2077726f6e672073746174757360501b604082015260600190565b634e487b7160e01b600052601260045260246000fd5b60008261593d5761593d615918565b500690565b8082018082111561135457611354615822565b808202811582820484141761135457611354615822565b60006020828403121561597e57600080fd5b815161166c8161516b565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b83811015615a91578181015183820152602001615a79565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615ad2816017850160208801615a76565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b03816028840160208801615a76565b01602801949350505050565b60008151808452615b27816020860160208601615a76565b601f01601f19169290920160200192915050565b60208152600061166c6020830184615b0f565b600082615b5d57615b5d615918565b500490565b600081615b7157615b71615822565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615bac90830184615b0f565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615bf090830184615b0f565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca26469706673582212209c4ed6ba7358af26f320c9b010355bc96cde3612b67544ec5203dc8e6c24d96364736f6c63430008120033

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.