ETH Price: $1,764.21 (+11.68%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...163078932022-12-31 23:00:35843 days ago1672527635IN
0x2d66B60c...65CDc3b0A
0 ETH0.0004984218.9055282
Set Approval For...163078932022-12-31 23:00:35843 days ago1672527635IN
0x2d66B60c...65CDc3b0A
0 ETH0.0008746418.9055282
Set Approval For...157843262022-10-19 19:45:47916 days ago1666208747IN
0x2d66B60c...65CDc3b0A
0 ETH0.0016571835.8759763
Set Approval For...157843262022-10-19 19:45:47916 days ago1666208747IN
0x2d66B60c...65CDc3b0A
0 ETH0.0016601935.8759763
Set Approval For...157843262022-10-19 19:45:47916 days ago1666208747IN
0x2d66B60c...65CDc3b0A
0 ETH0.0009462635.8759763
Set Approval For...157843242022-10-19 19:45:23916 days ago1666208723IN
0x2d66B60c...65CDc3b0A
0 ETH0.0016318435.2633825
Set Approval For...157843222022-10-19 19:44:59916 days ago1666208699IN
0x2d66B60c...65CDc3b0A
0 ETH0.0016826836.40918921
Set Approval For...151473012022-07-15 12:39:471012 days ago1657888787IN
0x2d66B60c...65CDc3b0A
0 ETH0.0004873220.00197231
Set Approval For...144373462022-03-22 17:03:481127 days ago1647968628IN
0x2d66B60c...65CDc3b0A
0 ETH0.0010686943.8636515
Set Approval For...144003412022-03-16 22:48:561133 days ago1647470936IN
0x2d66B60c...65CDc3b0A
0 ETH0.0010395142.70823612
Set Approval For...142403612022-02-20 2:59:031157 days ago1645325943IN
0x2d66B60c...65CDc3b0A
0 ETH0.0022423692.03618405
Set Approval For...142287182022-02-18 7:28:411159 days ago1645169321IN
0x2d66B60c...65CDc3b0A
0 ETH0.0027946460.39085258
Set Approval For...142139032022-02-16 0:12:161161 days ago1644970336IN
0x2d66B60c...65CDc3b0A
0 ETH0.01147511247.97116683
Set Approval For...142138762022-02-16 0:04:071161 days ago1644969847IN
0x2d66B60c...65CDc3b0A
0 ETH0.00818832176.94529803
Set Approval For...142136272022-02-15 23:12:461162 days ago1644966766IN
0x2d66B60c...65CDc3b0A
0 ETH0.00599469129.54213676
Set Approval For...142028222022-02-14 7:09:221163 days ago1644822562IN
0x2d66B60c...65CDc3b0A
0 ETH0.0021247845.91557432
Claim Prize142024602022-02-14 5:53:131163 days ago1644817993IN
0x2d66B60c...65CDc3b0A
0 ETH0.0031126541.82894887
Transfer From142024552022-02-14 5:52:021163 days ago1644817922IN
0x2d66B60c...65CDc3b0A
0 ETH0.0040742148.62006406
Claim Prize142019362022-02-14 4:00:031163 days ago1644811203IN
0x2d66B60c...65CDc3b0A
0 ETH0.0033616245.17462442
Claim Prize142018092022-02-14 3:33:161163 days ago1644809596IN
0x2d66B60c...65CDc3b0A
0 ETH0.0038739952.13636677
Claim Prize142018092022-02-14 3:33:161163 days ago1644809596IN
0x2d66B60c...65CDc3b0A
0 ETH0.0038796752.13636677
Set Approval For...142018082022-02-14 3:32:471163 days ago1644809567IN
0x2d66B60c...65CDc3b0A
0 ETH0.0021523146.51043354
Get Game Scores142017732022-02-14 3:25:431163 days ago1644809143IN
0x2d66B60c...65CDc3b0A
0 ETH0.0827255258.97873989
Stop Ad Sale142017642022-02-14 3:23:211163 days ago1644809001IN
0x2d66B60c...65CDc3b0A
0 ETH0.002958864.42825107
Silver Sponsorsh...142011522022-02-14 1:02:261163 days ago1644800546IN
0x2d66B60c...65CDc3b0A
0.05 ETH0.0033936244.46687755
View all transactions

Latest 4 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
-142024602022-02-14 5:53:131163 days ago1644817993
0x2d66B60c...65CDc3b0A
0.42525 ETH
-142019362022-02-14 4:00:031163 days ago1644811203
0x2d66B60c...65CDc3b0A
0.42525 ETH
-142018092022-02-14 3:33:161163 days ago1644809596
0x2d66B60c...65CDc3b0A
0.42525 ETH
-142018092022-02-14 3:33:161163 days ago1644809596
0x2d66B60c...65CDc3b0A
0.42525 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Squares

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 35 : Squares.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./AdAuction.sol";
import "./SportsDataAPIConsumer.sol";
import "./RandomGameBoard.sol";
import "./SquaresNFT.sol";
import "./Tag.sol";

/** 
  * @author Atlas Corporation
  * @title Squares on Chain
  */
contract Squares is Ownable, SquaresNFT, RandomGameBoard, SportsDataAPIConsumer, AdAuction {

    using SafeMath for uint256;

    mapping(uint256 => bool) public quarterPrizeClaimed;
    uint256 public totalPrizeCollected;

    constructor()
    SportsDataAPIConsumer(0x0aefab6f66d0278B99B6eCbFa8a03f9828cD90b0)
    AdAuction("Atlas Corp",0xe64581F067Cfdce58657E3c0F58175e638C30f2B)
    {
    }

    function getGameBoardRandomness() public override(RandomGameBoard) onlyOwner returns (bytes32) {
        return super.getGameBoardRandomness();
    }

    function assignGameBoard() public override(RandomGameBoard) onlyOwner {
        super.assignGameBoard();
    }

    function getGameScores() public override(SportsDataAPIConsumer) onlyOwner {
        super.getGameScores();
    }

    function getTile(uint256 _homeScore, uint256 _awayScore) public view returns (uint256) {
        require(gameState == GameState.Set, "Game not set");
        require(_homeScore >= 0 && _homeScore <= 9,"Home score must be within the bounds 0 to 9");
        require(_awayScore >= 0 && _awayScore <= 9,"Home score must be within the bounds 0 to 9");
        
        if(teamAssignment){
            return calculateTileNumber(homeTeamMap[_homeScore], awayTeamMap[_awayScore]);
        }
        else{
            return calculateTileNumber(awayTeamMap[_awayScore], homeTeamMap[_homeScore]);
        }
    }

    function calculateTileNumber(uint256 _x, uint256 _y) public pure returns (uint256){
        require(_x >= 0 && _x <= 9, "X out of bounds");
        require(_y >= 0 && _y <= 9, "Y out of bounds");
        return _y.mul(10).add(_x).add(1);
    }

    function getScorePair(uint256 _tokenId) public view returns (uint256 _homeScore, uint256 _awayScore){
        require(gameState == GameState.Set, "Game not set");
        require(_tokenId > 0, "TokenID must be greater than 0");
        require(_tokenId <= 100, "TokenID must be less than 100");

        uint256 x = _tokenId.sub(1).mod(10);
        uint256 y = _tokenId.sub(1).sub(x).div(10);

        if(teamAssignment){
            return (homeTeam[x],awayTeam[y]);
        }
        else{
            return (homeTeam[y],awayTeam[x]);
        }
    }

    function startAdSale() public override(AdAuction) onlyOwner {
        require(gameState != GameState.Complete, "Game is complete. No more ads");
        super.startAdSale();
    }

    function stopAdSale() public override(AdAuction) onlyOwner {
        totalPrizeCollected = address(this).balance;
        super.stopAdSale();
    }

    function claimPrize(uint256 _quarter) public {
        require(_quarter >= 1 && _quarter <= 4, "Quarter must be 1 through 4");
        require(quarter[_quarter].homeDataState == DataState.Complete, "Home Score Not Set");
        require(quarter[_quarter].awayDataState == DataState.Complete, "Away Score Not Set");
        require(!quarterPrizeClaimed[_quarter],"Prize already claimed");
        require(ownerOf(quarterWinner(_quarter))==msg.sender,"Caller does not own winning tile");
        require(!adSaleActive,"Prizes cannot be claimed while Ad Auction is live");
        require(totalPrizeCollected!=0,"No prize pool");
        require(payable(msg.sender).send(totalPrizeCollected.div(4)));
        quarterPrizeClaimed[_quarter] = true;
    }

    function quarterWinner(uint256 _quarter) public view returns (uint256) {
        require(_quarter >= 1 && _quarter <= 4, "Quarter must be 1 through 4");
        require(quarter[_quarter].homeDataState == DataState.Complete, "Home Score Not Set");
        require(quarter[_quarter].awayDataState == DataState.Complete, "Away Score Not Set");

        if(_quarter == 4){
            return getTile(
                quarter[5].homeScoreTotal.mod(10),
                quarter[5].awayScoreTotal.mod(10)
            );
        }
        else {
            return getTile(
                quarter[_quarter].homeScoreTotal.mod(10),
                quarter[_quarter].awayScoreTotal.mod(10)
            );
        }
        
    }

    function setBaseURI(string memory _URI) public override(SquaresNFT) onlyOwner {
        super.setBaseURI(_URI);
    }

    function startClaim() public override(SquaresNFT) onlyOwner {
        super.startClaim();
    }

    function withdrawBalance() public onlyOwner {
        require(quarterPrizeClaimed[1],"Quarter 1  prize not claimed");
        require(quarterPrizeClaimed[2],"Quarter 1  prize not claimed");
        require(quarterPrizeClaimed[3],"Quarter 1  prize not claimed");
        require(quarterPrizeClaimed[4],"Quarter 1  prize not claimed");
        require(payable(owner()).send(address(this).balance));
    }

    // To be used in the event of an emergency. Should there be a contract failure, having this
    // function in place will allow winners to be paid manually. 
    // If this function is called, expect a post mortem from: MorrisMustang.eth, howieDoin.eth

    function emergencyRug() public onlyOwner {
        require(payable(owner()).send(address(this).balance));
    }

}

File 2 of 35 : Tag.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

//                      ---------------[ ]---------------
//                      -------[ ]-------------[ ]-------
//                      ---------------------------------
//                      ----[ ]--------[ ]--------[ ]----
//                      ---------------------------------
//                      -------[ ]-------------[ ]-------
//                      ---------------[ ]---------------

File 3 of 35 : SquaresNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Address.sol";

enum ClaimState {
        Off,
        Active,
        SoldOut
    }

contract SquaresNFT is ERC721, ERC721Enumerable  {

    using SafeMath for uint256;
    using Address for address;
    using Counters for Counters.Counter;

    uint256 public constant MAX_TILE_NUMBER = 100;
    Counters.Counter private tileCounter; 

    ClaimState public claimState;
    string public baseURI;

    mapping(uint256 => bool) public tilePurchased;
    mapping(address => bool) public addressHasPurchased;

    constructor() ERC721("SQUARES", "SQUARES") {
        claimState = ClaimState.Off;
    }

    function mint(uint256 _tile) external payable {
        require(claimState == ClaimState.Active, "Sale not active");
        require(_tile <= MAX_TILE_NUMBER, "Tile number must be below 100");
        require(_tile > 0,"Tile 0 is not valid");
        require(!tilePurchased[_tile], "Tile already purchased");
        require(!addressHasPurchased[msg.sender], "Caller has already purchased a tile");
        require(!msg.sender.isContract(),"Caller cannot be a smart contract");

        _safeMint(msg.sender, _tile);
        tileCounter.increment();
        addressHasPurchased[msg.sender] = true;
        tilePurchased[_tile] = true;

        if(tileCounter.current()==100){
            stopClaim();
        }
        
    }

    function startClaim() public virtual{
        require(claimState == ClaimState.Off, "Sale already started and/or completed");
        claimState = ClaimState.Active;
    }
    
    function stopClaim() private {
        claimState = ClaimState.SoldOut;
    }

    function setBaseURI(string memory _URI) public virtual {
        baseURI = _URI;
    }

    function _baseURI() internal view override(ERC721) returns (string memory) {
        return baseURI;
    }

    // Read only, not to be used in smart contract calls
    function getTileOwners(uint256 _lower, uint256 _upper) public view returns (address[] memory) {
        require(_upper < 101, "Upper cannot exceed 100");
        require(_lower > 0, "Lower must be greater than zero");
        require(_upper > _lower, "Upper must be larger than lower");
        address[] memory tileOwners = new address[](100);
        for(uint256 i = _lower; i <= _upper; i++ ){
            if(tilePurchased[i]){
                tileOwners[i-1] = ownerOf(i);
            }
            else{
                tileOwners[i-1] = address(0);
            }
        }
        return tileOwners;

    }

    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

File 4 of 35 : RandomGameBoard.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";

enum GameState {
    PreReveal,
    GettingVRF,
    ReceivedVRF,
    Set,
    Complete
}

contract RandomGameBoard is VRFConsumerBase {

    using SafeMath for uint256;

    GameState public gameState;

    uint256[] internal homeTeam = new uint256[](10);
    uint256[] internal awayTeam = new uint256[](10);
    mapping(uint256 => uint256) public homeTeamMap;
    mapping(uint256 => uint256) public awayTeamMap;
    bool public teamAssignment;
    uint256[] public possibleScores = [0,1,2,3,4,5,6,7,8,9];

    uint256[] public homeTeamRandomness;
    uint256[] public awayTeamRandomness;
    uint256 public teamAssignmentRandomness;

    bytes32 internal keyHash;
    uint256 internal VRFfee;
    bytes32 internal VRFRequestId;

    constructor()
    VRFConsumerBase(
        0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, // VRF Coordinator
        0x514910771AF9Ca656af840dff83E8264EcF986CA  // LINK Token
    ) 
    {
        gameState = GameState.PreReveal;

        keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
        VRFfee = 2 ether;

        homeTeamRandomness = new uint256[](9);
        awayTeamRandomness = new uint256[](9);
    }

    function getGameBoardRandomness() public virtual returns (bytes32) {
        require(LINK.balanceOf(address(this)) >= VRFfee, "Not enough LINK - fill contract with faucet");
        return requestRandomness(keyHash, VRFfee);
    }

    /**
     * Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
        require(gameState == GameState.PreReveal,"Game must be in initial state");
        gameState = GameState.GettingVRF;
        assignRandomness(randomness);
    }

    function assignRandomness(uint256 _randomness) internal {
        require(gameState == GameState.GettingVRF,"Game must be in initial state");
        gameState = GameState.ReceivedVRF;

        uint256 nextRandomNumber = uint256(keccak256(abi.encode(_randomness)));

        for(uint256 i=0; i < 9; i++){
            nextRandomNumber = uint256(keccak256(abi.encode(nextRandomNumber)));
            homeTeamRandomness[i] = nextRandomNumber;
            
        }

        for(uint256 i=0; i < 9; i++){
            nextRandomNumber = uint256(keccak256(abi.encode(nextRandomNumber)));
            awayTeamRandomness[i] = nextRandomNumber;
        }

        nextRandomNumber = uint256(keccak256(abi.encode(nextRandomNumber)));
        teamAssignmentRandomness = nextRandomNumber;

    }

    function assignGameBoard() public virtual {
        require(gameState == GameState.ReceivedVRF, "Game in wrong state");
        gameState = GameState.Set;
        
        uint256[] memory digits = possibleScores;
        uint256 randomNumberInRange = 0;

        for(uint256 i = 0; i < 9; i++){
            randomNumberInRange = getRandomNumberInRange(homeTeamRandomness[i],0+i,9);
            digits = swapArrayElement(digits,i,randomNumberInRange);
            homeTeamMap[digits[i]] = i;
        }
        homeTeam = digits;

        digits = possibleScores;

        for(uint256 i = 0; i < 9; i++){
            randomNumberInRange = getRandomNumberInRange(awayTeamRandomness[i],0+i,9);
            digits = swapArrayElement(digits,i,randomNumberInRange);
            awayTeamMap[digits[i]] = i;
        }
        awayTeam = digits;

        randomNumberInRange = getRandomNumberInRange(teamAssignmentRandomness, 0, 1);
        
        if(randomNumberInRange == 0){
            teamAssignment = false;
        }
        else{
            teamAssignment = true;
        }

    }

    function swapArrayElement(uint256[] memory initialArray, uint256 firstElement, uint256 secondElement) public pure returns (uint256[] memory){
        uint256 temp = initialArray[firstElement];
        initialArray[firstElement] = initialArray[secondElement];
        initialArray[secondElement] = temp;
        return initialArray;
    }

    function getRandomNumberInRange(uint256 randomness, uint256 lowerBound, uint256 upperBound) public pure returns (uint256){
        return randomness.mod(upperBound.sub(lowerBound).add(1)).add(lowerBound);
    }

    function getHomeTeamArray() public view returns (uint256[] memory){
        uint256[] memory homeTeamArray = new uint256[](10);
        for(uint256 i = 0; i < 10; i++){
            homeTeamArray[i] = homeTeam[i];
        }
        return homeTeamArray;
    }

    function getAwayTeamArray() public view returns (uint256[] memory){
        uint256[] memory awayTeamArray = new uint256[](10);
        for(uint256 i = 0; i < 10; i++){
            awayTeamArray[i] = awayTeam[i];
        }
        return awayTeamArray;
    }
    

}

File 5 of 35 : SportsDataAPIConsumer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

enum DataState {
    Waiting,
    Getting,
    SetRaw,
    Complete
}

struct Quarter {
    uint256 homeScoreQuarter;
    uint256 awayScoreQuarter;
    uint256 homeScoreTotal;
    uint256 awayScoreTotal;
    DataState homeDataState;
    DataState awayDataState;
    string homePath;
    string awayPath;
}

contract SportsDataAPIConsumer is ChainlinkClient  {

    using Chainlink for Chainlink.Request;

    struct JobSpec {
        uint256 quarter;
        // 1 - home, 2 - away
        uint256 team;
    }

    mapping(uint256 => Quarter) public quarter;
    mapping(bytes32 => JobSpec) public jobSpecs;

    bytes32 private jobId;
    uint256 public dataFee;
    DataState public gameScoreDataState;

    event ScoresReceived(uint256 _quarter, uint256 _team, uint256 _score);

    /**
     * Network: Mainnet
     * Oracle: 0x0aefab6f66d0278B99B6eCbFa8a03f9828cD90b0 (Atlas Chainlink Node) 
     * Job ID: 47a7f197fec844fc8c1fe259441bd3dc
     * Fee: 2 LINK
     */
    constructor(address _oracleAddress){
        setPublicChainlinkToken();
        setChainlinkOracle(_oracleAddress);
        // Mainnet
        jobId = "47a7f197fec844fc8c1fe259441bd3dc";

        dataFee = 2 ether;  

        gameScoreDataState = DataState.Waiting;

        quarter[1].homePath = "0,HomeScoreQuarter1";
        quarter[1].awayPath = "0,AwayScoreQuarter1";
        quarter[2].homePath = "0,HomeScoreQuarter2";
        quarter[2].awayPath = "0,AwayScoreQuarter2";
        quarter[3].homePath = "0,HomeScoreQuarter3";
        quarter[3].awayPath = "0,AwayScoreQuarter3";
        quarter[4].homePath = "0,HomeScoreQuarter4";
        quarter[4].awayPath = "0,AwayScoreQuarter4";
        quarter[5].homePath = "0,HomeScoreOvertime";
        quarter[5].awayPath = "0,AwayScoreOvertime";

    }

    function getGameScores() public virtual {
        for(uint256 i = 1; i <= 5; i++){
            requestQuarterScoreData(i);
        }
    }

    function requestQuarterScoreData(uint256 _quarter) internal {
        require(_quarter > 0, "Quarter must be greater than 0");
        require(_quarter <= 5, "Quarter must be less than or equal to 5, includes overtime");
        require(quarter[_quarter].homeDataState == DataState.Waiting, "Quarter score lookup already initiated");
        require(quarter[_quarter].awayDataState == DataState.Waiting, "Quarter score lookup already initiated");
        jobSpecs[requestScoreData(quarter[_quarter].homePath)] = JobSpec({quarter: _quarter, team: 1});
        jobSpecs[requestScoreData(quarter[_quarter].awayPath)] = JobSpec({quarter: _quarter, team: 2});

        quarter[_quarter].homeDataState = DataState.Getting;
        quarter[_quarter].awayDataState = DataState.Getting;
    }

    function requestScoreData(string memory _dataPath) private returns (bytes32 requestId) 
    {
        require(IERC20(chainlinkTokenAddress()).balanceOf(address(this)) >= dataFee, "Not enough LINK - fill contract with faucet");
        Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
    
        request.add("path", _dataPath);
        
        return sendChainlinkRequest(request, dataFee);
    }
    
    /**
     * Receive the response in the form of uint256
     */ 
    function fulfill(bytes32 _requestId, uint256 _score) public recordChainlinkFulfillment(_requestId)
    {
        // home team score
        if(jobSpecs[_requestId].team==1){
            quarter[jobSpecs[_requestId].quarter].homeScoreQuarter = _score;
            quarter[jobSpecs[_requestId].quarter].homeDataState = DataState.SetRaw;
            emit ScoresReceived(jobSpecs[_requestId].quarter, 1, _score);
        }
        else if (jobSpecs[_requestId].team==2){
            quarter[jobSpecs[_requestId].quarter].awayScoreQuarter = _score;
            quarter[jobSpecs[_requestId].quarter].awayDataState = DataState.SetRaw;
            emit ScoresReceived(jobSpecs[_requestId].quarter, 2, _score);
        }

        if(allQuartersScoresReturned()){
            sumQuarterScores();
            gameScoreDataState = DataState.Complete;
        }
        
    }

    function sumQuarterScores() private {

        quarter[1].homeScoreTotal = quarter[1].homeScoreQuarter;
        quarter[1].homeDataState = DataState.Complete;
        quarter[1].awayScoreTotal = quarter[1].awayScoreQuarter;
        quarter[1].awayDataState = DataState.Complete;

        for(uint256 i = 2; i <= 5; i++ ){
            quarter[i].homeScoreTotal = quarter[i].homeScoreQuarter + quarter[i-1].homeScoreTotal;
            quarter[i].homeDataState = DataState.Complete;
            quarter[i].awayScoreTotal = quarter[i].awayScoreQuarter + quarter[i-1].awayScoreTotal;
            quarter[i].awayDataState = DataState.Complete;
        }

    }

    function allQuartersScoresReturned() private view returns (bool){
        for(uint256 i = 1; i <= 5; i++){
            if (
                quarter[i].homeDataState != DataState.SetRaw ||
                quarter[i].awayDataState != DataState.SetRaw 
            )
            {
                return false;
            }
            
        }
        return true;
    }

}

File 6 of 35 : AdAuction.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract AdAuction {

    using Counters for Counters.Counter;
    using EnumerableSet for EnumerableSet.AddressSet;

    bool public adSaleActive;

    string public diamondSponsorAd;
    address public diamondSponsor;
    uint256 public lastAmountPaid;
    uint256 public diamondSponsorshipBlockNumber;
    uint256 public minimumAirtimeInBlocks;
    Counters.Counter private diamondSponsorshipCounter;

    EnumerableSet.AddressSet private platinumSponsors;
    uint256 public platinumSponsorshipRate;

    EnumerableSet.AddressSet private goldSponsors;
    uint256 public goldSponsorshipRate;

    EnumerableSet.AddressSet private silverSponsors;
    uint256 public silverSponsorshipRate;

    event DiamondSponsorReplaced(address _address, uint256 _amount);
    event PlatinumSponsorAdded(address _address);
    event GoldSponsorAdded(address _address);
    event SilverSponsorAdded(address _address);

    constructor(string memory _initialDiamondSponsorAd, address _initialDiamondSponsor){
        diamondSponsorAd = _initialDiamondSponsorAd;
        diamondSponsor = _initialDiamondSponsor;
        lastAmountPaid = 0;
        minimumAirtimeInBlocks = 20;

        platinumSponsorshipRate = 0.25 ether;
        goldSponsorshipRate = 0.1 ether;
        silverSponsorshipRate = 0.05 ether;
    }

    function diamondSponsorship(string calldata _ad) public payable {
        require(bytes(_ad).length<=32,"Ad cannot be greater than 32 characters");
        require(msg.value > lastAmountPaid, "Caller must pay more than previous Advertiser");
        require(block.timestamp >= diamondSponsorshipBlockNumber + minimumAirtimeInBlocks,"Must wait at leaast 10 blocks between ads");
        require(adSaleActive,"Ad sale not active");
        diamondSponsorAd = _ad;
        diamondSponsor = msg.sender;
        diamondSponsorshipBlockNumber = block.timestamp;
        lastAmountPaid = msg.value;
        diamondSponsorshipCounter.increment();

        emit DiamondSponsorReplaced(msg.sender, msg.value);
    }

    function platinumSponsorship() public payable {
        require(msg.value >= platinumSponsorshipRate, "Caller must send correct amount");
        require(platinumSponsors.add(msg.sender),"Caller already a Platinum Sponsor");
        require(adSaleActive,"Ad sale not active");

        emit PlatinumSponsorAdded(msg.sender);
    }

    function goldSponsorship() public payable {
        require(msg.value >= goldSponsorshipRate, "Caller must send correct amount");
        require(goldSponsors.add(msg.sender),"Caller already a Gold Sponsor");
        require(adSaleActive,"Ad sale not active");

        emit GoldSponsorAdded(msg.sender);
    }

    function silverSponsorship() public payable {
        require(msg.value >= silverSponsorshipRate, "Caller must send correct amount");
        require(silverSponsors.add(msg.sender),"Caller already a Silver Sponsor");
        require(adSaleActive,"Ad sale not active");

        emit SilverSponsorAdded(msg.sender);
    }

    function startAdSale() public virtual {
        require(!adSaleActive, "Ad sale already active");
        adSaleActive = true;
    }

    function stopAdSale() public virtual {
        require(adSaleActive, "Ad sale off");
        adSaleActive = false;
    }

    function getPlatinumSponsors() public view returns (address[] memory){
        return platinumSponsors.values();
    }

    function getGoldSponsors() public view returns (address[] memory){
        return goldSponsors.values();
    }

    function getSilverSponsors() public view returns (address[] memory){
        return silverSponsors.values();
    }

}

File 7 of 35 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 8 of 35 : 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 9 of 35 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

File 10 of 35 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 12 of 35 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

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

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 14 of 35 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

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

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

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

    /**
     * @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 15 of 35 : ChainlinkClient.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./Chainlink.sol";
import "./interfaces/ENSInterface.sol";
import "./interfaces/LinkTokenInterface.sol";
import "./interfaces/ChainlinkRequestInterface.sol";
import "./interfaces/OperatorInterface.sol";
import "./interfaces/PointerInterface.sol";
import {ENSResolver as ENSResolver_Chainlink} from "./vendor/ENSResolver.sol";

/**
 * @title The ChainlinkClient contract
 * @notice Contract writers can inherit this contract in order to create requests for the
 * Chainlink network
 */
abstract contract ChainlinkClient {
  using Chainlink for Chainlink.Request;

  uint256 internal constant LINK_DIVISIBILITY = 10**18;
  uint256 private constant AMOUNT_OVERRIDE = 0;
  address private constant SENDER_OVERRIDE = address(0);
  uint256 private constant ORACLE_ARGS_VERSION = 1;
  uint256 private constant OPERATOR_ARGS_VERSION = 2;
  bytes32 private constant ENS_TOKEN_SUBNAME = keccak256("link");
  bytes32 private constant ENS_ORACLE_SUBNAME = keccak256("oracle");
  address private constant LINK_TOKEN_POINTER = 0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571;

  ENSInterface private s_ens;
  bytes32 private s_ensNode;
  LinkTokenInterface private s_link;
  OperatorInterface private s_oracle;
  uint256 private s_requestCount = 1;
  mapping(bytes32 => address) private s_pendingRequests;

  event ChainlinkRequested(bytes32 indexed id);
  event ChainlinkFulfilled(bytes32 indexed id);
  event ChainlinkCancelled(bytes32 indexed id);

  /**
   * @notice Creates a request that can hold additional parameters
   * @param specId The Job Specification ID that the request will be created for
   * @param callbackAddr address to operate the callback on
   * @param callbackFunctionSignature function signature to use for the callback
   * @return A Chainlink Request struct in memory
   */
  function buildChainlinkRequest(
    bytes32 specId,
    address callbackAddr,
    bytes4 callbackFunctionSignature
  ) internal pure returns (Chainlink.Request memory) {
    Chainlink.Request memory req;
    return req.initialize(specId, callbackAddr, callbackFunctionSignature);
  }

  /**
   * @notice Creates a request that can hold additional parameters
   * @param specId The Job Specification ID that the request will be created for
   * @param callbackFunctionSignature function signature to use for the callback
   * @return A Chainlink Request struct in memory
   */
  function buildOperatorRequest(bytes32 specId, bytes4 callbackFunctionSignature)
    internal
    view
    returns (Chainlink.Request memory)
  {
    Chainlink.Request memory req;
    return req.initialize(specId, address(this), callbackFunctionSignature);
  }

  /**
   * @notice Creates a Chainlink request to the stored oracle address
   * @dev Calls `chainlinkRequestTo` with the stored oracle address
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendChainlinkRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
    return sendChainlinkRequestTo(address(s_oracle), req, payment);
  }

  /**
   * @notice Creates a Chainlink request to the specified oracle address
   * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
   * send LINK which creates a request on the target oracle contract.
   * Emits ChainlinkRequested event.
   * @param oracleAddress The address of the oracle for the request
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendChainlinkRequestTo(
    address oracleAddress,
    Chainlink.Request memory req,
    uint256 payment
  ) internal returns (bytes32 requestId) {
    uint256 nonce = s_requestCount;
    s_requestCount = nonce + 1;
    bytes memory encodedRequest = abi.encodeWithSelector(
      ChainlinkRequestInterface.oracleRequest.selector,
      SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
      AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
      req.id,
      address(this),
      req.callbackFunctionId,
      nonce,
      ORACLE_ARGS_VERSION,
      req.buf.buf
    );
    return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
  }

  /**
   * @notice Creates a Chainlink request to the stored oracle address
   * @dev This function supports multi-word response
   * @dev Calls `sendOperatorRequestTo` with the stored oracle address
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendOperatorRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
    return sendOperatorRequestTo(address(s_oracle), req, payment);
  }

  /**
   * @notice Creates a Chainlink request to the specified oracle address
   * @dev This function supports multi-word response
   * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
   * send LINK which creates a request on the target oracle contract.
   * Emits ChainlinkRequested event.
   * @param oracleAddress The address of the oracle for the request
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendOperatorRequestTo(
    address oracleAddress,
    Chainlink.Request memory req,
    uint256 payment
  ) internal returns (bytes32 requestId) {
    uint256 nonce = s_requestCount;
    s_requestCount = nonce + 1;
    bytes memory encodedRequest = abi.encodeWithSelector(
      OperatorInterface.operatorRequest.selector,
      SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
      AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
      req.id,
      req.callbackFunctionId,
      nonce,
      OPERATOR_ARGS_VERSION,
      req.buf.buf
    );
    return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
  }

  /**
   * @notice Make a request to an oracle
   * @param oracleAddress The address of the oracle for the request
   * @param nonce used to generate the request ID
   * @param payment The amount of LINK to send for the request
   * @param encodedRequest data encoded for request type specific format
   * @return requestId The request ID
   */
  function _rawRequest(
    address oracleAddress,
    uint256 nonce,
    uint256 payment,
    bytes memory encodedRequest
  ) private returns (bytes32 requestId) {
    requestId = keccak256(abi.encodePacked(this, nonce));
    s_pendingRequests[requestId] = oracleAddress;
    emit ChainlinkRequested(requestId);
    require(s_link.transferAndCall(oracleAddress, payment, encodedRequest), "unable to transferAndCall to oracle");
  }

  /**
   * @notice Allows a request to be cancelled if it has not been fulfilled
   * @dev Requires keeping track of the expiration value emitted from the oracle contract.
   * Deletes the request from the `pendingRequests` mapping.
   * Emits ChainlinkCancelled event.
   * @param requestId The request ID
   * @param payment The amount of LINK sent for the request
   * @param callbackFunc The callback function specified for the request
   * @param expiration The time of the expiration for the request
   */
  function cancelChainlinkRequest(
    bytes32 requestId,
    uint256 payment,
    bytes4 callbackFunc,
    uint256 expiration
  ) internal {
    OperatorInterface requested = OperatorInterface(s_pendingRequests[requestId]);
    delete s_pendingRequests[requestId];
    emit ChainlinkCancelled(requestId);
    requested.cancelOracleRequest(requestId, payment, callbackFunc, expiration);
  }

  /**
   * @notice the next request count to be used in generating a nonce
   * @dev starts at 1 in order to ensure consistent gas cost
   * @return returns the next request count to be used in a nonce
   */
  function getNextRequestCount() internal view returns (uint256) {
    return s_requestCount;
  }

  /**
   * @notice Sets the stored oracle address
   * @param oracleAddress The address of the oracle contract
   */
  function setChainlinkOracle(address oracleAddress) internal {
    s_oracle = OperatorInterface(oracleAddress);
  }

  /**
   * @notice Sets the LINK token address
   * @param linkAddress The address of the LINK token contract
   */
  function setChainlinkToken(address linkAddress) internal {
    s_link = LinkTokenInterface(linkAddress);
  }

  /**
   * @notice Sets the Chainlink token address for the public
   * network as given by the Pointer contract
   */
  function setPublicChainlinkToken() internal {
    setChainlinkToken(PointerInterface(LINK_TOKEN_POINTER).getAddress());
  }

  /**
   * @notice Retrieves the stored address of the LINK token
   * @return The address of the LINK token
   */
  function chainlinkTokenAddress() internal view returns (address) {
    return address(s_link);
  }

  /**
   * @notice Retrieves the stored address of the oracle contract
   * @return The address of the oracle contract
   */
  function chainlinkOracleAddress() internal view returns (address) {
    return address(s_oracle);
  }

  /**
   * @notice Allows for a request which was created on another contract to be fulfilled
   * on this contract
   * @param oracleAddress The address of the oracle contract that will fulfill the request
   * @param requestId The request ID used for the response
   */
  function addChainlinkExternalRequest(address oracleAddress, bytes32 requestId) internal notPendingRequest(requestId) {
    s_pendingRequests[requestId] = oracleAddress;
  }

  /**
   * @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS
   * @dev Accounts for subnodes having different resolvers
   * @param ensAddress The address of the ENS contract
   * @param node The ENS node hash
   */
  function useChainlinkWithENS(address ensAddress, bytes32 node) internal {
    s_ens = ENSInterface(ensAddress);
    s_ensNode = node;
    bytes32 linkSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_TOKEN_SUBNAME));
    ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(linkSubnode));
    setChainlinkToken(resolver.addr(linkSubnode));
    updateChainlinkOracleWithENS();
  }

  /**
   * @notice Sets the stored oracle contract with the address resolved by ENS
   * @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously
   */
  function updateChainlinkOracleWithENS() internal {
    bytes32 oracleSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_ORACLE_SUBNAME));
    ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(oracleSubnode));
    setChainlinkOracle(resolver.addr(oracleSubnode));
  }

  /**
   * @notice Ensures that the fulfillment is valid for this contract
   * @dev Use if the contract developer prefers methods instead of modifiers for validation
   * @param requestId The request ID for fulfillment
   */
  function validateChainlinkCallback(bytes32 requestId)
    internal
    recordChainlinkFulfillment(requestId)
  // solhint-disable-next-line no-empty-blocks
  {

  }

  /**
   * @dev Reverts if the sender is not the oracle of the request.
   * Emits ChainlinkFulfilled event.
   * @param requestId The request ID for fulfillment
   */
  modifier recordChainlinkFulfillment(bytes32 requestId) {
    require(msg.sender == s_pendingRequests[requestId], "Source must be the oracle of the request");
    delete s_pendingRequests[requestId];
    emit ChainlinkFulfilled(requestId);
    _;
  }

  /**
   * @dev Reverts if the request is already pending
   * @param requestId The request ID for fulfillment
   */
  modifier notPendingRequest(bytes32 requestId) {
    require(s_pendingRequests[requestId] == address(0), "Request is already pending");
    _;
  }
}

File 16 of 35 : VRFConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @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.
 * *****************************************************************************
 * @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, _link) 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), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (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. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @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 ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @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.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {
  /**
   * @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 VRFConsumerBase 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 randomness the VRF output
   */
  function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 private constant USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface internal immutable LINK;
  address private immutable vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 => uint256) /* keyHash */ /* nonce */
    private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(address _vrfCoordinator, address _link) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 17 of 35 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

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

pragma solidity ^0.8.0;

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

File 19 of 35 : 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 20 of 35 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 22 of 35 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

File 23 of 35 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 24 of 35 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 25 of 35 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {
  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  ) internal pure returns (uint256) {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

File 26 of 35 : 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 27 of 35 : ENSResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract ENSResolver {
  function addr(bytes32 node) public view virtual returns (address);
}

File 28 of 35 : PointerInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface PointerInterface {
  function getAddress() external view returns (address);
}

File 29 of 35 : OperatorInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./OracleInterface.sol";
import "./ChainlinkRequestInterface.sol";

interface OperatorInterface is OracleInterface, ChainlinkRequestInterface {
  function operatorRequest(
    address sender,
    uint256 payment,
    bytes32 specId,
    bytes4 callbackFunctionId,
    uint256 nonce,
    uint256 dataVersion,
    bytes calldata data
  ) external;

  function fulfillOracleRequest2(
    bytes32 requestId,
    uint256 payment,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 expiration,
    bytes calldata data
  ) external returns (bool);

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

  function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable;

  function getAuthorizedSenders() external returns (address[] memory);

  function setAuthorizedSenders(address[] calldata senders) external;

  function getForwarder() external returns (address);
}

File 30 of 35 : ChainlinkRequestInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ChainlinkRequestInterface {
  function oracleRequest(
    address sender,
    uint256 requestPrice,
    bytes32 serviceAgreementID,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 nonce,
    uint256 dataVersion,
    bytes calldata data
  ) external;

  function cancelOracleRequest(
    bytes32 requestId,
    uint256 payment,
    bytes4 callbackFunctionId,
    uint256 expiration
  ) external;
}

File 31 of 35 : ENSInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ENSInterface {
  // Logged when the owner of a node assigns a new owner to a subnode.
  event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);

  // Logged when the owner of a node transfers ownership to a new account.
  event Transfer(bytes32 indexed node, address owner);

  // Logged when the resolver for a node changes.
  event NewResolver(bytes32 indexed node, address resolver);

  // Logged when the TTL of a node changes
  event NewTTL(bytes32 indexed node, uint64 ttl);

  function setSubnodeOwner(
    bytes32 node,
    bytes32 label,
    address owner
  ) external;

  function setResolver(bytes32 node, address resolver) external;

  function setOwner(bytes32 node, address owner) external;

  function setTTL(bytes32 node, uint64 ttl) external;

  function owner(bytes32 node) external view returns (address);

  function resolver(bytes32 node) external view returns (address);

  function ttl(bytes32 node) external view returns (uint64);
}

File 32 of 35 : Chainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {CBORChainlink} from "./vendor/CBORChainlink.sol";
import {BufferChainlink} from "./vendor/BufferChainlink.sol";

/**
 * @title Library for common Chainlink functions
 * @dev Uses imported CBOR library for encoding to buffer
 */
library Chainlink {
  uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase

  using CBORChainlink for BufferChainlink.buffer;

  struct Request {
    bytes32 id;
    address callbackAddress;
    bytes4 callbackFunctionId;
    uint256 nonce;
    BufferChainlink.buffer buf;
  }

  /**
   * @notice Initializes a Chainlink request
   * @dev Sets the ID, callback address, and callback function signature on the request
   * @param self The uninitialized request
   * @param jobId The Job Specification ID
   * @param callbackAddr The callback address
   * @param callbackFunc The callback function signature
   * @return The initialized request
   */
  function initialize(
    Request memory self,
    bytes32 jobId,
    address callbackAddr,
    bytes4 callbackFunc
  ) internal pure returns (Chainlink.Request memory) {
    BufferChainlink.init(self.buf, defaultBufferSize);
    self.id = jobId;
    self.callbackAddress = callbackAddr;
    self.callbackFunctionId = callbackFunc;
    return self;
  }

  /**
   * @notice Sets the data for the buffer without encoding CBOR on-chain
   * @dev CBOR can be closed with curly-brackets {} or they can be left off
   * @param self The initialized request
   * @param data The CBOR data
   */
  function setBuffer(Request memory self, bytes memory data) internal pure {
    BufferChainlink.init(self.buf, data.length);
    BufferChainlink.append(self.buf, data);
  }

  /**
   * @notice Adds a string value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The string value to add
   */
  function add(
    Request memory self,
    string memory key,
    string memory value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeString(value);
  }

  /**
   * @notice Adds a bytes value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The bytes value to add
   */
  function addBytes(
    Request memory self,
    string memory key,
    bytes memory value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeBytes(value);
  }

  /**
   * @notice Adds a int256 value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The int256 value to add
   */
  function addInt(
    Request memory self,
    string memory key,
    int256 value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeInt(value);
  }

  /**
   * @notice Adds a uint256 value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The uint256 value to add
   */
  function addUint(
    Request memory self,
    string memory key,
    uint256 value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeUInt(value);
  }

  /**
   * @notice Adds an array of strings to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param values The array of string values to add
   */
  function addStringArray(
    Request memory self,
    string memory key,
    string[] memory values
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.startArray();
    for (uint256 i = 0; i < values.length; i++) {
      self.buf.encodeString(values[i]);
    }
    self.buf.endSequence();
  }
}

File 33 of 35 : OracleInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface OracleInterface {
  function fulfillOracleRequest(
    bytes32 requestId,
    uint256 payment,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 expiration,
    bytes32 data
  ) external returns (bool);

  function isAuthorizedSender(address node) external view returns (bool);

  function withdraw(address recipient, uint256 amount) external;

  function withdrawable() external view returns (uint256);
}

File 34 of 35 : BufferChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev A library for working with mutable byte buffers in Solidity.
 *
 * Byte buffers are mutable and expandable, and provide a variety of primitives
 * for writing to them. At any time you can fetch a bytes object containing the
 * current contents of the buffer. The bytes object should not be stored between
 * operations, as it may change due to resizing of the buffer.
 */
library BufferChainlink {
  /**
   * @dev Represents a mutable buffer. Buffers have a current value (buf) and
   *      a capacity. The capacity may be longer than the current value, in
   *      which case it can be extended without the need to allocate more memory.
   */
  struct buffer {
    bytes buf;
    uint256 capacity;
  }

  /**
   * @dev Initializes a buffer with an initial capacity.
   * @param buf The buffer to initialize.
   * @param capacity The number of bytes of space to allocate the buffer.
   * @return The buffer, for chaining.
   */
  function init(buffer memory buf, uint256 capacity) internal pure returns (buffer memory) {
    if (capacity % 32 != 0) {
      capacity += 32 - (capacity % 32);
    }
    // Allocate space for the buffer data
    buf.capacity = capacity;
    assembly {
      let ptr := mload(0x40)
      mstore(buf, ptr)
      mstore(ptr, 0)
      mstore(0x40, add(32, add(ptr, capacity)))
    }
    return buf;
  }

  /**
   * @dev Initializes a new buffer from an existing bytes object.
   *      Changes to the buffer may mutate the original value.
   * @param b The bytes object to initialize the buffer with.
   * @return A new buffer.
   */
  function fromBytes(bytes memory b) internal pure returns (buffer memory) {
    buffer memory buf;
    buf.buf = b;
    buf.capacity = b.length;
    return buf;
  }

  function resize(buffer memory buf, uint256 capacity) private pure {
    bytes memory oldbuf = buf.buf;
    init(buf, capacity);
    append(buf, oldbuf);
  }

  function max(uint256 a, uint256 b) private pure returns (uint256) {
    if (a > b) {
      return a;
    }
    return b;
  }

  /**
   * @dev Sets buffer length to 0.
   * @param buf The buffer to truncate.
   * @return The original buffer, for chaining..
   */
  function truncate(buffer memory buf) internal pure returns (buffer memory) {
    assembly {
      let bufptr := mload(buf)
      mstore(bufptr, 0)
    }
    return buf;
  }

  /**
   * @dev Writes a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The start offset to write to.
   * @param data The data to append.
   * @param len The number of bytes to copy.
   * @return The original buffer, for chaining.
   */
  function write(
    buffer memory buf,
    uint256 off,
    bytes memory data,
    uint256 len
  ) internal pure returns (buffer memory) {
    require(len <= data.length);

    if (off + len > buf.capacity) {
      resize(buf, max(buf.capacity, len + off) * 2);
    }

    uint256 dest;
    uint256 src;
    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Length of existing buffer data
      let buflen := mload(bufptr)
      // Start address = buffer address + offset + sizeof(buffer length)
      dest := add(add(bufptr, 32), off)
      // Update buffer length if we're extending it
      if gt(add(len, off), buflen) {
        mstore(bufptr, add(len, off))
      }
      src := add(data, 32)
    }

    // Copy word-length chunks while possible
    for (; len >= 32; len -= 32) {
      assembly {
        mstore(dest, mload(src))
      }
      dest += 32;
      src += 32;
    }

    // Copy remaining bytes
    unchecked {
      uint256 mask = (256**(32 - len)) - 1;
      assembly {
        let srcpart := and(mload(src), not(mask))
        let destpart := and(mload(dest), mask)
        mstore(dest, or(destpart, srcpart))
      }
    }

    return buf;
  }

  /**
   * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @param len The number of bytes to copy.
   * @return The original buffer, for chaining.
   */
  function append(
    buffer memory buf,
    bytes memory data,
    uint256 len
  ) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, len);
  }

  /**
   * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, data.length);
  }

  /**
   * @dev Writes a byte to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write the byte at.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function writeUint8(
    buffer memory buf,
    uint256 off,
    uint8 data
  ) internal pure returns (buffer memory) {
    if (off >= buf.capacity) {
      resize(buf, buf.capacity * 2);
    }

    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Length of existing buffer data
      let buflen := mload(bufptr)
      // Address = buffer address + sizeof(buffer length) + off
      let dest := add(add(bufptr, off), 32)
      mstore8(dest, data)
      // Update buffer length if we extended it
      if eq(off, buflen) {
        mstore(bufptr, add(buflen, 1))
      }
    }
    return buf;
  }

  /**
   * @dev Appends a byte to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function appendUint8(buffer memory buf, uint8 data) internal pure returns (buffer memory) {
    return writeUint8(buf, buf.buf.length, data);
  }

  /**
   * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would
   *      exceed the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @param len The number of bytes to write (left-aligned).
   * @return The original buffer, for chaining.
   */
  function write(
    buffer memory buf,
    uint256 off,
    bytes32 data,
    uint256 len
  ) private pure returns (buffer memory) {
    if (len + off > buf.capacity) {
      resize(buf, (len + off) * 2);
    }

    unchecked {
      uint256 mask = (256**len) - 1;
      // Right-align data
      data = data >> (8 * (32 - len));
      assembly {
        // Memory address of the buffer data
        let bufptr := mload(buf)
        // Address = buffer address + sizeof(buffer length) + off + len
        let dest := add(add(bufptr, off), len)
        mstore(dest, or(and(mload(dest), not(mask)), data))
        // Update buffer length if we extended it
        if gt(add(off, len), mload(bufptr)) {
          mstore(bufptr, add(off, len))
        }
      }
    }
    return buf;
  }

  /**
   * @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function writeBytes20(
    buffer memory buf,
    uint256 off,
    bytes20 data
  ) internal pure returns (buffer memory) {
    return write(buf, off, bytes32(data), 20);
  }

  /**
   * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chhaining.
   */
  function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, bytes32(data), 20);
  }

  /**
   * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, 32);
  }

  /**
   * @dev Writes an integer to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @param len The number of bytes to write (right-aligned).
   * @return The original buffer, for chaining.
   */
  function writeInt(
    buffer memory buf,
    uint256 off,
    uint256 data,
    uint256 len
  ) private pure returns (buffer memory) {
    if (len + off > buf.capacity) {
      resize(buf, (len + off) * 2);
    }

    uint256 mask = (256**len) - 1;
    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Address = buffer address + off + sizeof(buffer length) + len
      let dest := add(add(bufptr, off), len)
      mstore(dest, or(and(mload(dest), not(mask)), data))
      // Update buffer length if we extended it
      if gt(add(off, len), mload(bufptr)) {
        mstore(bufptr, add(off, len))
      }
    }
    return buf;
  }

  /**
   * @dev Appends a byte to the end of the buffer. Resizes if doing so would
   * exceed the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer.
   */
  function appendInt(
    buffer memory buf,
    uint256 data,
    uint256 len
  ) internal pure returns (buffer memory) {
    return writeInt(buf, buf.buf.length, data, len);
  }
}

File 35 of 35 : CBORChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.19;

import {BufferChainlink} from "./BufferChainlink.sol";

library CBORChainlink {
  using BufferChainlink for BufferChainlink.buffer;

  uint8 private constant MAJOR_TYPE_INT = 0;
  uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
  uint8 private constant MAJOR_TYPE_BYTES = 2;
  uint8 private constant MAJOR_TYPE_STRING = 3;
  uint8 private constant MAJOR_TYPE_ARRAY = 4;
  uint8 private constant MAJOR_TYPE_MAP = 5;
  uint8 private constant MAJOR_TYPE_TAG = 6;
  uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;

  uint8 private constant TAG_TYPE_BIGNUM = 2;
  uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;

  function encodeFixedNumeric(BufferChainlink.buffer memory buf, uint8 major, uint64 value) private pure {
    if(value <= 23) {
      buf.appendUint8(uint8((major << 5) | value));
    } else if (value <= 0xFF) {
      buf.appendUint8(uint8((major << 5) | 24));
      buf.appendInt(value, 1);
    } else if (value <= 0xFFFF) {
      buf.appendUint8(uint8((major << 5) | 25));
      buf.appendInt(value, 2);
    } else if (value <= 0xFFFFFFFF) {
      buf.appendUint8(uint8((major << 5) | 26));
      buf.appendInt(value, 4);
    } else {
      buf.appendUint8(uint8((major << 5) | 27));
      buf.appendInt(value, 8);
    }
  }

  function encodeIndefiniteLengthType(BufferChainlink.buffer memory buf, uint8 major) private pure {
    buf.appendUint8(uint8((major << 5) | 31));
  }

  function encodeUInt(BufferChainlink.buffer memory buf, uint value) internal pure {
    if(value > 0xFFFFFFFFFFFFFFFF) {
      encodeBigNum(buf, value);
    } else {
      encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));
    }
  }

  function encodeInt(BufferChainlink.buffer memory buf, int value) internal pure {
    if(value < -0x10000000000000000) {
      encodeSignedBigNum(buf, value);
    } else if(value > 0xFFFFFFFFFFFFFFFF) {
      encodeBigNum(buf, uint(value));
    } else if(value >= 0) {
      encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(uint256(value)));
    } else {
      encodeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(uint256(-1 - value)));
    }
  }

  function encodeBytes(BufferChainlink.buffer memory buf, bytes memory value) internal pure {
    encodeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));
    buf.append(value);
  }

  function encodeBigNum(BufferChainlink.buffer memory buf, uint value) internal pure {
    buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));
    encodeBytes(buf, abi.encode(value));
  }

  function encodeSignedBigNum(BufferChainlink.buffer memory buf, int input) internal pure {
    buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM));
    encodeBytes(buf, abi.encode(uint256(-1 - input)));
  }

  function encodeString(BufferChainlink.buffer memory buf, string memory value) internal pure {
    encodeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));
    buf.append(bytes(value));
  }

  function startArray(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
  }

  function startMap(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
  }

  function endSequence(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
  }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"DiamondSponsorReplaced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"GoldSponsorAdded","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":"_address","type":"address"}],"name":"PlatinumSponsorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_quarter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_team","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_score","type":"uint256"}],"name":"ScoresReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"SilverSponsorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_TILE_NUMBER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressHasPurchased","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assignGameBoard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"awayTeamMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"awayTeamRandomness","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_x","type":"uint256"},{"internalType":"uint256","name":"_y","type":"uint256"}],"name":"calculateTileNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quarter","type":"uint256"}],"name":"claimPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimState","outputs":[{"internalType":"enum ClaimState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dataFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"diamondSponsor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"diamondSponsorAd","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_ad","type":"string"}],"name":"diamondSponsorship","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"diamondSponsorshipBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyRug","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_score","type":"uint256"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gameScoreDataState","outputs":[{"internalType":"enum DataState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameState","outputs":[{"internalType":"enum GameState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAwayTeamArray","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameBoardRandomness","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getGameScores","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getGoldSponsors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHomeTeamArray","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlatinumSponsors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"randomness","type":"uint256"},{"internalType":"uint256","name":"lowerBound","type":"uint256"},{"internalType":"uint256","name":"upperBound","type":"uint256"}],"name":"getRandomNumberInRange","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getScorePair","outputs":[{"internalType":"uint256","name":"_homeScore","type":"uint256"},{"internalType":"uint256","name":"_awayScore","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSilverSponsors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_homeScore","type":"uint256"},{"internalType":"uint256","name":"_awayScore","type":"uint256"}],"name":"getTile","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lower","type":"uint256"},{"internalType":"uint256","name":"_upper","type":"uint256"}],"name":"getTileOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goldSponsorship","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"goldSponsorshipRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"homeTeamMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"homeTeamRandomness","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"jobSpecs","outputs":[{"internalType":"uint256","name":"quarter","type":"uint256"},{"internalType":"uint256","name":"team","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastAmountPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumAirtimeInBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tile","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platinumSponsorship","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"platinumSponsorshipRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"possibleScores","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"quarter","outputs":[{"internalType":"uint256","name":"homeScoreQuarter","type":"uint256"},{"internalType":"uint256","name":"awayScoreQuarter","type":"uint256"},{"internalType":"uint256","name":"homeScoreTotal","type":"uint256"},{"internalType":"uint256","name":"awayScoreTotal","type":"uint256"},{"internalType":"enum DataState","name":"homeDataState","type":"uint8"},{"internalType":"enum DataState","name":"awayDataState","type":"uint8"},{"internalType":"string","name":"homePath","type":"string"},{"internalType":"string","name":"awayPath","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"quarterPrizeClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quarter","type":"uint256"}],"name":"quarterWinner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_URI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"silverSponsorship","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"silverSponsorshipRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startAdSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopAdSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"initialArray","type":"uint256[]"},{"internalType":"uint256","name":"firstElement","type":"uint256"},{"internalType":"uint256","name":"secondElement","type":"uint256"}],"name":"swapArrayElement","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamAssignment","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamAssignmentRandomness","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tilePurchased","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPrizeCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

600a60c08181526102206040529060e061014080368337505081516200002d926012925060200190620008bc565b5060408051600a80825261016082019092529060208201610140803683375050815162000062926013925060200190620008bc565b50604080516101408101825260008152600160208201526002918101919091526003606082015260046080820152600560a0820152600660c0820152600760e082015260086101008201526009610120820152620000c590601790600a6200090c565b506001602255348015620000d857600080fd5b506040518060400160405280600a815260200169041746c617320436f72760b41b81525073e64581f067cfdce58657e3c0f58175e638c30f2b730aefab6f66d0278b99b6ecbfa8a03f9828cd90b073f0d54349addcf704f77ae15b96510dea15cb795273514910771af9ca656af840dff83e8264ecf986ca604051806040016040528060078152602001665351554152455360c81b815250604051806040016040528060078152602001665351554152455360c81b815250620001aa620001a4620007c760201b60201c565b620007cb565b8151620001bf9060019060208501906200094f565b508051620001d59060029060208401906200094f565b5050600c805460ff199081169091556001600160a01b0393841660a05291909216608052601180549091169055507faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445601b55671bc16d674ec80000601c5560408051600980825261014082019092529060208201610120803683375050815162000267926018925060200190620008bc565b506040805160098082526101408201909252906020820161012080368337505081516200029c926019925060200190620008bc565b50620002a76200081b565b602180546001600160a01b0319166001600160a01b0383161790557f3437613766313937666563383434666338633166653235393434316264336463602655671bc16d674ec800006027556028805460ff1916905560408051808201909152601381527f302c486f6d6553636f7265517561727465723100000000000000000000000000602080830191825260016000526024905290516200036b917fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97db916200094f565b5060408051808201909152601381527f302c4177617953636f726551756172746572310000000000000000000000000060208083019182526001600052602490529051620003db917fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97dc916200094f565b5060408051808201909152601381527f302c486f6d6553636f7265517561727465723200000000000000000000000000602080830191825260026000526024905290516200044b917f47bb5529a97e2b401b32950f6360fbc9e3f4e70b887dc0f9b9ad1f7402ca11df916200094f565b5060408051808201909152601381527f302c4177617953636f726551756172746572320000000000000000000000000060208083019182526002600052602490529051620004bb917f47bb5529a97e2b401b32950f6360fbc9e3f4e70b887dc0f9b9ad1f7402ca11e0916200094f565b5060408051808201909152601381527f302c486f6d6553636f7265517561727465723300000000000000000000000000602080830191825260036000526024905290516200052b917f8a6809e43cef135a96df89aa3c0800baae7c497913adf6156625c15a6f57cdf5916200094f565b5060408051808201909152601381527f302c4177617953636f7265517561727465723300000000000000000000000000602080830191825260036000526024905290516200059b917f8a6809e43cef135a96df89aa3c0800baae7c497913adf6156625c15a6f57cdf6916200094f565b5060408051808201909152601381527f302c486f6d6553636f7265517561727465723400000000000000000000000000602080830191825260046000526024905290516200060b917fe0059098054d65c76a17a4d86f8572395c4d366a1d067b0643b918330bac9e1a916200094f565b5060408051808201909152601381527f302c4177617953636f7265517561727465723400000000000000000000000000602080830191825260046000526024905290516200067b917fe0059098054d65c76a17a4d86f8572395c4d366a1d067b0643b918330bac9e1b916200094f565b5060408051808201909152601381527f302c486f6d6553636f72654f76657274696d650000000000000000000000000060208083019182526005600052602490529051620006eb917ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad610916200094f565b5060408051808201909152601381527f302c4177617953636f72654f76657274696d6500000000000000000000000000602080830191825260056000526024905290516200075b917ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad611916200094f565b50508151620007729060299060208501906200094f565b50602a80546001600160a01b0319166001600160a01b0392909216919091179055506000602b556014602d556703782dace9d9000060315567016345785d8a000060345566b1a2bc2ec5000060375562000a51565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620008ba73c89bd4e1632d3a43cb03aaad5262cbe4038bc5716001600160a01b03166338cc48316040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000872573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008989190620009e2565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b565b828054828255906000526020600020908101928215620008fa579160200282015b82811115620008fa578251825591602001919060010190620008dd565b5062000908929150620009cb565b5090565b828054828255906000526020600020908101928215620008fa579160200282015b82811115620008fa578251829060ff169055916020019190600101906200092d565b8280546200095d9062000a14565b90600052602060002090601f016020900481019282620009815760008555620008fa565b82601f106200099c57805160ff1916838001178555620008fa565b82800160010185558215620008fa5791820182811115620008fa578251825591602001919060010190620008dd565b5b80821115620009085760008155600101620009cc565b600060208284031215620009f557600080fd5b81516001600160a01b038116811462000a0d57600080fd5b9392505050565b600181811c9082168062000a2957607f821691505b6020821081141562000a4b57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051615cb662000a8560003960008181611f48015261408e015260008181613a4a015261405f0152615cb66000f3fe6080604052600436106104475760003560e01c80637e05659211610234578063b88d4fde1161012e578063d1f9c24d116100b6578063ecbfc0771161007a578063ecbfc07714610cc3578063f014428414610cd8578063f2fde38b14610cff578063fe57c4bc14610d1f578063ff8cac9d14610d3f57600080fd5b8063d1f9c24d14610bfb578063d44462e114610c22578063d709815414610c2a578063e24507c114610c4a578063e985e9c514610c7a57600080fd5b8063c9911564116100fd578063c991156414610b88578063cb28a2e314610b9d578063cb748a2814610bb2578063cfddc0d414610bc7578063d0fe220e14610be657600080fd5b8063b88d4fde14610b2b578063bb06183014610b4b578063bdefed0b14610b60578063c87b56dd14610b6857600080fd5b806395abda8f116101bc578063a0712d6811610180578063a0712d6814610a87578063a22cb46514610a9a578063a3ce86ca14610aba578063a68deedd14610aef578063ac8293a614610af757600080fd5b806395abda8f146109f157806395d89b4114610a115780639794c8bf14610a265780639a72580914610a465780639b24b81014610a6d57600080fd5b80638b65e715116102035780638b65e715146109675780638da5cb5b146109875780638f583397146109a55780639401630f146109bb57806394985ddd146109d157600080fd5b80637e056592146108e15780637e4f700d146109115780637e52948014610931578063826964c91461095157600080fd5b80634f6ccce7116103455780636352211e116102cd5780636d9b9fdb116102915780636d9b9fdb146108545780636e174c511461086957806370a0823114610896578063715018a6146108b657806375ba82e8146108cb57600080fd5b80636352211e146107c457806365d7d687146107e457806368204916146107fa5780636c0360eb1461080f5780636d4d1f421461082457600080fd5b80635cdcdde6116103145780635cdcdde6146107235780635fd8c7101461073857806360cc5a851461074d578063618479811461077a57806361fc23201461079057600080fd5b80634f6ccce7146106b8578063542f7d5f146106d857806355f804b3146106ee5780635ba6f24c1461070e57600080fd5b806318160ddd116103d35780632f745c59116103975780632f745c591461062d57806340dee59e1461064d578063416aeedc1461066357806342842e0e146106785780634357855e1461069857600080fd5b806318160ddd146105af5780631bda1b92146105c45780631cccbf20146105e457806323b872dd146105fa578063259d3c781461061a57600080fd5b80630632256c1161041a5780630632256c1461050b57806306fdde031461052b578063081812fc1461054d578063095ea7b31461056d5780630f7aab011461058d57600080fd5b806301ffc9a71461044c578063035bb74e146104815780630454464a14610498578063055cd369146104d0575b600080fd5b34801561045857600080fd5b5061046c610467366004615116565b610d54565b60405190151581526020015b60405180910390f35b34801561048d57600080fd5b50610496610d65565b005b3480156104a457600080fd5b50602a546104b8906001600160a01b031681565b6040516001600160a01b039091168152602001610478565b3480156104dc57600080fd5b506104fd6104eb366004615133565b60156020526000908152604090205481565b604051908152602001610478565b34801561051757600080fd5b506104fd61052636600461514c565b610da6565b34801561053757600080fd5b50610540610dd1565b60405161047891906151d0565b34801561055957600080fd5b506104b8610568366004615133565b610e63565b34801561057957600080fd5b506104966105883660046151fa565b610ef8565b34801561059957600080fd5b506105a261100e565b6040516104789190615224565b3480156105bb57600080fd5b506009546104fd565b3480156105d057600080fd5b506104fd6105df366004615133565b61101f565b3480156105f057600080fd5b506104fd602d5481565b34801561060657600080fd5b50610496610615366004615271565b611040565b6104966106283660046152ad565b611071565b34801561063957600080fd5b506104fd6106483660046151fa565b611242565b34801561065957600080fd5b506104fd60345481565b34801561066f57600080fd5b506104966112d8565b34801561068457600080fd5b50610496610693366004615271565b61130a565b3480156106a457600080fd5b506104966106b336600461531e565b611325565b3480156106c457600080fd5b506104fd6106d3366004615133565b611540565b3480156106e457600080fd5b506104fd602c5481565b3480156106fa57600080fd5b506104966107093660046153dd565b6115d3565b34801561071a57600080fd5b50610496611609565b34801561072f57600080fd5b506104fd606481565b34801561074457600080fd5b506104966116a2565b34801561075957600080fd5b5061076d610768366004615425565b61182a565b60405161047891906154da565b34801561078657600080fd5b506104fd60315481565b34801561079c57600080fd5b506107b06107ab366004615133565b6118a9565b60405161047898979695949392919061553c565b3480156107d057600080fd5b506104b86107df366004615133565b611a05565b3480156107f057600080fd5b506104fd601a5481565b34801561080657600080fd5b5061076d611a7c565b34801561081b57600080fd5b50610540611b04565b34801561083057600080fd5b5061046c61083f3660046155a5565b600f6020526000908152604090205460ff1681565b34801561086057600080fd5b506105a2611b92565b34801561087557600080fd5b506104fd610884366004615133565b60146020526000908152604090205481565b3480156108a257600080fd5b506104fd6108b13660046155a5565b611b9e565b3480156108c257600080fd5b50610496611c25565b3480156108d757600080fd5b506104fd60375481565b3480156108ed57600080fd5b5061046c6108fc366004615133565b60386020526000908152604090205460ff1681565b34801561091d57600080fd5b506105a261092c36600461531e565b611c59565b34801561093d57600080fd5b506104fd61094c36600461531e565b611e32565b34801561095d57600080fd5b506104fd602b5481565b34801561097357600080fd5b506104fd610982366004615133565b611f2d565b34801561099357600080fd5b506000546001600160a01b03166104b8565b3480156109b157600080fd5b506104fd60395481565b3480156109c757600080fd5b506104fd60275481565b3480156109dd57600080fd5b506104966109ec36600461531e565b611f3d565b3480156109fd57600080fd5b506104fd610a0c366004615133565b611fc3565b348015610a1d57600080fd5b506105406121ba565b348015610a3257600080fd5b506104fd610a4136600461531e565b6121c9565b348015610a5257600080fd5b50600c54610a609060ff1681565b60405161047891906155c0565b348015610a7957600080fd5b5060165461046c9060ff1681565b610496610a95366004615133565b61226a565b348015610aa657600080fd5b50610496610ab53660046155e8565b6124d6565b348015610ac657600080fd5b50610ada610ad5366004615133565b6124e1565b60408051928352602083019190915201610478565b61049661269c565b348015610b0357600080fd5b50610ada610b12366004615133565b6025602052600090815260409020805460019091015482565b348015610b3757600080fd5b50610496610b4636600461561f565b61277c565b348015610b5757600080fd5b506104fd6127b4565b6104966127e7565b348015610b7457600080fd5b50610540610b83366004615133565b6128b7565b348015610b9457600080fd5b50610496612991565b348015610ba957600080fd5b506104966129c3565b348015610bbe57600080fd5b506105a26129ed565b348015610bd357600080fd5b5060285461046c90610100900460ff1681565b348015610bf257600080fd5b506105406129f9565b348015610c0757600080fd5b50601154610c159060ff1681565b604051610478919061569a565b610496612a06565b348015610c3657600080fd5b50610496610c45366004615133565b612ad6565b348015610c5657600080fd5b5061046c610c65366004615133565b600e6020526000908152604090205460ff1681565b348015610c8657600080fd5b5061046c610c953660046156ae565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610ccf57600080fd5b50610496612dc7565b348015610ce457600080fd5b50602854610cf29060ff1681565b60405161047891906156e1565b348015610d0b57600080fd5b50610496610d1a3660046155a5565b612df9565b348015610d2b57600080fd5b506104fd610d3a366004615133565b612e91565b348015610d4b57600080fd5b5061076d612ea1565b6000610d5f82612f23565b92915050565b6000546001600160a01b03163314610d985760405162461bcd60e51b8152600401610d8f906156ef565b60405180910390fd5b47603955610da4612f48565b565b6000610dc983610dbc610dc26001828785612f9a565b90612fa6565b8790612fb2565b949350505050565b606060018054610de090615724565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0c90615724565b8015610e595780601f10610e2e57610100808354040283529160200191610e59565b820191906000526020600020905b815481529060010190602001808311610e3c57829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b0316610edc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d8f565b506000908152600560205260409020546001600160a01b031690565b6000610f0382611a05565b9050806001600160a01b0316836001600160a01b03161415610f715760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610d8f565b336001600160a01b0382161480610f8d5750610f8d8133610c95565b610fff5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610d8f565b6110098383612fbe565b505050565b606061101a603261302c565b905090565b6018818154811061102f57600080fd5b600091825260209091200154905081565b61104a3382613039565b6110665760405162461bcd60e51b8152600401610d8f90615759565b61100983838361312c565b60208111156110d25760405162461bcd60e51b815260206004820152602760248201527f41642063616e6e6f742062652067726561746572207468616e203332206368616044820152667261637465727360c81b6064820152608401610d8f565b602b5434116111395760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6572206d75737420706179206d6f7265207468616e2070726576696f60448201526c3ab99020b23b32b93a34b9b2b960991b6064820152608401610d8f565b602d54602c5461114991906157c0565b4210156111aa5760405162461bcd60e51b815260206004820152602960248201527f4d7573742077616974206174206c656161737420313020626c6f636b73206265604482015268747765656e2061647360b81b6064820152608401610d8f565b602854610100900460ff166111d15760405162461bcd60e51b8152600401610d8f906157d8565b6111dd60298383614f7e565b50602a80546001600160a01b0319163317905542602c5534602b55611206602e80546001019055565b604080513381523460208201527fdee7f86036014b3234d25bca449f2691a954b90e78ea5b9536af5296990df2ee910160405180910390a15050565b600061124d83611b9e565b82106112af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610d8f565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b6000546001600160a01b031633146113025760405162461bcd60e51b8152600401610d8f906156ef565b610da46132d3565b6110098383836040518060200160405280600081525061277c565b60008281526023602052604090205482906001600160a01b0316331461139e5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b6064820152608401610d8f565b60008181526023602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26000838152602560205260409020600190810154141561147d576000838152602560208181526040808420805485526024835281852087905580548552818520600401805460ff19166002179055938790529181529154815190815260019281019290925281018390527fc07d746233879661285ee6d276b911f3bfdb532fc7fbc45962b4cbcec2e1bc6c9060600160405180910390a1611519565b60008381526025602052604090206001015460021415611519576000838152602560208181526040808420805485526024835281852060010187905580548552818520600401805461ff0019166102001790559387905291815291548151908152600292810192909252818101849052517fc07d746233879661285ee6d276b911f3bfdb532fc7fbc45962b4cbcec2e1bc6c9181900360600190a15b61152161354c565b156110095761152e6135e0565b50506028805460ff1916600317905550565b600061154b60095490565b82106115ae5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610d8f565b600982815481106115c1576115c1615804565b90600052602060002001549050919050565b6000546001600160a01b031633146115fd5760405162461bcd60e51b8152600401610d8f906156ef565b61160681613785565b50565b6000546001600160a01b031633146116335760405162461bcd60e51b8152600401610d8f906156ef565b600460115460ff16600481111561164c5761164c615512565b141561169a5760405162461bcd60e51b815260206004820152601d60248201527f47616d6520697320636f6d706c6574652e204e6f206d6f7265206164730000006044820152606401610d8f565b610da4613798565b6000546001600160a01b031633146116cc5760405162461bcd60e51b8152600401610d8f906156ef565b600160005260386020527f33a28b70ecab075fc507d0cb5ffac06e3bc912aa6c671a1fa4ccb48318e19b115460ff166117175760405162461bcd60e51b8152600401610d8f9061581a565b600260005260386020527f44eb26011dd1cf82e0b45a2fb60b23f01ab68cabbe2fe1f3e7b70c0873d5dc5b5460ff166117625760405162461bcd60e51b8152600401610d8f9061581a565b600360005260386020527f76ace02705df1df747e114090468e0edd81a8d99edc641fff18613cd34df0a6e5460ff166117ad5760405162461bcd60e51b8152600401610d8f9061581a565b600460005260386020527fcc8ed3027127ab69e71f55f03e2b60fb19c73a8aa6226b8d2256163b82f4941f5460ff166117f85760405162461bcd60e51b8152600401610d8f9061581a565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050610da457600080fd5b6060600084848151811061184057611840615804565b6020026020010151905084838151811061185c5761185c615804565b602002602001015185858151811061187657611876615804565b6020026020010181815250508085848151811061189557611895615804565b602090810291909101015250929392505050565b602460205260009081526040902080546001820154600283015460038401546004850154600586018054959694959394929360ff80841694610100909404169291906118f490615724565b80601f016020809104026020016040519081016040528092919081815260200182805461192090615724565b801561196d5780601f106119425761010080835404028352916020019161196d565b820191906000526020600020905b81548152906001019060200180831161195057829003601f168201915b50505050509080600601805461198290615724565b80601f01602080910402602001604051908101604052809291908181526020018280546119ae90615724565b80156119fb5780601f106119d0576101008083540402835291602001916119fb565b820191906000526020600020905b8154815290600101906020018083116119de57829003601f168201915b5050505050905088565b6000818152600360205260408120546001600160a01b031680610d5f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610d8f565b60408051600a808252610160820190925260609160009190602082016101408036833701905050905060005b600a811015611afe5760128181548110611ac457611ac4615804565b9060005260206000200154828281518110611ae157611ae1615804565b602090810291909101015280611af681615851565b915050611aa8565b50919050565b600d8054611b1190615724565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3d90615724565b8015611b8a5780601f10611b5f57610100808354040283529160200191611b8a565b820191906000526020600020905b815481529060010190602001808311611b6d57829003601f168201915b505050505081565b606061101a602f61302c565b60006001600160a01b038216611c095760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610d8f565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314611c4f5760405162461bcd60e51b8152600401610d8f906156ef565b610da460006137fa565b606060658210611cab5760405162461bcd60e51b815260206004820152601760248201527f55707065722063616e6e6f7420657863656564203130300000000000000000006044820152606401610d8f565b60008311611cfb5760405162461bcd60e51b815260206004820152601f60248201527f4c6f776572206d7573742062652067726561746572207468616e207a65726f006044820152606401610d8f565b828211611d4a5760405162461bcd60e51b815260206004820152601f60248201527f5570706572206d757374206265206c6172676572207468616e206c6f776572006044820152606401610d8f565b604080516064808252610ca0820190925260009160208201610c8080368337019050509050835b838111611e2a576000818152600e602052604090205460ff1615611dd957611d9881611a05565b82611da460018461586c565b81518110611db457611db4615804565b60200260200101906001600160a01b031690816001600160a01b031681525050611e18565b600082611de760018461586c565b81518110611df757611df7615804565b60200260200101906001600160a01b031690816001600160a01b0316815250505b80611e2281615851565b915050611d71565b509392505050565b6000600360115460ff166004811115611e4d57611e4d615512565b14611e895760405162461bcd60e51b815260206004820152600c60248201526b11d85b59481b9bdd081cd95d60a21b6044820152606401610d8f565b6009831115611eaa5760405162461bcd60e51b8152600401610d8f90615883565b6009821115611ecb5760405162461bcd60e51b8152600401610d8f90615883565b60165460ff1615611f0557600083815260146020908152604080832054858452601590925290912054611efe91906121c9565b9050610d5f565b600082815260156020908152604080832054868452601490925290912054611efe91906121c9565b6017818154811061102f57600080fd5b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611fb55760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610d8f565b611fbf828261384a565b5050565b600060018210158015611fd7575060048211155b6120235760405162461bcd60e51b815260206004820152601b60248201527f51756172746572206d7573742062652031207468726f756768203400000000006044820152606401610d8f565b600360008381526024602052604090206004015460ff16600381111561204b5761204b615512565b1461208d5760405162461bcd60e51b8152602060048201526012602482015271121bdb594814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b6003600083815260246020526040902060040154610100900460ff1660038111156120ba576120ba615512565b146120fc5760405162461bcd60e51b8152602060048201526012602482015271105dd85e4814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b816004141561217757600560005260246020527ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad60d54610d5f9061214090600a612fb2565b600560005260246020527ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad60e5461094c90600a612fb2565b600082815260246020526040902060020154610d5f9061219890600a612fb2565b60008481526024602052604090206003015461094c90600a612fb2565b919050565b606060028054610de090615724565b6000600983111561220e5760405162461bcd60e51b815260206004820152600f60248201526e58206f7574206f6620626f756e647360881b6044820152606401610d8f565b60098211156122515760405162461bcd60e51b815260206004820152600f60248201526e59206f7574206f6620626f756e647360881b6044820152606401610d8f565b6122636001610dbc858186600a6138c6565b9392505050565b6001600c5460ff16600281111561228357612283615512565b146122c25760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610d8f565b60648111156123135760405162461bcd60e51b815260206004820152601d60248201527f54696c65206e756d626572206d7573742062652062656c6f77203130300000006044820152606401610d8f565b600081116123595760405162461bcd60e51b8152602060048201526013602482015272151a5b19480c081a5cc81b9bdd081d985b1a59606a1b6044820152606401610d8f565b6000818152600e602052604090205460ff16156123b15760405162461bcd60e51b8152602060048201526016602482015275151a5b1948185b1c9958591e481c1d5c98da185cd95960521b6044820152606401610d8f565b336000908152600f602052604090205460ff161561241d5760405162461bcd60e51b815260206004820152602360248201527f43616c6c65722068617320616c72656164792070757263686173656420612074604482015262696c6560e81b6064820152608401610d8f565b333b156124765760405162461bcd60e51b815260206004820152602160248201527f43616c6c65722063616e6e6f74206265206120736d61727420636f6e747261636044820152601d60fa1b6064820152608401610d8f565b61248033826138d2565b61248e600b80546001019055565b336000908152600f602090815260408083208054600160ff199182168117909255858552600e909352922080549091169091179055600b5460641415611606576116066138ec565b611fbf338383613903565b600080600360115460ff1660048111156124fd576124fd615512565b146125395760405162461bcd60e51b815260206004820152600c60248201526b11d85b59481b9bdd081cd95d60a21b6044820152606401610d8f565b600083116125895760405162461bcd60e51b815260206004820152601e60248201527f546f6b656e4944206d7573742062652067726561746572207468616e203000006044820152606401610d8f565b60648311156125da5760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e4944206d757374206265206c657373207468616e203130300000006044820152606401610d8f565b60006125f2600a6125ec866001612f9a565b90612fb2565b90506000612616600a6126108461260a896001612f9a565b90612f9a565b906139d2565b60165490915060ff161561266b576012828154811061263757612637615804565b90600052602060002001546013828154811061265557612655615804565b9060005260206000200154935093505050915091565b6012818154811061267e5761267e615804565b90600052602060002001546013838154811061265557612655615804565b6031543410156126be5760405162461bcd60e51b8152600401610d8f906158ce565b6126c9602f336139de565b61271f5760405162461bcd60e51b815260206004820152602160248201527f43616c6c657220616c7265616479206120506c6174696e756d2053706f6e736f6044820152603960f91b6064820152608401610d8f565b602854610100900460ff166127465760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527f2a17bc9ecaa523f59bcc8f687d12681a264eb96ce29c997791e470452494e25b906020015b60405180910390a1565b6127863383613039565b6127a25760405162461bcd60e51b8152600401610d8f90615759565b6127ae848484846139f3565b50505050565b600080546001600160a01b031633146127df5760405162461bcd60e51b8152600401610d8f906156ef565b61101a613a26565b6037543410156128095760405162461bcd60e51b8152600401610d8f906158ce565b6128146035336139de565b6128605760405162461bcd60e51b815260206004820152601f60248201527f43616c6c657220616c726561647920612053696c7665722053706f6e736f72006044820152606401610d8f565b602854610100900460ff166128875760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527f4283f0c35d6a31fb27211adf7f4ce471038da9759d78a78dd0f046f9f9631bea90602001612772565b6000818152600360205260409020546060906001600160a01b03166129365760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610d8f565b6000612940613ae1565b905060008151116129605760405180602001604052806000815250612263565b8061296a84613af0565b60405160200161297b929190615905565b6040516020818303038152906040529392505050565b6000546001600160a01b031633146129bb5760405162461bcd60e51b8152600401610d8f906156ef565b610da4613bed565b6000546001600160a01b031633146117f85760405162461bcd60e51b8152600401610d8f906156ef565b606061101a603561302c565b60298054611b1190615724565b603454341015612a285760405162461bcd60e51b8152600401610d8f906158ce565b612a336032336139de565b612a7f5760405162461bcd60e51b815260206004820152601d60248201527f43616c6c657220616c7265616479206120476f6c642053706f6e736f720000006044820152606401610d8f565b602854610100900460ff16612aa65760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527fa5616057c5d736bcbe378b5b403f0a9b48789881e741ee0217a74807ea95924c90602001612772565b60018110158015612ae8575060048111155b612b345760405162461bcd60e51b815260206004820152601b60248201527f51756172746572206d7573742062652031207468726f756768203400000000006044820152606401610d8f565b600360008281526024602052604090206004015460ff166003811115612b5c57612b5c615512565b14612b9e5760405162461bcd60e51b8152602060048201526012602482015271121bdb594814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b6003600082815260246020526040902060040154610100900460ff166003811115612bcb57612bcb615512565b14612c0d5760405162461bcd60e51b8152602060048201526012602482015271105dd85e4814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b60008181526038602052604090205460ff1615612c645760405162461bcd60e51b8152602060048201526015602482015274141c9a5e9948185b1c9958591e4818db185a5b5959605a1b6044820152606401610d8f565b33612c716107df83611fc3565b6001600160a01b031614612cc75760405162461bcd60e51b815260206004820181905260248201527f43616c6c657220646f6573206e6f74206f776e2077696e6e696e672074696c656044820152606401610d8f565b602854610100900460ff1615612d395760405162461bcd60e51b815260206004820152603160248201527f5072697a65732063616e6e6f7420626520636c61696d6564207768696c652041604482015270642041756374696f6e206973206c69766560781b6064820152608401610d8f565b603954612d785760405162461bcd60e51b815260206004820152600d60248201526c139bc81c1c9a5e99481c1bdbdb609a1b6044820152606401610d8f565b60395433906108fc90612d8c9060046139d2565b6040518115909202916000818181858888f19350505050612dac57600080fd5b6000908152603860205260409020805460ff19166001179055565b6000546001600160a01b03163314612df15760405162461bcd60e51b8152600401610d8f906156ef565b610da4613c13565b6000546001600160a01b03163314612e235760405162461bcd60e51b8152600401610d8f906156ef565b6001600160a01b038116612e885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d8f565b611606816137fa565b6019818154811061102f57600080fd5b60408051600a808252610160820190925260609160009190602082016101408036833701905050905060005b600a811015611afe5760138181548110612ee957612ee9615804565b9060005260206000200154828281518110612f0657612f06615804565b602090810291909101015280612f1b81615851565b915050612ecd565b60006001600160e01b0319821663780e9d6360e01b1480610d5f5750610d5f82613c9a565b602854610100900460ff16612f8d5760405162461bcd60e51b815260206004820152600b60248201526a20b21039b0b6329037b33360a91b6044820152606401610d8f565b6028805461ff0019169055565b6000612263828461586c565b600061226382846157c0565b6000612263828461594a565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ff382611a05565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6060600061226383613cea565b6000818152600360205260408120546001600160a01b03166130b25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d8f565b60006130bd83611a05565b9050806001600160a01b0316846001600160a01b031614806130f85750836001600160a01b03166130ed84610e63565b6001600160a01b0316145b80610dc957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff16610dc9565b826001600160a01b031661313f82611a05565b6001600160a01b0316146131a35760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610d8f565b6001600160a01b0382166132055760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d8f565b613210838383613d46565b61321b600082612fbe565b6001600160a01b038316600090815260046020526040812080546001929061324490849061586c565b90915550506001600160a01b03821660009081526004602052604081208054600192906132729084906157c0565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600260115460ff1660048111156132ec576132ec615512565b1461332f5760405162461bcd60e51b815260206004820152601360248201527247616d6520696e2077726f6e6720737461746560681b6044820152606401610d8f565b6011805460ff1916600317905560178054604080516020808402820181019092528281526000939092909183018282801561338957602002820191906000526020600020905b815481526020019060010190808311613375575b505050505090506000805b6009811015613425576133d2601882815481106133b3576133b3615804565b90600052602060002001548260006133cb91906157c0565b6009610da6565b91506133df83828461182a565b925080601460008584815181106133f8576133f8615804565b6020026020010151815260200190815260200160002081905550808061341d90615851565b915050613394565b508151613439906012906020850190615002565b50601780548060200260200160405190810160405280929190818152602001828054801561348657602002820191906000526020600020905b815481526020019060010190808311613472575b5050505050915060005b6009811015613502576134af601982815481106133b3576133b3615804565b91506134bc83828461182a565b925080601560008584815181106134d5576134d5615804565b602002602001015181526020019081526020016000208190555080806134fa90615851565b915050613490565b508151613516906013906020850190615002565b50613526601a5460006001610da6565b90508061353b576016805460ff191690555050565b6016805460ff191660011790555050565b600060015b600581116135d857600260008281526024602052604090206004015460ff16600381111561358157613581615512565b1415806135b957506002600082815260246020526040902060040154610100900460ff1660038111156135b6576135b6615512565b14155b156135c657600091505090565b806135d081615851565b915050613551565b506001905090565b600160005260246020527fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d6547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d8557fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97da80547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d7547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d95561ffff191661030317905560025b6005811161160657602460006136ba60018461586c565b81526020808201929092526040908101600090812060020154848252602490935220546136e791906157c0565b6000828152602460208190526040822060028101939093556004909201805460ff1916600317905561371a60018461586c565b815260200190815260200160002060030154602460008381526020019081526020016000206001015461374d91906157c0565b60008281526024602052604090206003810191909155600401805461ff0019166103001790558061377d81615851565b9150506136a3565b8051611fbf90600d90602084019061503d565b602854610100900460ff16156137e95760405162461bcd60e51b815260206004820152601660248201527541642073616c6520616c72656164792061637469766560501b6044820152606401610d8f565b6028805461ff001916610100179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060115460ff16600481111561386357613863615512565b146138b05760405162461bcd60e51b815260206004820152601d60248201527f47616d65206d75737420626520696e20696e697469616c2073746174650000006044820152606401610d8f565b6011805460ff19166001179055611fbf81613d51565b6000612263828461595e565b611fbf828260405180602001604052806000815250613edb565b600c80546002919060ff19166001835b0217905550565b816001600160a01b0316836001600160a01b031614156139655760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d8f565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612263828461597d565b6000612263836001600160a01b038416613f0e565b6139fe84848461312c565b613a0a84848484613f5d565b6127ae5760405162461bcd60e51b8152600401610d8f90615991565b601c546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015613a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab591906159e3565b1015613ad35760405162461bcd60e51b8152600401610d8f906159fc565b61101a601b54601c5461405b565b6060600d8054610de090615724565b606081613b145750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613b3e5780613b2881615851565b9150613b379050600a8361597d565b9150613b18565b6000816001600160401b03811115613b5857613b58615340565b6040519080825280601f01601f191660200182016040528015613b82576020820181803683370190505b5090505b8415610dc957613b9760018361586c565b9150613ba4600a8661594a565b613baf9060306157c0565b60f81b818381518110613bc457613bc4615804565b60200101906001600160f81b031916908160001a905350613be6600a8661597d565b9450613b86565b60015b6005811161160657613c01816141d7565b80613c0b81615851565b915050613bf0565b6000600c5460ff166002811115613c2c57613c2c615512565b14613c875760405162461bcd60e51b815260206004820152602560248201527f53616c6520616c7265616479207374617274656420616e642f6f7220636f6d706044820152641b195d195960da1b6064820152608401610d8f565b600c80546001919060ff191682806138fc565b60006001600160e01b031982166380ac58cd60e01b1480613ccb57506001600160e01b03198216635b5e139f60e01b145b80610d5f57506301ffc9a760e01b6001600160e01b0319831614610d5f565b606081600001805480602002602001604051908101604052809291908181526020018280548015613d3a57602002820191906000526020600020905b815481526020019060010190808311613d26575b50505050509050919050565b61100983838361448e565b600160115460ff166004811115613d6a57613d6a615512565b14613db75760405162461bcd60e51b815260206004820152601d60248201527f47616d65206d75737420626520696e20696e697469616c2073746174650000006044820152606401610d8f565b6011805460ff19166002179055604080516020808201849052825180830382018152918301909252805191012060005b6009811015613e49576040805160208101849052016040516020818303038152906040528051906020012060001c91508160188281548110613e2b57613e2b615804565b60009182526020909120015580613e4181615851565b915050613de7565b5060005b6009811015613eaf576040805160208101849052016040516020818303038152906040528051906020012060001c91508160198281548110613e9157613e91615804565b60009182526020909120015580613ea781615851565b915050613e4d565b5060408051602081018390520160408051601f198184030181529190528051602090910120601a555050565b613ee58383614546565b613ef26000848484613f5d565b6110095760405162461bcd60e51b8152600401610d8f90615991565b6000818152600183016020526040812054613f5557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d5f565b506000610d5f565b60006001600160a01b0384163b1561405057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613fa1903390899088908890600401615a47565b6020604051808303816000875af1925050508015613fdc575060408051601f3d908101601f19168201909252613fd991810190615a7a565b60015b614036573d80801561400a576040519150601f19603f3d011682016040523d82523d6000602084013e61400f565b606091505b50805161402e5760405162461bcd60e51b8152600401610d8f90615991565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610dc9565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016140cb929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016140f893929190615a97565b6020604051808303816000875af1158015614117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061413b9190615abe565b50600083815260106020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526141979060016157c0565b600085815260106020526040902055610dc98482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b600081116142275760405162461bcd60e51b815260206004820152601e60248201527f51756172746572206d7573742062652067726561746572207468616e203000006044820152606401610d8f565b600581111561429e5760405162461bcd60e51b815260206004820152603a60248201527f51756172746572206d757374206265206c657373207468616e206f722065717560448201527f616c20746f20352c20696e636c75646573206f76657274696d650000000000006064820152608401610d8f565b60008181526024602052604081206004015460ff1660038111156142c4576142c4615512565b146142e15760405162461bcd60e51b8152600401610d8f90615adb565b60008082815260246020526040902060040154610100900460ff16600381111561430d5761430d615512565b1461432a5760405162461bcd60e51b8152600401610d8f90615adb565b60405180604001604052808281526020016001815250602560006143eb60246000868152602001908152602001600020600501805461436890615724565b80601f016020809104026020016040519081016040528092919081815260200182805461439490615724565b80156143e15780601f106143b6576101008083540402835291602001916143e1565b820191906000526020600020905b8154815290600101906020018083116143c457829003601f168201915b5050505050614694565b81526020019081526020016000206000820151816000015560208201518160010155905050604051806040016040528082815260200160028152506025600061444e60246000868152602001908152602001600020600601805461436890615724565b81526020808201929092526040908101600090812084518155938301516001909401939093559282526024905220600401805461ffff1916610101179055565b6001600160a01b0383166144e9576144e481600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b61450c565b816001600160a01b0316836001600160a01b03161461450c5761450c838261477f565b6001600160a01b038216614523576110098161481c565b826001600160a01b0316826001600160a01b0316146110095761100982826148cb565b6001600160a01b03821661459c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d8f565b6000818152600360205260409020546001600160a01b0316156146015760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d8f565b61460d60008383613d46565b6001600160a01b03821660009081526004602052604081208054600192906146369084906157c0565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006027546146ab6020546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156146f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061471591906159e3565b10156147335760405162461bcd60e51b8152600401610d8f906159fc565b600061474960265430634357855e60e01b61490f565b6040805180820190915260048152630e0c2e8d60e31b602082015290915061477390829085614934565b61226381602754614952565b6000600161478c84611b9e565b614796919061586c565b6000838152600860205260409020549091508082146147e9576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b60095460009061482e9060019061586c565b6000838152600a60205260408120546009805493945090928490811061485657614856615804565b90600052602060002001549050806009838154811061487757614877615804565b6000918252602080832090910192909255828152600a909152604080822084905585825281205560098054806148af576148af615b21565b6001900381819060005260206000200160009055905550505050565b60006148d683611b9e565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b6149176150b0565b61491f6150b0565b61492b8186868661496c565b95945050505050565b608083015161494390836149a9565b608083015161100990826149a9565b602154600090612263906001600160a01b031684846149c0565b6149746150b0565b6149848560800151610100614a53565b50509183526001600160a01b031660208301526001600160e01b031916604082015290565b6149b68260038351614ab8565b6110098282614bbf565b6022546000906149d18160016157c0565b602255835160408086015160808701515191516000936320214ca360e11b93614a099386938493923092918a91600191602401615b37565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050614a4986838684614be6565b9695505050505050565b604080518082019091526060815260006020820152614a7360208361594a565b15614a9b57614a8360208361594a565b614a8e90602061586c565b614a9890836157c0565b91505b506020828101829052604080518085526000815290920101905290565b6017816001600160401b031611614adc576127ae8360e0600585901b168317614d44565b60ff816001600160401b031611614b1857614b02836018611fe0600586901b1617614d44565b506127ae836001600160401b0383166001614d69565b61ffff816001600160401b031611614b5557614b3f836019611fe0600586901b1617614d44565b506127ae836001600160401b0383166002614d69565b63ffffffff816001600160401b031611614b9457614b7e83601a611fe0600586901b1617614d44565b506127ae836001600160401b0383166004614d69565b614ba983601b611fe0600586901b1617614d44565b506127ae836001600160401b0383166008614d69565b60408051808201909152606081526000602082015261226383846000015151848551614d8f565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152602390925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2602054604051630200057560e51b81526001600160a01b0390911690634000aea090614ca990889087908790600401615a97565b6020604051808303816000875af1158015614cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cec9190615abe565b610dc95760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610d8f565b6040805180820190915260608152600060208201526122638384600001515184614e79565b604080518082019091526060815260006020820152610dc9848560000151518585614ed5565b6040805180820190915260608152600060208201528251821115614db257600080fd5b6020850151614dc183866157c0565b1115614df457614df485614de487602001518786614ddf91906157c0565b614f56565b614def90600261595e565b614f67565b600080865180518760208301019350808887011115614e135787860182525b505050602084015b60208410614e535780518252614e326020836157c0565b9150614e3f6020826157c0565b9050614e4c60208561586c565b9350614e1b565b51815160001960208690036101000a019081169019919091161790525083949350505050565b60408051808201909152606081526000602082015283602001518310614eae57614eae8485602001516002614def919061595e565b835180516020858301018481535080851415614ecb576001810182525b5093949350505050565b6040805180820190915260608152600060208201526020850151614ef985846157c0565b1115614f0d57614f0d85614de486856157c0565b60006001614f1d84610100615c74565b614f27919061586c565b9050855183868201018583198251161781525080518487011115614f4b5783860181525b509495945050505050565b600081831115611afe575081610d5f565b8151614f738383614a53565b506127ae8382614bbf565b828054614f8a90615724565b90600052602060002090601f016020900481019282614fac5760008555614ff2565b82601f10614fc55782800160ff19823516178555614ff2565b82800160010185558215614ff2579182015b82811115614ff2578235825591602001919060010190614fd7565b50614ffe9291506150eb565b5090565b828054828255906000526020600020908101928215614ff2579160200282015b82811115614ff2578251825591602001919060010190615022565b82805461504990615724565b90600052602060002090601f01602090048101928261506b5760008555614ff2565b82601f1061508457805160ff1916838001178555614ff2565b82800160010185558215614ff25791820182811115614ff2578251825591602001919060010190615022565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b5b80821115614ffe57600081556001016150ec565b6001600160e01b03198116811461160657600080fd5b60006020828403121561512857600080fd5b813561226381615100565b60006020828403121561514557600080fd5b5035919050565b60008060006060848603121561516157600080fd5b505081359360208301359350604090920135919050565b60005b8381101561519357818101518382015260200161517b565b838111156127ae5750506000910152565b600081518084526151bc816020860160208601615178565b601f01601f19169290920160200192915050565b60208152600061226360208301846151a4565b80356001600160a01b03811681146121b557600080fd5b6000806040838503121561520d57600080fd5b615216836151e3565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156152655783516001600160a01b031683529284019291840191600101615240565b50909695505050505050565b60008060006060848603121561528657600080fd5b61528f846151e3565b925061529d602085016151e3565b9150604084013590509250925092565b600080602083850312156152c057600080fd5b82356001600160401b03808211156152d757600080fd5b818501915085601f8301126152eb57600080fd5b8135818111156152fa57600080fd5b86602082850101111561530c57600080fd5b60209290920196919550909350505050565b6000806040838503121561533157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561537e5761537e615340565b604052919050565b60006001600160401b0383111561539f5761539f615340565b6153b2601f8401601f1916602001615356565b90508281528383830111156153c657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156153ef57600080fd5b81356001600160401b0381111561540557600080fd5b8201601f8101841361541657600080fd5b610dc984823560208401615386565b60008060006060848603121561543a57600080fd5b83356001600160401b038082111561545157600080fd5b818601915086601f83011261546557600080fd5b813560208282111561547957615479615340565b8160051b925061548a818401615356565b828152928401810192818101908a8511156154a457600080fd5b948201945b848610156154c2578535825294820194908201906154a9565b9a918901359950506040909701359695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015615265578351835292840192918401916001016154f6565b634e487b7160e01b600052602160045260246000fd5b6004811061553857615538615512565b9052565b60006101008a83528960208401528860408401528760608401526155636080840188615528565b61557060a0840187615528565b8060c0840152615582818401866151a4565b905082810360e084015261559681856151a4565b9b9a5050505050505050505050565b6000602082840312156155b757600080fd5b612263826151e3565b60208101600383106155d4576155d4615512565b91905290565b801515811461160657600080fd5b600080604083850312156155fb57600080fd5b615604836151e3565b91506020830135615614816155da565b809150509250929050565b6000806000806080858703121561563557600080fd5b61563e856151e3565b935061564c602086016151e3565b92506040850135915060608501356001600160401b0381111561566e57600080fd5b8501601f8101871361567f57600080fd5b61568e87823560208401615386565b91505092959194509250565b60208101600583106155d4576155d4615512565b600080604083850312156156c157600080fd5b6156ca836151e3565b91506156d8602084016151e3565b90509250929050565b60208101610d5f8284615528565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061573857607f821691505b60208210811415611afe57634e487b7160e01b600052602260045260246000fd5b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156157d3576157d36157aa565b500190565b60208082526012908201527141642073616c65206e6f742061637469766560701b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252601c908201527f51756172746572203120207072697a65206e6f7420636c61696d656400000000604082015260600190565b6000600019821415615865576158656157aa565b5060010190565b60008282101561587e5761587e6157aa565b500390565b6020808252602b908201527f486f6d652073636f7265206d7573742062652077697468696e2074686520626f60408201526a756e6473203020746f203960a81b606082015260800190565b6020808252601f908201527f43616c6c6572206d7573742073656e6420636f727265637420616d6f756e7400604082015260600190565b60008351615917818460208801615178565b83519083019061592b818360208801615178565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261595957615959615934565b500690565b6000816000190483118215151615615978576159786157aa565b500290565b60008261598c5761598c615934565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000602082840312156159f557600080fd5b5051919050565b6020808252602b908201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060408201526a1dda5d1a0819985d58d95d60aa1b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614a49908301846151a4565b600060208284031215615a8c57600080fd5b815161226381615100565b60018060a01b038416815282602082015260606040820152600061492b60608301846151a4565b600060208284031215615ad057600080fd5b8151612263816155da565b60208082526026908201527f517561727465722073636f7265206c6f6f6b757020616c726561647920696e696040820152651d1a585d195960d21b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090615596838201856151a4565b600181815b80851115615bcb578160001904821115615bb157615bb16157aa565b80851615615bbe57918102915b93841c9390800290615b95565b509250929050565b600082615be257506001610d5f565b81615bef57506000610d5f565b8160018114615c055760028114615c0f57615c2b565b6001915050610d5f565b60ff841115615c2057615c206157aa565b50506001821b610d5f565b5060208310610133831016604e8410600b8410161715615c4e575081810a610d5f565b615c588383615b90565b8060001904821115615c6c57615c6c6157aa565b029392505050565b60006122638383615bd356fea2646970667358221220709561ed20de7115c4727fa8651d38c8f9e3adad46ad49ac7fa8b7920e9c1aa664736f6c634300080b0033

Deployed Bytecode

0x6080604052600436106104475760003560e01c80637e05659211610234578063b88d4fde1161012e578063d1f9c24d116100b6578063ecbfc0771161007a578063ecbfc07714610cc3578063f014428414610cd8578063f2fde38b14610cff578063fe57c4bc14610d1f578063ff8cac9d14610d3f57600080fd5b8063d1f9c24d14610bfb578063d44462e114610c22578063d709815414610c2a578063e24507c114610c4a578063e985e9c514610c7a57600080fd5b8063c9911564116100fd578063c991156414610b88578063cb28a2e314610b9d578063cb748a2814610bb2578063cfddc0d414610bc7578063d0fe220e14610be657600080fd5b8063b88d4fde14610b2b578063bb06183014610b4b578063bdefed0b14610b60578063c87b56dd14610b6857600080fd5b806395abda8f116101bc578063a0712d6811610180578063a0712d6814610a87578063a22cb46514610a9a578063a3ce86ca14610aba578063a68deedd14610aef578063ac8293a614610af757600080fd5b806395abda8f146109f157806395d89b4114610a115780639794c8bf14610a265780639a72580914610a465780639b24b81014610a6d57600080fd5b80638b65e715116102035780638b65e715146109675780638da5cb5b146109875780638f583397146109a55780639401630f146109bb57806394985ddd146109d157600080fd5b80637e056592146108e15780637e4f700d146109115780637e52948014610931578063826964c91461095157600080fd5b80634f6ccce7116103455780636352211e116102cd5780636d9b9fdb116102915780636d9b9fdb146108545780636e174c511461086957806370a0823114610896578063715018a6146108b657806375ba82e8146108cb57600080fd5b80636352211e146107c457806365d7d687146107e457806368204916146107fa5780636c0360eb1461080f5780636d4d1f421461082457600080fd5b80635cdcdde6116103145780635cdcdde6146107235780635fd8c7101461073857806360cc5a851461074d578063618479811461077a57806361fc23201461079057600080fd5b80634f6ccce7146106b8578063542f7d5f146106d857806355f804b3146106ee5780635ba6f24c1461070e57600080fd5b806318160ddd116103d35780632f745c59116103975780632f745c591461062d57806340dee59e1461064d578063416aeedc1461066357806342842e0e146106785780634357855e1461069857600080fd5b806318160ddd146105af5780631bda1b92146105c45780631cccbf20146105e457806323b872dd146105fa578063259d3c781461061a57600080fd5b80630632256c1161041a5780630632256c1461050b57806306fdde031461052b578063081812fc1461054d578063095ea7b31461056d5780630f7aab011461058d57600080fd5b806301ffc9a71461044c578063035bb74e146104815780630454464a14610498578063055cd369146104d0575b600080fd5b34801561045857600080fd5b5061046c610467366004615116565b610d54565b60405190151581526020015b60405180910390f35b34801561048d57600080fd5b50610496610d65565b005b3480156104a457600080fd5b50602a546104b8906001600160a01b031681565b6040516001600160a01b039091168152602001610478565b3480156104dc57600080fd5b506104fd6104eb366004615133565b60156020526000908152604090205481565b604051908152602001610478565b34801561051757600080fd5b506104fd61052636600461514c565b610da6565b34801561053757600080fd5b50610540610dd1565b60405161047891906151d0565b34801561055957600080fd5b506104b8610568366004615133565b610e63565b34801561057957600080fd5b506104966105883660046151fa565b610ef8565b34801561059957600080fd5b506105a261100e565b6040516104789190615224565b3480156105bb57600080fd5b506009546104fd565b3480156105d057600080fd5b506104fd6105df366004615133565b61101f565b3480156105f057600080fd5b506104fd602d5481565b34801561060657600080fd5b50610496610615366004615271565b611040565b6104966106283660046152ad565b611071565b34801561063957600080fd5b506104fd6106483660046151fa565b611242565b34801561065957600080fd5b506104fd60345481565b34801561066f57600080fd5b506104966112d8565b34801561068457600080fd5b50610496610693366004615271565b61130a565b3480156106a457600080fd5b506104966106b336600461531e565b611325565b3480156106c457600080fd5b506104fd6106d3366004615133565b611540565b3480156106e457600080fd5b506104fd602c5481565b3480156106fa57600080fd5b506104966107093660046153dd565b6115d3565b34801561071a57600080fd5b50610496611609565b34801561072f57600080fd5b506104fd606481565b34801561074457600080fd5b506104966116a2565b34801561075957600080fd5b5061076d610768366004615425565b61182a565b60405161047891906154da565b34801561078657600080fd5b506104fd60315481565b34801561079c57600080fd5b506107b06107ab366004615133565b6118a9565b60405161047898979695949392919061553c565b3480156107d057600080fd5b506104b86107df366004615133565b611a05565b3480156107f057600080fd5b506104fd601a5481565b34801561080657600080fd5b5061076d611a7c565b34801561081b57600080fd5b50610540611b04565b34801561083057600080fd5b5061046c61083f3660046155a5565b600f6020526000908152604090205460ff1681565b34801561086057600080fd5b506105a2611b92565b34801561087557600080fd5b506104fd610884366004615133565b60146020526000908152604090205481565b3480156108a257600080fd5b506104fd6108b13660046155a5565b611b9e565b3480156108c257600080fd5b50610496611c25565b3480156108d757600080fd5b506104fd60375481565b3480156108ed57600080fd5b5061046c6108fc366004615133565b60386020526000908152604090205460ff1681565b34801561091d57600080fd5b506105a261092c36600461531e565b611c59565b34801561093d57600080fd5b506104fd61094c36600461531e565b611e32565b34801561095d57600080fd5b506104fd602b5481565b34801561097357600080fd5b506104fd610982366004615133565b611f2d565b34801561099357600080fd5b506000546001600160a01b03166104b8565b3480156109b157600080fd5b506104fd60395481565b3480156109c757600080fd5b506104fd60275481565b3480156109dd57600080fd5b506104966109ec36600461531e565b611f3d565b3480156109fd57600080fd5b506104fd610a0c366004615133565b611fc3565b348015610a1d57600080fd5b506105406121ba565b348015610a3257600080fd5b506104fd610a4136600461531e565b6121c9565b348015610a5257600080fd5b50600c54610a609060ff1681565b60405161047891906155c0565b348015610a7957600080fd5b5060165461046c9060ff1681565b610496610a95366004615133565b61226a565b348015610aa657600080fd5b50610496610ab53660046155e8565b6124d6565b348015610ac657600080fd5b50610ada610ad5366004615133565b6124e1565b60408051928352602083019190915201610478565b61049661269c565b348015610b0357600080fd5b50610ada610b12366004615133565b6025602052600090815260409020805460019091015482565b348015610b3757600080fd5b50610496610b4636600461561f565b61277c565b348015610b5757600080fd5b506104fd6127b4565b6104966127e7565b348015610b7457600080fd5b50610540610b83366004615133565b6128b7565b348015610b9457600080fd5b50610496612991565b348015610ba957600080fd5b506104966129c3565b348015610bbe57600080fd5b506105a26129ed565b348015610bd357600080fd5b5060285461046c90610100900460ff1681565b348015610bf257600080fd5b506105406129f9565b348015610c0757600080fd5b50601154610c159060ff1681565b604051610478919061569a565b610496612a06565b348015610c3657600080fd5b50610496610c45366004615133565b612ad6565b348015610c5657600080fd5b5061046c610c65366004615133565b600e6020526000908152604090205460ff1681565b348015610c8657600080fd5b5061046c610c953660046156ae565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610ccf57600080fd5b50610496612dc7565b348015610ce457600080fd5b50602854610cf29060ff1681565b60405161047891906156e1565b348015610d0b57600080fd5b50610496610d1a3660046155a5565b612df9565b348015610d2b57600080fd5b506104fd610d3a366004615133565b612e91565b348015610d4b57600080fd5b5061076d612ea1565b6000610d5f82612f23565b92915050565b6000546001600160a01b03163314610d985760405162461bcd60e51b8152600401610d8f906156ef565b60405180910390fd5b47603955610da4612f48565b565b6000610dc983610dbc610dc26001828785612f9a565b90612fa6565b8790612fb2565b949350505050565b606060018054610de090615724565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0c90615724565b8015610e595780601f10610e2e57610100808354040283529160200191610e59565b820191906000526020600020905b815481529060010190602001808311610e3c57829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b0316610edc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d8f565b506000908152600560205260409020546001600160a01b031690565b6000610f0382611a05565b9050806001600160a01b0316836001600160a01b03161415610f715760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610d8f565b336001600160a01b0382161480610f8d5750610f8d8133610c95565b610fff5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610d8f565b6110098383612fbe565b505050565b606061101a603261302c565b905090565b6018818154811061102f57600080fd5b600091825260209091200154905081565b61104a3382613039565b6110665760405162461bcd60e51b8152600401610d8f90615759565b61100983838361312c565b60208111156110d25760405162461bcd60e51b815260206004820152602760248201527f41642063616e6e6f742062652067726561746572207468616e203332206368616044820152667261637465727360c81b6064820152608401610d8f565b602b5434116111395760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6572206d75737420706179206d6f7265207468616e2070726576696f60448201526c3ab99020b23b32b93a34b9b2b960991b6064820152608401610d8f565b602d54602c5461114991906157c0565b4210156111aa5760405162461bcd60e51b815260206004820152602960248201527f4d7573742077616974206174206c656161737420313020626c6f636b73206265604482015268747765656e2061647360b81b6064820152608401610d8f565b602854610100900460ff166111d15760405162461bcd60e51b8152600401610d8f906157d8565b6111dd60298383614f7e565b50602a80546001600160a01b0319163317905542602c5534602b55611206602e80546001019055565b604080513381523460208201527fdee7f86036014b3234d25bca449f2691a954b90e78ea5b9536af5296990df2ee910160405180910390a15050565b600061124d83611b9e565b82106112af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610d8f565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b6000546001600160a01b031633146113025760405162461bcd60e51b8152600401610d8f906156ef565b610da46132d3565b6110098383836040518060200160405280600081525061277c565b60008281526023602052604090205482906001600160a01b0316331461139e5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b6064820152608401610d8f565b60008181526023602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26000838152602560205260409020600190810154141561147d576000838152602560208181526040808420805485526024835281852087905580548552818520600401805460ff19166002179055938790529181529154815190815260019281019290925281018390527fc07d746233879661285ee6d276b911f3bfdb532fc7fbc45962b4cbcec2e1bc6c9060600160405180910390a1611519565b60008381526025602052604090206001015460021415611519576000838152602560208181526040808420805485526024835281852060010187905580548552818520600401805461ff0019166102001790559387905291815291548151908152600292810192909252818101849052517fc07d746233879661285ee6d276b911f3bfdb532fc7fbc45962b4cbcec2e1bc6c9181900360600190a15b61152161354c565b156110095761152e6135e0565b50506028805460ff1916600317905550565b600061154b60095490565b82106115ae5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610d8f565b600982815481106115c1576115c1615804565b90600052602060002001549050919050565b6000546001600160a01b031633146115fd5760405162461bcd60e51b8152600401610d8f906156ef565b61160681613785565b50565b6000546001600160a01b031633146116335760405162461bcd60e51b8152600401610d8f906156ef565b600460115460ff16600481111561164c5761164c615512565b141561169a5760405162461bcd60e51b815260206004820152601d60248201527f47616d6520697320636f6d706c6574652e204e6f206d6f7265206164730000006044820152606401610d8f565b610da4613798565b6000546001600160a01b031633146116cc5760405162461bcd60e51b8152600401610d8f906156ef565b600160005260386020527f33a28b70ecab075fc507d0cb5ffac06e3bc912aa6c671a1fa4ccb48318e19b115460ff166117175760405162461bcd60e51b8152600401610d8f9061581a565b600260005260386020527f44eb26011dd1cf82e0b45a2fb60b23f01ab68cabbe2fe1f3e7b70c0873d5dc5b5460ff166117625760405162461bcd60e51b8152600401610d8f9061581a565b600360005260386020527f76ace02705df1df747e114090468e0edd81a8d99edc641fff18613cd34df0a6e5460ff166117ad5760405162461bcd60e51b8152600401610d8f9061581a565b600460005260386020527fcc8ed3027127ab69e71f55f03e2b60fb19c73a8aa6226b8d2256163b82f4941f5460ff166117f85760405162461bcd60e51b8152600401610d8f9061581a565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050610da457600080fd5b6060600084848151811061184057611840615804565b6020026020010151905084838151811061185c5761185c615804565b602002602001015185858151811061187657611876615804565b6020026020010181815250508085848151811061189557611895615804565b602090810291909101015250929392505050565b602460205260009081526040902080546001820154600283015460038401546004850154600586018054959694959394929360ff80841694610100909404169291906118f490615724565b80601f016020809104026020016040519081016040528092919081815260200182805461192090615724565b801561196d5780601f106119425761010080835404028352916020019161196d565b820191906000526020600020905b81548152906001019060200180831161195057829003601f168201915b50505050509080600601805461198290615724565b80601f01602080910402602001604051908101604052809291908181526020018280546119ae90615724565b80156119fb5780601f106119d0576101008083540402835291602001916119fb565b820191906000526020600020905b8154815290600101906020018083116119de57829003601f168201915b5050505050905088565b6000818152600360205260408120546001600160a01b031680610d5f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610d8f565b60408051600a808252610160820190925260609160009190602082016101408036833701905050905060005b600a811015611afe5760128181548110611ac457611ac4615804565b9060005260206000200154828281518110611ae157611ae1615804565b602090810291909101015280611af681615851565b915050611aa8565b50919050565b600d8054611b1190615724565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3d90615724565b8015611b8a5780601f10611b5f57610100808354040283529160200191611b8a565b820191906000526020600020905b815481529060010190602001808311611b6d57829003601f168201915b505050505081565b606061101a602f61302c565b60006001600160a01b038216611c095760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610d8f565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314611c4f5760405162461bcd60e51b8152600401610d8f906156ef565b610da460006137fa565b606060658210611cab5760405162461bcd60e51b815260206004820152601760248201527f55707065722063616e6e6f7420657863656564203130300000000000000000006044820152606401610d8f565b60008311611cfb5760405162461bcd60e51b815260206004820152601f60248201527f4c6f776572206d7573742062652067726561746572207468616e207a65726f006044820152606401610d8f565b828211611d4a5760405162461bcd60e51b815260206004820152601f60248201527f5570706572206d757374206265206c6172676572207468616e206c6f776572006044820152606401610d8f565b604080516064808252610ca0820190925260009160208201610c8080368337019050509050835b838111611e2a576000818152600e602052604090205460ff1615611dd957611d9881611a05565b82611da460018461586c565b81518110611db457611db4615804565b60200260200101906001600160a01b031690816001600160a01b031681525050611e18565b600082611de760018461586c565b81518110611df757611df7615804565b60200260200101906001600160a01b031690816001600160a01b0316815250505b80611e2281615851565b915050611d71565b509392505050565b6000600360115460ff166004811115611e4d57611e4d615512565b14611e895760405162461bcd60e51b815260206004820152600c60248201526b11d85b59481b9bdd081cd95d60a21b6044820152606401610d8f565b6009831115611eaa5760405162461bcd60e51b8152600401610d8f90615883565b6009821115611ecb5760405162461bcd60e51b8152600401610d8f90615883565b60165460ff1615611f0557600083815260146020908152604080832054858452601590925290912054611efe91906121c9565b9050610d5f565b600082815260156020908152604080832054868452601490925290912054611efe91906121c9565b6017818154811061102f57600080fd5b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79521614611fb55760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610d8f565b611fbf828261384a565b5050565b600060018210158015611fd7575060048211155b6120235760405162461bcd60e51b815260206004820152601b60248201527f51756172746572206d7573742062652031207468726f756768203400000000006044820152606401610d8f565b600360008381526024602052604090206004015460ff16600381111561204b5761204b615512565b1461208d5760405162461bcd60e51b8152602060048201526012602482015271121bdb594814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b6003600083815260246020526040902060040154610100900460ff1660038111156120ba576120ba615512565b146120fc5760405162461bcd60e51b8152602060048201526012602482015271105dd85e4814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b816004141561217757600560005260246020527ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad60d54610d5f9061214090600a612fb2565b600560005260246020527ff737fbf41dafb4990088c527475c23d7ec8faec34b668fc96ba68bf83b8ad60e5461094c90600a612fb2565b600082815260246020526040902060020154610d5f9061219890600a612fb2565b60008481526024602052604090206003015461094c90600a612fb2565b919050565b606060028054610de090615724565b6000600983111561220e5760405162461bcd60e51b815260206004820152600f60248201526e58206f7574206f6620626f756e647360881b6044820152606401610d8f565b60098211156122515760405162461bcd60e51b815260206004820152600f60248201526e59206f7574206f6620626f756e647360881b6044820152606401610d8f565b6122636001610dbc858186600a6138c6565b9392505050565b6001600c5460ff16600281111561228357612283615512565b146122c25760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610d8f565b60648111156123135760405162461bcd60e51b815260206004820152601d60248201527f54696c65206e756d626572206d7573742062652062656c6f77203130300000006044820152606401610d8f565b600081116123595760405162461bcd60e51b8152602060048201526013602482015272151a5b19480c081a5cc81b9bdd081d985b1a59606a1b6044820152606401610d8f565b6000818152600e602052604090205460ff16156123b15760405162461bcd60e51b8152602060048201526016602482015275151a5b1948185b1c9958591e481c1d5c98da185cd95960521b6044820152606401610d8f565b336000908152600f602052604090205460ff161561241d5760405162461bcd60e51b815260206004820152602360248201527f43616c6c65722068617320616c72656164792070757263686173656420612074604482015262696c6560e81b6064820152608401610d8f565b333b156124765760405162461bcd60e51b815260206004820152602160248201527f43616c6c65722063616e6e6f74206265206120736d61727420636f6e747261636044820152601d60fa1b6064820152608401610d8f565b61248033826138d2565b61248e600b80546001019055565b336000908152600f602090815260408083208054600160ff199182168117909255858552600e909352922080549091169091179055600b5460641415611606576116066138ec565b611fbf338383613903565b600080600360115460ff1660048111156124fd576124fd615512565b146125395760405162461bcd60e51b815260206004820152600c60248201526b11d85b59481b9bdd081cd95d60a21b6044820152606401610d8f565b600083116125895760405162461bcd60e51b815260206004820152601e60248201527f546f6b656e4944206d7573742062652067726561746572207468616e203000006044820152606401610d8f565b60648311156125da5760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e4944206d757374206265206c657373207468616e203130300000006044820152606401610d8f565b60006125f2600a6125ec866001612f9a565b90612fb2565b90506000612616600a6126108461260a896001612f9a565b90612f9a565b906139d2565b60165490915060ff161561266b576012828154811061263757612637615804565b90600052602060002001546013828154811061265557612655615804565b9060005260206000200154935093505050915091565b6012818154811061267e5761267e615804565b90600052602060002001546013838154811061265557612655615804565b6031543410156126be5760405162461bcd60e51b8152600401610d8f906158ce565b6126c9602f336139de565b61271f5760405162461bcd60e51b815260206004820152602160248201527f43616c6c657220616c7265616479206120506c6174696e756d2053706f6e736f6044820152603960f91b6064820152608401610d8f565b602854610100900460ff166127465760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527f2a17bc9ecaa523f59bcc8f687d12681a264eb96ce29c997791e470452494e25b906020015b60405180910390a1565b6127863383613039565b6127a25760405162461bcd60e51b8152600401610d8f90615759565b6127ae848484846139f3565b50505050565b600080546001600160a01b031633146127df5760405162461bcd60e51b8152600401610d8f906156ef565b61101a613a26565b6037543410156128095760405162461bcd60e51b8152600401610d8f906158ce565b6128146035336139de565b6128605760405162461bcd60e51b815260206004820152601f60248201527f43616c6c657220616c726561647920612053696c7665722053706f6e736f72006044820152606401610d8f565b602854610100900460ff166128875760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527f4283f0c35d6a31fb27211adf7f4ce471038da9759d78a78dd0f046f9f9631bea90602001612772565b6000818152600360205260409020546060906001600160a01b03166129365760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610d8f565b6000612940613ae1565b905060008151116129605760405180602001604052806000815250612263565b8061296a84613af0565b60405160200161297b929190615905565b6040516020818303038152906040529392505050565b6000546001600160a01b031633146129bb5760405162461bcd60e51b8152600401610d8f906156ef565b610da4613bed565b6000546001600160a01b031633146117f85760405162461bcd60e51b8152600401610d8f906156ef565b606061101a603561302c565b60298054611b1190615724565b603454341015612a285760405162461bcd60e51b8152600401610d8f906158ce565b612a336032336139de565b612a7f5760405162461bcd60e51b815260206004820152601d60248201527f43616c6c657220616c7265616479206120476f6c642053706f6e736f720000006044820152606401610d8f565b602854610100900460ff16612aa65760405162461bcd60e51b8152600401610d8f906157d8565b6040513381527fa5616057c5d736bcbe378b5b403f0a9b48789881e741ee0217a74807ea95924c90602001612772565b60018110158015612ae8575060048111155b612b345760405162461bcd60e51b815260206004820152601b60248201527f51756172746572206d7573742062652031207468726f756768203400000000006044820152606401610d8f565b600360008281526024602052604090206004015460ff166003811115612b5c57612b5c615512565b14612b9e5760405162461bcd60e51b8152602060048201526012602482015271121bdb594814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b6003600082815260246020526040902060040154610100900460ff166003811115612bcb57612bcb615512565b14612c0d5760405162461bcd60e51b8152602060048201526012602482015271105dd85e4814d8dbdc9948139bdd0814d95d60721b6044820152606401610d8f565b60008181526038602052604090205460ff1615612c645760405162461bcd60e51b8152602060048201526015602482015274141c9a5e9948185b1c9958591e4818db185a5b5959605a1b6044820152606401610d8f565b33612c716107df83611fc3565b6001600160a01b031614612cc75760405162461bcd60e51b815260206004820181905260248201527f43616c6c657220646f6573206e6f74206f776e2077696e6e696e672074696c656044820152606401610d8f565b602854610100900460ff1615612d395760405162461bcd60e51b815260206004820152603160248201527f5072697a65732063616e6e6f7420626520636c61696d6564207768696c652041604482015270642041756374696f6e206973206c69766560781b6064820152608401610d8f565b603954612d785760405162461bcd60e51b815260206004820152600d60248201526c139bc81c1c9a5e99481c1bdbdb609a1b6044820152606401610d8f565b60395433906108fc90612d8c9060046139d2565b6040518115909202916000818181858888f19350505050612dac57600080fd5b6000908152603860205260409020805460ff19166001179055565b6000546001600160a01b03163314612df15760405162461bcd60e51b8152600401610d8f906156ef565b610da4613c13565b6000546001600160a01b03163314612e235760405162461bcd60e51b8152600401610d8f906156ef565b6001600160a01b038116612e885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d8f565b611606816137fa565b6019818154811061102f57600080fd5b60408051600a808252610160820190925260609160009190602082016101408036833701905050905060005b600a811015611afe5760138181548110612ee957612ee9615804565b9060005260206000200154828281518110612f0657612f06615804565b602090810291909101015280612f1b81615851565b915050612ecd565b60006001600160e01b0319821663780e9d6360e01b1480610d5f5750610d5f82613c9a565b602854610100900460ff16612f8d5760405162461bcd60e51b815260206004820152600b60248201526a20b21039b0b6329037b33360a91b6044820152606401610d8f565b6028805461ff0019169055565b6000612263828461586c565b600061226382846157c0565b6000612263828461594a565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ff382611a05565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6060600061226383613cea565b6000818152600360205260408120546001600160a01b03166130b25760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610d8f565b60006130bd83611a05565b9050806001600160a01b0316846001600160a01b031614806130f85750836001600160a01b03166130ed84610e63565b6001600160a01b0316145b80610dc957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff16610dc9565b826001600160a01b031661313f82611a05565b6001600160a01b0316146131a35760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610d8f565b6001600160a01b0382166132055760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610d8f565b613210838383613d46565b61321b600082612fbe565b6001600160a01b038316600090815260046020526040812080546001929061324490849061586c565b90915550506001600160a01b03821660009081526004602052604081208054600192906132729084906157c0565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600260115460ff1660048111156132ec576132ec615512565b1461332f5760405162461bcd60e51b815260206004820152601360248201527247616d6520696e2077726f6e6720737461746560681b6044820152606401610d8f565b6011805460ff1916600317905560178054604080516020808402820181019092528281526000939092909183018282801561338957602002820191906000526020600020905b815481526020019060010190808311613375575b505050505090506000805b6009811015613425576133d2601882815481106133b3576133b3615804565b90600052602060002001548260006133cb91906157c0565b6009610da6565b91506133df83828461182a565b925080601460008584815181106133f8576133f8615804565b6020026020010151815260200190815260200160002081905550808061341d90615851565b915050613394565b508151613439906012906020850190615002565b50601780548060200260200160405190810160405280929190818152602001828054801561348657602002820191906000526020600020905b815481526020019060010190808311613472575b5050505050915060005b6009811015613502576134af601982815481106133b3576133b3615804565b91506134bc83828461182a565b925080601560008584815181106134d5576134d5615804565b602002602001015181526020019081526020016000208190555080806134fa90615851565b915050613490565b508151613516906013906020850190615002565b50613526601a5460006001610da6565b90508061353b576016805460ff191690555050565b6016805460ff191660011790555050565b600060015b600581116135d857600260008281526024602052604090206004015460ff16600381111561358157613581615512565b1415806135b957506002600082815260246020526040902060040154610100900460ff1660038111156135b6576135b6615512565b14155b156135c657600091505090565b806135d081615851565b915050613551565b506001905090565b600160005260246020527fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d6547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d8557fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97da80547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d7547fbbbb3b1da0cb0951f34c5e9db4606f934b7367b5284f29163e9e6fe67e1e97d95561ffff191661030317905560025b6005811161160657602460006136ba60018461586c565b81526020808201929092526040908101600090812060020154848252602490935220546136e791906157c0565b6000828152602460208190526040822060028101939093556004909201805460ff1916600317905561371a60018461586c565b815260200190815260200160002060030154602460008381526020019081526020016000206001015461374d91906157c0565b60008281526024602052604090206003810191909155600401805461ff0019166103001790558061377d81615851565b9150506136a3565b8051611fbf90600d90602084019061503d565b602854610100900460ff16156137e95760405162461bcd60e51b815260206004820152601660248201527541642073616c6520616c72656164792061637469766560501b6044820152606401610d8f565b6028805461ff001916610100179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060115460ff16600481111561386357613863615512565b146138b05760405162461bcd60e51b815260206004820152601d60248201527f47616d65206d75737420626520696e20696e697469616c2073746174650000006044820152606401610d8f565b6011805460ff19166001179055611fbf81613d51565b6000612263828461595e565b611fbf828260405180602001604052806000815250613edb565b600c80546002919060ff19166001835b0217905550565b816001600160a01b0316836001600160a01b031614156139655760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610d8f565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612263828461597d565b6000612263836001600160a01b038416613f0e565b6139fe84848461312c565b613a0a84848484613f5d565b6127ae5760405162461bcd60e51b8152600401610d8f90615991565b601c546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a0823190602401602060405180830381865afa158015613a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab591906159e3565b1015613ad35760405162461bcd60e51b8152600401610d8f906159fc565b61101a601b54601c5461405b565b6060600d8054610de090615724565b606081613b145750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613b3e5780613b2881615851565b9150613b379050600a8361597d565b9150613b18565b6000816001600160401b03811115613b5857613b58615340565b6040519080825280601f01601f191660200182016040528015613b82576020820181803683370190505b5090505b8415610dc957613b9760018361586c565b9150613ba4600a8661594a565b613baf9060306157c0565b60f81b818381518110613bc457613bc4615804565b60200101906001600160f81b031916908160001a905350613be6600a8661597d565b9450613b86565b60015b6005811161160657613c01816141d7565b80613c0b81615851565b915050613bf0565b6000600c5460ff166002811115613c2c57613c2c615512565b14613c875760405162461bcd60e51b815260206004820152602560248201527f53616c6520616c7265616479207374617274656420616e642f6f7220636f6d706044820152641b195d195960da1b6064820152608401610d8f565b600c80546001919060ff191682806138fc565b60006001600160e01b031982166380ac58cd60e01b1480613ccb57506001600160e01b03198216635b5e139f60e01b145b80610d5f57506301ffc9a760e01b6001600160e01b0319831614610d5f565b606081600001805480602002602001604051908101604052809291908181526020018280548015613d3a57602002820191906000526020600020905b815481526020019060010190808311613d26575b50505050509050919050565b61100983838361448e565b600160115460ff166004811115613d6a57613d6a615512565b14613db75760405162461bcd60e51b815260206004820152601d60248201527f47616d65206d75737420626520696e20696e697469616c2073746174650000006044820152606401610d8f565b6011805460ff19166002179055604080516020808201849052825180830382018152918301909252805191012060005b6009811015613e49576040805160208101849052016040516020818303038152906040528051906020012060001c91508160188281548110613e2b57613e2b615804565b60009182526020909120015580613e4181615851565b915050613de7565b5060005b6009811015613eaf576040805160208101849052016040516020818303038152906040528051906020012060001c91508160198281548110613e9157613e91615804565b60009182526020909120015580613ea781615851565b915050613e4d565b5060408051602081018390520160408051601f198184030181529190528051602090910120601a555050565b613ee58383614546565b613ef26000848484613f5d565b6110095760405162461bcd60e51b8152600401610d8f90615991565b6000818152600183016020526040812054613f5557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d5f565b506000610d5f565b60006001600160a01b0384163b1561405057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613fa1903390899088908890600401615a47565b6020604051808303816000875af1925050508015613fdc575060408051601f3d908101601f19168201909252613fd991810190615a7a565b60015b614036573d80801561400a576040519150601f19603f3d011682016040523d82523d6000602084013e61400f565b606091505b50805161402e5760405162461bcd60e51b8152600401610d8f90615991565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610dc9565b506001949350505050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952848660006040516020016140cb929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016140f893929190615a97565b6020604051808303816000875af1158015614117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061413b9190615abe565b50600083815260106020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526141979060016157c0565b600085815260106020526040902055610dc98482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b600081116142275760405162461bcd60e51b815260206004820152601e60248201527f51756172746572206d7573742062652067726561746572207468616e203000006044820152606401610d8f565b600581111561429e5760405162461bcd60e51b815260206004820152603a60248201527f51756172746572206d757374206265206c657373207468616e206f722065717560448201527f616c20746f20352c20696e636c75646573206f76657274696d650000000000006064820152608401610d8f565b60008181526024602052604081206004015460ff1660038111156142c4576142c4615512565b146142e15760405162461bcd60e51b8152600401610d8f90615adb565b60008082815260246020526040902060040154610100900460ff16600381111561430d5761430d615512565b1461432a5760405162461bcd60e51b8152600401610d8f90615adb565b60405180604001604052808281526020016001815250602560006143eb60246000868152602001908152602001600020600501805461436890615724565b80601f016020809104026020016040519081016040528092919081815260200182805461439490615724565b80156143e15780601f106143b6576101008083540402835291602001916143e1565b820191906000526020600020905b8154815290600101906020018083116143c457829003601f168201915b5050505050614694565b81526020019081526020016000206000820151816000015560208201518160010155905050604051806040016040528082815260200160028152506025600061444e60246000868152602001908152602001600020600601805461436890615724565b81526020808201929092526040908101600090812084518155938301516001909401939093559282526024905220600401805461ffff1916610101179055565b6001600160a01b0383166144e9576144e481600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b61450c565b816001600160a01b0316836001600160a01b03161461450c5761450c838261477f565b6001600160a01b038216614523576110098161481c565b826001600160a01b0316826001600160a01b0316146110095761100982826148cb565b6001600160a01b03821661459c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610d8f565b6000818152600360205260409020546001600160a01b0316156146015760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610d8f565b61460d60008383613d46565b6001600160a01b03821660009081526004602052604081208054600192906146369084906157c0565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006027546146ab6020546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156146f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061471591906159e3565b10156147335760405162461bcd60e51b8152600401610d8f906159fc565b600061474960265430634357855e60e01b61490f565b6040805180820190915260048152630e0c2e8d60e31b602082015290915061477390829085614934565b61226381602754614952565b6000600161478c84611b9e565b614796919061586c565b6000838152600860205260409020549091508082146147e9576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b60095460009061482e9060019061586c565b6000838152600a60205260408120546009805493945090928490811061485657614856615804565b90600052602060002001549050806009838154811061487757614877615804565b6000918252602080832090910192909255828152600a909152604080822084905585825281205560098054806148af576148af615b21565b6001900381819060005260206000200160009055905550505050565b60006148d683611b9e565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b6149176150b0565b61491f6150b0565b61492b8186868661496c565b95945050505050565b608083015161494390836149a9565b608083015161100990826149a9565b602154600090612263906001600160a01b031684846149c0565b6149746150b0565b6149848560800151610100614a53565b50509183526001600160a01b031660208301526001600160e01b031916604082015290565b6149b68260038351614ab8565b6110098282614bbf565b6022546000906149d18160016157c0565b602255835160408086015160808701515191516000936320214ca360e11b93614a099386938493923092918a91600191602401615b37565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050614a4986838684614be6565b9695505050505050565b604080518082019091526060815260006020820152614a7360208361594a565b15614a9b57614a8360208361594a565b614a8e90602061586c565b614a9890836157c0565b91505b506020828101829052604080518085526000815290920101905290565b6017816001600160401b031611614adc576127ae8360e0600585901b168317614d44565b60ff816001600160401b031611614b1857614b02836018611fe0600586901b1617614d44565b506127ae836001600160401b0383166001614d69565b61ffff816001600160401b031611614b5557614b3f836019611fe0600586901b1617614d44565b506127ae836001600160401b0383166002614d69565b63ffffffff816001600160401b031611614b9457614b7e83601a611fe0600586901b1617614d44565b506127ae836001600160401b0383166004614d69565b614ba983601b611fe0600586901b1617614d44565b506127ae836001600160401b0383166008614d69565b60408051808201909152606081526000602082015261226383846000015151848551614d8f565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152602390925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2602054604051630200057560e51b81526001600160a01b0390911690634000aea090614ca990889087908790600401615a97565b6020604051808303816000875af1158015614cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cec9190615abe565b610dc95760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610d8f565b6040805180820190915260608152600060208201526122638384600001515184614e79565b604080518082019091526060815260006020820152610dc9848560000151518585614ed5565b6040805180820190915260608152600060208201528251821115614db257600080fd5b6020850151614dc183866157c0565b1115614df457614df485614de487602001518786614ddf91906157c0565b614f56565b614def90600261595e565b614f67565b600080865180518760208301019350808887011115614e135787860182525b505050602084015b60208410614e535780518252614e326020836157c0565b9150614e3f6020826157c0565b9050614e4c60208561586c565b9350614e1b565b51815160001960208690036101000a019081169019919091161790525083949350505050565b60408051808201909152606081526000602082015283602001518310614eae57614eae8485602001516002614def919061595e565b835180516020858301018481535080851415614ecb576001810182525b5093949350505050565b6040805180820190915260608152600060208201526020850151614ef985846157c0565b1115614f0d57614f0d85614de486856157c0565b60006001614f1d84610100615c74565b614f27919061586c565b9050855183868201018583198251161781525080518487011115614f4b5783860181525b509495945050505050565b600081831115611afe575081610d5f565b8151614f738383614a53565b506127ae8382614bbf565b828054614f8a90615724565b90600052602060002090601f016020900481019282614fac5760008555614ff2565b82601f10614fc55782800160ff19823516178555614ff2565b82800160010185558215614ff2579182015b82811115614ff2578235825591602001919060010190614fd7565b50614ffe9291506150eb565b5090565b828054828255906000526020600020908101928215614ff2579160200282015b82811115614ff2578251825591602001919060010190615022565b82805461504990615724565b90600052602060002090601f01602090048101928261506b5760008555614ff2565b82601f1061508457805160ff1916838001178555614ff2565b82800160010185558215614ff25791820182811115614ff2578251825591602001919060010190615022565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b5b80821115614ffe57600081556001016150ec565b6001600160e01b03198116811461160657600080fd5b60006020828403121561512857600080fd5b813561226381615100565b60006020828403121561514557600080fd5b5035919050565b60008060006060848603121561516157600080fd5b505081359360208301359350604090920135919050565b60005b8381101561519357818101518382015260200161517b565b838111156127ae5750506000910152565b600081518084526151bc816020860160208601615178565b601f01601f19169290920160200192915050565b60208152600061226360208301846151a4565b80356001600160a01b03811681146121b557600080fd5b6000806040838503121561520d57600080fd5b615216836151e3565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156152655783516001600160a01b031683529284019291840191600101615240565b50909695505050505050565b60008060006060848603121561528657600080fd5b61528f846151e3565b925061529d602085016151e3565b9150604084013590509250925092565b600080602083850312156152c057600080fd5b82356001600160401b03808211156152d757600080fd5b818501915085601f8301126152eb57600080fd5b8135818111156152fa57600080fd5b86602082850101111561530c57600080fd5b60209290920196919550909350505050565b6000806040838503121561533157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561537e5761537e615340565b604052919050565b60006001600160401b0383111561539f5761539f615340565b6153b2601f8401601f1916602001615356565b90508281528383830111156153c657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156153ef57600080fd5b81356001600160401b0381111561540557600080fd5b8201601f8101841361541657600080fd5b610dc984823560208401615386565b60008060006060848603121561543a57600080fd5b83356001600160401b038082111561545157600080fd5b818601915086601f83011261546557600080fd5b813560208282111561547957615479615340565b8160051b925061548a818401615356565b828152928401810192818101908a8511156154a457600080fd5b948201945b848610156154c2578535825294820194908201906154a9565b9a918901359950506040909701359695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015615265578351835292840192918401916001016154f6565b634e487b7160e01b600052602160045260246000fd5b6004811061553857615538615512565b9052565b60006101008a83528960208401528860408401528760608401526155636080840188615528565b61557060a0840187615528565b8060c0840152615582818401866151a4565b905082810360e084015261559681856151a4565b9b9a5050505050505050505050565b6000602082840312156155b757600080fd5b612263826151e3565b60208101600383106155d4576155d4615512565b91905290565b801515811461160657600080fd5b600080604083850312156155fb57600080fd5b615604836151e3565b91506020830135615614816155da565b809150509250929050565b6000806000806080858703121561563557600080fd5b61563e856151e3565b935061564c602086016151e3565b92506040850135915060608501356001600160401b0381111561566e57600080fd5b8501601f8101871361567f57600080fd5b61568e87823560208401615386565b91505092959194509250565b60208101600583106155d4576155d4615512565b600080604083850312156156c157600080fd5b6156ca836151e3565b91506156d8602084016151e3565b90509250929050565b60208101610d5f8284615528565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061573857607f821691505b60208210811415611afe57634e487b7160e01b600052602260045260246000fd5b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082198211156157d3576157d36157aa565b500190565b60208082526012908201527141642073616c65206e6f742061637469766560701b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252601c908201527f51756172746572203120207072697a65206e6f7420636c61696d656400000000604082015260600190565b6000600019821415615865576158656157aa565b5060010190565b60008282101561587e5761587e6157aa565b500390565b6020808252602b908201527f486f6d652073636f7265206d7573742062652077697468696e2074686520626f60408201526a756e6473203020746f203960a81b606082015260800190565b6020808252601f908201527f43616c6c6572206d7573742073656e6420636f727265637420616d6f756e7400604082015260600190565b60008351615917818460208801615178565b83519083019061592b818360208801615178565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261595957615959615934565b500690565b6000816000190483118215151615615978576159786157aa565b500290565b60008261598c5761598c615934565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000602082840312156159f557600080fd5b5051919050565b6020808252602b908201527f4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e74726163742060408201526a1dda5d1a0819985d58d95d60aa1b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614a49908301846151a4565b600060208284031215615a8c57600080fd5b815161226381615100565b60018060a01b038416815282602082015260606040820152600061492b60608301846151a4565b600060208284031215615ad057600080fd5b8151612263816155da565b60208082526026908201527f517561727465722073636f7265206c6f6f6b757020616c726561647920696e696040820152651d1a585d195960d21b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090615596838201856151a4565b600181815b80851115615bcb578160001904821115615bb157615bb16157aa565b80851615615bbe57918102915b93841c9390800290615b95565b509250929050565b600082615be257506001610d5f565b81615bef57506000610d5f565b8160018114615c055760028114615c0f57615c2b565b6001915050610d5f565b60ff841115615c2057615c206157aa565b50506001821b610d5f565b5060208310610133831016604e8410600b8410161715615c4e575081810a610d5f565b615c588383615b90565b8060001904821115615c6c57615c6c6157aa565b029392505050565b60006122638383615bd356fea2646970667358221220709561ed20de7115c4727fa8651d38c8f9e3adad46ad49ac7fa8b7920e9c1aa664736f6c634300080b0033

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.