ETH Price: $3,318.10 (+1.79%)
Gas: 3 Gwei

Contract

0x80FC2260921F17E959555d486Da34Ff2bE7ABaE7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Emergency Withdr...173321362023-05-24 22:54:23431 days ago1684968863IN
0x80FC2260...2bE7ABaE7
0 ETH0.0022089427.84707616
Emergency Withdr...173321292023-05-24 22:52:47431 days ago1684968767IN
0x80FC2260...2bE7ABaE7
0 ETH0.0008549228.09760553
Request Random W...169072862023-03-25 21:55:47491 days ago1679781347IN
0x80FC2260...2bE7ABaE7
0 ETH0.0016279517.20613394
Claim168797082023-03-22 0:57:11495 days ago1679446631IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0012162313.11881607
Claim168759492023-03-21 12:15:23496 days ago1679400923IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0011641712.55734659
Claim168682742023-03-20 10:24:59497 days ago1679307899IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0013588514.65721524
Claim168664232023-03-20 4:11:35497 days ago1679285495IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0015422914.04523941
Claim168664142023-03-20 4:09:47497 days ago1679285387IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.001485413.52718101
Claim168661922023-03-20 3:24:59497 days ago1679282699IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0016139617.40897324
Claim168658822023-03-20 2:22:23497 days ago1679278943IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0013729614.80941387
Claim168658782023-03-20 2:21:35497 days ago1679278895IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0015713916.94974587
Claim168658642023-03-20 2:18:47497 days ago1679278727IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0014333415.46064743
Claim168658622023-03-20 2:18:23497 days ago1679278703IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0014926416.10033462
Claim168658592023-03-20 2:17:47497 days ago1679278667IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.001699118.32731631
Claim168658552023-03-20 2:16:59497 days ago1679278619IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0016162917.43403061
Claim168658392023-03-20 2:13:47497 days ago1679278427IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.001865520.12219427
Call Airdrop168657442023-03-20 1:54:47497 days ago1679277287IN
0x80FC2260...2bE7ABaE7
0 ETH0.0043858414.52840614
Add Distributor168524042023-03-18 4:56:11499 days ago1679115371IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0037563116.34026397
Add Distributor168523282023-03-18 4:40:59499 days ago1679114459IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0039079717
Transfer168523022023-03-18 4:35:23499 days ago1679114123IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0003640817.29193426
Add Distributor168522542023-03-18 4:25:47499 days ago1679113547IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0037523916.3232018
Add Distributor168521282023-03-18 4:00:23499 days ago1679112023IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0036537315.89404122
Add Distributor168520992023-03-18 3:54:11499 days ago1679111651IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0037244816.20181347
Add Distributor168520842023-03-18 3:51:11499 days ago1679111471IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.004525719.68718039
Add Distributor168520642023-03-18 3:46:59499 days ago1679111219IN
0x80FC2260...2bE7ABaE7
0.00052 ETH0.0036771115.99575018
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
173321292023-05-24 22:52:47431 days ago1684968767
0x80FC2260...2bE7ABaE7
0.30312 ETH
168797082023-03-22 0:57:11495 days ago1679446631
0x80FC2260...2bE7ABaE7
0.00052 ETH
168759492023-03-21 12:15:23496 days ago1679400923
0x80FC2260...2bE7ABaE7
0.00052 ETH
168682742023-03-20 10:24:59497 days ago1679307899
0x80FC2260...2bE7ABaE7
0.00052 ETH
168664232023-03-20 4:11:35497 days ago1679285495
0x80FC2260...2bE7ABaE7
0.00052 ETH
168664142023-03-20 4:09:47497 days ago1679285387
0x80FC2260...2bE7ABaE7
0.00052 ETH
168661922023-03-20 3:24:59497 days ago1679282699
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658822023-03-20 2:22:23497 days ago1679278943
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658782023-03-20 2:21:35497 days ago1679278895
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658642023-03-20 2:18:47497 days ago1679278727
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658622023-03-20 2:18:23497 days ago1679278703
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658592023-03-20 2:17:47497 days ago1679278667
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658552023-03-20 2:16:59497 days ago1679278619
0x80FC2260...2bE7ABaE7
0.00052 ETH
168658392023-03-20 2:13:47497 days ago1679278427
0x80FC2260...2bE7ABaE7
0.00052 ETH
168524042023-03-18 4:56:11499 days ago1679115371
0x80FC2260...2bE7ABaE7
0.00052 ETH
168523282023-03-18 4:40:59499 days ago1679114459
0x80FC2260...2bE7ABaE7
0.00052 ETH
168522542023-03-18 4:25:47499 days ago1679113547
0x80FC2260...2bE7ABaE7
0.00052 ETH
168521282023-03-18 4:00:23499 days ago1679112023
0x80FC2260...2bE7ABaE7
0.00052 ETH
168520992023-03-18 3:54:11499 days ago1679111651
0x80FC2260...2bE7ABaE7
0.00052 ETH
168520842023-03-18 3:51:11499 days ago1679111471
0x80FC2260...2bE7ABaE7
0.00052 ETH
168520642023-03-18 3:46:59499 days ago1679111219
0x80FC2260...2bE7ABaE7
0.00052 ETH
168520002023-03-18 3:33:35499 days ago1679110415
0x80FC2260...2bE7ABaE7
0.00052 ETH
168494082023-03-17 18:48:35500 days ago1679078915
0x80FC2260...2bE7ABaE7
0.00052 ETH
168492772023-03-17 18:21:59500 days ago1679077319
0x80FC2260...2bE7ABaE7
0.00052 ETH
168491862023-03-17 18:03:47500 days ago1679076227
0x80FC2260...2bE7ABaE7
0.00052 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AlcazarAirdrop

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 11 : AlcazarAirdrop.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma abicoder v2;

/**
 * @author Brewlabs
 * This contract has been developed by brewlabs.info
 */
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.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 "../libs/IPriceOracle.sol";

interface IPegSwap {
    function swap(uint256 amount, address source, address target) external;
    function getSwappableAmount(address source, address target) external view returns (uint256);
}

contract AlcazarAirdrop is ReentrancyGuard, VRFConsumerBaseV2, Ownable {
    using SafeERC20 for IERC20;

    VRFCoordinatorV2Interface COORDINATOR;
    LinkTokenInterface LINKTOKEN;

    bool public initialized = false;
    IERC20 public token;
    IPriceOracle private oracle;

    uint64 public s_subscriptionId;

    bytes32 keyHash;
    uint32 callbackGasLimit = 150000;
    uint16 requestConfirmations = 3;
    uint32 numWords = 3;

    uint256 public s_requestId;
    uint256 public r_requestId;
    uint256[] public s_randomWords;

    struct AirdropResult {
        address[3] winner;
        uint256[3] amount;
    }

    uint256 public currentID = 1;
    uint256 public distributeRate = 9500;
    uint256 public distributorLimit = 500 ether;
    uint256[3] public airdropRates = [6000, 2500, 1000];
    mapping(uint256 => AirdropResult) private results;
    uint256 public lastAirdropTime;

    struct DistributorInfo {
        uint256 amount;
        uint256 regAirdropID;
    }

    mapping(address => DistributorInfo) public userInfo;
    address[] public distributors;

    address public treasury = 0xE2123f0F85953414eb3B4Dfa97790ec8e0102D44;
    uint256 public performanceFee = 0.00052 ether;
    uint256 public totalStaked;

    // BSC Mainnet ERC20_LINK_ADDRESS
    address public constant ERC20_LINK_ADDRESS = 0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD;
    address public constant PEGSWAP_ADDRESS = 0x1FCc3B22955e76Ca48bF025f1A6993685975Bb9e;

    event AddDistributor(address user, uint256 amount);
    event Claim(address user, uint256 amount);
    event HolderDistributed(uint256 id, address[3] winners, uint256[3] amounts);
    event SetDistributorLimit(uint256 limit);
    event SetDistributorRates(uint256[3] rates);
    event ServiceInfoUpadted(address addr, uint256 fee);

    /**
     * @notice Constructor
     * @dev RandomNumberGenerator must be deployed prior to this contract
     */
    constructor(address _vrfCoordinator, address _link, bytes32 _keyHash) VRFConsumerBaseV2(_vrfCoordinator) {
        COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator);
        s_subscriptionId = COORDINATOR.createSubscription();
        keyHash = _keyHash;

        COORDINATOR.addConsumer(s_subscriptionId, address(this));
        LINKTOKEN = LinkTokenInterface(_link);
    }

    /**
     * @notice Initialize the contract
     * @dev This function must be called by the owner of the contract.
     */
    function initialize(address _token, address _oracle) external onlyOwner {
        require(!initialized, "Contract already initialized");
        initialized = true;

        token = IERC20(_token);
        oracle = IPriceOracle(_oracle);
    }

    function addDistributor() external payable nonReentrant {
        require(initialized, "Contract not initialized");
        require(!isContract(msg.sender), "contract cannot be distributor");

        DistributorInfo storage user = userInfo[msg.sender];
        require(user.regAirdropID < currentID, "already added");
        require(user.amount == 0, "claim previous stake first");

        _transferPerformanceFee();

        uint256 tokenPrice = oracle.getTokenPrice(address(token));
        uint256 tokenBal = token.balanceOf(msg.sender);
        uint256 amount = distributorLimit * 1 ether / tokenPrice;
        require(tokenPrice > 0, "LUCKY ROO price is missing");
        require(tokenBal >= amount, "insufficient holder balance");

        uint256 beforeAmt = token.balanceOf(address(this));
        token.safeTransferFrom(msg.sender, address(this), amount);
        uint256 realAmt = token.balanceOf(address(this)) - beforeAmt;
        if (realAmt > amount) realAmt = amount;

        user.amount = realAmt;
        user.regAirdropID = currentID;
        distributors.push(msg.sender);

        totalStaked += user.amount;
        emit AddDistributor(msg.sender, realAmt);
    }

    function claim() external payable nonReentrant {
        DistributorInfo storage user = userInfo[msg.sender];
        require(user.amount > 0, "not registered");
        require(user.regAirdropID < currentID, "can claim after this round is finished");

        _transferPerformanceFee();

        token.safeTransfer(msg.sender, user.amount);
        emit Claim(msg.sender, user.amount);

        totalStaked -= user.amount;
        user.amount = 0;
    }

    function _transferPerformanceFee() internal {
        require(msg.value >= performanceFee, "should pay small gas to add as a distributor");

        payable(treasury).transfer(performanceFee);
        if (msg.value > performanceFee) {
            payable(msg.sender).transfer(msg.value - performanceFee);
        }
    }

    function numDistributors() external view returns (uint256) {
        return distributors.length;
    }

    /**
     * @notice Distribute the prizes to the three winners
     * @dev This function must be called by the owner of the contract.
     */
    function callAirdrop() external onlyOwner {
        require(initialized, "Contract not initialized");
        require(s_requestId == r_requestId, "Request IDs do not match");
        require(s_randomWords.length == numWords, "Number of words does not match");

        uint256 numHolders = distributors.length;
        require(numHolders > 3, "Not enough distributors");

        s_requestId = 0;

        uint256[3] memory idx;
        uint256[3] memory sortedIdx;
        for (uint256 i = 0; i < 3; i++) {
            idx[i] = s_randomWords[i] % (numHolders - i);
            for (uint256 j = 0; j < i; j++) {
                if (idx[i] >= sortedIdx[j]) {
                    idx[i] = idx[i] + 1;
                } else {
                    break;
                }
            }

            idx[i] = idx[i] % numHolders;
            sortedIdx[i] = idx[i];
            if (i > 0 && sortedIdx[i] < sortedIdx[i - 1]) {
                uint256 t = sortedIdx[i];
                sortedIdx[i] = sortedIdx[i - 1];
                sortedIdx[i - 1] = t;
            }
        }

        AirdropResult storage airdropResult = results[currentID];

        uint256 amount = token.balanceOf(address(this));
        if(amount > totalStaked ) {
            amount -= totalStaked;
        } else amount = 0;

        amount = amount * distributeRate / 10000;
        for (uint256 i = 0; i < 3; i++) {
            address winnerA = distributors[idx[i]];
            airdropResult.winner[i] = winnerA;

            uint256 amountA = amount * airdropRates[i] / 10000;
            airdropResult.amount[i] = amountA;
            token.safeTransfer(winnerA, amountA);
        }
        emit HolderDistributed(currentID, airdropResult.winner, airdropResult.amount);

        currentID = currentID + 1;
        lastAirdropTime = block.timestamp;
        distributors = new address[](0);
    }

    function getAirdropResult(uint256 _id) external view returns (address[3] memory, uint256[3] memory) {
        return (results[_id].winner, results[_id].amount);
    }

    /**
     * @notice Set the distribution rates for the three wallets
     * @dev This function must be called by the owner of the contract.
     */
    function setAirdropRates(uint256 _rateA, uint256 _rateB, uint256 _rateC) external onlyOwner {
        require(_rateA > 0, "Rate A must be greater than 0");
        require(_rateB > 0, "Rate B must be greater than 0");
        require(_rateC > 0, "Rate C must be greater than 0");
        require(_rateA + _rateB + _rateC < 10000, "Total rate must be less than 10000");

        airdropRates = [_rateA, _rateB, _rateC];
        emit SetDistributorRates(airdropRates);
    }

    /**
     * @notice Set the minimum holding tokens to add distributor in usd
     * @dev This function must be called by the owner of the contract.
     */
    function setDistributorBalanceLimit(uint256 _min) external onlyOwner {
        distributorLimit = _min * 1 ether;
        emit SetDistributorLimit(_min);
    }

    function setServiceInfo(address _treasury, uint256 _fee) external {
        require(msg.sender == treasury, "setServiceInfo: FORBIDDEN");
        require(_treasury != address(0x0), "Invalid address");

        treasury = _treasury;
        performanceFee = _fee;

        emit ServiceInfoUpadted(_treasury, _fee);
    }

    function setCoordiatorConfig(bytes32 _keyHash, uint32 _gasLimit, uint32 _numWords) external onlyOwner {
        keyHash = _keyHash;
        callbackGasLimit = _gasLimit;
        numWords = _numWords;
    }

    /**
     * @notice fetch subscription information from the VRF coordinator
     */
    function getSubscriptionInfo()
        external
        view
        returns (uint96 balance, uint64 reqCount, address owner, address[] memory consumers)
    {
        return COORDINATOR.getSubscription(s_subscriptionId);
    }

    /**
     * @notice cancle subscription from the VRF coordinator
     * @dev This function must be called by the owner of the contract.
     */
    function cancelSubscription() external onlyOwner {
        COORDINATOR.cancelSubscription(s_subscriptionId, msg.sender);
        s_subscriptionId = 0;
    }

    /**
     * @notice subscribe to the VRF coordinator
     * @dev This function must be called by the owner of the contract.
     */
    function startSubscription(address _vrfCoordinator) external onlyOwner {
        require(s_subscriptionId == 0, "Subscription already started");

        COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator);
        s_subscriptionId = COORDINATOR.createSubscription();
        COORDINATOR.addConsumer(s_subscriptionId, address(this));
    }

    /**
     * @notice Fund link token from the VRF coordinator for subscription
     * @dev This function must be called by the owner of the contract.
     */
    function fundToCoordiator(uint96 _amount) external onlyOwner {
        LINKTOKEN.transferFrom(msg.sender, address(this), _amount);
        LINKTOKEN.transferAndCall(address(COORDINATOR), _amount, abi.encode(s_subscriptionId));
    }

    /**
     * @notice Fund link token from the VRF coordinator for subscription
     * @dev This function must be called by the owner of the contract.
     */
    function fundPeggedLinkToCoordiator(uint256 _amount) external onlyOwner {
        IERC20(ERC20_LINK_ADDRESS).transferFrom(msg.sender, address(this), _amount);
        IERC20(ERC20_LINK_ADDRESS).approve(PEGSWAP_ADDRESS, _amount);
        IPegSwap(PEGSWAP_ADDRESS).swap(_amount, ERC20_LINK_ADDRESS, address(LINKTOKEN));

        uint256 tokenBal = LINKTOKEN.balanceOf(address(this));
        LINKTOKEN.transferAndCall(address(COORDINATOR), tokenBal, abi.encode(s_subscriptionId));
    }

    /**
     * @notice Request random words from the VRF coordinator
     * @dev This function must be called by the owner of the contract.
     */
    function requestRandomWords() external onlyOwner {
        r_requestId = 0;
        // Will revert if subscription is not set and funded.
        s_requestId =
            COORDINATOR.requestRandomWords(keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords);
    }

    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        r_requestId = requestId;
        s_randomWords = randomWords;
    }

    function emergencyWithdrawETH() external onlyOwner {
        uint256 _tokenAmount = address(this).balance;
        payable(msg.sender).transfer(_tokenAmount);
    }

    /**
     * @notice It allows the admin to recover wrong tokens sent to the contract
     * @param _token: the address of the token to withdraw
     * @dev This function is only callable by admin.
     */
    function emergencyWithdrawToken(address _token) external onlyOwner {
        uint256 _tokenAmount = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(msg.sender, _tokenAmount);
    }

    function isContract(address _addr) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(_addr)
        }
        return size > 0;
    }

    receive() external payable {}
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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 3 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 4 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 5 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 11 : 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 11 : 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;
}

File 8 of 11 : 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 9 of 11 : IPriceOracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

interface IPriceOracle {
    /**
     * @notice Get the price of a token
     * @param token The token to get the price of
     * @return The asset price mantissa (scaled by 1e18).
     *  Zero means the price is unavailable.
     */
    function getTokenPrice(address token) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

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

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

File 11 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"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":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddDistributor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address[3]","name":"winners","type":"address[3]"},{"indexed":false,"internalType":"uint256[3]","name":"amounts","type":"uint256[3]"}],"name":"HolderDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"ServiceInfoUpadted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"SetDistributorLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[3]","name":"rates","type":"uint256[3]"}],"name":"SetDistributorRates","type":"event"},{"inputs":[],"name":"ERC20_LINK_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PEGSWAP_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addDistributor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"airdropRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currentID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributorLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"distributors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"emergencyWithdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundPeggedLinkToCoordiator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_amount","type":"uint96"}],"name":"fundToCoordiator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getAirdropResult","outputs":[{"internalType":"address[3]","name":"","type":"address[3]"},{"internalType":"uint256[3]","name":"","type":"uint256[3]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubscriptionInfo","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"uint64","name":"reqCount","type":"uint64"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"consumers","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_oracle","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastAirdropTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numDistributors","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"r_requestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"requestRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"s_randomWords","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"s_requestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"s_subscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rateA","type":"uint256"},{"internalType":"uint256","name":"_rateB","type":"uint256"},{"internalType":"uint256","name":"_rateC","type":"uint256"}],"name":"setAirdropRates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint32","name":"_gasLimit","type":"uint32"},{"internalType":"uint32","name":"_numWords","type":"uint32"}],"name":"setCoordiatorConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"}],"name":"setDistributorBalanceLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setServiceInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"}],"name":"startSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"regAirdropID","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6003805460ff60a01b19168155600780546001600160501b03191666030003000249f01790556001600b5561251c600c55681b1ae4d6e2ef500000600d5561010060405261177060a09081526109c460c0526103e860e0526200006691600e919062000291565b50601580546001600160a01b03191673e2123f0f85953414eb3b4dfa97790ec8e0102d441790556601d8efef488000601655348015620000a557600080fd5b506040516200361838038062003618833981016040819052620000c8916200030e565b6001600055606083901b6001600160601b031916608052620000ea336200023f565b600280546001600160a01b0319166001600160a01b0385169081179091556040805163288688f960e21b8152905163a21a23e4916004808201926020929091908290030181600087803b1580156200014157600080fd5b505af115801562000156573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200017c91906200034e565b60058054600160a01b600160e01b031916600160a01b6001600160401b03938416810291909117918290556006849055600254604051631cd0704360e21b81529190920490921660048301523060248301526001600160a01b031690637341c10c90604401600060405180830381600087803b158015620001fc57600080fd5b505af115801562000211573d6000803e3d6000fd5b5050600380546001600160a01b0319166001600160a01b039590951694909417909355506200037e92505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8260038101928215620002c8579160200282015b82811115620002c8578251829061ffff16905591602001919060010190620002a5565b50620002d6929150620002da565b5090565b5b80821115620002d65760008155600101620002db565b80516001600160a01b03811681146200030957600080fd5b919050565b60008060006060848603121562000323578283fd5b6200032e84620002f1565b92506200033e60208501620002f1565b9150604084015190509250925092565b60006020828403121562000360578081fd5b81516001600160401b038116811462000377578182fd5b9392505050565b60805160601c613274620003a4600039600081816109ed0152610a2f01526132746000f3fe60806040526004361061023f5760003560e01c806385d52d431161012e578063c4b1ea15116100ab578063e89e106a1161006f578063e89e106a14610691578063f2fde38b146106a7578063f6eaffc8146106c7578063fc0c546a146106e7578063fde1baca1461070757600080fd5b8063c4b1ea1514610602578063cd69731514610622578063cdd2efd014610637578063d72310d11461065c578063e0c862891461067c57600080fd5b8063a9d8e968116100f2578063a9d8e96814610580578063ac52480e146105a0578063ae503a94146105a8578063b1c2b3e4146105be578063c3890403146105d457600080fd5b806385d52d43146104ce57806387788782146104ee5780638ac00021146105045780638da5cb5b146105435780638ef40ffd1461055857600080fd5b80634e71d92d116101bc57806376ce6b401161018057806376ce6b4014610445578063817b1cd21461046d57806381b6194814610483578063843cf851146104a357806384536017146104b957600080fd5b80634e71d92d146103bb57806350b492ba146103c35780635f795b4d146103f057806361d027b314610410578063715018a61461043057600080fd5b80631fe543e3116102035780631fe543e31461033057806324e9edb01461035057806339096c3314610365578063485cc9551461037b5780634b18b3df1461039b57600080fd5b8063133f26501461024b578063158ef93e1461026d5780631959a002146102a35780631af03203146102ec5780631c75cfb41461030c57600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004612c64565b61071c565b005b34801561027957600080fd5b5060035461028e90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b3480156102af57600080fd5b506102d76102be366004612ab7565b6013602052600090815260409020805460019091015482565b6040805192835260208301919091520161029a565b3480156102f857600080fd5b5061026b610307366004612ab7565b61091a565b34801561031857600080fd5b50610322600b5481565b60405190815260200161029a565b34801561033c57600080fd5b5061026b61034b366004612bc1565b6109e2565b34801561035c57600080fd5b5061026b610a66565b34801561037157600080fd5b5061032260125481565b34801561038757600080fd5b5061026b610396366004612ad3565b610b22565b3480156103a757600080fd5b5061026b6103b6366004612b91565b610bec565b61026b610c66565b3480156103cf57600080fd5b506103e36103de366004612b91565b610dc3565b60405161029a9190612e02565b3480156103fc57600080fd5b5061026b61040b366004612ca9565b610ded565b34801561041c57600080fd5b506015546103e3906001600160a01b031681565b34801561043c57600080fd5b5061026b610f68565b34801561045157600080fd5b506103e373f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd81565b34801561047957600080fd5b5061032260175481565b34801561048f57600080fd5b5061026b61049e366004612b0b565b610fa3565b3480156104af57600080fd5b50610322600d5481565b3480156104c557600080fd5b5061026b61109f565b3480156104da57600080fd5b5061026b6104e9366004612b91565b6110fd565b3480156104fa57600080fd5b5061032260165481565b34801561051057600080fd5b5060055461052b90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161029a565b34801561054f57600080fd5b506103e3611432565b34801561056457600080fd5b506103e3731fcc3b22955e76ca48bf025f1a6993685975bb9e81565b34801561058c57600080fd5b5061026b61059b366004612ab7565b611441565b61026b6115f3565b3480156105b457600080fd5b50610322600c5481565b3480156105ca57600080fd5b5061032260095481565b3480156105e057600080fd5b506105f46105ef366004612b91565b611af8565b60405161029a929190612eb6565b34801561060e57600080fd5b5061026b61061d366004612b56565b611b8e565b34801561062e57600080fd5b5061026b611bf1565b34801561064357600080fd5b5061064c6122e4565b60405161029a9493929190613049565b34801561066857600080fd5b50610322610677366004612b91565b61238e565b34801561068857600080fd5b5061026b6123a5565b34801561069d57600080fd5b5061032260085481565b3480156106b357600080fd5b5061026b6106c2366004612ab7565b6124a8565b3480156106d357600080fd5b506103226106e2366004612b91565b612548565b3480156106f357600080fd5b506004546103e3906001600160a01b031681565b34801561071357600080fd5b50601454610322565b33610725611432565b6001600160a01b0316146107545760405162461bcd60e51b815260040161074b90612f42565b60405180910390fd5b600083116107a45760405162461bcd60e51b815260206004820152601d60248201527f526174652041206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b600082116107f45760405162461bcd60e51b815260206004820152601d60248201527f526174652042206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b600081116108445760405162461bcd60e51b815260206004820152601d60248201527f526174652043206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b612710816108528486613115565b61085c9190613115565b106108b45760405162461bcd60e51b815260206004820152602260248201527f546f74616c2072617465206d757374206265206c657373207468616e20313030604482015261030360f41b606482015260840161074b565b60408051606081018252848152602081018490529081018290526108dc90600e906003612987565b507f9790ef7c1f45d72c28f24be5b24c0bfc1066f8d9d8ed0093f34e330a392ae5ae600e60405161090d9190612f1b565b60405180910390a1505050565b33610923611432565b6001600160a01b0316146109495760405162461bcd60e51b815260040161074b90612f42565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610978903090600401612e02565b60206040518083038186803b15801561099057600080fd5b505afa1580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c89190612ba9565b90506109de6001600160a01b0383163383612569565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a5c5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602482015260440161074b565b6109de82826125bf565b33610a6f611432565b6001600160a01b031614610a955760405162461bcd60e51b815260040161074b90612f42565b600254600554604051630d7ae1d360e41b81526001600160a01b039092169163d7ae1d3091610ada91600160a01b9091046001600160401b0316903390600401613027565b600060405180830381600087803b158015610af457600080fd5b505af1158015610b08573d6000803e3d6000fd5b50506005805467ffffffffffffffff60a01b191690555050565b33610b2b611432565b6001600160a01b031614610b515760405162461bcd60e51b815260040161074b90612f42565b600354600160a01b900460ff1615610bab5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420616c726561647920696e697469616c697a656400000000604482015260640161074b565b6003805460ff60a01b1916600160a01b179055600480546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b33610bf5611432565b6001600160a01b031614610c1b5760405162461bcd60e51b815260040161074b90612f42565b610c2d81670de0b6b3a7640000613141565b600d556040518181527f60ecaa7da6b4bb3a399ca8b025cdc06c0950a0c9b03644ebf721bf5985ac848d9060200160405180910390a150565b60026000541415610c895760405162461bcd60e51b815260040161074b90612f77565b600260009081553381526013602052604090208054610cdb5760405162461bcd60e51b815260206004820152600e60248201526d1b9bdd081c9959da5cdd195c995960921b604482015260640161074b565b600b54816001015410610d3f5760405162461bcd60e51b815260206004820152602660248201527f63616e20636c61696d206166746572207468697320726f756e642069732066696044820152651b9a5cda195960d21b606482015260840161074b565b610d476125d7565b8054600454610d63916001600160a01b03909116903390612569565b80546040517f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d491610d9691339190612e3a565b60405180910390a1805460178054600090610db2908490613160565b909155505060009081905560019055565b60148181548110610dd357600080fd5b6000918252602090912001546001600160a01b0316905081565b33610df6611432565b6001600160a01b031614610e1c5760405162461bcd60e51b815260040161074b90612f42565b6003546040516323b872dd60e01b81523360048201523060248201526001600160601b03831660448201526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eae9190612b36565b5060035460025460055460408051600160a01b9092046001600160401b031660208301526001600160a01b0393841693634000aea09316918591016040516020818303038152906040526040518463ffffffff1660e01b8152600401610f1693929190612e83565b602060405180830381600087803b158015610f3057600080fd5b505af1158015610f44573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190612b36565b33610f71611432565b6001600160a01b031614610f975760405162461bcd60e51b815260040161074b90612f42565b610fa160006126c0565b565b6015546001600160a01b03163314610ff95760405162461bcd60e51b815260206004820152601960248201527839b2ba29b2b93b34b1b2a4b733379d102327a92124a22222a760391b604482015260640161074b565b6001600160a01b0382166110415760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161074b565b601580546001600160a01b0319166001600160a01b03841617905560168190556040517f232f2e6280d2064b1e439bf40ecdada042d84eefbb55039e4c49e8dc4f4c90c9906110939084908490612e3a565b60405180910390a15050565b336110a8611432565b6001600160a01b0316146110ce5760405162461bcd60e51b815260040161074b90612f42565b6040514790339082156108fc029083906000818181858888f193505050501580156109de573d6000803e3d6000fd5b33611106611432565b6001600160a01b03161461112c5760405162461bcd60e51b815260040161074b90612f42565b6040516323b872dd60e01b815273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd906323b872dd9061116790339030908690600401612e16565b602060405180830381600087803b15801561118157600080fd5b505af1158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b99190612b36565b5060405163095ea7b360e01b815273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd9063095ea7b39061120790731fcc3b22955e76ca48bf025f1a6993685975bb9e908590600401612e3a565b602060405180830381600087803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112599190612b36565b50600354604051632b7f092360e01b81526004810183905273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd60248201526001600160a01b039091166044820152731fcc3b22955e76ca48bf025f1a6993685975bb9e90632b7f092390606401600060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b50506003546040516370a0823160e01b8152600093506001600160a01b0390911691506370a082319061131f903090600401612e02565b60206040518083038186803b15801561133757600080fd5b505afa15801561134b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136f9190612ba9565b60035460025460055460408051600160a01b9092046001600160401b031660208301529394506001600160a01b0392831693634000aea093909216918591016040516020818303038152906040526040518463ffffffff1660e01b81526004016113db93929190612e53565b602060405180830381600087803b1580156113f557600080fd5b505af1158015611409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142d9190612b36565b505050565b6001546001600160a01b031690565b3361144a611432565b6001600160a01b0316146114705760405162461bcd60e51b815260040161074b90612f42565b600554600160a01b90046001600160401b0316156114d05760405162461bcd60e51b815260206004820152601c60248201527f537562736372697074696f6e20616c7265616479207374617274656400000000604482015260640161074b565b600280546001600160a01b0319166001600160a01b0383169081179091556040805163288688f960e21b8152905163a21a23e4916004808201926020929091908290030181600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155e9190612c8f565b6005805467ffffffffffffffff60a01b1916600160a01b6001600160401b0393841681029190911791829055600254604051631cd0704360e21b81526001600160a01b0390911693637341c10c936115be93900416903090600401613027565b600060405180830381600087803b1580156115d857600080fd5b505af11580156115ec573d6000803e3d6000fd5b5050505050565b600260005414156116165760405162461bcd60e51b815260040161074b90612f77565b6002600055600354600160a01b900460ff166116445760405162461bcd60e51b815260040161074b90612fae565b333b156116935760405162461bcd60e51b815260206004820152601e60248201527f636f6e74726163742063616e6e6f74206265206469737472696275746f720000604482015260640161074b565b336000908152601360205260409020600b546001820154106116e75760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481859191959609a1b604482015260640161074b565b8054156117365760405162461bcd60e51b815260206004820152601a60248201527f636c61696d2070726576696f7573207374616b65206669727374000000000000604482015260640161074b565b61173e6125d7565b60055460048054604051630681320d60e51b81526000936001600160a01b039081169363d02641a0936117749392169101612e02565b60206040518083038186803b15801561178c57600080fd5b505afa1580156117a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c49190612ba9565b600480546040516370a0823160e01b81529293506000926001600160a01b03909116916370a08231916117f991339101612e02565b60206040518083038186803b15801561181157600080fd5b505afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118499190612ba9565b9050600082600d54670de0b6b3a76400006118649190613141565b61186e919061312d565b9050600083116118c05760405162461bcd60e51b815260206004820152601a60248201527f4c55434b5920524f4f207072696365206973206d697373696e67000000000000604482015260640161074b565b808210156119105760405162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e7420686f6c6465722062616c616e63650000000000604482015260640161074b565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a082319161194291309101612e02565b60206040518083038186803b15801561195a57600080fd5b505afa15801561196e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119929190612ba9565b6004549091506119ad906001600160a01b0316333085612712565b600480546040516370a0823160e01b815260009284926001600160a01b0316916370a08231916119df91309101612e02565b60206040518083038186803b1580156119f757600080fd5b505afa158015611a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2f9190612ba9565b611a399190613160565b905082811115611a465750815b808655600b5460018088019190915560148054918201815560009081527fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90910180546001600160a01b0319163317905586546017805491929091611aac908490613115565b90915550506040517fa5babb86a45dcaf11bfb2fb70a03b04ce046203b581637539f567d01f6e8c68390611ae39033908490612e3a565b60405180910390a15050600160005550505050565b611b006129c5565b611b086129c5565b600083815260116020526040908190208151606081019283905290916003808401929184919082845b81546001600160a01b03168152600190910190602001808311611b3157505060408051606081019182905294965085935060039250905082845b815481526020019060010190808311611b6b575050505050905091509150915091565b33611b97611432565b6001600160a01b031614611bbd5760405162461bcd60e51b815260040161074b90612f42565b6006929092556007805463ffffffff938416600160301b0269ffffffff0000ffffffff199091169390921692909217179055565b33611bfa611432565b6001600160a01b031614611c205760405162461bcd60e51b815260040161074b90612f42565b600354600160a01b900460ff16611c495760405162461bcd60e51b815260040161074b90612fae565b60095460085414611c975760405162461bcd60e51b81526020600482015260186024820152770a4cae2eacae6e8409288e640c8de40dcdee840dac2e8c6d60431b604482015260640161074b565b600754600a54600160301b90910463ffffffff1614611cf85760405162461bcd60e51b815260206004820152601e60248201527f4e756d626572206f6620776f72647320646f6573206e6f74206d617463680000604482015260640161074b565b60145460038111611d455760405162461bcd60e51b81526020600482015260176024820152764e6f7420656e6f756768206469737472696275746f727360481b604482015260640161074b565b6000600855611d526129c5565b611d5a6129c5565b60005b600381101561205c57611d708185613160565b600a8281548110611d9157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154611da691906131be565b838260038110611dc657634e487b7160e01b600052603260045260246000fd5b602002015260005b81811015611e9657828160038110611df657634e487b7160e01b600052603260045260246000fd5b6020020151848360038110611e1b57634e487b7160e01b600052603260045260246000fd5b602002015110611e7f57838260038110611e4557634e487b7160e01b600052603260045260246000fd5b6020020151611e55906001613115565b848360038110611e7557634e487b7160e01b600052603260045260246000fd5b6020020152611e84565b611e96565b80611e8e816131a3565b915050611dce565b5083838260038110611eb857634e487b7160e01b600052603260045260246000fd5b6020020151611ec791906131be565b838260038110611ee757634e487b7160e01b600052603260045260246000fd5b6020020152828160038110611f0c57634e487b7160e01b600052603260045260246000fd5b6020020151828260038110611f3157634e487b7160e01b600052603260045260246000fd5b60200201528015801590611f96575081611f4c600183613160565b60038110611f6a57634e487b7160e01b600052603260045260246000fd5b6020020151828260038110611f8f57634e487b7160e01b600052603260045260246000fd5b6020020151105b1561204a576000828260038110611fbd57634e487b7160e01b600052603260045260246000fd5b6020020151905082611fd0600184613160565b60038110611fee57634e487b7160e01b600052603260045260246000fd5b602002015183836003811061201357634e487b7160e01b600052603260045260246000fd5b60200201528083612025600185613160565b6003811061204357634e487b7160e01b600052603260045260246000fd5b6020020152505b80612054816131a3565b915050611d5d565b50600b546000908152601160205260408082206004805492516370a0823160e01b81529193926001600160a01b0316916370a082319161209e91309101612e02565b60206040518083038186803b1580156120b657600080fd5b505afa1580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190612ba9565b905060175481111561210e576017546121079082613160565b9050612112565b5060005b612710600c54826121239190613141565b61212d919061312d565b905060005b6003811015612269576000601486836003811061215f57634e487b7160e01b600052603260045260246000fd5b60200201518154811061218257634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03169050808483600381106121ba57634e487b7160e01b600052603260045260246000fd5b0180546001600160a01b0319166001600160a01b03929092169190911790556000612710600e84600381106121ff57634e487b7160e01b600052603260045260246000fd5b015461220b9086613141565b612215919061312d565b90508085600301846003811061223b57634e487b7160e01b600052603260045260246000fd5b0155600454612254906001600160a01b03168383612569565b50508080612261906131a3565b915050612132565b50600b546040517ff60d42537d8c91b054cdf2259dbc4355292892f0cf4b936e64a1025bfb62dcf8916122a29185906003820190612fe0565b60405180910390a1600b546122b8906001613115565b600b554260125560408051600081526020810191829052516122dc916014916129e3565b505050505050565b60025460055460405163523e3b4b60e11b8152600160a01b9091046001600160401b03166004820152600091829182916060916001600160a01b039091169063a47c76969060240160006040518083038186803b15801561234457600080fd5b505afa158015612358573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123809190810190612cc5565b935093509350935090919293565b600e816003811061239e57600080fd5b0154905081565b336123ae611432565b6001600160a01b0316146123d45760405162461bcd60e51b815260040161074b90612f42565b60006009556002546006546005546007546040516305d3b1d360e41b81526004810193909352600160a01b9091046001600160401b03166024830152640100000000810461ffff16604483015263ffffffff8082166064840152600160301b9091041660848201526001600160a01b0390911690635d3b1d309060a401602060405180830381600087803b15801561246b57600080fd5b505af115801561247f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a39190612ba9565b600855565b336124b1611432565b6001600160a01b0316146124d75760405162461bcd60e51b815260040161074b90612f42565b6001600160a01b03811661253c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161074b565b612545816126c0565b50565b600a818154811061255857600080fd5b600091825260209091200154905081565b61142d8363a9059cbb60e01b8484604051602401612588929190612e3a565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612739565b6009829055805161142d90600a906020840190612a38565b60165434101561263e5760405162461bcd60e51b815260206004820152602c60248201527f73686f756c642070617920736d616c6c2067617320746f20616464206173206160448201526b103234b9ba3934b13aba37b960a11b606482015260840161074b565b6015546016546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561267a573d6000803e3d6000fd5b50601654341115610fa15760165433906108fc906126989034613160565b6040518115909202916000818181858888f19350505050158015612545573d6000803e3d6000fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612733846323b872dd60e01b85858560405160240161258893929190612e16565b50505050565b600061278e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661280b9092919063ffffffff16565b80519091501561142d57808060200190518101906127ac9190612b36565b61142d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161074b565b606061281a8484600085612824565b90505b9392505050565b6060824710156128855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161074b565b843b6128d35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161074b565b600080866001600160a01b031685876040516128ef9190612de6565b60006040518083038185875af1925050503d806000811461292c576040519150601f19603f3d011682016040523d82523d6000602084013e612931565b606091505b509150915061294182828661294e565b925050505b949350505050565b6060831561295d57508161281d565b82511561296d5782518084602001fd5b8160405162461bcd60e51b815260040161074b9190612f2f565b82600381019282156129b5579160200282015b828111156129b557825182559160200191906001019061299a565b506129c1929150612a72565b5090565b60405180606001604052806003906020820280368337509192915050565b8280548282559060005260206000209081019282156129b5579160200282015b828111156129b557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612a03565b8280548282559060005260206000209081019282156129b557916020028201828111156129b557825182559160200191906001019061299a565b5b808211156129c15760008155600101612a73565b803563ffffffff81168114612a9b57600080fd5b919050565b80516001600160401b0381168114612a9b57600080fd5b600060208284031215612ac8578081fd5b813561281d81613214565b60008060408385031215612ae5578081fd5b8235612af081613214565b91506020830135612b0081613214565b809150509250929050565b60008060408385031215612b1d578182fd5b8235612b2881613214565b946020939093013593505050565b600060208284031215612b47578081fd5b8151801515811461281d578182fd5b600080600060608486031215612b6a578081fd5b83359250612b7a60208501612a87565b9150612b8860408501612a87565b90509250925092565b600060208284031215612ba2578081fd5b5035919050565b600060208284031215612bba578081fd5b5051919050565b60008060408385031215612bd3578182fd5b823591506020808401356001600160401b03811115612bf0578283fd5b8401601f81018613612c00578283fd5b8035612c13612c0e826130f2565b6130c2565b80828252848201915084840189868560051b8701011115612c32578687fd5b8694505b83851015612c54578035835260019490940193918501918501612c36565b5080955050505050509250929050565b600080600060608486031215612c78578283fd5b505081359360208301359350604090920135919050565b600060208284031215612ca0578081fd5b61281d82612aa0565b600060208284031215612cba578081fd5b813561281d81613229565b60008060008060808587031215612cda578182fd5b8451612ce581613229565b93506020612cf4868201612aa0565b93506040860151612d0481613214565b60608701519093506001600160401b03811115612d1f578283fd5b8601601f81018813612d2f578283fd5b8051612d3d612c0e826130f2565b8082825284820191508484018b868560051b8701011115612d5c578687fd5b8694505b83851015612d87578051612d7381613214565b835260019490940193918501918501612d60565b50979a9699509497505050505050565b8060005b6003811015612733578154845260209093019260019182019101612d9b565b60008151808452612dd2816020860160208601613177565b601f01601f19169290920160200192915050565b60008251612df8818460208701613177565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b60018060a01b0384168152826020820152606060408201526000612e7a6060830184612dba565b95945050505050565b6001600160a01b03841681526001600160601b0383166020820152606060408201819052600090612e7a90830184612dba565b60c08101818460005b6003811015612ee75781516001600160a01b0316835260209283019290910190600101612ebf565b505050606082018360005b6003811015612f11578151835260209283019290910190600101612ef2565b5050509392505050565b60608101612f298284612d97565b92915050565b60208152600061281d6020830184612dba565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526018908201527710dbdb9d1c9858dd081b9bdd081a5b9a5d1a585b1a5e995960421b604082015260600190565b83815260e0810160208083018560005b60038110156130165781546001600160a01b031683529183019160019182019101612ff0565b505050506129466080830184612d97565b6001600160401b039290921682526001600160a01b0316602082015260400190565b6000608082016001600160601b038716835260206001600160401b0387168185015260018060a01b0380871660408601526080606086015282865180855260a0870191508388019450855b818110156130b2578551841683529484019491840191600101613094565b50909a9950505050505050505050565b604051601f8201601f191681016001600160401b03811182821017156130ea576130ea6131fe565b604052919050565b60006001600160401b0382111561310b5761310b6131fe565b5060051b60200190565b60008219821115613128576131286131d2565b500190565b60008261313c5761313c6131e8565b500490565b600081600019048311821515161561315b5761315b6131d2565b500290565b600082821015613172576131726131d2565b500390565b60005b8381101561319257818101518382015260200161317a565b838111156127335750506000910152565b60006000198214156131b7576131b76131d2565b5060010190565b6000826131cd576131cd6131e8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461254557600080fd5b6001600160601b038116811461254557600080fdfea2646970667358221220372827d1aa6f46de5f7a6d9fdaacb7fd2b831c1b89bb9df3a9bf4c3b7fff21ad64736f6c63430008040033000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986caff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92

Deployed Bytecode

0x60806040526004361061023f5760003560e01c806385d52d431161012e578063c4b1ea15116100ab578063e89e106a1161006f578063e89e106a14610691578063f2fde38b146106a7578063f6eaffc8146106c7578063fc0c546a146106e7578063fde1baca1461070757600080fd5b8063c4b1ea1514610602578063cd69731514610622578063cdd2efd014610637578063d72310d11461065c578063e0c862891461067c57600080fd5b8063a9d8e968116100f2578063a9d8e96814610580578063ac52480e146105a0578063ae503a94146105a8578063b1c2b3e4146105be578063c3890403146105d457600080fd5b806385d52d43146104ce57806387788782146104ee5780638ac00021146105045780638da5cb5b146105435780638ef40ffd1461055857600080fd5b80634e71d92d116101bc57806376ce6b401161018057806376ce6b4014610445578063817b1cd21461046d57806381b6194814610483578063843cf851146104a357806384536017146104b957600080fd5b80634e71d92d146103bb57806350b492ba146103c35780635f795b4d146103f057806361d027b314610410578063715018a61461043057600080fd5b80631fe543e3116102035780631fe543e31461033057806324e9edb01461035057806339096c3314610365578063485cc9551461037b5780634b18b3df1461039b57600080fd5b8063133f26501461024b578063158ef93e1461026d5780631959a002146102a35780631af03203146102ec5780631c75cfb41461030c57600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004612c64565b61071c565b005b34801561027957600080fd5b5060035461028e90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b3480156102af57600080fd5b506102d76102be366004612ab7565b6013602052600090815260409020805460019091015482565b6040805192835260208301919091520161029a565b3480156102f857600080fd5b5061026b610307366004612ab7565b61091a565b34801561031857600080fd5b50610322600b5481565b60405190815260200161029a565b34801561033c57600080fd5b5061026b61034b366004612bc1565b6109e2565b34801561035c57600080fd5b5061026b610a66565b34801561037157600080fd5b5061032260125481565b34801561038757600080fd5b5061026b610396366004612ad3565b610b22565b3480156103a757600080fd5b5061026b6103b6366004612b91565b610bec565b61026b610c66565b3480156103cf57600080fd5b506103e36103de366004612b91565b610dc3565b60405161029a9190612e02565b3480156103fc57600080fd5b5061026b61040b366004612ca9565b610ded565b34801561041c57600080fd5b506015546103e3906001600160a01b031681565b34801561043c57600080fd5b5061026b610f68565b34801561045157600080fd5b506103e373f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd81565b34801561047957600080fd5b5061032260175481565b34801561048f57600080fd5b5061026b61049e366004612b0b565b610fa3565b3480156104af57600080fd5b50610322600d5481565b3480156104c557600080fd5b5061026b61109f565b3480156104da57600080fd5b5061026b6104e9366004612b91565b6110fd565b3480156104fa57600080fd5b5061032260165481565b34801561051057600080fd5b5060055461052b90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161029a565b34801561054f57600080fd5b506103e3611432565b34801561056457600080fd5b506103e3731fcc3b22955e76ca48bf025f1a6993685975bb9e81565b34801561058c57600080fd5b5061026b61059b366004612ab7565b611441565b61026b6115f3565b3480156105b457600080fd5b50610322600c5481565b3480156105ca57600080fd5b5061032260095481565b3480156105e057600080fd5b506105f46105ef366004612b91565b611af8565b60405161029a929190612eb6565b34801561060e57600080fd5b5061026b61061d366004612b56565b611b8e565b34801561062e57600080fd5b5061026b611bf1565b34801561064357600080fd5b5061064c6122e4565b60405161029a9493929190613049565b34801561066857600080fd5b50610322610677366004612b91565b61238e565b34801561068857600080fd5b5061026b6123a5565b34801561069d57600080fd5b5061032260085481565b3480156106b357600080fd5b5061026b6106c2366004612ab7565b6124a8565b3480156106d357600080fd5b506103226106e2366004612b91565b612548565b3480156106f357600080fd5b506004546103e3906001600160a01b031681565b34801561071357600080fd5b50601454610322565b33610725611432565b6001600160a01b0316146107545760405162461bcd60e51b815260040161074b90612f42565b60405180910390fd5b600083116107a45760405162461bcd60e51b815260206004820152601d60248201527f526174652041206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b600082116107f45760405162461bcd60e51b815260206004820152601d60248201527f526174652042206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b600081116108445760405162461bcd60e51b815260206004820152601d60248201527f526174652043206d7573742062652067726561746572207468616e2030000000604482015260640161074b565b612710816108528486613115565b61085c9190613115565b106108b45760405162461bcd60e51b815260206004820152602260248201527f546f74616c2072617465206d757374206265206c657373207468616e20313030604482015261030360f41b606482015260840161074b565b60408051606081018252848152602081018490529081018290526108dc90600e906003612987565b507f9790ef7c1f45d72c28f24be5b24c0bfc1066f8d9d8ed0093f34e330a392ae5ae600e60405161090d9190612f1b565b60405180910390a1505050565b33610923611432565b6001600160a01b0316146109495760405162461bcd60e51b815260040161074b90612f42565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610978903090600401612e02565b60206040518083038186803b15801561099057600080fd5b505afa1580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c89190612ba9565b90506109de6001600160a01b0383163383612569565b5050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610a5c5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916602482015260440161074b565b6109de82826125bf565b33610a6f611432565b6001600160a01b031614610a955760405162461bcd60e51b815260040161074b90612f42565b600254600554604051630d7ae1d360e41b81526001600160a01b039092169163d7ae1d3091610ada91600160a01b9091046001600160401b0316903390600401613027565b600060405180830381600087803b158015610af457600080fd5b505af1158015610b08573d6000803e3d6000fd5b50506005805467ffffffffffffffff60a01b191690555050565b33610b2b611432565b6001600160a01b031614610b515760405162461bcd60e51b815260040161074b90612f42565b600354600160a01b900460ff1615610bab5760405162461bcd60e51b815260206004820152601c60248201527f436f6e747261637420616c726561647920696e697469616c697a656400000000604482015260640161074b565b6003805460ff60a01b1916600160a01b179055600480546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b33610bf5611432565b6001600160a01b031614610c1b5760405162461bcd60e51b815260040161074b90612f42565b610c2d81670de0b6b3a7640000613141565b600d556040518181527f60ecaa7da6b4bb3a399ca8b025cdc06c0950a0c9b03644ebf721bf5985ac848d9060200160405180910390a150565b60026000541415610c895760405162461bcd60e51b815260040161074b90612f77565b600260009081553381526013602052604090208054610cdb5760405162461bcd60e51b815260206004820152600e60248201526d1b9bdd081c9959da5cdd195c995960921b604482015260640161074b565b600b54816001015410610d3f5760405162461bcd60e51b815260206004820152602660248201527f63616e20636c61696d206166746572207468697320726f756e642069732066696044820152651b9a5cda195960d21b606482015260840161074b565b610d476125d7565b8054600454610d63916001600160a01b03909116903390612569565b80546040517f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d491610d9691339190612e3a565b60405180910390a1805460178054600090610db2908490613160565b909155505060009081905560019055565b60148181548110610dd357600080fd5b6000918252602090912001546001600160a01b0316905081565b33610df6611432565b6001600160a01b031614610e1c5760405162461bcd60e51b815260040161074b90612f42565b6003546040516323b872dd60e01b81523360048201523060248201526001600160601b03831660448201526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eae9190612b36565b5060035460025460055460408051600160a01b9092046001600160401b031660208301526001600160a01b0393841693634000aea09316918591016040516020818303038152906040526040518463ffffffff1660e01b8152600401610f1693929190612e83565b602060405180830381600087803b158015610f3057600080fd5b505af1158015610f44573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190612b36565b33610f71611432565b6001600160a01b031614610f975760405162461bcd60e51b815260040161074b90612f42565b610fa160006126c0565b565b6015546001600160a01b03163314610ff95760405162461bcd60e51b815260206004820152601960248201527839b2ba29b2b93b34b1b2a4b733379d102327a92124a22222a760391b604482015260640161074b565b6001600160a01b0382166110415760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161074b565b601580546001600160a01b0319166001600160a01b03841617905560168190556040517f232f2e6280d2064b1e439bf40ecdada042d84eefbb55039e4c49e8dc4f4c90c9906110939084908490612e3a565b60405180910390a15050565b336110a8611432565b6001600160a01b0316146110ce5760405162461bcd60e51b815260040161074b90612f42565b6040514790339082156108fc029083906000818181858888f193505050501580156109de573d6000803e3d6000fd5b33611106611432565b6001600160a01b03161461112c5760405162461bcd60e51b815260040161074b90612f42565b6040516323b872dd60e01b815273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd906323b872dd9061116790339030908690600401612e16565b602060405180830381600087803b15801561118157600080fd5b505af1158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b99190612b36565b5060405163095ea7b360e01b815273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd9063095ea7b39061120790731fcc3b22955e76ca48bf025f1a6993685975bb9e908590600401612e3a565b602060405180830381600087803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112599190612b36565b50600354604051632b7f092360e01b81526004810183905273f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd60248201526001600160a01b039091166044820152731fcc3b22955e76ca48bf025f1a6993685975bb9e90632b7f092390606401600060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b50506003546040516370a0823160e01b8152600093506001600160a01b0390911691506370a082319061131f903090600401612e02565b60206040518083038186803b15801561133757600080fd5b505afa15801561134b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136f9190612ba9565b60035460025460055460408051600160a01b9092046001600160401b031660208301529394506001600160a01b0392831693634000aea093909216918591016040516020818303038152906040526040518463ffffffff1660e01b81526004016113db93929190612e53565b602060405180830381600087803b1580156113f557600080fd5b505af1158015611409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142d9190612b36565b505050565b6001546001600160a01b031690565b3361144a611432565b6001600160a01b0316146114705760405162461bcd60e51b815260040161074b90612f42565b600554600160a01b90046001600160401b0316156114d05760405162461bcd60e51b815260206004820152601c60248201527f537562736372697074696f6e20616c7265616479207374617274656400000000604482015260640161074b565b600280546001600160a01b0319166001600160a01b0383169081179091556040805163288688f960e21b8152905163a21a23e4916004808201926020929091908290030181600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155e9190612c8f565b6005805467ffffffffffffffff60a01b1916600160a01b6001600160401b0393841681029190911791829055600254604051631cd0704360e21b81526001600160a01b0390911693637341c10c936115be93900416903090600401613027565b600060405180830381600087803b1580156115d857600080fd5b505af11580156115ec573d6000803e3d6000fd5b5050505050565b600260005414156116165760405162461bcd60e51b815260040161074b90612f77565b6002600055600354600160a01b900460ff166116445760405162461bcd60e51b815260040161074b90612fae565b333b156116935760405162461bcd60e51b815260206004820152601e60248201527f636f6e74726163742063616e6e6f74206265206469737472696275746f720000604482015260640161074b565b336000908152601360205260409020600b546001820154106116e75760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481859191959609a1b604482015260640161074b565b8054156117365760405162461bcd60e51b815260206004820152601a60248201527f636c61696d2070726576696f7573207374616b65206669727374000000000000604482015260640161074b565b61173e6125d7565b60055460048054604051630681320d60e51b81526000936001600160a01b039081169363d02641a0936117749392169101612e02565b60206040518083038186803b15801561178c57600080fd5b505afa1580156117a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c49190612ba9565b600480546040516370a0823160e01b81529293506000926001600160a01b03909116916370a08231916117f991339101612e02565b60206040518083038186803b15801561181157600080fd5b505afa158015611825573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118499190612ba9565b9050600082600d54670de0b6b3a76400006118649190613141565b61186e919061312d565b9050600083116118c05760405162461bcd60e51b815260206004820152601a60248201527f4c55434b5920524f4f207072696365206973206d697373696e67000000000000604482015260640161074b565b808210156119105760405162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e7420686f6c6465722062616c616e63650000000000604482015260640161074b565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a082319161194291309101612e02565b60206040518083038186803b15801561195a57600080fd5b505afa15801561196e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119929190612ba9565b6004549091506119ad906001600160a01b0316333085612712565b600480546040516370a0823160e01b815260009284926001600160a01b0316916370a08231916119df91309101612e02565b60206040518083038186803b1580156119f757600080fd5b505afa158015611a0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2f9190612ba9565b611a399190613160565b905082811115611a465750815b808655600b5460018088019190915560148054918201815560009081527fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90910180546001600160a01b0319163317905586546017805491929091611aac908490613115565b90915550506040517fa5babb86a45dcaf11bfb2fb70a03b04ce046203b581637539f567d01f6e8c68390611ae39033908490612e3a565b60405180910390a15050600160005550505050565b611b006129c5565b611b086129c5565b600083815260116020526040908190208151606081019283905290916003808401929184919082845b81546001600160a01b03168152600190910190602001808311611b3157505060408051606081019182905294965085935060039250905082845b815481526020019060010190808311611b6b575050505050905091509150915091565b33611b97611432565b6001600160a01b031614611bbd5760405162461bcd60e51b815260040161074b90612f42565b6006929092556007805463ffffffff938416600160301b0269ffffffff0000ffffffff199091169390921692909217179055565b33611bfa611432565b6001600160a01b031614611c205760405162461bcd60e51b815260040161074b90612f42565b600354600160a01b900460ff16611c495760405162461bcd60e51b815260040161074b90612fae565b60095460085414611c975760405162461bcd60e51b81526020600482015260186024820152770a4cae2eacae6e8409288e640c8de40dcdee840dac2e8c6d60431b604482015260640161074b565b600754600a54600160301b90910463ffffffff1614611cf85760405162461bcd60e51b815260206004820152601e60248201527f4e756d626572206f6620776f72647320646f6573206e6f74206d617463680000604482015260640161074b565b60145460038111611d455760405162461bcd60e51b81526020600482015260176024820152764e6f7420656e6f756768206469737472696275746f727360481b604482015260640161074b565b6000600855611d526129c5565b611d5a6129c5565b60005b600381101561205c57611d708185613160565b600a8281548110611d9157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154611da691906131be565b838260038110611dc657634e487b7160e01b600052603260045260246000fd5b602002015260005b81811015611e9657828160038110611df657634e487b7160e01b600052603260045260246000fd5b6020020151848360038110611e1b57634e487b7160e01b600052603260045260246000fd5b602002015110611e7f57838260038110611e4557634e487b7160e01b600052603260045260246000fd5b6020020151611e55906001613115565b848360038110611e7557634e487b7160e01b600052603260045260246000fd5b6020020152611e84565b611e96565b80611e8e816131a3565b915050611dce565b5083838260038110611eb857634e487b7160e01b600052603260045260246000fd5b6020020151611ec791906131be565b838260038110611ee757634e487b7160e01b600052603260045260246000fd5b6020020152828160038110611f0c57634e487b7160e01b600052603260045260246000fd5b6020020151828260038110611f3157634e487b7160e01b600052603260045260246000fd5b60200201528015801590611f96575081611f4c600183613160565b60038110611f6a57634e487b7160e01b600052603260045260246000fd5b6020020151828260038110611f8f57634e487b7160e01b600052603260045260246000fd5b6020020151105b1561204a576000828260038110611fbd57634e487b7160e01b600052603260045260246000fd5b6020020151905082611fd0600184613160565b60038110611fee57634e487b7160e01b600052603260045260246000fd5b602002015183836003811061201357634e487b7160e01b600052603260045260246000fd5b60200201528083612025600185613160565b6003811061204357634e487b7160e01b600052603260045260246000fd5b6020020152505b80612054816131a3565b915050611d5d565b50600b546000908152601160205260408082206004805492516370a0823160e01b81529193926001600160a01b0316916370a082319161209e91309101612e02565b60206040518083038186803b1580156120b657600080fd5b505afa1580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190612ba9565b905060175481111561210e576017546121079082613160565b9050612112565b5060005b612710600c54826121239190613141565b61212d919061312d565b905060005b6003811015612269576000601486836003811061215f57634e487b7160e01b600052603260045260246000fd5b60200201518154811061218257634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03169050808483600381106121ba57634e487b7160e01b600052603260045260246000fd5b0180546001600160a01b0319166001600160a01b03929092169190911790556000612710600e84600381106121ff57634e487b7160e01b600052603260045260246000fd5b015461220b9086613141565b612215919061312d565b90508085600301846003811061223b57634e487b7160e01b600052603260045260246000fd5b0155600454612254906001600160a01b03168383612569565b50508080612261906131a3565b915050612132565b50600b546040517ff60d42537d8c91b054cdf2259dbc4355292892f0cf4b936e64a1025bfb62dcf8916122a29185906003820190612fe0565b60405180910390a1600b546122b8906001613115565b600b554260125560408051600081526020810191829052516122dc916014916129e3565b505050505050565b60025460055460405163523e3b4b60e11b8152600160a01b9091046001600160401b03166004820152600091829182916060916001600160a01b039091169063a47c76969060240160006040518083038186803b15801561234457600080fd5b505afa158015612358573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526123809190810190612cc5565b935093509350935090919293565b600e816003811061239e57600080fd5b0154905081565b336123ae611432565b6001600160a01b0316146123d45760405162461bcd60e51b815260040161074b90612f42565b60006009556002546006546005546007546040516305d3b1d360e41b81526004810193909352600160a01b9091046001600160401b03166024830152640100000000810461ffff16604483015263ffffffff8082166064840152600160301b9091041660848201526001600160a01b0390911690635d3b1d309060a401602060405180830381600087803b15801561246b57600080fd5b505af115801561247f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a39190612ba9565b600855565b336124b1611432565b6001600160a01b0316146124d75760405162461bcd60e51b815260040161074b90612f42565b6001600160a01b03811661253c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161074b565b612545816126c0565b50565b600a818154811061255857600080fd5b600091825260209091200154905081565b61142d8363a9059cbb60e01b8484604051602401612588929190612e3a565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612739565b6009829055805161142d90600a906020840190612a38565b60165434101561263e5760405162461bcd60e51b815260206004820152602c60248201527f73686f756c642070617920736d616c6c2067617320746f20616464206173206160448201526b103234b9ba3934b13aba37b960a11b606482015260840161074b565b6015546016546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561267a573d6000803e3d6000fd5b50601654341115610fa15760165433906108fc906126989034613160565b6040518115909202916000818181858888f19350505050158015612545573d6000803e3d6000fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612733846323b872dd60e01b85858560405160240161258893929190612e16565b50505050565b600061278e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661280b9092919063ffffffff16565b80519091501561142d57808060200190518101906127ac9190612b36565b61142d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161074b565b606061281a8484600085612824565b90505b9392505050565b6060824710156128855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161074b565b843b6128d35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161074b565b600080866001600160a01b031685876040516128ef9190612de6565b60006040518083038185875af1925050503d806000811461292c576040519150601f19603f3d011682016040523d82523d6000602084013e612931565b606091505b509150915061294182828661294e565b925050505b949350505050565b6060831561295d57508161281d565b82511561296d5782518084602001fd5b8160405162461bcd60e51b815260040161074b9190612f2f565b82600381019282156129b5579160200282015b828111156129b557825182559160200191906001019061299a565b506129c1929150612a72565b5090565b60405180606001604052806003906020820280368337509192915050565b8280548282559060005260206000209081019282156129b5579160200282015b828111156129b557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612a03565b8280548282559060005260206000209081019282156129b557916020028201828111156129b557825182559160200191906001019061299a565b5b808211156129c15760008155600101612a73565b803563ffffffff81168114612a9b57600080fd5b919050565b80516001600160401b0381168114612a9b57600080fd5b600060208284031215612ac8578081fd5b813561281d81613214565b60008060408385031215612ae5578081fd5b8235612af081613214565b91506020830135612b0081613214565b809150509250929050565b60008060408385031215612b1d578182fd5b8235612b2881613214565b946020939093013593505050565b600060208284031215612b47578081fd5b8151801515811461281d578182fd5b600080600060608486031215612b6a578081fd5b83359250612b7a60208501612a87565b9150612b8860408501612a87565b90509250925092565b600060208284031215612ba2578081fd5b5035919050565b600060208284031215612bba578081fd5b5051919050565b60008060408385031215612bd3578182fd5b823591506020808401356001600160401b03811115612bf0578283fd5b8401601f81018613612c00578283fd5b8035612c13612c0e826130f2565b6130c2565b80828252848201915084840189868560051b8701011115612c32578687fd5b8694505b83851015612c54578035835260019490940193918501918501612c36565b5080955050505050509250929050565b600080600060608486031215612c78578283fd5b505081359360208301359350604090920135919050565b600060208284031215612ca0578081fd5b61281d82612aa0565b600060208284031215612cba578081fd5b813561281d81613229565b60008060008060808587031215612cda578182fd5b8451612ce581613229565b93506020612cf4868201612aa0565b93506040860151612d0481613214565b60608701519093506001600160401b03811115612d1f578283fd5b8601601f81018813612d2f578283fd5b8051612d3d612c0e826130f2565b8082825284820191508484018b868560051b8701011115612d5c578687fd5b8694505b83851015612d87578051612d7381613214565b835260019490940193918501918501612d60565b50979a9699509497505050505050565b8060005b6003811015612733578154845260209093019260019182019101612d9b565b60008151808452612dd2816020860160208601613177565b601f01601f19169290920160200192915050565b60008251612df8818460208701613177565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b60018060a01b0384168152826020820152606060408201526000612e7a6060830184612dba565b95945050505050565b6001600160a01b03841681526001600160601b0383166020820152606060408201819052600090612e7a90830184612dba565b60c08101818460005b6003811015612ee75781516001600160a01b0316835260209283019290910190600101612ebf565b505050606082018360005b6003811015612f11578151835260209283019290910190600101612ef2565b5050509392505050565b60608101612f298284612d97565b92915050565b60208152600061281d6020830184612dba565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526018908201527710dbdb9d1c9858dd081b9bdd081a5b9a5d1a585b1a5e995960421b604082015260600190565b83815260e0810160208083018560005b60038110156130165781546001600160a01b031683529183019160019182019101612ff0565b505050506129466080830184612d97565b6001600160401b039290921682526001600160a01b0316602082015260400190565b6000608082016001600160601b038716835260206001600160401b0387168185015260018060a01b0380871660408601526080606086015282865180855260a0870191508388019450855b818110156130b2578551841683529484019491840191600101613094565b50909a9950505050505050505050565b604051601f8201601f191681016001600160401b03811182821017156130ea576130ea6131fe565b604052919050565b60006001600160401b0382111561310b5761310b6131fe565b5060051b60200190565b60008219821115613128576131286131d2565b500190565b60008261313c5761313c6131e8565b500490565b600081600019048311821515161561315b5761315b6131d2565b500290565b600082821015613172576131726131d2565b500390565b60005b8381101561319257818101518382015260200161317a565b838111156127335750506000910152565b60006000198214156131b7576131b76131d2565b5060010190565b6000826131cd576131cd6131e8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461254557600080fd5b6001600160601b038116811461254557600080fdfea2646970667358221220372827d1aa6f46de5f7a6d9fdaacb7fd2b831c1b89bb9df3a9bf4c3b7fff21ad64736f6c63430008040033

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

000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909000000000000000000000000514910771af9ca656af840dff83e8264ecf986caff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92

-----Decoded View---------------
Arg [0] : _vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [1] : _link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [2] : _keyHash (bytes32): 0xff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [1] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [2] : ff8dedfbfa60af186cf3c830acbc32c05aae823045ae5ea7da1e45fbfaba4f92


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.