ETH Price: $2,782.16 (-1.33%)

Contract

0xca0BD2D68b19553826E34201C89248F809507e4e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Winner Raffl...184954212023-11-04 1:31:59460 days ago1699061519IN
0xca0BD2D6...809507e4e
0 ETH0.0023828715.44195381
Buy Entry184950972023-11-04 0:26:47460 days ago1699057607IN
0xca0BD2D6...809507e4e
0.0078 ETH0.0017152712.27245948
Buy Entry184950752023-11-04 0:22:23460 days ago1699057343IN
0xca0BD2D6...809507e4e
0.0013 ETH0.0017833814.53853516
Buy Entry184950672023-11-04 0:20:47460 days ago1699057247IN
0xca0BD2D6...809507e4e
0.013 ETH0.0017554314.31065138
Buy Entry184948662023-11-03 23:40:35460 days ago1699054835IN
0xca0BD2D6...809507e4e
0.013 ETH0.0016519513.46709123
Buy Entry184948612023-11-03 23:39:35460 days ago1699054775IN
0xca0BD2D6...809507e4e
0.013 ETH0.0015787612.87044438
Buy Entry184948582023-11-03 23:38:59460 days ago1699054739IN
0xca0BD2D6...809507e4e
0.0026 ETH0.0018602113.30950125
Buy Entry184947842023-11-03 23:23:47460 days ago1699053827IN
0xca0BD2D6...809507e4e
0.0013 ETH0.0023560316.85698167
Buy Entry184947102023-11-03 23:08:59460 days ago1699052939IN
0xca0BD2D6...809507e4e
0.039 ETH0.0021082415.08412473
Buy Entry184946992023-11-03 23:06:47460 days ago1699052807IN
0xca0BD2D6...809507e4e
0.0039 ETH0.0022215515.89482391
Buy Entry184945282023-11-03 22:32:23460 days ago1699050743IN
0xca0BD2D6...809507e4e
0.013 ETH0.0021733315.5498325
Buy Entry184944562023-11-03 22:17:35460 days ago1699049855IN
0xca0BD2D6...809507e4e
0.0195 ETH0.0019229513.75842016
Buy Entry184934052023-11-03 18:45:11460 days ago1699037111IN
0xca0BD2D6...809507e4e
0.013 ETH0.0027662122.55074882
Buy Entry184922882023-11-03 15:00:11460 days ago1699023611IN
0xca0BD2D6...809507e4e
0.0039 ETH0.0044935432.15045722
Buy Entry184917452023-11-03 13:11:11461 days ago1699017071IN
0xca0BD2D6...809507e4e
0.0026 ETH0.0032640723.35385846
Buy Entry184916032023-11-03 12:42:11461 days ago1699015331IN
0xca0BD2D6...809507e4e
0.0078 ETH0.0023579319.22239225
Buy Entry184915612023-11-03 12:33:47461 days ago1699014827IN
0xca0BD2D6...809507e4e
0.0013 ETH0.0032459723.22436396
Buy Entry184909502023-11-03 10:30:59461 days ago1699007459IN
0xca0BD2D6...809507e4e
0.013 ETH0.0024501417.53030744
Buy Entry184888492023-11-03 3:26:47461 days ago1698982007IN
0xca0BD2D6...809507e4e
0.0039 ETH0.001728212.36496757
Buy Entry184887872023-11-03 3:14:11461 days ago1698981251IN
0xca0BD2D6...809507e4e
0.0013 ETH0.0019575214.00689798
Buy Entry184887552023-11-03 3:07:47461 days ago1698980867IN
0xca0BD2D6...809507e4e
0.0013 ETH0.0020557914.70884584
Buy Entry184885072023-11-03 2:17:35461 days ago1698977855IN
0xca0BD2D6...809507e4e
0.0052 ETH0.0021463715.35693184
Buy Entry184880972023-11-03 0:55:23461 days ago1698972923IN
0xca0BD2D6...809507e4e
0.0039 ETH0.002984421.35288589
Buy Entry184880822023-11-03 0:52:23461 days ago1698972743IN
0xca0BD2D6...809507e4e
0.0065 ETH0.002581421.04413641
Buy Entry184877252023-11-02 23:40:11461 days ago1698968411IN
0xca0BD2D6...809507e4e
0.0065 ETH0.002931720.97758382
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
184954252023-11-04 1:32:47460 days ago1699061567
0xca0BD2D6...809507e4e
0.0156 ETH
184954252023-11-04 1:32:47460 days ago1699061567
0xca0BD2D6...809507e4e
0.5044 ETH
184954252023-11-04 1:32:47460 days ago1699061567
0xca0BD2D6...809507e4e
0.4 ETH
184585312023-10-29 21:31:11465 days ago1698615071
0xca0BD2D6...809507e4e
0.0111 ETH
184585312023-10-29 21:31:11465 days ago1698615071
0xca0BD2D6...809507e4e
0.3589 ETH
184585312023-10-29 21:31:11465 days ago1698615071
0xca0BD2D6...809507e4e
0.25 ETH
184584812023-10-29 21:20:59465 days ago1698614459
0xca0BD2D6...809507e4e
0.002535 ETH
184584812023-10-29 21:20:59465 days ago1698614459
0xca0BD2D6...809507e4e
0.081965 ETH
184511382023-10-28 20:40:59466 days ago1698525659
0xca0BD2D6...809507e4e
0.015 ETH
184511382023-10-28 20:40:59466 days ago1698525659
0xca0BD2D6...809507e4e
0.485 ETH
184511382023-10-28 20:40:59466 days ago1698525659
0xca0BD2D6...809507e4e
0.4 ETH
184452852023-10-28 1:00:47467 days ago1698454847
0xca0BD2D6...809507e4e
0.015 ETH
184342132023-10-26 11:51:47469 days ago1698321107
0xca0BD2D6...809507e4e
0.15 ETH
184270752023-10-25 11:53:35470 days ago1698234815
0xca0BD2D6...809507e4e
0.15 ETH
184178692023-10-24 4:55:11471 days ago1698123311
0xca0BD2D6...809507e4e
0.015 ETH
184152062023-10-23 19:58:59471 days ago1698091139
0xca0BD2D6...809507e4e
0.035 ETH
184151662023-10-23 19:50:59471 days ago1698090659
0xca0BD2D6...809507e4e
0.0069 ETH
184151662023-10-23 19:50:59471 days ago1698090659
0xca0BD2D6...809507e4e
0.1311 ETH
184151662023-10-23 19:50:59471 days ago1698090659
0xca0BD2D6...809507e4e
0.1 ETH
184151212023-10-23 19:41:59471 days ago1698090119
0xca0BD2D6...809507e4e
0.035 ETH
184109382023-10-23 5:36:59472 days ago1698039419
0xca0BD2D6...809507e4e
0.015 ETH
184097202023-10-23 1:30:59472 days ago1698024659
0xca0BD2D6...809507e4e
0.012 ETH
184097202023-10-23 1:30:59472 days ago1698024659
0xca0BD2D6...809507e4e
0.388 ETH
184097202023-10-23 1:30:59472 days ago1698024659
0xca0BD2D6...809507e4e
0.3 ETH
184094692023-10-23 0:40:47472 days ago1698021647
0xca0BD2D6...809507e4e
0.015 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RafldexCryptoCoins_V1_1

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

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

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";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

contract RafldexCryptoCoins_V1_1 is Ownable, ReentrancyGuard, VRFConsumerBaseV2 {
    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 TokenAdded(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[] coinAddress,
        uint256[] amount
    );
    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[] collateralAmount;
        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 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 TokenAddresses;
    mapping(address => bool) public TokenPaymentAddresses;
    mapping(address => bool) public DiscountTokenPayments;

    bool public createEnabledHolders = true;
    bool public createEnabledSubscribers = true;

    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 _collateralAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle,
        uint256 _maxEntriesUser
    ) external payable onlyRole(OPERATOR_ROLE, msg.sender) returns (uint256) {
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(_maxEntriesRaffle > 0, "No entries");
        require(
            _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle,
            "Min entries user > 0 and <= max entries raffle"
        );
        require(
            _collateralAddress.length == _collateralAmount.length,
            "Require same length"
        );

        if (_tokenPayment != address(0)) {
            require(
                TokenPaymentAddresses[_tokenPayment],
                "Token Address not added "
            );
        }
        uint256 totalEth;
        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAmount[i] > 0, "Amount can't be null");
            if (_collateralAddress[i] == address(0)) {
                totalEth += _collateralAmount[i];
            } else {
                require(
                    TokenAddresses[_collateralAddress[i]],
                    "Token Address not added "
                );
                /*
                require(
                    IERC20(_collateralAddress[i]).balanceOf(msg.sender) >=
                        _collateralAmount[i],
                    "Need to have in wallet equal or more than ERC20 Token price"
                );*/
                safeTransferFrom(
                    msg.sender,
                    address(this),
                    _collateralAddress[i],
                    _collateralAmount[i]
                );
            }
        }

        require(msg.value == totalEth, "Total mismatched");

        uint256 _commissionInBasicPoints = 0;

        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralAmount: _collateralAmount,
            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, _collateralAmount);
        return idRaffle;
    }

    function createRaffleSubscriber(
        uint256 _endTime,
        address[] memory _collateralAddress,
        uint256[] memory _collateralAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle,
        uint256 _maxEntriesUser
    ) external payable nonReentrant returns (uint256) {
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(
            createEnabledSubscribers,
            "Create raffle noot set for subscribers."
        );
        require(
            Subscribers[msg.sender],
            "Need to be subscriber to create raffle."
        );
        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"
        );
        require(
            _collateralAddress.length == _collateralAmount.length,
            "Require same length"
        );

        if (_tokenPayment != address(0)) {
            require(
                TokenPaymentAddresses[_tokenPayment],
                "Token Address not added "
            );
        }
        uint256 totalEth;
        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAmount[i] > 0, "Amount can't be null");
            if (_collateralAddress[i] == address(0)) {
                totalEth += _collateralAmount[i];
            } else {
                require(
                    TokenAddresses[_collateralAddress[i]],
                    "Token Address not added "
                );
                /*
                require(
                    IERC20(_collateralAddress[i]).balanceOf(msg.sender) >=
                        _collateralAmount[i],
                    "Need to have in wallet equal or more than ERC20 Token price"
                );*/
                safeTransferFrom(
                    msg.sender,
                    address(this),
                    _collateralAddress[i],
                    _collateralAmount[i]
                );
            }
        }
        require(msg.value >= totalEth + CHAINLINK_RAFFLE_FEE , "Total mismatched");

        uint256 _commissionInBasicPoints = 0;

        if (DiscountTokenPayments[_tokenPayment]) {
            _commissionInBasicPoints = COMMISSION_SUBSCRIBERS_DISCOUNT;
        } else {
            _commissionInBasicPoints = COMMISSION_SUBSCRIBERS;
        }
        platformWallet.transfer(CHAINLINK_RAFFLE_FEE);

        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralAmount: _collateralAmount,
            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, _collateralAmount);
        return idRaffle;
    }

    function createRaffleHolder(
        address createRaffleCollection,
        uint256 createRaffleTokenId,
        uint256 _endTime,
        address[] memory _collateralAddress,
        uint256[] memory _collateralAmount,
        address _tokenPayment,
        uint256 _pricePerEntry,
        uint256 _maxEntriesRaffle,
        uint256 _maxEntriesUser
    ) external payable nonReentrant returns (uint256) {
        require(
            _endTime > getCurrentTime(),
            "End time can't be < as current time."
        );
        require(createEnabledHolders, "Create raffle not set for holders.");

        require(_maxEntriesRaffle > 0, "No entries");
        require(
            _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle,
            "Min entries user > 0 and <= max entries raffle"
        );
        require(
            _collateralAddress.length == _collateralAmount.length,
            "Require same length"
        );

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


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

        uint256 totalEth;
        for (uint256 i = 0; i < _collateralAddress.length; i++) {
            require(_collateralAmount[i] > 0, "Amount can't be null");
            if (_collateralAddress[i] == address(0)) {
                totalEth += _collateralAmount[i];
            } else {
                require(
                    TokenAddresses[_collateralAddress[i]],
                    "Token Address not added "
                );
                /*
                require(
                    IERC20(_collateralAddress[i]).balanceOf(msg.sender) >=
                        _collateralAmount[i],
                    "Need to have in wallet equal or more than ERC20 Token price"
                );*/
                safeTransferFrom(
                    msg.sender,
                    address(this),
                    _collateralAddress[i],
                    _collateralAmount[i]
                );
            }
        }


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

            _commissionInBasicPoints = COMMISSION_HOLDERS_DISCOUNT;
        } else {
            require(
                msg.value >= HOLDER_CREATE_RAFFLE_FEE + CHAINLINK_RAFFLE_FEE + totalEth,
                "Invalid funds provided"
            );
            platformWallet.transfer(HOLDER_CREATE_RAFFLE_FEE + CHAINLINK_RAFFLE_FEE);

            _commissionInBasicPoints = COMMISSION_HOLDERS;
        }


        RaffleStruct memory raffle = RaffleStruct({
            status: STATUS.CREATED,
            endTime: _endTime,
            collateralAddress: _collateralAddress,
            collateralAmount: _collateralAmount,
            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, _collateralAmount);
        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 addorRemoveTokens(address[] memory _addresses, bool _isAdded)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        for (uint256 i = 0; i < _addresses.length; i++) {
            TokenAddresses[_addresses[i]] = _isAdded;
            if (_isAdded == true) {
                emit TokenAdded(_addresses[i]);
            }
        }
    }

    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 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 addTokenPayments(address[] memory _address, bool _isAdded)
        external
        onlyRole(OPERATOR_ROLE, msg.sender)
    {
        for (uint256 i = 0; i < _address.length; i++) {
            TokenPaymentAddresses[_address[i]] = _isAdded;
            if (_isAdded == true) {
                emit AddedTokenPayment(_address[i]);
            }
        }
    }

    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 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];
        raffle.randomNumber = _normalizedRandomNumber;
        raffle.winner = (raffle.entriesSold == 0)
            ? raffle.creator
            : getWinnerAddressFromRandom(_raffleId, _normalizedRandomNumber);

        safeMultipleTransfersFrom(
            address(this),
            raffle.winner,
            raffle.collateralAddress,
            raffle.collateralAmount
        );

        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) && raffle.creator != 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];

        if (
            hasRole(OPERATOR_ROLE, msg.sender) && raffle.creator != msg.sender
        ) {
            require(
                raffle.entriesSold == raffle.entriesSupply ||
                    raffle.endTime <= getCurrentTime(),
                "Raffle still opened or not sold out"
            );
        }

        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.collateralAmount
        );

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

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

    function safeTransferFrom(
        address from,
        address to,
        address tokenAddress,
        uint256 tokenAmount
    ) internal virtual {
        if (tokenAddress == address(0)) {
            payable(to).transfer(tokenAmount);
        } else {
            if (from == address(this)) {
                IERC20(tokenAddress).approve(address(this), tokenAmount);
            }
            IERC20(tokenAddress).transferFrom(from, to, tokenAmount);
        }
    }

    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 13 : 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 3 of 13 : 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 4 of 13 : 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 5 of 13 : 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 6 of 13 : 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 7 of 13 : 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 8 of 13 : 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 9 of 13 : 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 10 of 13 : 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 11 of 13 : 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 12 of 13 : 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 13 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

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":"coinAddress","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amount","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":"TokenAdded","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":"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":[{"internalType":"address","name":"","type":"address"}],"name":"Subscribers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TokenAddresses","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":"addTokenPayments","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"_isAdded","type":"bool"}],"name":"addorRemoveTokens","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":"_collateralAmount","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":"_collateralAmount","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":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralAmount","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 RafldexCryptoCoins_V1_1.EntriesBought[]","name":"","type":"tuple[]"}],"stateMutability":"view","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":[],"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 RafldexCryptoCoins_V1_1.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":[],"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"}]

60a06040527f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef600455600580546001600160901b0319166b032a00000001002625a00003179055600d8054732300ae69d7d1ea0457ad79e822422888e3ee3e876001600160a01b031990911617905566354a6ba7a18000600e5566470de4df820000600f55662386f26fc10000601055666a94d74f4300006011556101f460125561015e60135561012c6014556096601555601a805461ffff1916610101179055348015620000cd57600080fd5b5073271682deb8c4e0901d1a1550ad2e64d568e69909620000ee3362000185565b600180556001600160a01b0316608052600280546001600160a01b031990811673271682deb8c4e0901d1a1550ad2e64d568e69909179091556003805490911673514910771af9ca656af840dff83e8264ecf986ca179055620001727f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c33620001d5565b6200017f600033620001d5565b62000241565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001e18282620001e5565b5050565b6000828152601b602090815260408083206001600160a01b038516845290915290205460ff16620001e1576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6080516153036200026460003960008181610c560152610c9801526153036000f3fe6080604052600436106103765760003560e01c80638354a49c116101d1578063bb54c33b11610102578063d703ece8116100a0578063f2fde38b1161006f578063f2fde38b14610aa0578063f369145514610ac0578063f5b541a614610ae0578063f860cec514610b0257600080fd5b8063d703ece814610a41578063dd59e92c14610a57578063e058c88514610a77578063e096839b14610a8a57600080fd5b8063cf7874a3116100dc578063cf7874a3146109bd578063d0038ff4146109f1578063d3c4d66414610a0b578063d547741f14610a2157600080fd5b8063bb54c33b1461097f578063bc0618c314610992578063cb77c147146109a857600080fd5b80639dde45da1161016f578063aaced47011610149578063aaced470146108ff578063acbb4eff1461092c578063b26a78c51461094c578063b2957ac11461095f57600080fd5b80639dde45da146108b4578063a217fddf146108d4578063a79bdca4146108e957600080fd5b80638da5cb5b116101ab5780638da5cb5b146108225780638dfc13b61461085457806391d14854146108745780639bab070b1461089457600080fd5b80638354a49c146107c357806388aaf2a9146107e357806388ec392c1461080257600080fd5b80634c72e770116102ab57806369f26fb0116102495780636fd96903116102235780636fd969031461072f578063715018a614610745578063719c0a131461075a57806381d12c581461077a57600080fd5b806369f26fb0146106af5780636bf3f8f6146106cf5780636cc735d5146106ff57600080fd5b806353e53a871161028557806353e53a8714610617578063581343c4146106445780635d4bc0ce146106645780635fba31711461069c57600080fd5b80634c72e770146105c15780634c86bca1146105e157806350aa9dda146105f757600080fd5b80632bb022b7116103185780633cb7ed3b116102f25780633cb7ed3b146105075780634169933f1461053757806344872b071461058e57806346988a40146105a157600080fd5b80632bb022b7146104a45780632f2ff15d146104ba578063365e3658146104da57600080fd5b806320c741b31161035457806320c741b31461040757806321f4bd611461042757806329cb924d1461046757806329dd67f91461048457600080fd5b8063013805c51461037b5780630f5e812e146103c55780631fe543e3146103e7575b600080fd5b34801561038757600080fd5b5061039b61039636600461487d565b610b17565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b3480156103d157600080fd5b506103e56103e036600461489f565b610b63565b005b3480156103f357600080fd5b506103e561040236600461498e565b610c4b565b34801561041357600080fd5b506103e56104223660046149f8565b610cd3565b34801561043357600080fd5b50610457610442366004614a31565b60186020526000908152604090205460ff1681565b60405190151581526020016103bc565b34801561047357600080fd5b50425b6040519081526020016103bc565b34801561049057600080fd5b506103e561049f36600461489f565b610d1a565b3480156104b057600080fd5b5061047660115481565b3480156104c657600080fd5b506103e56104d5366004614a4e565b610d3b565b3480156104e657600080fd5b506104fa6104f536600461489f565b610d65565b6040516103bc9190614a73565b34801561051357600080fd5b50610457610522366004614a31565b60176020526000908152604090205460ff1681565b34801561054357600080fd5b5061057361055236600461489f565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103bc565b61047661059c366004614b39565b610dfa565b3480156105ad57600080fd5b506104766105bc366004614bd4565b611371565b3480156105cd57600080fd5b506103e56105dc36600461489f565b6113fa565b3480156105ed57600080fd5b50610476600f5481565b34801561060357600080fd5b506103e5610612366004614c00565b61141b565b34801561062357600080fd5b5061047661063236600461489f565b600c6020526000908152604090205481565b34801561065057600080fd5b506103e561065f36600461489f565b61150d565b34801561067057600080fd5b5061068461067f36600461489f565b61163b565b6040516103bc9c9b9a99989796959493929190614c5d565b6103e56106aa36600461489f565b6116c1565b3480156106bb57600080fd5b506103e56106ca366004614a31565b611d79565b3480156106db57600080fd5b506104576106ea366004614a31565b60196020526000908152604090205460ff1681565b34801561070b57600080fd5b5061045761071a366004614a31565b60166020526000908152604090205460ff1681565b34801561073b57600080fd5b5061047660145481565b34801561075157600080fd5b506103e5611da3565b34801561076657600080fd5b5061047661077536600461489f565b611db7565b34801561078657600080fd5b506107ae61079536600461489f565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103bc565b3480156107cf57600080fd5b506103e56107de36600461489f565b611f45565b3480156107ef57600080fd5b50601a5461045790610100900460ff1681565b34801561080e57600080fd5b506103e561081d36600461489f565b611f66565b34801561082e57600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103bc565b34801561086057600080fd5b506103e561086f366004614d0f565b612165565b34801561088057600080fd5b5061045761088f366004614a4e565b6121a5565b3480156108a057600080fd5b506103e56108af366004614c00565b6121d0565b3480156108c057600080fd5b506103e56108cf366004614d35565b6122bb565b3480156108e057600080fd5b50610476600081565b3480156108f557600080fd5b50610476600e5481565b34801561090b57600080fd5b5061047661091a366004614a31565b600b6020526000908152604090205481565b34801561093857600080fd5b506103e561094736600461489f565b612305565b6103e561095a366004614d5f565b612326565b34801561096b57600080fd5b506103e561097a366004614c00565b612831565b61047661098d366004614d98565b61291c565b34801561099e57600080fd5b5061047660135481565b3480156109b457600080fd5b506103e5613195565b3480156109c957600080fd5b506107ae6109d836600461489f565b6007602052600090815260409020805460019091015482565b3480156109fd57600080fd5b50601a546104579060ff1681565b348015610a1757600080fd5b5061047660125481565b348015610a2d57600080fd5b506103e5610a3c366004614a4e565b6131ce565b348015610a4d57600080fd5b5061047660155481565b348015610a6357600080fd5b506103e5610a72366004614bd4565b6131f2565b610476610a85366004614b39565b613266565b348015610a9657600080fd5b5061047660105481565b348015610aac57600080fd5b506103e5610abb366004614a31565b613915565b348015610acc57600080fd5b5061083c610adb36600461487d565b61398b565b348015610aec57600080fd5b506104766000805160206152ae83398151915281565b348015610b0e57600080fd5b506103e5613a6f565b60086020528160005260406000208181548110610b3357600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b610b6b613a9f565b600060098281548110610b8057610b80614e54565b600091825260209091206009600e90920201908101549091506001600160a01b03163314610beb5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b60448201526064015b60405180910390fd5b600d81015460ff161515600103610c3e57600d8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b50610c4860018055565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610cc55760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610be2565b610ccf8282613af8565b5050565b6000805160206152ae83398151915233610ced8282613c2f565b50506001600160a01b03919091166000908152601960205260409020805460ff1916911515919091179055565b6000805160206152ae83398151915233610d348282613c2f565b5050600455565b6000805160206152ae83398151915233610d558282613c2f565b610d5f8484613c88565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610def576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101610d9a565b505050509050919050565b60006000805160206152ae83398151915233610e168282613c2f565b428a11610e355760405162461bcd60e51b8152600401610be290614e6a565b60008511610e555760405162461bcd60e51b8152600401610be290614eae565b600084118015610e655750848411155b610e815760405162461bcd60e51b8152600401610be290614ed2565b8751895114610ea25760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b03871615610ee9576001600160a01b03871660009081526018602052604090205460ff16610ee95760405162461bcd60e51b8152600401610be290614f4d565b6000805b8a518110156110375760008a8281518110610f0a57610f0a614e54565b602002602001015111610f2f5760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b03168b8281518110610f4c57610f4c614e54565b60200260200101516001600160a01b031603610f8e57898181518110610f7457610f74614e54565b602002602001015182610f879190614fc8565b9150611025565b601760008c8381518110610fa457610fa4614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610fe75760405162461bcd60e51b8152600401610be290614f4d565b61102533308d8481518110610ffe57610ffe614e54565b60200260200101518d858151811061101857611018614e54565b6020026020010151613cc7565b8061102f81614fdb565b915050610eed565b5080341461107a5760405162461bcd60e51b815260206004820152601060248201526f151bdd185b081b5a5cdb585d18da195960821b6044820152606401610be2565b600080604051806101c001604052806000600481111561109c5761109c614c47565b8152602081018f9052604081018e9052606081018d9052608081018a905260a081018b905260c08101899052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038d16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561116157611161614c47565b021790555060208281015160018301556040830151805161118892600285019201906147c8565b50606082015180516111a491600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061126590600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926112ea576112ea614e54565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611357929190615007565b60405180910390a2509d9c50505050505050505050505050565b6001600160a01b0382166000908152600b60205260408120548190156113f157604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b90935292909120546113ed9190614ff4565b9150505b90505b92915050565b6000805160206152ae833981519152336114148282613c2f565b5050600f55565b6000805160206152ae833981519152336114358282613c2f565b60005b845181101561150657836016600087848151811061145857611458614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558315156001036114f4577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e738582815181106114c7576114c7614e54565b60200260200101516040516114eb91906001600160a01b0391909116815260200190565b60405180910390a15b806114fe81614fdb565b915050611438565b5050505050565b6000805160206152ae833981519152336115278282613c2f565b60006009848154811061153c5761153c614e54565b90600052602060002090600e020190506115646000805160206152ae833981519152336121a5565b801561157d575060098101546001600160a01b03163314155b156115b857806004015481600c0154148061159c575042816001015411155b6115b85760405162461bcd60e51b8152600401610be29061508b565b600c810154604080514360208083019190915242828401524560608084019190915241901b6bffffffffffffffffffffffff191660808301528251808303607401815260949092019092528051910120600061161483836150e4565b61161f906001614fc8565b6008850181905590506116328782613e07565b50505050505050565b6009818154811061164b57600080fd5b60009182526020909120600e9091020180546001820154600483015460058401546006850154600786015460088701546009880154600a890154600b8a0154600c8b0154600d909b015460ff9a8b169c50989a9799969895976001600160a01b039586169794969386169592949190921692168c565b6116c9613a9f565b6000600982815481106116de576116de614e54565b600091825260209091206009600e90920201908101549091506001600160a01b031633148061172057506117206000805160206152ae833981519152336121a5565b61176c5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610be2565b4281600101541161178f5760405162461bcd60e51b8152600401610be290614e6a565b6000815460ff1660048111156117a7576117a7614c47565b146117e35760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610be2565b6117fb6000805160206152ae833981519152336121a5565b61193657600d81015460ff166118475760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610be2565b80600c01546000036118a65734156118a15760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610be2565b611936565b6011543410156118f85760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610be2565b600d546011546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611934573d6000803e3d6000fd5b505b60008281526008602052604090205460c88111156119b55760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610be2565b6000826005015483600c01546119cb91906150f8565b600b8401549091506001600160a01b0316611ac35760005b82811015611abd576000858152600860205260408120805483908110611a0b57611a0b614e54565b60009182526020909120600390910201546001600160a01b031690508015611aaa576000868152600860205260408120805484908110611a4d57611a4d614e54565b9060005260206000209060030201600201548660050154611a6e91906150f8565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611aa7573d6000803e3d6000fd5b50505b5080611ab581614fdb565b9150506119e3565b50611c5b565b600b83015460405163095ea7b360e01b8152306004820152602481018390526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015611b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3a919061510f565b5060005b82811015611c59576000858152600860205260408120805483908110611b6657611b66614e54565b60009182526020909120600390910201546001600160a01b031690508015611c46576000868152600860205260408120805484908110611ba857611ba8614e54565b9060005260206000209060030201600201548660050154611bc991906150f8565b600b8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611c009030908690869060040161512c565b6020604051808303816000875af1158015611c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c43919061510f565b50505b5080611c5181614fdb565b915050611b3e565b505b611d2c308460090160009054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611ccf57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611cb1575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611d2257602002820191906000526020600020905b815481526020019060010190808311611d0e575b5050505050614372565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a2505050610c4860018055565b611d816143c1565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b611dab6143c1565b611db5600061441b565b565b60006000805160206152ae83398151915233611dd38282613c2f565b600060098581548110611de857611de8614e54565b60009182526020909120600254600480546005546040516305d3b1d360e41b81529283019190915267ffffffffffffffff600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152600e90930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015611e8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb09190615150565b604080518082018252878152600c8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b6000805160206152ae83398151915233611f5f8282613c2f565b5050601155565b611f6e613a9f565b600060098281548110611f8357611f83614e54565b600091825260209091206009600e90920201908101549091506001600160a01b0316331480611fc55750611fc56000805160206152ae833981519152336121a5565b6120115760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610be2565b6120296000805160206152ae833981519152336121a5565b8015612042575060098101546001600160a01b03163314155b1561207d57806004015481600c01541480612061575042816001015411155b61207d5760405162461bcd60e51b8152600401610be29061508b565b6000815460ff16600481111561209557612095614c47565b146120db5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610be2565b805460ff19166001178155600c81015460058201546000906120fd90836150f8565b90508160000361212757825460ff191660021783556008830154612122908590613e07565b612133565b612131848361446b565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611d6591815260200190565b6000805160206152ae8339815191523361217f8282613c2f565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206152ae833981519152336121ea8282613c2f565b60005b845181101561150657836018600087848151811061220d5761220d614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558315156001036122a9577f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c73385828151811061227c5761227c614e54565b60200260200101516040516122a091906001600160a01b0391909116815260200190565b60405180910390a15b806122b381614fdb565b9150506121ed565b6000805160206152ae833981519152336122d58282613c2f565b50506005805467ffffffffffffffff909216600160501b0267ffffffffffffffff60501b19909216919091179055565b6000805160206152ae8339815191523361231f8282613c2f565b5050601055565b60006009848154811061233b5761233b614e54565b90600052602060002090600e020190506123524290565b81600101541161239c5760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610be2565b6000815460ff1660048111156123b4576123b4614c47565b146124015760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610be2565b600083118015612415575080600601548311155b6124875760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610be2565b6001600160a01b0382166124dd5760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610be2565b600984815481106124f0576124f0614e54565b90600052602060002090600e0201600401548382600c01546125129190614fc8565b11156125605760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610be2565b600b8101546001600160a01b03166125e15782816005015461258291906150f8565b34146125dc5760405162461bcd60e51b8152602060048201526024808201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706044820152637269636560e01b6064820152608401610be2565b61266f565b600b81015460058201546001600160a01b03909116906323b872dd903390309061260c9088906150f8565b6040518463ffffffff1660e01b815260040161262a9392919061512c565b6020604051808303816000875af1158015612649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266d919061510f565b505b60408051336020820152908101859052600090606001604051602081830303815290604052805190602001209050816006015484600c6000848152602001908152602001600020546126c19190614fc8565b111561270f5760405162461bcd60e51b815260206004820152601960248201527f4d617820656e7472696573207573657220726561636865642e000000000000006044820152606401610be2565b6000818152600c60205260408120805486929061272d908490614fc8565b9250508190555060006040518060600160405280856001600160a01b031681526020018685600c01546127609190614fc8565b815260209081018790526000888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600c8501805492935087929091906127d9908490614fc8565b9091555050600c83015460408051918252602082018790526001600160a01b0386169188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b6000805160206152ae8339815191523361284b8282613c2f565b60005b845181101561150657836017600087848151811061286e5761286e614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905583151560010361290a577f784c8f4dbf0ffedd6e72c76501c545a70f8b203b30a26ce542bf92ba87c248a48582815181106128dd576128dd614e54565b602002602001015160405161290191906001600160a01b0391909116815260200190565b60405180910390a15b8061291481614fdb565b91505061284e565b6000612926613a9f565b4288116129455760405162461bcd60e51b8152600401610be290614e6a565b601a5460ff166129a25760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610be2565b600083116129c25760405162461bcd60e51b8152600401610be290614eae565b6000821180156129d25750828211155b6129ee5760405162461bcd60e51b8152600401610be290614ed2565b8551875114612a0f5760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b03851615612a56576001600160a01b03851660009081526018602052604090205460ff16612a565760405162461bcd60e51b8152600401610be290614f4d565b6040516331a9108f60e11b8152600481018a90528a9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac39190615169565b6001600160a01b031614612b195760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610be2565b604080516001600160a01b038d1660208201529081018b9052600090606001604051602081830303815290604052805190602001209050612b574290565b6000828152600a60205260409020600101541115612c08576000612b7b8d8d611371565b11612be15760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610be2565b6000818152600a60205260408120600201805491612bfe83614fdb565b9190505550612c42565b426000828152600a602052604090205542612c269062278d00614fc8565b6000828152600a60205260409020600180820192909255600201555b6000805b8a51811015612d695760008a8281518110612c6357612c63614e54565b602002602001015111612c885760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b03168b8281518110612ca557612ca5614e54565b60200260200101516001600160a01b031603612ce757898181518110612ccd57612ccd614e54565b602002602001015182612ce09190614fc8565b9150612d57565b601760008c8381518110612cfd57612cfd614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16612d405760405162461bcd60e51b8152600401610be290614f4d565b612d5733308d8481518110610ffe57610ffe614e54565b80612d6181614fdb565b915050612c46565b506001600160a01b03881660009081526019602052604081205460ff1615612e195781600e54601054612d9c9190614fc8565b612da69190614fc8565b341015612dc55760405162461bcd60e51b8152600401610be290615186565b600d54600e546010546001600160a01b03909216916108fc91612de791614fc8565b6040518115909202916000818181858888f19350505050158015612e0f573d6000803e3d6000fd5b5050601354612ea3565b81600e54600f54612e2a9190614fc8565b612e349190614fc8565b341015612e535760405162461bcd60e51b8152600401610be290615186565b600d54600e54600f546001600160a01b03909216916108fc91612e7591614fc8565b6040518115909202916000818181858888f19350505050158015612e9d573d6000803e3d6000fd5b50506012545b604080516101c0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018a905260a081018b905260c08101899052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038d16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115612f7957612f79614c47565b0217905550602082810151600183015560408301518051612fa092600285019201906147c8565b5060608201518051612fbc91600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061307d90600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261310257613102614e54565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f60405161316f929190615007565b60405180910390a2509550505050505061318860018055565b9998505050505050505050565b6000805160206152ae833981519152336131af8282613c2f565b5050601a805461ff001981166101009182900460ff1615909102179055565b6000805160206152ae833981519152336131e88282613c2f565b610d5f84846145dd565b6000805160206152ae8339815191523361320c8282613c2f565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d910160405180910390a150505050565b6000613270613a9f565b42881161328f5760405162461bcd60e51b8152600401610be290614e6a565b601a54610100900460ff166132f65760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610be2565b3360009081526016602052604090205460ff166133655760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610be2565b600e543410156133875760405162461bcd60e51b8152600401610be290615186565b600083116133a75760405162461bcd60e51b8152600401610be290614eae565b6000821180156133b75750828211155b6133d35760405162461bcd60e51b8152600401610be290614ed2565b85518751146133f45760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b0385161561343b576001600160a01b03851660009081526018602052604090205460ff1661343b5760405162461bcd60e51b8152600401610be290614f4d565b6000805b885181101561357c57600088828151811061345c5761345c614e54565b6020026020010151116134815760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b031689828151811061349e5761349e614e54565b60200260200101516001600160a01b0316036134e0578781815181106134c6576134c6614e54565b6020026020010151826134d99190614fc8565b915061356a565b601760008a83815181106134f6576134f6614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166135395760405162461bcd60e51b8152600401610be290614f4d565b61356a33308b848151811061355057613550614e54565b60200260200101518b858151811061101857611018614e54565b8061357481614fdb565b91505061343f565b50600e5461358a9082614fc8565b3410156135cc5760405162461bcd60e51b815260206004820152601060248201526f151bdd185b081b5a5cdb585d18da195960821b6044820152606401610be2565b6001600160a01b03861660009081526019602052604081205460ff16156135f657506015546135fb565b506014545b600d54600e546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015613637573d6000803e3d6000fd5b50604080516101c0810190915260009080828152602081018d9052604081018c9052606081018b90526080810188905260a0810189905260c08101879052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038b16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561370e5761370e614c47565b021790555060208281015160018301556040830151805161373592600285019201906147c8565b506060820151805161375191600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061381290600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261389757613897614e54565b60009182526020822060039091020180546001600160a01b0319168155600181018290556002015560405182907ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a4906138f3908f908f90615007565b60405180910390a250935050505061390a60018055565b979650505050505050565b61391d6143c1565b6001600160a01b0381166139825760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610be2565b610c488161441b565b60008281526008602052604081208190815b8154811015613a1d5760008282815481106139ba576139ba614e54565b9060005260206000209060030201600101549050858110613a0a578282815481106139e7576139e7614e54565b60009182526020909120600390910201546001600160a01b03169350613a1d9050565b5080613a1581614fdb565b91505061399d565b506001600160a01b038216613a675760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610be2565b509392505050565b6000805160206152ae83398151915233613a898282613c2f565b5050601a805460ff19811660ff90911615179055565b600260015403613af15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be2565b6002600155565b600082815260076020526040812060010154825183908390613b1c57613b1c614e54565b6020026020010151613b2e91906150e4565b613b39906001614fc8565b6000848152600760205260408120546009805493945091928110613b5f57613b5f614e54565b90600052602060002090600e020190508181600801819055506000604051806040016040528085600081518110613b9857613b98614e54565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a26000858152600760205260409020546115069084613e07565b613c3982826121a5565b610ccf57613c468161461a565b613c5183602061462c565b604051602001613c629291906151da565b60408051601f198184030181529082905262461bcd60e51b8252610be29160040161524f565b613c9282826121a5565b610ccf576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6001600160a01b038216613d11576040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015613d0b573d6000803e3d6000fd5b50610d5f565b306001600160a01b03851603613d945760405163095ea7b360e01b8152306004820152602481018290526001600160a01b0383169063095ea7b3906044016020604051808303816000875af1158015613d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d92919061510f565b505b6040516323b872dd60e01b81526001600160a01b038316906323b872dd90613dc49087908790869060040161512c565b6020604051808303816000875af1158015613de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611506919061510f565b613e0f613a9f565b600060098381548110613e2457613e24614e54565b90600052602060002090600e0201905081816008018190555080600c0154600014613e5857613e53838361398b565b613e67565b60098101546001600160a01b03165b6007820180546001600160a01b0319166001600160a01b0392909216918217905560028201805460408051602080840282018101909252828152613f4294309490939192909190830182828015613ee757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613ec9575b505050505084600301805480602002602001604051908101604052809291908181526020018280548015611d225760200282019190600052602060002090815481526020019060010190808311611d0e575050505050614372565b6000816005015482600c0154613f5891906150f8565b9050600061271083600a015483613f6f91906150f8565b613f799190615282565b90506000613f878284614ff4565b600b8501549091506001600160a01b03166140e05760098401546040516000916001600160a01b03169083908381818185875af1925050503d8060008114613feb576040519150601f19603f3d011682016040523d82523d6000602084013e613ff0565b606091505b50509050806140365760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610be2565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614083576040519150601f19603f3d011682016040523d82523d6000602084013e614088565b606091505b50509050806140d95760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610be2565b5050614308565b600b84015460405163095ea7b360e01b8152306004820152602481018590526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614133573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614157919061510f565b50600b84015460098501546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd926141969230921690879060040161512c565b6020604051808303816000875af11580156141b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d9919061510f565b9050806142285760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610be2565b600b850154600d546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd926142649230921690899060040161512c565b6020604051808303816000875af1158015614283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142a7919061510f565b9050806143055760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610be2565b50505b835460ff19166003178455600784015460088501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a350505050610ccf60018055565b60005b8251811015611506576143af858585848151811061439557614395614e54565b602002602001015185858151811061101857611018614e54565b806143b981614fdb565b915050614375565b6000546001600160a01b03163314611db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b81529283019190915267ffffffffffffffff600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156144fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145229190615150565b6040805180820182528581526020808201868152600085815260079092529281209151825591516001909101556009805492935090918590811061456857614568614e54565b60009182526020909120600e909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6145e782826121a5565b15610ccf576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113f46001600160a01b03831660145b6060600061463b8360026150f8565b614646906002614fc8565b67ffffffffffffffff81111561465e5761465e6148b8565b6040519080825280601f01601f191660200182016040528015614688576020820181803683370190505b509050600360fc1b816000815181106146a3576146a3614e54565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106146d2576146d2614e54565b60200101906001600160f81b031916908160001a90535060006146f68460026150f8565b614701906001614fc8565b90505b6001811115614779576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061473557614735614e54565b1a60f81b82828151811061474b5761474b614e54565b60200101906001600160f81b031916908160001a90535060049490941c9361477281615296565b9050614704565b5083156113f15760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610be2565b82805482825590600052602060002090810192821561481d579160200282015b8281111561481d57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906147e8565b50614829929150614868565b5090565b82805482825590600052602060002090810192821561481d579160200282015b8281111561481d57825182559160200191906001019061484d565b5b808211156148295760008155600101614869565b6000806040838503121561489057600080fd5b50508035926020909101359150565b6000602082840312156148b157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156148f7576148f76148b8565b604052919050565b600067ffffffffffffffff821115614919576149196148b8565b5060051b60200190565b600082601f83011261493457600080fd5b81356020614949614944836148ff565b6148ce565b82815260059290921b8401810191818101908684111561496857600080fd5b8286015b84811015614983578035835291830191830161496c565b509695505050505050565b600080604083850312156149a157600080fd5b82359150602083013567ffffffffffffffff8111156149bf57600080fd5b6149cb85828601614923565b9150509250929050565b6001600160a01b0381168114610c4857600080fd5b8015158114610c4857600080fd5b60008060408385031215614a0b57600080fd5b8235614a16816149d5565b91506020830135614a26816149ea565b809150509250929050565b600060208284031215614a4357600080fd5b81356113f1816149d5565b60008060408385031215614a6157600080fd5b823591506020830135614a26816149d5565b602080825282518282018190526000919060409081850190868401855b82811015614ac857815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101614a90565b5091979650505050505050565b600082601f830112614ae657600080fd5b81356020614af6614944836148ff565b82815260059290921b84018101918181019086841115614b1557600080fd5b8286015b84811015614983578035614b2c816149d5565b8352918301918301614b19565b600080600080600080600060e0888a031215614b5457600080fd5b87359650602088013567ffffffffffffffff80821115614b7357600080fd5b614b7f8b838c01614ad5565b975060408a0135915080821115614b9557600080fd5b50614ba28a828b01614923565b9550506060880135614bb3816149d5565b9699959850939660808101359560a0820135955060c0909101359350915050565b60008060408385031215614be757600080fd5b8235614bf2816149d5565b946020939093013593505050565b60008060408385031215614c1357600080fd5b823567ffffffffffffffff811115614c2a57600080fd5b614c3685828601614ad5565b9250506020830135614a26816149ea565b634e487b7160e01b600052602160045260246000fd5b610180810160058e10614c8057634e487b7160e01b600052602160045260246000fd5b8d82528c60208301528b60408301528a6060830152896080830152614cb060a083018a6001600160a01b03169052565b8760c0830152614ccb60e08301886001600160a01b03169052565b85610100830152614ce86101208301866001600160a01b03169052565b83610140830152614cfe61016083018415159052565b9d9c50505050505050505050505050565b600060208284031215614d2157600080fd5b813563ffffffff811681146113f157600080fd5b600060208284031215614d4757600080fd5b813567ffffffffffffffff811681146113f157600080fd5b600080600060608486031215614d7457600080fd5b83359250602084013591506040840135614d8d816149d5565b809150509250925092565b60008060008060008060008060006101208a8c031215614db757600080fd5b8935614dc2816149d5565b985060208a0135975060408a0135965060608a013567ffffffffffffffff80821115614ded57600080fd5b614df98d838e01614ad5565b975060808c0135915080821115614e0f57600080fd5b50614e1c8c828d01614923565b95505060a08a0135614e2d816149d5565b8094505060c08a0135925060e08a013591506101008a013590509295985092959850929598565b634e487b7160e01b600052603260045260246000fd5b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b6020808252601390820152720a4cae2ead2e4ca40e6c2daca40d8cadccee8d606b1b604082015260600190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b602080825260149082015273105b5bdd5b9d0818d85b89dd081899481b9d5b1b60621b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156113f4576113f4614fb2565b600060018201614fed57614fed614fb2565b5060010190565b818103818111156113f4576113f4614fb2565b604080825283519082018190526000906020906060840190828701845b828110156150495781516001600160a01b031684529284019290840190600101615024565b5050508381038285015284518082528583019183019060005b8181101561507e57835183529284019291840191600101615062565b5090979650505050505050565b60208082526023908201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206040820152621bdd5d60ea1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826150f3576150f36150ce565b500690565b80820281158282048414176113f4576113f4614fb2565b60006020828403121561512157600080fd5b81516113f1816149ea565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561516257600080fd5b5051919050565b60006020828403121561517b57600080fd5b81516113f1816149d5565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b838110156151d15781810151838201526020016151b9565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516152128160178501602088016151b6565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516152438160288401602088016151b6565b01602801949350505050565b602081526000825180602084015261526e8160408501602087016151b6565b601f01601f19169190910160400192915050565b600082615291576152916150ce565b500490565b6000816152a5576152a5614fb2565b50600019019056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220a63a918fda67a93784dff1bcee284ace76ba73f15e1388040302d3c0fda9db8064736f6c63430008120033

Deployed Bytecode

0x6080604052600436106103765760003560e01c80638354a49c116101d1578063bb54c33b11610102578063d703ece8116100a0578063f2fde38b1161006f578063f2fde38b14610aa0578063f369145514610ac0578063f5b541a614610ae0578063f860cec514610b0257600080fd5b8063d703ece814610a41578063dd59e92c14610a57578063e058c88514610a77578063e096839b14610a8a57600080fd5b8063cf7874a3116100dc578063cf7874a3146109bd578063d0038ff4146109f1578063d3c4d66414610a0b578063d547741f14610a2157600080fd5b8063bb54c33b1461097f578063bc0618c314610992578063cb77c147146109a857600080fd5b80639dde45da1161016f578063aaced47011610149578063aaced470146108ff578063acbb4eff1461092c578063b26a78c51461094c578063b2957ac11461095f57600080fd5b80639dde45da146108b4578063a217fddf146108d4578063a79bdca4146108e957600080fd5b80638da5cb5b116101ab5780638da5cb5b146108225780638dfc13b61461085457806391d14854146108745780639bab070b1461089457600080fd5b80638354a49c146107c357806388aaf2a9146107e357806388ec392c1461080257600080fd5b80634c72e770116102ab57806369f26fb0116102495780636fd96903116102235780636fd969031461072f578063715018a614610745578063719c0a131461075a57806381d12c581461077a57600080fd5b806369f26fb0146106af5780636bf3f8f6146106cf5780636cc735d5146106ff57600080fd5b806353e53a871161028557806353e53a8714610617578063581343c4146106445780635d4bc0ce146106645780635fba31711461069c57600080fd5b80634c72e770146105c15780634c86bca1146105e157806350aa9dda146105f757600080fd5b80632bb022b7116103185780633cb7ed3b116102f25780633cb7ed3b146105075780634169933f1461053757806344872b071461058e57806346988a40146105a157600080fd5b80632bb022b7146104a45780632f2ff15d146104ba578063365e3658146104da57600080fd5b806320c741b31161035457806320c741b31461040757806321f4bd611461042757806329cb924d1461046757806329dd67f91461048457600080fd5b8063013805c51461037b5780630f5e812e146103c55780631fe543e3146103e7575b600080fd5b34801561038757600080fd5b5061039b61039636600461487d565b610b17565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b3480156103d157600080fd5b506103e56103e036600461489f565b610b63565b005b3480156103f357600080fd5b506103e561040236600461498e565b610c4b565b34801561041357600080fd5b506103e56104223660046149f8565b610cd3565b34801561043357600080fd5b50610457610442366004614a31565b60186020526000908152604090205460ff1681565b60405190151581526020016103bc565b34801561047357600080fd5b50425b6040519081526020016103bc565b34801561049057600080fd5b506103e561049f36600461489f565b610d1a565b3480156104b057600080fd5b5061047660115481565b3480156104c657600080fd5b506103e56104d5366004614a4e565b610d3b565b3480156104e657600080fd5b506104fa6104f536600461489f565b610d65565b6040516103bc9190614a73565b34801561051357600080fd5b50610457610522366004614a31565b60176020526000908152604090205460ff1681565b34801561054357600080fd5b5061057361055236600461489f565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103bc565b61047661059c366004614b39565b610dfa565b3480156105ad57600080fd5b506104766105bc366004614bd4565b611371565b3480156105cd57600080fd5b506103e56105dc36600461489f565b6113fa565b3480156105ed57600080fd5b50610476600f5481565b34801561060357600080fd5b506103e5610612366004614c00565b61141b565b34801561062357600080fd5b5061047661063236600461489f565b600c6020526000908152604090205481565b34801561065057600080fd5b506103e561065f36600461489f565b61150d565b34801561067057600080fd5b5061068461067f36600461489f565b61163b565b6040516103bc9c9b9a99989796959493929190614c5d565b6103e56106aa36600461489f565b6116c1565b3480156106bb57600080fd5b506103e56106ca366004614a31565b611d79565b3480156106db57600080fd5b506104576106ea366004614a31565b60196020526000908152604090205460ff1681565b34801561070b57600080fd5b5061045761071a366004614a31565b60166020526000908152604090205460ff1681565b34801561073b57600080fd5b5061047660145481565b34801561075157600080fd5b506103e5611da3565b34801561076657600080fd5b5061047661077536600461489f565b611db7565b34801561078657600080fd5b506107ae61079536600461489f565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103bc565b3480156107cf57600080fd5b506103e56107de36600461489f565b611f45565b3480156107ef57600080fd5b50601a5461045790610100900460ff1681565b34801561080e57600080fd5b506103e561081d36600461489f565b611f66565b34801561082e57600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103bc565b34801561086057600080fd5b506103e561086f366004614d0f565b612165565b34801561088057600080fd5b5061045761088f366004614a4e565b6121a5565b3480156108a057600080fd5b506103e56108af366004614c00565b6121d0565b3480156108c057600080fd5b506103e56108cf366004614d35565b6122bb565b3480156108e057600080fd5b50610476600081565b3480156108f557600080fd5b50610476600e5481565b34801561090b57600080fd5b5061047661091a366004614a31565b600b6020526000908152604090205481565b34801561093857600080fd5b506103e561094736600461489f565b612305565b6103e561095a366004614d5f565b612326565b34801561096b57600080fd5b506103e561097a366004614c00565b612831565b61047661098d366004614d98565b61291c565b34801561099e57600080fd5b5061047660135481565b3480156109b457600080fd5b506103e5613195565b3480156109c957600080fd5b506107ae6109d836600461489f565b6007602052600090815260409020805460019091015482565b3480156109fd57600080fd5b50601a546104579060ff1681565b348015610a1757600080fd5b5061047660125481565b348015610a2d57600080fd5b506103e5610a3c366004614a4e565b6131ce565b348015610a4d57600080fd5b5061047660155481565b348015610a6357600080fd5b506103e5610a72366004614bd4565b6131f2565b610476610a85366004614b39565b613266565b348015610a9657600080fd5b5061047660105481565b348015610aac57600080fd5b506103e5610abb366004614a31565b613915565b348015610acc57600080fd5b5061083c610adb36600461487d565b61398b565b348015610aec57600080fd5b506104766000805160206152ae83398151915281565b348015610b0e57600080fd5b506103e5613a6f565b60086020528160005260406000208181548110610b3357600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b610b6b613a9f565b600060098281548110610b8057610b80614e54565b600091825260209091206009600e90920201908101549091506001600160a01b03163314610beb5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b60448201526064015b60405180910390fd5b600d81015460ff161515600103610c3e57600d8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b50610c4860018055565b50565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610cc55760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610be2565b610ccf8282613af8565b5050565b6000805160206152ae83398151915233610ced8282613c2f565b50506001600160a01b03919091166000908152601960205260409020805460ff1916911515919091179055565b6000805160206152ae83398151915233610d348282613c2f565b5050600455565b6000805160206152ae83398151915233610d558282613c2f565b610d5f8484613c88565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610def576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101610d9a565b505050509050919050565b60006000805160206152ae83398151915233610e168282613c2f565b428a11610e355760405162461bcd60e51b8152600401610be290614e6a565b60008511610e555760405162461bcd60e51b8152600401610be290614eae565b600084118015610e655750848411155b610e815760405162461bcd60e51b8152600401610be290614ed2565b8751895114610ea25760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b03871615610ee9576001600160a01b03871660009081526018602052604090205460ff16610ee95760405162461bcd60e51b8152600401610be290614f4d565b6000805b8a518110156110375760008a8281518110610f0a57610f0a614e54565b602002602001015111610f2f5760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b03168b8281518110610f4c57610f4c614e54565b60200260200101516001600160a01b031603610f8e57898181518110610f7457610f74614e54565b602002602001015182610f879190614fc8565b9150611025565b601760008c8381518110610fa457610fa4614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16610fe75760405162461bcd60e51b8152600401610be290614f4d565b61102533308d8481518110610ffe57610ffe614e54565b60200260200101518d858151811061101857611018614e54565b6020026020010151613cc7565b8061102f81614fdb565b915050610eed565b5080341461107a5760405162461bcd60e51b815260206004820152601060248201526f151bdd185b081b5a5cdb585d18da195960821b6044820152606401610be2565b600080604051806101c001604052806000600481111561109c5761109c614c47565b8152602081018f9052604081018e9052606081018d9052608081018a905260a081018b905260c08101899052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038d16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561116157611161614c47565b021790555060208281015160018301556040830151805161118892600285019201906147c8565b50606082015180516111a491600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061126590600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926112ea576112ea614e54565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611357929190615007565b60405180910390a2509d9c50505050505050505050505050565b6001600160a01b0382166000908152600b60205260408120548190156113f157604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b90935292909120546113ed9190614ff4565b9150505b90505b92915050565b6000805160206152ae833981519152336114148282613c2f565b5050600f55565b6000805160206152ae833981519152336114358282613c2f565b60005b845181101561150657836016600087848151811061145857611458614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558315156001036114f4577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e738582815181106114c7576114c7614e54565b60200260200101516040516114eb91906001600160a01b0391909116815260200190565b60405180910390a15b806114fe81614fdb565b915050611438565b5050505050565b6000805160206152ae833981519152336115278282613c2f565b60006009848154811061153c5761153c614e54565b90600052602060002090600e020190506115646000805160206152ae833981519152336121a5565b801561157d575060098101546001600160a01b03163314155b156115b857806004015481600c0154148061159c575042816001015411155b6115b85760405162461bcd60e51b8152600401610be29061508b565b600c810154604080514360208083019190915242828401524560608084019190915241901b6bffffffffffffffffffffffff191660808301528251808303607401815260949092019092528051910120600061161483836150e4565b61161f906001614fc8565b6008850181905590506116328782613e07565b50505050505050565b6009818154811061164b57600080fd5b60009182526020909120600e9091020180546001820154600483015460058401546006850154600786015460088701546009880154600a890154600b8a0154600c8b0154600d909b015460ff9a8b169c50989a9799969895976001600160a01b039586169794969386169592949190921692168c565b6116c9613a9f565b6000600982815481106116de576116de614e54565b600091825260209091206009600e90920201908101549091506001600160a01b031633148061172057506117206000805160206152ae833981519152336121a5565b61176c5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610be2565b4281600101541161178f5760405162461bcd60e51b8152600401610be290614e6a565b6000815460ff1660048111156117a7576117a7614c47565b146117e35760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610be2565b6117fb6000805160206152ae833981519152336121a5565b61193657600d81015460ff166118475760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610be2565b80600c01546000036118a65734156118a15760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610be2565b611936565b6011543410156118f85760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610be2565b600d546011546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015611934573d6000803e3d6000fd5b505b60008281526008602052604090205460c88111156119b55760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610be2565b6000826005015483600c01546119cb91906150f8565b600b8401549091506001600160a01b0316611ac35760005b82811015611abd576000858152600860205260408120805483908110611a0b57611a0b614e54565b60009182526020909120600390910201546001600160a01b031690508015611aaa576000868152600860205260408120805484908110611a4d57611a4d614e54565b9060005260206000209060030201600201548660050154611a6e91906150f8565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611aa7573d6000803e3d6000fd5b50505b5080611ab581614fdb565b9150506119e3565b50611c5b565b600b83015460405163095ea7b360e01b8152306004820152602481018390526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015611b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3a919061510f565b5060005b82811015611c59576000858152600860205260408120805483908110611b6657611b66614e54565b60009182526020909120600390910201546001600160a01b031690508015611c46576000868152600860205260408120805484908110611ba857611ba8614e54565b9060005260206000209060030201600201548660050154611bc991906150f8565b600b8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611c009030908690869060040161512c565b6020604051808303816000875af1158015611c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c43919061510f565b50505b5080611c5181614fdb565b915050611b3e565b505b611d2c308460090160009054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611ccf57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611cb1575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611d2257602002820191906000526020600020905b815481526020019060010190808311611d0e575b5050505050614372565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a2505050610c4860018055565b611d816143c1565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b611dab6143c1565b611db5600061441b565b565b60006000805160206152ae83398151915233611dd38282613c2f565b600060098581548110611de857611de8614e54565b60009182526020909120600254600480546005546040516305d3b1d360e41b81529283019190915267ffffffffffffffff600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152600e90930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015611e8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb09190615150565b604080518082018252878152600c8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b6000805160206152ae83398151915233611f5f8282613c2f565b5050601155565b611f6e613a9f565b600060098281548110611f8357611f83614e54565b600091825260209091206009600e90920201908101549091506001600160a01b0316331480611fc55750611fc56000805160206152ae833981519152336121a5565b6120115760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610be2565b6120296000805160206152ae833981519152336121a5565b8015612042575060098101546001600160a01b03163314155b1561207d57806004015481600c01541480612061575042816001015411155b61207d5760405162461bcd60e51b8152600401610be29061508b565b6000815460ff16600481111561209557612095614c47565b146120db5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610be2565b805460ff19166001178155600c81015460058201546000906120fd90836150f8565b90508160000361212757825460ff191660021783556008830154612122908590613e07565b612133565b612131848361446b565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611d6591815260200190565b6000805160206152ae8339815191523361217f8282613c2f565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206152ae833981519152336121ea8282613c2f565b60005b845181101561150657836018600087848151811061220d5761220d614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558315156001036122a9577f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c73385828151811061227c5761227c614e54565b60200260200101516040516122a091906001600160a01b0391909116815260200190565b60405180910390a15b806122b381614fdb565b9150506121ed565b6000805160206152ae833981519152336122d58282613c2f565b50506005805467ffffffffffffffff909216600160501b0267ffffffffffffffff60501b19909216919091179055565b6000805160206152ae8339815191523361231f8282613c2f565b5050601055565b60006009848154811061233b5761233b614e54565b90600052602060002090600e020190506123524290565b81600101541161239c5760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610be2565b6000815460ff1660048111156123b4576123b4614c47565b146124015760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610be2565b600083118015612415575080600601548311155b6124875760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610be2565b6001600160a01b0382166124dd5760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610be2565b600984815481106124f0576124f0614e54565b90600052602060002090600e0201600401548382600c01546125129190614fc8565b11156125605760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610be2565b600b8101546001600160a01b03166125e15782816005015461258291906150f8565b34146125dc5760405162461bcd60e51b8152602060048201526024808201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706044820152637269636560e01b6064820152608401610be2565b61266f565b600b81015460058201546001600160a01b03909116906323b872dd903390309061260c9088906150f8565b6040518463ffffffff1660e01b815260040161262a9392919061512c565b6020604051808303816000875af1158015612649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266d919061510f565b505b60408051336020820152908101859052600090606001604051602081830303815290604052805190602001209050816006015484600c6000848152602001908152602001600020546126c19190614fc8565b111561270f5760405162461bcd60e51b815260206004820152601960248201527f4d617820656e7472696573207573657220726561636865642e000000000000006044820152606401610be2565b6000818152600c60205260408120805486929061272d908490614fc8565b9250508190555060006040518060600160405280856001600160a01b031681526020018685600c01546127609190614fc8565b815260209081018790526000888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600c8501805492935087929091906127d9908490614fc8565b9091555050600c83015460408051918252602082018790526001600160a01b0386169188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b6000805160206152ae8339815191523361284b8282613c2f565b60005b845181101561150657836017600087848151811061286e5761286e614e54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905583151560010361290a577f784c8f4dbf0ffedd6e72c76501c545a70f8b203b30a26ce542bf92ba87c248a48582815181106128dd576128dd614e54565b602002602001015160405161290191906001600160a01b0391909116815260200190565b60405180910390a15b8061291481614fdb565b91505061284e565b6000612926613a9f565b4288116129455760405162461bcd60e51b8152600401610be290614e6a565b601a5460ff166129a25760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610be2565b600083116129c25760405162461bcd60e51b8152600401610be290614eae565b6000821180156129d25750828211155b6129ee5760405162461bcd60e51b8152600401610be290614ed2565b8551875114612a0f5760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b03851615612a56576001600160a01b03851660009081526018602052604090205460ff16612a565760405162461bcd60e51b8152600401610be290614f4d565b6040516331a9108f60e11b8152600481018a90528a9033906001600160a01b03831690636352211e90602401602060405180830381865afa158015612a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac39190615169565b6001600160a01b031614612b195760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610be2565b604080516001600160a01b038d1660208201529081018b9052600090606001604051602081830303815290604052805190602001209050612b574290565b6000828152600a60205260409020600101541115612c08576000612b7b8d8d611371565b11612be15760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610be2565b6000818152600a60205260408120600201805491612bfe83614fdb565b9190505550612c42565b426000828152600a602052604090205542612c269062278d00614fc8565b6000828152600a60205260409020600180820192909255600201555b6000805b8a51811015612d695760008a8281518110612c6357612c63614e54565b602002602001015111612c885760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b03168b8281518110612ca557612ca5614e54565b60200260200101516001600160a01b031603612ce757898181518110612ccd57612ccd614e54565b602002602001015182612ce09190614fc8565b9150612d57565b601760008c8381518110612cfd57612cfd614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16612d405760405162461bcd60e51b8152600401610be290614f4d565b612d5733308d8481518110610ffe57610ffe614e54565b80612d6181614fdb565b915050612c46565b506001600160a01b03881660009081526019602052604081205460ff1615612e195781600e54601054612d9c9190614fc8565b612da69190614fc8565b341015612dc55760405162461bcd60e51b8152600401610be290615186565b600d54600e546010546001600160a01b03909216916108fc91612de791614fc8565b6040518115909202916000818181858888f19350505050158015612e0f573d6000803e3d6000fd5b5050601354612ea3565b81600e54600f54612e2a9190614fc8565b612e349190614fc8565b341015612e535760405162461bcd60e51b8152600401610be290615186565b600d54600e54600f546001600160a01b03909216916108fc91612e7591614fc8565b6040518115909202916000818181858888f19350505050158015612e9d573d6000803e3d6000fd5b50506012545b604080516101c0810190915260009080828152602081018f9052604081018e9052606081018d9052608081018a905260a081018b905260c08101899052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038d16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115612f7957612f79614c47565b0217905550602082810151600183015560408301518051612fa092600285019201906147c8565b5060608201518051612fbc91600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061307d90600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261310257613102614e54565b9060005260206000209060030201600080820160006101000a8154906001600160a01b030219169055600182016000905560028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f60405161316f929190615007565b60405180910390a2509550505050505061318860018055565b9998505050505050505050565b6000805160206152ae833981519152336131af8282613c2f565b5050601a805461ff001981166101009182900460ff1615909102179055565b6000805160206152ae833981519152336131e88282613c2f565b610d5f84846145dd565b6000805160206152ae8339815191523361320c8282613c2f565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d910160405180910390a150505050565b6000613270613a9f565b42881161328f5760405162461bcd60e51b8152600401610be290614e6a565b601a54610100900460ff166132f65760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610be2565b3360009081526016602052604090205460ff166133655760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610be2565b600e543410156133875760405162461bcd60e51b8152600401610be290615186565b600083116133a75760405162461bcd60e51b8152600401610be290614eae565b6000821180156133b75750828211155b6133d35760405162461bcd60e51b8152600401610be290614ed2565b85518751146133f45760405162461bcd60e51b8152600401610be290614f20565b6001600160a01b0385161561343b576001600160a01b03851660009081526018602052604090205460ff1661343b5760405162461bcd60e51b8152600401610be290614f4d565b6000805b885181101561357c57600088828151811061345c5761345c614e54565b6020026020010151116134815760405162461bcd60e51b8152600401610be290614f84565b60006001600160a01b031689828151811061349e5761349e614e54565b60200260200101516001600160a01b0316036134e0578781815181106134c6576134c6614e54565b6020026020010151826134d99190614fc8565b915061356a565b601760008a83815181106134f6576134f6614e54565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166135395760405162461bcd60e51b8152600401610be290614f4d565b61356a33308b848151811061355057613550614e54565b60200260200101518b858151811061101857611018614e54565b8061357481614fdb565b91505061343f565b50600e5461358a9082614fc8565b3410156135cc5760405162461bcd60e51b815260206004820152601060248201526f151bdd185b081b5a5cdb585d18da195960821b6044820152606401610be2565b6001600160a01b03861660009081526019602052604081205460ff16156135f657506015546135fb565b506014545b600d54600e546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015613637573d6000803e3d6000fd5b50604080516101c0810190915260009080828152602081018d9052604081018c9052606081018b90526080810188905260a0810189905260c08101879052600060e0820181905261010082018190523361012083015261014082018590526001600160a01b038b16610160830152610180820181905260016101a090920182905260098054808401825591528251600e9091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561370e5761370e614c47565b021790555060208281015160018301556040830151805161373592600285019201906147c8565b506060820151805161375191600384019160209091019061482d565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820180546001600160a01b03199081166001600160a01b0393841617909155610100840151600884015561012084015160098085018054841692851692909217909155610140850151600a850155610160850151600b850180549093169316929092179055610180830151600c8301556101a090920151600d909101805460ff19169115159190911790555460009061381290600190614ff4565b604080516060810182526000808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b0390921691909117815591519282019290925593516002909401939093558381528254939450909261389757613897614e54565b60009182526020822060039091020180546001600160a01b0319168155600181018290556002015560405182907ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a4906138f3908f908f90615007565b60405180910390a250935050505061390a60018055565b979650505050505050565b61391d6143c1565b6001600160a01b0381166139825760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610be2565b610c488161441b565b60008281526008602052604081208190815b8154811015613a1d5760008282815481106139ba576139ba614e54565b9060005260206000209060030201600101549050858110613a0a578282815481106139e7576139e7614e54565b60009182526020909120600390910201546001600160a01b03169350613a1d9050565b5080613a1581614fdb565b91505061399d565b506001600160a01b038216613a675760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610be2565b509392505050565b6000805160206152ae83398151915233613a898282613c2f565b5050601a805460ff19811660ff90911615179055565b600260015403613af15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610be2565b6002600155565b600082815260076020526040812060010154825183908390613b1c57613b1c614e54565b6020026020010151613b2e91906150e4565b613b39906001614fc8565b6000848152600760205260408120546009805493945091928110613b5f57613b5f614e54565b90600052602060002090600e020190508181600801819055506000604051806040016040528085600081518110613b9857613b98614e54565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a26000858152600760205260409020546115069084613e07565b613c3982826121a5565b610ccf57613c468161461a565b613c5183602061462c565b604051602001613c629291906151da565b60408051601f198184030181529082905262461bcd60e51b8252610be29160040161524f565b613c9282826121a5565b610ccf576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6001600160a01b038216613d11576040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015613d0b573d6000803e3d6000fd5b50610d5f565b306001600160a01b03851603613d945760405163095ea7b360e01b8152306004820152602481018290526001600160a01b0383169063095ea7b3906044016020604051808303816000875af1158015613d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d92919061510f565b505b6040516323b872dd60e01b81526001600160a01b038316906323b872dd90613dc49087908790869060040161512c565b6020604051808303816000875af1158015613de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611506919061510f565b613e0f613a9f565b600060098381548110613e2457613e24614e54565b90600052602060002090600e0201905081816008018190555080600c0154600014613e5857613e53838361398b565b613e67565b60098101546001600160a01b03165b6007820180546001600160a01b0319166001600160a01b0392909216918217905560028201805460408051602080840282018101909252828152613f4294309490939192909190830182828015613ee757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613ec9575b505050505084600301805480602002602001604051908101604052809291908181526020018280548015611d225760200282019190600052602060002090815481526020019060010190808311611d0e575050505050614372565b6000816005015482600c0154613f5891906150f8565b9050600061271083600a015483613f6f91906150f8565b613f799190615282565b90506000613f878284614ff4565b600b8501549091506001600160a01b03166140e05760098401546040516000916001600160a01b03169083908381818185875af1925050503d8060008114613feb576040519150601f19603f3d011682016040523d82523d6000602084013e613ff0565b606091505b50509050806140365760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610be2565b600d546040516000916001600160a01b03169085908381818185875af1925050503d8060008114614083576040519150601f19603f3d011682016040523d82523d6000602084013e614088565b606091505b50509050806140d95760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610be2565b5050614308565b600b84015460405163095ea7b360e01b8152306004820152602481018590526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614133573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614157919061510f565b50600b84015460098501546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd926141969230921690879060040161512c565b6020604051808303816000875af11580156141b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d9919061510f565b9050806142285760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610be2565b600b850154600d546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd926142649230921690899060040161512c565b6020604051808303816000875af1158015614283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142a7919061510f565b9050806143055760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610be2565b50505b835460ff19166003178455600784015460088501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a350505050610ccf60018055565b60005b8251811015611506576143af858585848151811061439557614395614e54565b602002602001015185858151811061101857611018614e54565b806143b981614fdb565b915050614375565b6000546001600160a01b03163314611db55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610be2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b81529283019190915267ffffffffffffffff600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156144fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145229190615150565b6040805180820182528581526020808201868152600085815260079092529281209151825591516001909101556009805492935090918590811061456857614568614e54565b60009182526020909120600e909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6145e782826121a5565b15610ccf576000828152601b602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113f46001600160a01b03831660145b6060600061463b8360026150f8565b614646906002614fc8565b67ffffffffffffffff81111561465e5761465e6148b8565b6040519080825280601f01601f191660200182016040528015614688576020820181803683370190505b509050600360fc1b816000815181106146a3576146a3614e54565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106146d2576146d2614e54565b60200101906001600160f81b031916908160001a90535060006146f68460026150f8565b614701906001614fc8565b90505b6001811115614779576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061473557614735614e54565b1a60f81b82828151811061474b5761474b614e54565b60200101906001600160f81b031916908160001a90535060049490941c9361477281615296565b9050614704565b5083156113f15760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610be2565b82805482825590600052602060002090810192821561481d579160200282015b8281111561481d57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906147e8565b50614829929150614868565b5090565b82805482825590600052602060002090810192821561481d579160200282015b8281111561481d57825182559160200191906001019061484d565b5b808211156148295760008155600101614869565b6000806040838503121561489057600080fd5b50508035926020909101359150565b6000602082840312156148b157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156148f7576148f76148b8565b604052919050565b600067ffffffffffffffff821115614919576149196148b8565b5060051b60200190565b600082601f83011261493457600080fd5b81356020614949614944836148ff565b6148ce565b82815260059290921b8401810191818101908684111561496857600080fd5b8286015b84811015614983578035835291830191830161496c565b509695505050505050565b600080604083850312156149a157600080fd5b82359150602083013567ffffffffffffffff8111156149bf57600080fd5b6149cb85828601614923565b9150509250929050565b6001600160a01b0381168114610c4857600080fd5b8015158114610c4857600080fd5b60008060408385031215614a0b57600080fd5b8235614a16816149d5565b91506020830135614a26816149ea565b809150509250929050565b600060208284031215614a4357600080fd5b81356113f1816149d5565b60008060408385031215614a6157600080fd5b823591506020830135614a26816149d5565b602080825282518282018190526000919060409081850190868401855b82811015614ac857815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101614a90565b5091979650505050505050565b600082601f830112614ae657600080fd5b81356020614af6614944836148ff565b82815260059290921b84018101918181019086841115614b1557600080fd5b8286015b84811015614983578035614b2c816149d5565b8352918301918301614b19565b600080600080600080600060e0888a031215614b5457600080fd5b87359650602088013567ffffffffffffffff80821115614b7357600080fd5b614b7f8b838c01614ad5565b975060408a0135915080821115614b9557600080fd5b50614ba28a828b01614923565b9550506060880135614bb3816149d5565b9699959850939660808101359560a0820135955060c0909101359350915050565b60008060408385031215614be757600080fd5b8235614bf2816149d5565b946020939093013593505050565b60008060408385031215614c1357600080fd5b823567ffffffffffffffff811115614c2a57600080fd5b614c3685828601614ad5565b9250506020830135614a26816149ea565b634e487b7160e01b600052602160045260246000fd5b610180810160058e10614c8057634e487b7160e01b600052602160045260246000fd5b8d82528c60208301528b60408301528a6060830152896080830152614cb060a083018a6001600160a01b03169052565b8760c0830152614ccb60e08301886001600160a01b03169052565b85610100830152614ce86101208301866001600160a01b03169052565b83610140830152614cfe61016083018415159052565b9d9c50505050505050505050505050565b600060208284031215614d2157600080fd5b813563ffffffff811681146113f157600080fd5b600060208284031215614d4757600080fd5b813567ffffffffffffffff811681146113f157600080fd5b600080600060608486031215614d7457600080fd5b83359250602084013591506040840135614d8d816149d5565b809150509250925092565b60008060008060008060008060006101208a8c031215614db757600080fd5b8935614dc2816149d5565b985060208a0135975060408a0135965060608a013567ffffffffffffffff80821115614ded57600080fd5b614df98d838e01614ad5565b975060808c0135915080821115614e0f57600080fd5b50614e1c8c828d01614923565b95505060a08a0135614e2d816149d5565b8094505060c08a0135925060e08a013591506101008a013590509295985092959850929598565b634e487b7160e01b600052603260045260246000fd5b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b6020808252601390820152720a4cae2ead2e4ca40e6c2daca40d8cadccee8d606b1b604082015260600190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b602080825260149082015273105b5bdd5b9d0818d85b89dd081899481b9d5b1b60621b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156113f4576113f4614fb2565b600060018201614fed57614fed614fb2565b5060010190565b818103818111156113f4576113f4614fb2565b604080825283519082018190526000906020906060840190828701845b828110156150495781516001600160a01b031684529284019290840190600101615024565b5050508381038285015284518082528583019183019060005b8181101561507e57835183529284019291840191600101615062565b5090979650505050505050565b60208082526023908201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206040820152621bdd5d60ea1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826150f3576150f36150ce565b500690565b80820281158282048414176113f4576113f4614fb2565b60006020828403121561512157600080fd5b81516113f1816149ea565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561516257600080fd5b5051919050565b60006020828403121561517b57600080fd5b81516113f1816149d5565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b838110156151d15781810151838201526020016151b9565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516152128160178501602088016151b6565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516152438160288401602088016151b6565b01602801949350505050565b602081526000825180602084015261526e8160408501602087016151b6565b601f01601f19169190910160400192915050565b600082615291576152916150ce565b500490565b6000816152a5576152a5614fb2565b50600019019056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220a63a918fda67a93784dff1bcee284ace76ba73f15e1388040302d3c0fda9db8064736f6c63430008120033

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.