ETH Price: $2,490.83 (-2.51%)

Contract

0x2836590b5c6678dB15415D71a439FeA49B8b7C8b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Renounce Ownersh...136840952021-11-25 14:47:131064 days ago1637851633IN
0x2836590b...49B8b7C8b
0 ETH0.00301453127.6155972
Toggle Purchase136840762021-11-25 14:43:141064 days ago1637851394IN
0x2836590b...49B8b7C8b
0 ETH0.00283469118.79020226
Claim136737312021-11-23 23:19:541066 days ago1637709594IN
0x2836590b...49B8b7C8b
0 ETH0.00302917104.64923311
Claim136734692021-11-23 22:24:321066 days ago1637706272IN
0x2836590b...49B8b7C8b
0 ETH0.0029921103.36849219
Claim136734482021-11-23 22:21:091066 days ago1637706069IN
0x2836590b...49B8b7C8b
0 ETH0.002750495.0186145
Claim136734432021-11-23 22:20:111066 days ago1637706011IN
0x2836590b...49B8b7C8b
0 ETH0.00292511101.05428134
Toggle Claim136734422021-11-23 22:20:001066 days ago1637706000IN
0x2836590b...49B8b7C8b
0 ETH0.0028084195.84691323
Claim136734322021-11-23 22:18:221066 days ago1637705902IN
0x2836590b...49B8b7C8b
0 ETH0.0188524291.79068005
Claim136734272021-11-23 22:17:131066 days ago1637705833IN
0x2836590b...49B8b7C8b
0 ETH0.0186908391.00388075
Claim136734252021-11-23 22:16:461066 days ago1637705806IN
0x2836590b...49B8b7C8b
0 ETH0.113328584.44589795
Claim136734202021-11-23 22:16:071066 days ago1637705767IN
0x2836590b...49B8b7C8b
0 ETH0.0195605796.55491428
Claim136734162021-11-23 22:15:461066 days ago1637705746IN
0x2836590b...49B8b7C8b
0 ETH0.07825569101.51146964
Claim136734112021-11-23 22:14:461066 days ago1637705686IN
0x2836590b...49B8b7C8b
0 ETH0.02165905106.91342361
Claim136734112021-11-23 22:14:461066 days ago1637705686IN
0x2836590b...49B8b7C8b
0 ETH0.02165905106.91342361
Claim136734072021-11-23 22:13:421066 days ago1637705622IN
0x2836590b...49B8b7C8b
0 ETH0.0182512890.09197001
Claim136734032021-11-23 22:13:001066 days ago1637705580IN
0x2836590b...49B8b7C8b
0 ETH0.045402792.74470468
Claim136734012021-11-23 22:12:571066 days ago1637705577IN
0x2836590b...49B8b7C8b
0 ETH0.0324312394.09494974
Claim136733992021-11-23 22:12:361066 days ago1637705556IN
0x2836590b...49B8b7C8b
0 ETH0.0705469191.51181178
Claim136733942021-11-23 22:12:071066 days ago1637705527IN
0x2836590b...49B8b7C8b
0 ETH0.02335527115.28630909
Claim136733942021-11-23 22:12:071066 days ago1637705527IN
0x2836590b...49B8b7C8b
0 ETH0.03973515115.28630909
Claim136733932021-11-23 22:12:001066 days ago1637705520IN
0x2836590b...49B8b7C8b
0 ETH0.03991021114.86111704
Claim136733852021-11-23 22:10:161066 days ago1637705416IN
0x2836590b...49B8b7C8b
0 ETH0.02585948125.9073876
Claim136733842021-11-23 22:10:131066 days ago1637705413IN
0x2836590b...49B8b7C8b
0 ETH0.04391273127.40701145
Claim136733842021-11-23 22:10:131066 days ago1637705413IN
0x2836590b...49B8b7C8b
0 ETH0.02581074127.40701145
Claim136733842021-11-23 22:10:131066 days ago1637705413IN
0x2836590b...49B8b7C8b
0 ETH0.04426947127.40701145
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Satoshiverse

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion
File 1 of 15 : Satoshiverse.sol
//SPDX-License-Identifier: GNU General Public License v3.0

          
  //                      ******,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,**,,,,,,,,,,,,,,,,,,,,,,,,,,,,************                                          
  //                    *******,,,,,*,,,,*,*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#,/****/**//*//**#****                                        
  //                  ************* *,,*,*,/,,,..............,,,,,,,,,,,,,,,,,,,,*/(,/****(/,(*//////*****                                         
  //                ******,,,,*,,,**,,,,*./,,,. ............,,,,,,,,,,,,,,,,,,***/,******/(,(//*/*////*/###,                                          
  //               **,,,,,,,,,,,**,,,*, ,,,,,.  ..........,,,,,,,,,,,,,,,,,***,(,******/(,#//**/*///////,###,                                          
  //              **,,,,,,,,,*,*,**,,,*,,  ,/**,...*......,,,,,,,,,,,,*,,**//#/,*//******(*(///////////((((##.                                          
  //            *****,,,,,,,,,,,,*,**,,,,,,,,,,. ..*/,,,,**************/*/(*,,,/**/*******//,/*///*///////((##,                                          
  //          ******,,,,,,,,,,,,*,*,,,,,,,.,,,,.....,,,,**.,/,**.,,******,**************//*,////////////(((###%,                                          
  //        ********,*,,,,,,,*,,*,*,,,,,,,,,.....,,,.  ...,,/,**.,/,,******,,,,**********/**/**///**////(((###%%,                                          
  //       ********,*,,,,,,,,*,*,/*,*,,,,,..  .,,.....,,,,,*/.*/.,/**,,,,,,************///**,///*//////((((####%%(                                          
  //      **/********,**,,,,,*,,,,,,,,,.,,,,,,,....,,,,...,*(,/*.,/,,*****,,,*******,***//,,/***///////((######%%#/,                                          
  //      **********,,**,,,****,,,,,*,,,,,,,,....,,**,,,****(,**,,(***,********,,****////(,(*///////////(((#####%%%,                                          
  //     ************,,***,,,****,,,,***,,...,,,,,,....,,*/**(,/*,,(//***,,,***********///(,/**/////(////(########%%                                          
  //    ,///********,,,***,,,*****,,*,,******,,,,,****,,,,**/,/**,/,,,*********////******(,(//((////*//((########%%&,                                          
  //    *//*********,,,,*****,,,*******,*********,********/(,/*,,(//****////***,,,**//(/(,(((///*//((((#######%%%%%**                                          
  //    //*/************,,*****///*/*//****,,,*****,,,,***,//,/**,/*///***,,,**//((////*((*////((((((((((#######%%%%(,                                          
  //    *,(******************,**(/(/*****//**,,,,**********(,/****/****////////****//(((#/(((((((///(((((######%%#%%,,                                          
  //    /***/*/*/*//(((############%(##((((///////***/**(,#.,/*/,/(*///(///////((##%%%%&%&%&&&&&&&&&&&&&&&%%%###%#%%%*                                          
  //   *&/**//*/((###%&&#%%%%%%%%%%%#(((((((((###/(#%,,,,//*******/**,,*/((#&%%#%#######%&&&&&&&&&&&&@&&&&&&%%%%%##&@(,                                          
  //   &&&(*///((((#%%%(#*******///*//////(#%####(%,(******,******////((#%%%%%%%%%(////////////////(&&&&@&&&&%%%%#&&&@/,                                          
  //   %&,#%/**(((/#/#/*(*%***************/////#%%#(((/*,,**********///(%%%%%&%#////////////////////@%%%&@&&%&&%%#%&%#&,                                          
  //   (,*&&**(##,********,#/***************/////%(/******************#%%%%%////////////////****(//%%%%%%%##&&%%%&&##&#,                                          
  //   //*/&&#,/,,(*//********,/#*,,,,,,,,**/#%//*//****,,,,,,,****//(%#%%%%&&@%(/////***,*/&/*/((((((#%%&%#%%#@@@&#%&#*                                          
  //   #*#,(&/,,,,,**,*%,//*********************/******,,**********//(##%%%#%%%%%%*********///(//#%#(&/((/#####%@##@#&#*                                          
  //   #%**,#/,,,,,,,,,,*,,,,*##(***,,/,*((,.,*,*******,,,,,****,,,,*(###%%%%#%,*/((/****(*/#%#***///////((((#%%%###@%#,                                          
  //   *%*(#&/*,,,,,,,,,,,,,,,,,,,,..    .,*,,*********************//###%%%////*/*,****,*************////((((##%@%%%%##,                                          
  //   *(,(#**,,,,,,,,,,,,,,,,,,...   .,(,.*,,*****/***,,,,,,,,***//####%*,****/,*/*,,,,,,*,*******////((((##%#&&#%%%//                                          
  //   (//(*******,,,,,,,,,,,,,,,,......,/,*,,,,,,********,*********/##%%//*,,,*,*//*,,,,,,*******////(((###%%%%%%&%%%#                                          
  //    ((#*/*********,,,,,,,,,,,,,,,,,,./,,,**,****//**,,,,,,,*,,,*(#%%%///////*,****,,,,,,,,,,,,,,,,,,###%%%%%%&#%%%(                                          
  //    ((((#*#*********,,,,,,,,,,,,,,,,,*,,******///******,,,*/***/##%%(/****//(%/,,,,,,,,,,,,,,,,***##%%%%%%%&%&%%%%/                                          
  //     ((((((/*#***************,,,,,,***#*//**(//(///**,,****,****(#%%////(/(((,,,,,,*************##%%%%%%&%&%&%%%%(                                          
  //     ((((((((#*(////**********************,(/*/(//***,,,***,*/**#%%%((#/%(*/,**************###%%%%%%%%&%&&&&%%%%#                                          
  //       (((((((((*(%%(**///*********************//(//****,***,****##%%#%******************#%%%%&&%%&@&&&&&&&&%%%%                                          
  //        ((((((((#(/#//((**(%(***************,*****#//*////(//(((#/%#%%(****************###%#@&%%%&&%&&&&&&&&%%%                                          
  //         (((((((#(#%//////////************,,,,****(//%#(/***/(#&&@%%&%***************%#%%%&%%&&%%&&&&&&&&&%%%%%                                          
  //         (((((((((((#(///////#/*****%/*****,,,***(#/(#%&&%%%%%%&&@&&&&&(***********#@%#%%%%&%%%&&&&&&&&&&&&&%%                                          
  //          (%(((((((((/(////*((******#&#/****#*,,,********(%(%%%%%%%%%%*//#*******&&@%%%%%&&&%&&&&&&&&&&&&&&%&                                          
  //           ##%(((((#(/%%*////********@&%&&&&&&&&&&&(&*********//%&&&&&&&@@@@&&@@%%%%%%%%%%%%&@@&&&&&&&%&%%%%                                          
  //            /#*%//%&&%%/////**********/@@@@@@@@@@@@@&/,,,,,,,**%@@@@@@@@@@@@@@&%%%%%%%%%%%%%&%&&@@&%&&#&%%%                                          
  //            ///////(%/#/////********,#/**,,,,,,,,,,,,,,,,,,,,,*******/////%%%%&&%%%%%%%%%%%&&&&&@&%%%%%%%%                                          
  //             /*/*///////#//*************,,,,,,,,,,*///******///(((#((/////((((#%%%%%%%%%%%%%%%&&%%%%%%%%%                                          
  //              //******/(//**********#*******(&&&&&&&&&&&&&&&&&&&&&&@@@@&&%##%%%%&%%%%%%%%%%%&%%%%%%%%%&*                                          
  //              *(/******///**/%#(****%*&&&&%******,,. .,***********/////(%%&&@@@&&%%%&&@@%%%&%%%%%%%%%&(                                          
  //               (,(*******((/*****************,,,,,,,,,,,,,,,,,********/(######%#%%%%%%%%%&&&%%%%%%%&#%                                          
  //                ((,#*/***********************/////////****/////((#%%&&&%%%####%##%%%%%%%%%%%%%%%%&%&&                                          
  //                //((/*(*///********************///((##%%&&&&&&&&&&%%%####(#((##%%%%%%%%%%%%%%%&#&&&&*                                          
  //                 ,((//#*/*#******************////////////((#(#((#%#&%####((#%%%%%%%%%%%%%%&%%%&&%&&*                                          
  //                   ((((((*(/,(*********************************//////((((#(######%%%%%%&#%%%&&&&&%                                          
  //                    ##(((#*((#,#***********************/,***(***/////////(((((##%%%%%&%&&%%&&&&&                                          
  //                      ##((#/#(((,#**************(/,,*,/,//((/,#**,/%(////(((((%#%%%%%&&&%%&&&&&                                          
  //                       ((((((((((//(,#*/*###/,,,/#,%(,#&&&&&#&&@*(*(#%//*/%%&&(#%&#&%&&&&%&&&&                                          
  //                         ((()))))(/(////,,*##/,*/(((,(%%@*,,,**&@*%((/(((#(%&&#((&%&%%%&&&&                                         
  //                            (()))))))(///((/(/**(/*(#,,#@*//***/*(##(@/(/((/(#&#&&%&%%%&&&                                          
  //                               ()()()(()#(((/*(((*@*&,/(@@#(****//((@@@/%(#%&#%#&%%&&&()                                         
  //                                 ())))#####%(&/&,@@@@@(%/,/(####*(&(@@@@@@&&&&&&&())                                       
  //                                      &&(%*%@@@@@#(%%%#**#%%&%@@@@@@@()()()()()())                                         
  //                                         ()()()&^()()@@@@@@@@@@@@@@@&*&()()())()                                          
  //                                                
  //                                               
  //

/*
*Welcome to the Satoshiverse! The Satoshiverse is an epic comic NFT collaboration between Apollo NFT Studios, Jose Delbo, and YOU, the NFT community. 
*It tells the story of our hero, Satoshi The Creator and his quest to save the world from the Defenders of Fiat and the many other foes who lie ahead.
*/ 
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/ILegionnaire.sol";
import "./utils/Operatorable.sol";
import "./helpers/NumberHelper.sol";


 /**
    * Satoshiverse Legionnaire Avatar NFT Contract V1 
    * Provided by Satoshiverse LLC
    * Authored by brnaldomesi a Senior Solidity Developer @ Herasoft
    */
contract Satoshiverse is VRFConsumerBase, Operatorable, ReentrancyGuard {
  ILegionnaire public legionnaire;

  // Payable Address for the Initial Sale
  address payable public svEthAddr = payable(0x981268bF660454e24DBEa9020D57C2504a538C57);
  
  uint16 _claimSV = 1;
  uint16 _purchaseSV = 3301;

  uint256 SV_MAX = 10000;
  
  uint256 _activeDateTime; 
  uint256 INTERVAL = 3600;
  uint256 randNonce;
  
  // Chainlink
  uint256 randomNess;
  uint256 internal fee;
  bytes32 internal keyHash;
  
  bool revealState;

  bool public claimState = true;
  bool public purchaseState = true;

  bytes32 requestId;

  string[] public leftoverUris;

  mapping(address => mapping(string => uint8)) public tokensCount;

  // Only through Day 4 Mints
  mapping(address => uint8) public purchasedSoFar;
  

  // Set Initial Addresses and Variables Upon Deployment
  constructor(
    address _operator,
    address _uriSetter,
    address _legionnaire,
    address _vrfCoordinator,
    address _link,
    bytes32 _keyHash,
    uint256 _fee
  ) 
    VRFConsumerBase(_vrfCoordinator, _link)
  {
    keyHash = _keyHash;
    fee = _fee;

    legionnaire = ILegionnaire(_legionnaire);

    addOperator(_operator);
    addURISetter(_uriSetter);
  }

// Change the Payment Adddress if Necessary
  function setPaymentAddress(address _svEthAddr) external onlyOwner {
    svEthAddr = payable(_svEthAddr);
  }

 // Operator Account Sets the Contract with a List of Presale Holders Addresses
 // Snapshot was taken 12pm EST Monday November 22, 2021
  function seedPresaleWhiteList(address[] calldata users, string calldata tokenType, uint8[] calldata counts) external onlyOperator {
    require(users.length == counts.length, "Mismatched presale addresses and counts");

    for(uint256 i = 0; i < users.length; i++) {
      tokensCount[users[i]][tokenType] += counts[i];
    }
  }

// Operator can toggle the claim mechanism as On / Off
  function toggleClaim() external onlyOperator {
    claimState = !claimState;
  }
// Operator can toggle the purchasing mechanism as On / Off for the Sale of Legionnaires
  function togglePurchase() external onlyOperator {
    purchaseState = !purchaseState;
  }

// Returns a Random Legionnaire from the set of Random Legionniares 
  function popRandomTokenURI() internal returns(string memory) {
    // leftOverUris === unpurchased / unclaimed Legionnaires 
    uint256 randomIndex = getRandomIndex(leftoverUris.length);
    string memory tokenURI = leftoverUris[randomIndex];
    leftoverUris[randomIndex] = leftoverUris[leftoverUris.length - 1];
    leftoverUris.pop();
    return tokenURI;
  }

  // A secure function for Claiming Legionnaires on a specific window of time dependant on the presale token the user has. 
  function claim(uint256 claimedCount) external nonReentrant {
    require(claimState, "Claim is disabled");
    require(block.timestamp >= _activeDateTime, "Presale not start yet");
    
    uint8 genesisTokenCount = tokensCount[msg.sender]['genesis'];
    uint8 platinumTokenCount = tokensCount[msg.sender]['platinum'];
    uint8 goldTokenCount = tokensCount[msg.sender]['gold'];
    uint8 silverTokenCount = tokensCount[msg.sender]['silver'];

    uint256 passedDays = NumberHelper.daysSince(_activeDateTime, INTERVAL);

    uint256 totalCount = genesisTokenCount;
    totalCount += platinumTokenCount;
    totalCount += goldTokenCount;
    totalCount += silverTokenCount;

    uint256 minCount = NumberHelper.min(totalCount, claimedCount);
    require(_claimSV + minCount <= 3301, "No legionnaires left for presale");

    uint256 i = 0;
    uint256 tokenId;
    string memory tokenURI;

    while(i < minCount) {
      if(genesisTokenCount > 0) {
        genesisTokenCount--;
      } else if (passedDays >= 1 && platinumTokenCount > 0) {
        platinumTokenCount--;
      } else if (passedDays >= 2 && goldTokenCount > 0) {
        goldTokenCount--;
      } else if (passedDays >= 3 && silverTokenCount > 0) {
        silverTokenCount--;
      }

      if(revealState) {
        tokenURI = popRandomTokenURI();
      }

      tokenId = _claimSV;
      _claimSV++;
      
      legionnaire.safeMint(msg.sender, tokenId);
      if(!revealState) {
        legionnaire.setTokenURI(tokenId, "placeholder");
      } else {
        legionnaire.setTokenURI(tokenId, tokenURI);
      }
      i++;
    }

    tokensCount[msg.sender]['genesis'] = genesisTokenCount;
    tokensCount[msg.sender]['platinum'] = platinumTokenCount;
    tokensCount[msg.sender]['gold'] = goldTokenCount;
    tokensCount[msg.sender]['silver'] = silverTokenCount;
  }

  
// A secure function to purchase a Legionnaire 
  function purchase(uint256 count) external payable nonReentrant {
    require(purchaseState, "Purchase is disabled");
    require(block.timestamp >= _activeDateTime, "Sale not start yet");
    uint256 passedDays = NumberHelper.daysSince(_activeDateTime, INTERVAL);
    require(passedDays > 3, "Public sale not start yet");
    require(msg.value >= count * .1 ether, "Not enough ether");
    
    uint256 limit; 
    if(passedDays < 5) {
      limit = purchasedSoFar[msg.sender];
      require(count + limit > 0 && count + limit < 3, "Not allowed to purchase that amount");
      purchasedSoFar[msg.sender] += uint8(count);
     // on Day 5 you can only purchase up to 10 / transaction 
    } else if (passedDays < 6) {
      require(count < 11, "Up to 10 only");
    }

    limit = count;
    require(_purchaseSV + limit <= SV_MAX + 1, "No legionnaires left for public sale");

    uint256 tokenId;
    string memory tokenURI;


    for (uint256 i = 0; i < limit; i++) {
      if(revealState) {
        tokenURI = popRandomTokenURI();
      }

      tokenId = _purchaseSV;
      _purchaseSV++;
    
      legionnaire.safeMint(msg.sender, tokenId);
      if(!revealState) {
        legionnaire.setTokenURI(tokenId, "placeholder");
      } else {
        legionnaire.setTokenURI(tokenId, tokenURI);
      }
    }

    (bool sent, ) = svEthAddr.call{ value: limit * .1 ether }("");
    require(sent, "Failed to send Ether");

    if(msg.value > count * .1 ether) {
      (sent, ) = payable(msg.sender).call{ value: msg.value - limit * .1 ether }("");
      require(sent, "Failed to send change back to user");
    }
  }

// Operator can set the start time in UNIX stamp for the claim and sale period 
  function setActiveDateTime(uint256 activeDateTime) external onlyOperator {
    _activeDateTime = activeDateTime;
  }


// Operator pushes the set of remaining unclaimed legionnaires going into self-reveal phase
  function pushLeftOverUris(string[] memory leftoverUris_) external onlyOperator {
    require(!revealState, "Self-Reveal already begun");

    for(uint256 i = 0; i < leftoverUris_.length; i++) {
      leftoverUris.push(leftoverUris_[i]);
    }
  }

  // Returns the left over URIs array length
  function getLeftOverUrisLength() public view returns(uint256) {
    return leftoverUris.length;
  }

/*
*
* A function for the Operator to start the period of time for the user to reveal the URI upon mint
*
*/  
  function beginSelfRevealPeriod() external onlyOperator {
    revealState = true;
  }
   
   // A Random Index between zero and range leveraging VRF 
  
  function getRandomIndex(uint256 range) internal returns(uint256) {
    randNonce++;
    return uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender, randNonce, randomNess))) % range;
  }

// Operator can batch mint and trasnfer remaining Legionnaires to a secure address

  function safeBatchMintAndTransfer(address holder, bool isSetUri, uint16 batchSize) external onlyOperator {
    require(revealState, "Have to begin Self-Reveal");
    require(_purchaseSV + batchSize <= SV_MAX + 1, "No legionnaires left for public sale");

    for(uint256 i = _purchaseSV; i < _purchaseSV + batchSize; i++) {
      legionnaire.safeMint(holder, i);
      if(isSetUri) {
        legionnaire.setTokenURI(i, "placeholder");
      }
    }

    _purchaseSV = uint16(_purchaseSV + batchSize);
  }

 // URISetter will call this to randomly pair URIs with NFT Metadata to tokens.
  function pairLegionnairesWithUris(uint16[] memory _tokenIds, string[] memory _tokenURIs) external onlyURISetter {
    require(_tokenIds.length == _tokenURIs.length, "Mismatched ids and URIs");
    require(_tokenIds.length > 0, "Empty parameters");

    while(_tokenIds.length > 0) {
      uint256 length = _tokenIds.length;
      uint256 randomIndex = getRandomIndex(length);
      legionnaire.setTokenURI(_tokenIds[length - 1], _tokenURIs[randomIndex]);
      _tokenURIs[randomIndex] = _tokenURIs[length - 1];
      delete _tokenIds[length - 1];
      delete _tokenURIs[length - 1];

      assembly { mstore(_tokenIds, sub(mload(_tokenIds), 1)) }
      assembly { mstore(_tokenURIs, sub(mload(_tokenURIs), 1)) }
    }
  }

 // Function saves the random nonce from VRF into the contract 
  function fulfillRandomness(bytes32 _requestId, uint256 _randomness) internal override {
    if(requestId == _requestId) {
      randomNess = _randomness;
    }
  }

 // Owner can decrease the total supply not ever exceeding 10,000 Legionnaires
  function setMaxLimit(uint256 maxLimit) external onlyOwner {
    require(maxLimit < 10001, "Exceed max limit 10000");
    SV_MAX = maxLimit;
  }

 // Operator Calls to VRF for a random nonce
  function requestRandomToVRF() external onlyOperator {
    require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK");
    requestId = requestRandomness(keyHash, fee);
  }
}

File 2 of 15 : 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     constuctor(<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 constant private 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 immutable internal LINK;
  address immutable private vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 /* keyHash */ => uint256 /* 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 3 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 4 of 15 : ILegionnaire.sol
//SPDX-License-Identifier: GNU General Public License v3.0
pragma solidity ^0.8.0;

// Interface for Legionnaire token
interface ILegionnaire {
  
  function safeMint(address to, uint256 tokenId) external;

  function setTokenURI(uint256 tokenId, string memory _tokenURI) external;
}

File 5 of 15 : Operatorable.sol
//SPDX-License-Identifier: GNU General Public License v3.0
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

contract Operatorable is Ownable, AccessControl {
  bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
  bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");

  /**
    * @dev Restricted to members of the `operator` role.
    */
  modifier onlyOperator() {
    require(hasRole(OPERATOR_ROLE, msg.sender), "Operatorable: CALLER_NO_OPERATOR_ROLE");
    _;
  }

  modifier onlyURISetter() {
    require(hasRole(URI_SETTER_ROLE, msg.sender), "Settable: CALLER_NO_URI_SETTER_ROLE");
    _;
  }

  constructor() {
    _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    _setupRole(OPERATOR_ROLE, msg.sender);
    _setupRole(URI_SETTER_ROLE, msg.sender);
  }

  /**
    * @dev Add an `_account` to the `operator` role.
    */
  function addOperator(address _account) public onlyOwner {
    grantRole(OPERATOR_ROLE, _account);
  }

  /**
    * @dev Remove an `_account` from the `operator` role.
    */
  function removeOperator(address _account) public onlyOwner {
    revokeRole(OPERATOR_ROLE, _account);
  }

  function addURISetter(address _account) public onlyOwner {
    grantRole(URI_SETTER_ROLE, _account);
  }

  function removeURISetter(address _account) public onlyOwner {
    revokeRole(URI_SETTER_ROLE, _account);
  }

  /**
    * @dev Check if an _account is operator.
    */
  function isOperator(address _account) public view returns (bool) {
    return hasRole(OPERATOR_ROLE, _account);
  }

  /**
    * @dev Check if an _account is operator.
    */
  function isURISetter(address _account) public view returns (bool) {
    return hasRole(URI_SETTER_ROLE, _account);
  }
}

File 6 of 15 : NumberHelper.sol
//SPDX-License-Identifier: GNU General Public License v3.0
pragma solidity ^0.8.0;

library NumberHelper {
  function min(uint a, uint b) internal pure returns (uint) {
    return a < b ? a : b;
  }

  function daysSince(uint256 _activeDateTime, uint256 _interval) internal view returns (uint256) {
    unchecked {
      uint256 passedTime = (block.timestamp - _activeDateTime) / _interval;
      if(passedTime <= 6) {
        return 0;
      } else if( passedTime <= 24) {
        return 1;
      } else if( passedTime <= 48 ) {
        return 2;
      } else if( passedTime <=72 ) {
        return 3;
      } else if( passedTime <= 96 ) {
        return 4;
      } else if( passedTime <= 120 ) {
        return 5;
      } else if( passedTime <= 144 ) {
        return 6;
      } else if( passedTime <= 168 ) {
        return 7;
      } else {
        return 8;
      }
    }
  }
}

File 7 of 15 : 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 8 of 15 : 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 9 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 10 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 11 of 15 : Context.sol
// SPDX-License-Identifier: MIT

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 12 of 15 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 13 of 15 : Strings.sol
// SPDX-License-Identifier: MIT

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 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT

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 15 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_uriSetter","type":"address"},{"internalType":"address","name":"_legionnaire","type":"address"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"URI_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addURISetter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"beginSelfRevealPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"claimedCount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLeftOverUrisLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isURISetter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"leftoverUris","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"legionnaire","outputs":[{"internalType":"contract ILegionnaire","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"string[]","name":"_tokenURIs","type":"string[]"}],"name":"pairLegionnairesWithUris","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"purchaseState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"purchasedSoFar","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"leftoverUris_","type":"string[]"}],"name":"pushLeftOverUris","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeURISetter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomToVRF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"bool","name":"isSetUri","type":"bool"},{"internalType":"uint16","name":"batchSize","type":"uint16"}],"name":"safeBatchMintAndTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"string","name":"tokenType","type":"string"},{"internalType":"uint8[]","name":"counts","type":"uint8[]"}],"name":"seedPresaleWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"activeDateTime","type":"uint256"}],"name":"setActiveDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxLimit","type":"uint256"}],"name":"setMaxLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_svEthAddr","type":"address"}],"name":"setPaymentAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"svEthAddr","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePurchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"string","name":"","type":"string"}],"name":"tokensCount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600580546001600160c01b031916770ce50001981268bf660454e24dbea9020d57c2504a538c57179055612710600655610e10600855600d805462ffff001916620101001790553480156200005857600080fd5b5060405162003d2a38038062003d2a8339810160408190526200007b91620005d2565b6001600160601b0319606085811b821660a05284901b16608052620000a7620000a13390565b62000137565b620000b460003362000189565b620000cf60008051602062003d0a8339815191523362000189565b620000ea60008051602062003cea8339815191523362000189565b6001600355600c829055600b819055600480546001600160a01b0319166001600160a01b0387161790556200011f8762000199565b6200012a86620001f4565b50505050505050620007d7565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000195828262000243565b5050565b33620001a4620002cd565b6001600160a01b031614620001d65760405162461bcd60e51b8152600401620001cd9062000702565b60405180910390fd5b620001f160008051602062003d0a83398151915282620002dc565b50565b33620001ff620002cd565b6001600160a01b031614620002285760405162461bcd60e51b8152600401620001cd9062000702565b620001f160008051602062003cea83398151915282620002dc565b6200024f82826200030b565b620001955760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620002893390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001546001600160a01b031690565b600082815260026020526040902060010154620002fa813362000336565b62000306838362000243565b505050565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6200034282826200030b565b620001955762000368816001600160a01b03166014620003b960201b620021a01760201c565b6200037e836020620021a0620003b9821b17811c565b6040516020016200039192919062000654565b60408051601f198184030181529082905262461bcd60e51b8252620001cd91600401620006cd565b60606000620003ca83600262000752565b620003d790600262000737565b6001600160401b03811115620003fd57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801562000428576020820181803683370190505b509050600360fc1b816000815181106200045257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106200049057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000620004b684600262000752565b620004c390600162000737565b90505b60018111156200055d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106200050757634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106200052c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936200055581620007a7565b9050620004c6565b508315620005ae5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401620001cd565b9392505050565b80516001600160a01b0381168114620005cd57600080fd5b919050565b600080600080600080600060e0888a031215620005ed578283fd5b620005f888620005b5565b96506200060860208901620005b5565b95506200061860408901620005b5565b94506200062860608901620005b5565b93506200063860808901620005b5565b925060a0880151915060c0880151905092959891949750929550565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516200068e81601785016020880162000774565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351620006c181602884016020880162000774565b01602801949350505050565b6020815260008251806020840152620006ee81604085016020870162000774565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156200074d576200074d620007c1565b500190565b60008160001904831182151516156200076f576200076f620007c1565b500290565b60005b838110156200079157818101518382015260200162000777565b83811115620007a1576000848401525b50505050565b600081620007b957620007b9620007c1565b506000190190565b634e487b7160e01b600052601160045260246000fd5b60805160601c60a05160601c6134d9620008116000396000818161167001526124a5015260008181610bb0015261247601526134d96000f3fe6080604052600436106101cb5760003560e01c806301ffc9a7146101d0578063091a9da6146102055780630d1cbeec14610227578063107b808c1461028557806316e1a9f81461029a5780632181ef99146102ba578063248a9ca3146102da5780632847204f146103085780632e228034146103285780632f2ff15d1461033d578063319beaed1461035d57806336568abe14610372578063379607f5146103925780633a603035146103b257806350fedf7c146103c75780635a4b1610146103f45780635e1e10041461041457806369ead667146104345780636d70f7ae14610454578063715018a6146104745780637f345710146104895780638da5cb5b146104ab57806391d14854146104c057806394985ddd146104e05780639870d7fe146105005780639a72580914610520578063a217fddf1461053f578063ab8cf41b14610554578063ac8a584a14610581578063baabf96c146105a1578063bf8bcee4146105c1578063c173cd4b146105e1578063d112974514610601578063d547741f14610616578063dac42dcf14610636578063e622077014610656578063e888195e14610676578063efef39a1146106a6578063f2fde38b146106b9578063f5b541a6146106d9575b600080fd5b3480156101dc57600080fd5b506101f06101eb366004612f25565b6106fb565b60405190151581526020015b60405180910390f35b34801561021157600080fd5b50610225610220366004612dbd565b610732565b005b34801561023357600080fd5b50610273610242366004612cb2565b6010602090815260009283526040909220815180830184018051928152908401929093019190912091525460ff1681565b60405160ff90911681526020016101fc565b34801561029157600080fd5b50610225610835565b3480156102a657600080fd5b50600d546101f09062010000900460ff1681565b3480156102c657600080fd5b506102256102d5366004612c54565b610888565b3480156102e657600080fd5b506102fa6102f5366004612ec1565b6108d2565b6040519081526020016101fc565b34801561031457600080fd5b50610225610323366004612c6e565b6108e7565b34801561033457600080fd5b50610225610afd565b34801561034957600080fd5b50610225610358366004612ed9565b610b40565b34801561036957600080fd5b50610225610b62565b34801561037e57600080fd5b5061022561038d366004612ed9565b610c88565b34801561039e57600080fd5b506102256103ad366004612ec1565b610d02565b3480156103be57600080fd5b50600f546102fa565b3480156103d357600080fd5b506005546103e7906001600160a01b031681565b6040516101fc919061307a565b34801561040057600080fd5b5061022561040f366004612c54565b61128d565b34801561042057600080fd5b5061022561042f366004612c54565b6112d4565b34801561044057600080fd5b5061022561044f366004612def565b611325565b34801561046057600080fd5b506101f061046f366004612c54565b6115d6565b34801561048057600080fd5b506102256115f0565b34801561049557600080fd5b506102fa60008051602061346483398151915281565b3480156104b757600080fd5b506103e761162b565b3480156104cc57600080fd5b506101f06104db366004612ed9565b61163a565b3480156104ec57600080fd5b506102256104fb366004612f04565b611665565b34801561050c57600080fd5b5061022561051b366004612c54565b6116e7565b34801561052c57600080fd5b50600d546101f090610100900460ff1681565b34801561054b57600080fd5b506102fa600081565b34801561056057600080fd5b5061057461056f366004612ec1565b61172e565b6040516101fc91906130d7565b34801561058d57600080fd5b5061022561059c366004612c54565b6117da565b3480156105ad57600080fd5b506102256105bc366004612cfd565b611821565b3480156105cd57600080fd5b506102256105dc366004612ec1565b6119b3565b3480156105ed57600080fd5b506004546103e7906001600160a01b031681565b34801561060d57600080fd5b50610225611a31565b34801561062257600080fd5b50610225610631366004612ed9565b611a82565b34801561064257600080fd5b506101f0610651366004612c54565b611a9f565b34801561066257600080fd5b50610225610671366004612ec1565b611ab9565b34801561068257600080fd5b50610273610691366004612c54565b60116020526000908152604090205460ff1681565b6102256106b4366004612ec1565b611af2565b3480156106c557600080fd5b506102256106d4366004612c54565b612103565b3480156106e557600080fd5b506102fa60008051602061348483398151915281565b60006001600160e01b03198216637965db0b60e01b148061072c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61074a6000805160206134848339815191523361163a565b61076f5760405162461bcd60e51b815260040161076690613163565b60405180910390fd5b600d5460ff16156107be5760405162461bcd60e51b815260206004820152601960248201527829b2b63316a932bb32b0b61030b63932b0b23c903132b3bab760391b6044820152606401610766565b60005b815181101561083157600f8282815181106107ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518254600181018455600093845292829020815161081e9491909101929190910190612998565b5080610829816133ee565b9150506107c1565b5050565b61084d6000805160206134848339815191523361163a565b6108695760405162461bcd60e51b815260040161076690613163565b600d805462ff0000198116620100009182900460ff1615909102179055565b3361089161162b565b6001600160a01b0316146108b75760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061346483398151915282610b40565b50565b60009081526002602052604090206001015490565b6108ff6000805160206134848339815191523361163a565b61091b5760405162461bcd60e51b815260040161076690613163565b600d5460ff166109695760405162461bcd60e51b815260206004820152601960248201527812185d99481d1bc8189959da5b8814d95b198b54995d99585b603a1b6044820152606401610766565b6006546109779060016132ba565b600554610990908390600160b01b900461ffff16613294565b61ffff1611156109b25760405162461bcd60e51b8152600401610766906130ea565b600554600160b01b900461ffff165b6005546109da908390600160b01b900461ffff16613294565b61ffff16811015610ac25760048054604051632851206560e21b81526001600160a01b039091169163a144819491610a1691889186910161308e565b600060405180830381600087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050508215610ab05760048054604051630588253160e21b81526001600160a01b039091169163162094c491610a7d91859101613215565b600060405180830381600087803b158015610a9757600080fd5b505af1158015610aab573d6000803e3d6000fd5b505050505b80610aba816133ee565b9150506109c1565b50600554610adc908290600160b01b900461ffff16613294565b600560166101000a81548161ffff021916908361ffff160217905550505050565b610b156000805160206134848339815191523361163a565b610b315760405162461bcd60e51b815260040161076690613163565b600d805460ff19166001179055565b610b49826108d2565b610b538133612388565b610b5d83836123ec565b505050565b610b7a6000805160206134848339815191523361163a565b610b965760405162461bcd60e51b815260040161076690613163565b600b546040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610be590309060040161307a565b60206040518083038186803b158015610bfd57600080fd5b505afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190612f4d565b1015610c755760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204c494e4b60881b6044820152606401610766565b610c83600c54600b54612472565b600e55565b6001600160a01b0381163314610cf85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610766565b61083182826125fc565b60026003541415610d255760405162461bcd60e51b8152600401610766906131a8565b6002600355600d54610100900460ff16610d755760405162461bcd60e51b815260206004820152601160248201527010db185a5b481a5cc8191a5cd8589b1959607a1b6044820152606401610766565b600754421015610dbf5760405162461bcd60e51b8152602060048201526015602482015274141c995cd85b19481b9bdd081cdd185c9d081e595d605a1b6044820152606401610766565b336000908152601060205260408082209051610dda90612fc2565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e0a90612fd5565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e3a90612fe9565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e6a90613068565b9081526040519081900360200190205460075460085460ff9092169250600091610e949190612663565b905060ff80861690610ea8908616826132ba565b9050610eb760ff8516826132ba565b9050610ec660ff8416826132ba565b90506000610ed48289612722565b600554909150610ce590610ef4908390600160a01b900461ffff166132ba565b1115610f425760405162461bcd60e51b815260206004820181905260248201527f4e6f206c6567696f6e6e6169726573206c65667420666f722070726573616c656044820152606401610766565b60008060605b838310156111855760ff8a1615610f6b5789610f6381613374565b9a5050610fe8565b60018610158015610f7f575060008960ff16115b15610f965788610f8e81613374565b995050610fe8565b60028610158015610faa575060008860ff16115b15610fc15787610fb981613374565b985050610fe8565b60038610158015610fd5575060008760ff16115b15610fe85786610fe481613374565b9750505b600d5460ff1615610ffe57610ffb612738565b90505b60058054600160a01b900461ffff1692508290601461101c836133cc565b825461ffff9182166101009390930a92830291909202199091161790555060048054604051632851206560e21b81526001600160a01b039091169163a14481949161106b91339187910161308e565b600060405180830381600087803b15801561108557600080fd5b505af1158015611099573d6000803e3d6000fd5b5050600d5460ff16915061110f90505760048054604051630588253160e21b81526001600160a01b039091169163162094c4916110d891869101613215565b600060405180830381600087803b1580156110f257600080fd5b505af1158015611106573d6000803e3d6000fd5b50505050611173565b60048054604051630588253160e21b81526001600160a01b039091169163162094c4916111409186918691016131fc565b600060405180830381600087803b15801561115a57600080fd5b505af115801561116e573d6000803e3d6000fd5b505050505b8261117d816133ee565b935050610f48565b336000908152601060205260409081902090518b91906111a490612fc2565b9081526040805160209281900383018120805460ff191660ff9590951694909417909355336000908152601090925290208a916111e090612fd5565b9081526040805160209281900383018120805460ff191660ff959095169490941790935533600090815260109092529020899161121c90612fe9565b9081526040805160209281900383018120805460ff191660ff959095169490941790935533600090815260109092529020889161125890613068565b908152604051908190036020019020805460ff9290921660ff1990921691909117905550506001600355505050505050505050565b3361129661162b565b6001600160a01b0316146112bc5760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061346483398151915282611a82565b336112dd61162b565b6001600160a01b0316146113035760405162461bcd60e51b81526004016107669061312e565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b61133d6000805160206134648339815191523361163a565b6113955760405162461bcd60e51b815260206004820152602360248201527f5365747461626c653a2043414c4c45525f4e4f5f5552495f5345545445525f526044820152624f4c4560e81b6064820152608401610766565b80518251146113e05760405162461bcd60e51b81526020600482015260176024820152764d69736d6174636865642069647320616e64205552497360481b6044820152606401610766565b60008251116114245760405162461bcd60e51b815260206004820152601060248201526f456d70747920706172616d657465727360801b6044820152606401610766565b8151156108315781516000611438826128c6565b6004549091506001600160a01b031663162094c485611458600186613316565b8151811061147657634e487b7160e01b600052603260045260246000fd5b602002602001015185848151811061149e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016114c39291906131df565b600060405180830381600087803b1580156114dd57600080fd5b505af11580156114f1573d6000803e3d6000fd5b50505050826001836115039190613316565b8151811061152157634e487b7160e01b600052603260045260246000fd5b602002602001015183828151811061154957634e487b7160e01b600052603260045260246000fd5b602090810291909101015283611560600184613316565b8151811061157e57634e487b7160e01b600052603260045260246000fd5b6000602091820292909201015282611597600184613316565b815181106115b557634e487b7160e01b600052603260045260246000fd5b60200260200101606081525060018451038452600183510383525050611424565b600061072c6000805160206134848339815191528361163a565b336115f961162b565b6001600160a01b03161461161f5760405162461bcd60e51b81526004016107669061312e565b6116296000612936565b565b6001546001600160a01b031690565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116dd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610766565b6108318282612988565b336116f061162b565b6001600160a01b0316146117165760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061348483398151915282610b40565b600f818154811061173e57600080fd5b90600052602060002001600091509050805461175990613391565b80601f016020809104026020016040519081016040528092919081815260200182805461178590613391565b80156117d25780601f106117a7576101008083540402835291602001916117d2565b820191906000526020600020905b8154815290600101906020018083116117b557829003601f168201915b505050505081565b336117e361162b565b6001600160a01b0316146118095760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061348483398151915282611a82565b6118396000805160206134848339815191523361163a565b6118555760405162461bcd60e51b815260040161076690613163565b8481146118b45760405162461bcd60e51b815260206004820152602760248201527f4d69736d6174636865642070726573616c652061646472657373657320616e6460448201526620636f756e747360c81b6064820152608401610766565b60005b858110156119aa578282828181106118df57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906118f49190612f65565b6010600089898581811061191857634e487b7160e01b600052603260045260246000fd5b905060200201602081019061192d9190612c54565b6001600160a01b03166001600160a01b03168152602001908152602001600020868660405161195d929190612fb2565b908152604051908190036020019020805460009061197f90849060ff166132d2565b92506101000a81548160ff021916908360ff16021790555080806119a2906133ee565b9150506118b7565b50505050505050565b336119bc61162b565b6001600160a01b0316146119e25760405162461bcd60e51b81526004016107669061312e565b6127118110611a2c5760405162461bcd60e51b81526020600482015260166024820152750457863656564206d6178206c696d69742031303030360541b6044820152606401610766565b600655565b611a496000805160206134848339815191523361163a565b611a655760405162461bcd60e51b815260040161076690613163565b600d805461ff001981166101009182900460ff1615909102179055565b611a8b826108d2565b611a958133612388565b610b5d83836125fc565b600061072c6000805160206134648339815191528361163a565b611ad16000805160206134848339815191523361163a565b611aed5760405162461bcd60e51b815260040161076690613163565b600755565b60026003541415611b155760405162461bcd60e51b8152600401610766906131a8565b6002600355600d5462010000900460ff16611b695760405162461bcd60e51b8152602060048201526014602482015273141d5c98da185cd9481a5cc8191a5cd8589b195960621b6044820152606401610766565b600754421015611bb05760405162461bcd60e51b815260206004820152601260248201527114d85b19481b9bdd081cdd185c9d081e595d60721b6044820152606401610766565b6000611bc0600754600854612663565b905060038111611c0e5760405162461bcd60e51b8152602060048201526019602482015278141d589b1a58c81cd85b19481b9bdd081cdd185c9d081e595d603a1b6044820152606401610766565b611c208267016345785d8a00006132f7565b341015611c625760405162461bcd60e51b815260206004820152601060248201526f2737ba1032b737bab3b41032ba3432b960811b6044820152606401610766565b60006005821015611d3957503360009081526011602052604081205460ff1690611c8c82856132ba565b118015611ca257506003611ca082856132ba565b105b611cfa5760405162461bcd60e51b815260206004820152602360248201527f4e6f7420616c6c6f77656420746f207075726368617365207468617420616d6f6044820152621d5b9d60ea1b6064820152608401610766565b3360009081526011602052604081208054859290611d1c90849060ff166132d2565b92506101000a81548160ff021916908360ff160217905550611d82565b6006821015611d8257600b8310611d825760405162461bcd60e51b815260206004820152600d60248201526c557020746f203130206f6e6c7960981b6044820152606401610766565b506006548290611d939060016132ba565b600554611dac908390600160b01b900461ffff166132ba565b1115611dca5760405162461bcd60e51b8152600401610766906130ea565b6000606060005b83811015611f7657600d5460ff1615611def57611dec612738565b91505b60058054600160b01b900461ffff16935083906016611e0d836133cc565b825461ffff9182166101009390930a92830291909202199091161790555060048054604051632851206560e21b81526001600160a01b039091169163a144819491611e5c91339188910161308e565b600060405180830381600087803b158015611e7657600080fd5b505af1158015611e8a573d6000803e3d6000fd5b5050600d5460ff169150611f0090505760048054604051630588253160e21b81526001600160a01b039091169163162094c491611ec991879101613215565b600060405180830381600087803b158015611ee357600080fd5b505af1158015611ef7573d6000803e3d6000fd5b50505050611f64565b60048054604051630588253160e21b81526001600160a01b039091169163162094c491611f319187918791016131fc565b600060405180830381600087803b158015611f4b57600080fd5b505af1158015611f5f573d6000803e3d6000fd5b505050505b80611f6e816133ee565b915050611dd1565b506005546000906001600160a01b0316611f988567016345785d8a00006132f7565b604051600081818185875af1925050503d8060008114611fd4576040519150601f19603f3d011682016040523d82523d6000602084013e611fd9565b606091505b50509050806120215760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610766565b6120338667016345785d8a00006132f7565b3411156120f6573361204d8567016345785d8a00006132f7565b6120579034613316565b604051600081818185875af1925050503d8060008114612093576040519150601f19603f3d011682016040523d82523d6000602084013e612098565b606091505b505080915050806120f65760405162461bcd60e51b815260206004820152602260248201527f4661696c656420746f2073656e64206368616e6765206261636b20746f20757360448201526132b960f11b6064820152608401610766565b5050600160035550505050565b3361210c61162b565b6001600160a01b0316146121325760405162461bcd60e51b81526004016107669061312e565b6001600160a01b0381166121975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610766565b6108cf81612936565b606060006121af8360026132f7565b6121ba9060026132ba565b6001600160401b038111156121df57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612209576020820181803683370190505b509050600360fc1b8160008151811061223257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061226f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006122938460026132f7565b61229e9060016132ba565b90505b6001811115612332576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106122e057634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061230457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361232b8161335d565b90506122a1565b5083156123815760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610766565b9392505050565b612392828261163a565b610831576123aa816001600160a01b031660146121a0565b6123b58360206121a0565b6040516020016123c6929190612ff9565b60408051601f198184030181529082905262461bcd60e51b8252610766916004016130d7565b6123f6828261163a565b6108315760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561242e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016124e2929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161250f939291906130a7565b602060405180830381600087803b15801561252957600080fd5b505af115801561253d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125619190612ea5565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120868452929091526125bb9060016132ba565b60008581526020818152604091829020929092558051808301879052808201849052815180820383018152606090910190915280519101205b949350505050565b612606828261163a565b156108315760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080828442038161268557634e487b7160e01b600052601260045260246000fd5b0490506006811161269a57600091505061072c565b601881116126ac57600191505061072c565b603081116126be57600291505061072c565b604881116126d057600391505061072c565b606081116126e257600491505061072c565b607881116126f457600591505061072c565b6090811161270657600691505061072c565b60a8811161271857600791505061072c565b600891505061072c565b60008183106127315781612381565b5090919050565b6060600061274a600f805490506128c6565b90506000600f828154811061276f57634e487b7160e01b600052603260045260246000fd5b90600052602060002001805461278490613391565b80601f01602080910402602001604051908101604052809291908181526020018280546127b090613391565b80156127fd5780601f106127d2576101008083540402835291602001916127fd565b820191906000526020600020905b8154815290600101906020018083116127e057829003601f168201915b50505050509050600f6001600f805490506128189190613316565b8154811061283657634e487b7160e01b600052603260045260246000fd5b90600052602060002001600f838154811061286157634e487b7160e01b600052603260045260246000fd5b9060005260206000200190805461287790613391565b612882929190612a1c565b50600f8054806128a257634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160006128be9190612a97565b905592915050565b60098054600091826128d7836133ee565b9091555050600954600a54604080514260208201526001600160601b03193360601b16918101919091526054810192909252607482015282906094016040516020818303038152906040528051906020012060001c61072c9190613409565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b81600e54141561083157600a5550565b8280546129a490613391565b90600052602060002090601f0160209004810192826129c65760008555612a0c565b82601f106129df57805160ff1916838001178555612a0c565b82800160010185558215612a0c579182015b82811115612a0c5782518255916020019190600101906129f1565b50612a18929150612acd565b5090565b828054612a2890613391565b90600052602060002090601f016020900481019282612a4a5760008555612a0c565b82601f10612a5b5780548555612a0c565b82800160010185558215612a0c57600052602060002091601f016020900482015b82811115612a0c578254825591600101919060010190612a7c565b508054612aa390613391565b6000825580601f10612ab3575050565b601f0160209004906000526020600020908101906108cf91905b5b80821115612a185760008155600101612ace565b80356001600160a01b0381168114612af957600080fd5b919050565b60008083601f840112612b0f578182fd5b5081356001600160401b03811115612b25578182fd5b6020830191508360208260051b8501011115612b4057600080fd5b9250929050565b600082601f830112612b57578081fd5b81356020612b6c612b6783613271565b613241565b80838252828201915082860187848660051b8901011115612b8b578586fd5b855b85811015612bcb5781356001600160401b03811115612baa578788fd5b612bb88a87838c0101612bd8565b8552509284019290840190600101612b8d565b5090979650505050505050565b600082601f830112612be8578081fd5b81356001600160401b03811115612c0157612c0161343f565b612c14601f8201601f1916602001613241565b818152846020838601011115612c28578283fd5b816020850160208301379081016020019190915292915050565b803561ffff81168114612af957600080fd5b600060208284031215612c65578081fd5b61238182612ae2565b600080600060608486031215612c82578182fd5b612c8b84612ae2565b92506020840135612c9b81613455565b9150612ca960408501612c42565b90509250925092565b60008060408385031215612cc4578182fd5b612ccd83612ae2565b915060208301356001600160401b03811115612ce7578182fd5b612cf385828601612bd8565b9150509250929050565b60008060008060008060608789031215612d15578182fd5b86356001600160401b0380821115612d2b578384fd5b612d378a838b01612afe565b90985096506020890135915080821115612d4f578384fd5b818901915089601f830112612d62578384fd5b813581811115612d70578485fd5b8a6020828501011115612d81578485fd5b602083019650809550506040890135915080821115612d9e578384fd5b50612dab89828a01612afe565b979a9699509497509295939492505050565b600060208284031215612dce578081fd5b81356001600160401b03811115612de3578182fd5b6125f484828501612b47565b60008060408385031215612e01578182fd5b82356001600160401b0380821115612e17578384fd5b818501915085601f830112612e2a578384fd5b81356020612e3a612b6783613271565b8083825282820191508286018a848660051b8901011115612e59578889fd5b8896505b84871015612e8257612e6e81612c42565b835260019690960195918301918301612e5d565b5096505086013592505080821115612e98578283fd5b50612cf385828601612b47565b600060208284031215612eb6578081fd5b815161238181613455565b600060208284031215612ed2578081fd5b5035919050565b60008060408385031215612eeb578182fd5b82359150612efb60208401612ae2565b90509250929050565b60008060408385031215612f16578182fd5b50508035926020909101359150565b600060208284031215612f36578081fd5b81356001600160e01b031981168114612381578182fd5b600060208284031215612f5e578081fd5b5051919050565b600060208284031215612f76578081fd5b813560ff81168114612381578182fd5b60008151808452612f9e81602086016020860161332d565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6667656e6573697360c81b815260070190565b67706c6174696e756d60c01b815260080190565b6319dbdb1960e21b815260040190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161302b81601785016020880161332d565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161305c81602884016020880161332d565b01602801949350505050565b6539b4b63b32b960d11b815260060190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60018060a01b03841681528260208201526060604082015260006130ce6060830184612f86565b95945050505050565b6020815260006123816020830184612f86565b60208082526024908201527f4e6f206c6567696f6e6e6169726573206c65667420666f72207075626c69632060408201526373616c6560e01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526025908201527f4f70657261746f7261626c653a2043414c4c45525f4e4f5f4f50455241544f526040820152645f524f4c4560d81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b61ffff831681526040602082015260006125f46040830184612f86565b8281526040602082015260006125f46040830184612f86565b908152604060208201819052600b908201526a383630b1b2b437b63232b960a91b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156132695761326961343f565b604052919050565b60006001600160401b0382111561328a5761328a61343f565b5060051b60200190565b600061ffff8083168185168083038211156132b1576132b1613429565b01949350505050565b600082198211156132cd576132cd613429565b500190565b600060ff821660ff84168060ff038211156132ef576132ef613429565b019392505050565b600081600019048311821515161561331157613311613429565b500290565b60008282101561332857613328613429565b500390565b60005b83811015613348578181015183820152602001613330565b83811115613357576000848401525b50505050565b60008161336c5761336c613429565b506000190190565b600060ff82168061338757613387613429565b6000190192915050565b600181811c908216806133a557607f821691505b602082108114156133c657634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156133e4576133e4613429565b6001019392505050565b600060001982141561340257613402613429565b5060010190565b60008261342457634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146108cf57600080fdfe7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a2646970667358221220577dd292643c659ce7ad0ab519ba06152a98e1eff0e93c5df4547a0c100914ac64736f6c634300080400337804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f8000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f80000000000000000000000005041a99684d38e280e4b0b356185bf18c991f88b000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

Deployed Bytecode

0x6080604052600436106101cb5760003560e01c806301ffc9a7146101d0578063091a9da6146102055780630d1cbeec14610227578063107b808c1461028557806316e1a9f81461029a5780632181ef99146102ba578063248a9ca3146102da5780632847204f146103085780632e228034146103285780632f2ff15d1461033d578063319beaed1461035d57806336568abe14610372578063379607f5146103925780633a603035146103b257806350fedf7c146103c75780635a4b1610146103f45780635e1e10041461041457806369ead667146104345780636d70f7ae14610454578063715018a6146104745780637f345710146104895780638da5cb5b146104ab57806391d14854146104c057806394985ddd146104e05780639870d7fe146105005780639a72580914610520578063a217fddf1461053f578063ab8cf41b14610554578063ac8a584a14610581578063baabf96c146105a1578063bf8bcee4146105c1578063c173cd4b146105e1578063d112974514610601578063d547741f14610616578063dac42dcf14610636578063e622077014610656578063e888195e14610676578063efef39a1146106a6578063f2fde38b146106b9578063f5b541a6146106d9575b600080fd5b3480156101dc57600080fd5b506101f06101eb366004612f25565b6106fb565b60405190151581526020015b60405180910390f35b34801561021157600080fd5b50610225610220366004612dbd565b610732565b005b34801561023357600080fd5b50610273610242366004612cb2565b6010602090815260009283526040909220815180830184018051928152908401929093019190912091525460ff1681565b60405160ff90911681526020016101fc565b34801561029157600080fd5b50610225610835565b3480156102a657600080fd5b50600d546101f09062010000900460ff1681565b3480156102c657600080fd5b506102256102d5366004612c54565b610888565b3480156102e657600080fd5b506102fa6102f5366004612ec1565b6108d2565b6040519081526020016101fc565b34801561031457600080fd5b50610225610323366004612c6e565b6108e7565b34801561033457600080fd5b50610225610afd565b34801561034957600080fd5b50610225610358366004612ed9565b610b40565b34801561036957600080fd5b50610225610b62565b34801561037e57600080fd5b5061022561038d366004612ed9565b610c88565b34801561039e57600080fd5b506102256103ad366004612ec1565b610d02565b3480156103be57600080fd5b50600f546102fa565b3480156103d357600080fd5b506005546103e7906001600160a01b031681565b6040516101fc919061307a565b34801561040057600080fd5b5061022561040f366004612c54565b61128d565b34801561042057600080fd5b5061022561042f366004612c54565b6112d4565b34801561044057600080fd5b5061022561044f366004612def565b611325565b34801561046057600080fd5b506101f061046f366004612c54565b6115d6565b34801561048057600080fd5b506102256115f0565b34801561049557600080fd5b506102fa60008051602061346483398151915281565b3480156104b757600080fd5b506103e761162b565b3480156104cc57600080fd5b506101f06104db366004612ed9565b61163a565b3480156104ec57600080fd5b506102256104fb366004612f04565b611665565b34801561050c57600080fd5b5061022561051b366004612c54565b6116e7565b34801561052c57600080fd5b50600d546101f090610100900460ff1681565b34801561054b57600080fd5b506102fa600081565b34801561056057600080fd5b5061057461056f366004612ec1565b61172e565b6040516101fc91906130d7565b34801561058d57600080fd5b5061022561059c366004612c54565b6117da565b3480156105ad57600080fd5b506102256105bc366004612cfd565b611821565b3480156105cd57600080fd5b506102256105dc366004612ec1565b6119b3565b3480156105ed57600080fd5b506004546103e7906001600160a01b031681565b34801561060d57600080fd5b50610225611a31565b34801561062257600080fd5b50610225610631366004612ed9565b611a82565b34801561064257600080fd5b506101f0610651366004612c54565b611a9f565b34801561066257600080fd5b50610225610671366004612ec1565b611ab9565b34801561068257600080fd5b50610273610691366004612c54565b60116020526000908152604090205460ff1681565b6102256106b4366004612ec1565b611af2565b3480156106c557600080fd5b506102256106d4366004612c54565b612103565b3480156106e557600080fd5b506102fa60008051602061348483398151915281565b60006001600160e01b03198216637965db0b60e01b148061072c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61074a6000805160206134848339815191523361163a565b61076f5760405162461bcd60e51b815260040161076690613163565b60405180910390fd5b600d5460ff16156107be5760405162461bcd60e51b815260206004820152601960248201527829b2b63316a932bb32b0b61030b63932b0b23c903132b3bab760391b6044820152606401610766565b60005b815181101561083157600f8282815181106107ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518254600181018455600093845292829020815161081e9491909101929190910190612998565b5080610829816133ee565b9150506107c1565b5050565b61084d6000805160206134848339815191523361163a565b6108695760405162461bcd60e51b815260040161076690613163565b600d805462ff0000198116620100009182900460ff1615909102179055565b3361089161162b565b6001600160a01b0316146108b75760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061346483398151915282610b40565b50565b60009081526002602052604090206001015490565b6108ff6000805160206134848339815191523361163a565b61091b5760405162461bcd60e51b815260040161076690613163565b600d5460ff166109695760405162461bcd60e51b815260206004820152601960248201527812185d99481d1bc8189959da5b8814d95b198b54995d99585b603a1b6044820152606401610766565b6006546109779060016132ba565b600554610990908390600160b01b900461ffff16613294565b61ffff1611156109b25760405162461bcd60e51b8152600401610766906130ea565b600554600160b01b900461ffff165b6005546109da908390600160b01b900461ffff16613294565b61ffff16811015610ac25760048054604051632851206560e21b81526001600160a01b039091169163a144819491610a1691889186910161308e565b600060405180830381600087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050508215610ab05760048054604051630588253160e21b81526001600160a01b039091169163162094c491610a7d91859101613215565b600060405180830381600087803b158015610a9757600080fd5b505af1158015610aab573d6000803e3d6000fd5b505050505b80610aba816133ee565b9150506109c1565b50600554610adc908290600160b01b900461ffff16613294565b600560166101000a81548161ffff021916908361ffff160217905550505050565b610b156000805160206134848339815191523361163a565b610b315760405162461bcd60e51b815260040161076690613163565b600d805460ff19166001179055565b610b49826108d2565b610b538133612388565b610b5d83836123ec565b505050565b610b7a6000805160206134848339815191523361163a565b610b965760405162461bcd60e51b815260040161076690613163565b600b546040516370a0823160e01b81526001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a0823190610be590309060040161307a565b60206040518083038186803b158015610bfd57600080fd5b505afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c359190612f4d565b1015610c755760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420656e6f756768204c494e4b60881b6044820152606401610766565b610c83600c54600b54612472565b600e55565b6001600160a01b0381163314610cf85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610766565b61083182826125fc565b60026003541415610d255760405162461bcd60e51b8152600401610766906131a8565b6002600355600d54610100900460ff16610d755760405162461bcd60e51b815260206004820152601160248201527010db185a5b481a5cc8191a5cd8589b1959607a1b6044820152606401610766565b600754421015610dbf5760405162461bcd60e51b8152602060048201526015602482015274141c995cd85b19481b9bdd081cdd185c9d081e595d605a1b6044820152606401610766565b336000908152601060205260408082209051610dda90612fc2565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e0a90612fd5565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e3a90612fe9565b908152604080516020928190038301812054336000908152601090945291832060ff9092169350610e6a90613068565b9081526040519081900360200190205460075460085460ff9092169250600091610e949190612663565b905060ff80861690610ea8908616826132ba565b9050610eb760ff8516826132ba565b9050610ec660ff8416826132ba565b90506000610ed48289612722565b600554909150610ce590610ef4908390600160a01b900461ffff166132ba565b1115610f425760405162461bcd60e51b815260206004820181905260248201527f4e6f206c6567696f6e6e6169726573206c65667420666f722070726573616c656044820152606401610766565b60008060605b838310156111855760ff8a1615610f6b5789610f6381613374565b9a5050610fe8565b60018610158015610f7f575060008960ff16115b15610f965788610f8e81613374565b995050610fe8565b60028610158015610faa575060008860ff16115b15610fc15787610fb981613374565b985050610fe8565b60038610158015610fd5575060008760ff16115b15610fe85786610fe481613374565b9750505b600d5460ff1615610ffe57610ffb612738565b90505b60058054600160a01b900461ffff1692508290601461101c836133cc565b825461ffff9182166101009390930a92830291909202199091161790555060048054604051632851206560e21b81526001600160a01b039091169163a14481949161106b91339187910161308e565b600060405180830381600087803b15801561108557600080fd5b505af1158015611099573d6000803e3d6000fd5b5050600d5460ff16915061110f90505760048054604051630588253160e21b81526001600160a01b039091169163162094c4916110d891869101613215565b600060405180830381600087803b1580156110f257600080fd5b505af1158015611106573d6000803e3d6000fd5b50505050611173565b60048054604051630588253160e21b81526001600160a01b039091169163162094c4916111409186918691016131fc565b600060405180830381600087803b15801561115a57600080fd5b505af115801561116e573d6000803e3d6000fd5b505050505b8261117d816133ee565b935050610f48565b336000908152601060205260409081902090518b91906111a490612fc2565b9081526040805160209281900383018120805460ff191660ff9590951694909417909355336000908152601090925290208a916111e090612fd5565b9081526040805160209281900383018120805460ff191660ff959095169490941790935533600090815260109092529020899161121c90612fe9565b9081526040805160209281900383018120805460ff191660ff959095169490941790935533600090815260109092529020889161125890613068565b908152604051908190036020019020805460ff9290921660ff1990921691909117905550506001600355505050505050505050565b3361129661162b565b6001600160a01b0316146112bc5760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061346483398151915282611a82565b336112dd61162b565b6001600160a01b0316146113035760405162461bcd60e51b81526004016107669061312e565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b61133d6000805160206134648339815191523361163a565b6113955760405162461bcd60e51b815260206004820152602360248201527f5365747461626c653a2043414c4c45525f4e4f5f5552495f5345545445525f526044820152624f4c4560e81b6064820152608401610766565b80518251146113e05760405162461bcd60e51b81526020600482015260176024820152764d69736d6174636865642069647320616e64205552497360481b6044820152606401610766565b60008251116114245760405162461bcd60e51b815260206004820152601060248201526f456d70747920706172616d657465727360801b6044820152606401610766565b8151156108315781516000611438826128c6565b6004549091506001600160a01b031663162094c485611458600186613316565b8151811061147657634e487b7160e01b600052603260045260246000fd5b602002602001015185848151811061149e57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016114c39291906131df565b600060405180830381600087803b1580156114dd57600080fd5b505af11580156114f1573d6000803e3d6000fd5b50505050826001836115039190613316565b8151811061152157634e487b7160e01b600052603260045260246000fd5b602002602001015183828151811061154957634e487b7160e01b600052603260045260246000fd5b602090810291909101015283611560600184613316565b8151811061157e57634e487b7160e01b600052603260045260246000fd5b6000602091820292909201015282611597600184613316565b815181106115b557634e487b7160e01b600052603260045260246000fd5b60200260200101606081525060018451038452600183510383525050611424565b600061072c6000805160206134848339815191528361163a565b336115f961162b565b6001600160a01b03161461161f5760405162461bcd60e51b81526004016107669061312e565b6116296000612936565b565b6001546001600160a01b031690565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146116dd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610766565b6108318282612988565b336116f061162b565b6001600160a01b0316146117165760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061348483398151915282610b40565b600f818154811061173e57600080fd5b90600052602060002001600091509050805461175990613391565b80601f016020809104026020016040519081016040528092919081815260200182805461178590613391565b80156117d25780601f106117a7576101008083540402835291602001916117d2565b820191906000526020600020905b8154815290600101906020018083116117b557829003601f168201915b505050505081565b336117e361162b565b6001600160a01b0316146118095760405162461bcd60e51b81526004016107669061312e565b6108cf60008051602061348483398151915282611a82565b6118396000805160206134848339815191523361163a565b6118555760405162461bcd60e51b815260040161076690613163565b8481146118b45760405162461bcd60e51b815260206004820152602760248201527f4d69736d6174636865642070726573616c652061646472657373657320616e6460448201526620636f756e747360c81b6064820152608401610766565b60005b858110156119aa578282828181106118df57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906118f49190612f65565b6010600089898581811061191857634e487b7160e01b600052603260045260246000fd5b905060200201602081019061192d9190612c54565b6001600160a01b03166001600160a01b03168152602001908152602001600020868660405161195d929190612fb2565b908152604051908190036020019020805460009061197f90849060ff166132d2565b92506101000a81548160ff021916908360ff16021790555080806119a2906133ee565b9150506118b7565b50505050505050565b336119bc61162b565b6001600160a01b0316146119e25760405162461bcd60e51b81526004016107669061312e565b6127118110611a2c5760405162461bcd60e51b81526020600482015260166024820152750457863656564206d6178206c696d69742031303030360541b6044820152606401610766565b600655565b611a496000805160206134848339815191523361163a565b611a655760405162461bcd60e51b815260040161076690613163565b600d805461ff001981166101009182900460ff1615909102179055565b611a8b826108d2565b611a958133612388565b610b5d83836125fc565b600061072c6000805160206134648339815191528361163a565b611ad16000805160206134848339815191523361163a565b611aed5760405162461bcd60e51b815260040161076690613163565b600755565b60026003541415611b155760405162461bcd60e51b8152600401610766906131a8565b6002600355600d5462010000900460ff16611b695760405162461bcd60e51b8152602060048201526014602482015273141d5c98da185cd9481a5cc8191a5cd8589b195960621b6044820152606401610766565b600754421015611bb05760405162461bcd60e51b815260206004820152601260248201527114d85b19481b9bdd081cdd185c9d081e595d60721b6044820152606401610766565b6000611bc0600754600854612663565b905060038111611c0e5760405162461bcd60e51b8152602060048201526019602482015278141d589b1a58c81cd85b19481b9bdd081cdd185c9d081e595d603a1b6044820152606401610766565b611c208267016345785d8a00006132f7565b341015611c625760405162461bcd60e51b815260206004820152601060248201526f2737ba1032b737bab3b41032ba3432b960811b6044820152606401610766565b60006005821015611d3957503360009081526011602052604081205460ff1690611c8c82856132ba565b118015611ca257506003611ca082856132ba565b105b611cfa5760405162461bcd60e51b815260206004820152602360248201527f4e6f7420616c6c6f77656420746f207075726368617365207468617420616d6f6044820152621d5b9d60ea1b6064820152608401610766565b3360009081526011602052604081208054859290611d1c90849060ff166132d2565b92506101000a81548160ff021916908360ff160217905550611d82565b6006821015611d8257600b8310611d825760405162461bcd60e51b815260206004820152600d60248201526c557020746f203130206f6e6c7960981b6044820152606401610766565b506006548290611d939060016132ba565b600554611dac908390600160b01b900461ffff166132ba565b1115611dca5760405162461bcd60e51b8152600401610766906130ea565b6000606060005b83811015611f7657600d5460ff1615611def57611dec612738565b91505b60058054600160b01b900461ffff16935083906016611e0d836133cc565b825461ffff9182166101009390930a92830291909202199091161790555060048054604051632851206560e21b81526001600160a01b039091169163a144819491611e5c91339188910161308e565b600060405180830381600087803b158015611e7657600080fd5b505af1158015611e8a573d6000803e3d6000fd5b5050600d5460ff169150611f0090505760048054604051630588253160e21b81526001600160a01b039091169163162094c491611ec991879101613215565b600060405180830381600087803b158015611ee357600080fd5b505af1158015611ef7573d6000803e3d6000fd5b50505050611f64565b60048054604051630588253160e21b81526001600160a01b039091169163162094c491611f319187918791016131fc565b600060405180830381600087803b158015611f4b57600080fd5b505af1158015611f5f573d6000803e3d6000fd5b505050505b80611f6e816133ee565b915050611dd1565b506005546000906001600160a01b0316611f988567016345785d8a00006132f7565b604051600081818185875af1925050503d8060008114611fd4576040519150601f19603f3d011682016040523d82523d6000602084013e611fd9565b606091505b50509050806120215760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610766565b6120338667016345785d8a00006132f7565b3411156120f6573361204d8567016345785d8a00006132f7565b6120579034613316565b604051600081818185875af1925050503d8060008114612093576040519150601f19603f3d011682016040523d82523d6000602084013e612098565b606091505b505080915050806120f65760405162461bcd60e51b815260206004820152602260248201527f4661696c656420746f2073656e64206368616e6765206261636b20746f20757360448201526132b960f11b6064820152608401610766565b5050600160035550505050565b3361210c61162b565b6001600160a01b0316146121325760405162461bcd60e51b81526004016107669061312e565b6001600160a01b0381166121975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610766565b6108cf81612936565b606060006121af8360026132f7565b6121ba9060026132ba565b6001600160401b038111156121df57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612209576020820181803683370190505b509050600360fc1b8160008151811061223257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061226f57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006122938460026132f7565b61229e9060016132ba565b90505b6001811115612332576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106122e057634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061230457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361232b8161335d565b90506122a1565b5083156123815760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610766565b9392505050565b612392828261163a565b610831576123aa816001600160a01b031660146121a0565b6123b58360206121a0565b6040516020016123c6929190612ff9565b60408051601f198184030181529082905262461bcd60e51b8252610766916004016130d7565b6123f6828261163a565b6108315760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561242e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952848660006040516020016124e2929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161250f939291906130a7565b602060405180830381600087803b15801561252957600080fd5b505af115801561253d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125619190612ea5565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120868452929091526125bb9060016132ba565b60008581526020818152604091829020929092558051808301879052808201849052815180820383018152606090910190915280519101205b949350505050565b612606828261163a565b156108315760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080828442038161268557634e487b7160e01b600052601260045260246000fd5b0490506006811161269a57600091505061072c565b601881116126ac57600191505061072c565b603081116126be57600291505061072c565b604881116126d057600391505061072c565b606081116126e257600491505061072c565b607881116126f457600591505061072c565b6090811161270657600691505061072c565b60a8811161271857600791505061072c565b600891505061072c565b60008183106127315781612381565b5090919050565b6060600061274a600f805490506128c6565b90506000600f828154811061276f57634e487b7160e01b600052603260045260246000fd5b90600052602060002001805461278490613391565b80601f01602080910402602001604051908101604052809291908181526020018280546127b090613391565b80156127fd5780601f106127d2576101008083540402835291602001916127fd565b820191906000526020600020905b8154815290600101906020018083116127e057829003601f168201915b50505050509050600f6001600f805490506128189190613316565b8154811061283657634e487b7160e01b600052603260045260246000fd5b90600052602060002001600f838154811061286157634e487b7160e01b600052603260045260246000fd5b9060005260206000200190805461287790613391565b612882929190612a1c565b50600f8054806128a257634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160006128be9190612a97565b905592915050565b60098054600091826128d7836133ee565b9091555050600954600a54604080514260208201526001600160601b03193360601b16918101919091526054810192909252607482015282906094016040516020818303038152906040528051906020012060001c61072c9190613409565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b81600e54141561083157600a5550565b8280546129a490613391565b90600052602060002090601f0160209004810192826129c65760008555612a0c565b82601f106129df57805160ff1916838001178555612a0c565b82800160010185558215612a0c579182015b82811115612a0c5782518255916020019190600101906129f1565b50612a18929150612acd565b5090565b828054612a2890613391565b90600052602060002090601f016020900481019282612a4a5760008555612a0c565b82601f10612a5b5780548555612a0c565b82800160010185558215612a0c57600052602060002091601f016020900482015b82811115612a0c578254825591600101919060010190612a7c565b508054612aa390613391565b6000825580601f10612ab3575050565b601f0160209004906000526020600020908101906108cf91905b5b80821115612a185760008155600101612ace565b80356001600160a01b0381168114612af957600080fd5b919050565b60008083601f840112612b0f578182fd5b5081356001600160401b03811115612b25578182fd5b6020830191508360208260051b8501011115612b4057600080fd5b9250929050565b600082601f830112612b57578081fd5b81356020612b6c612b6783613271565b613241565b80838252828201915082860187848660051b8901011115612b8b578586fd5b855b85811015612bcb5781356001600160401b03811115612baa578788fd5b612bb88a87838c0101612bd8565b8552509284019290840190600101612b8d565b5090979650505050505050565b600082601f830112612be8578081fd5b81356001600160401b03811115612c0157612c0161343f565b612c14601f8201601f1916602001613241565b818152846020838601011115612c28578283fd5b816020850160208301379081016020019190915292915050565b803561ffff81168114612af957600080fd5b600060208284031215612c65578081fd5b61238182612ae2565b600080600060608486031215612c82578182fd5b612c8b84612ae2565b92506020840135612c9b81613455565b9150612ca960408501612c42565b90509250925092565b60008060408385031215612cc4578182fd5b612ccd83612ae2565b915060208301356001600160401b03811115612ce7578182fd5b612cf385828601612bd8565b9150509250929050565b60008060008060008060608789031215612d15578182fd5b86356001600160401b0380821115612d2b578384fd5b612d378a838b01612afe565b90985096506020890135915080821115612d4f578384fd5b818901915089601f830112612d62578384fd5b813581811115612d70578485fd5b8a6020828501011115612d81578485fd5b602083019650809550506040890135915080821115612d9e578384fd5b50612dab89828a01612afe565b979a9699509497509295939492505050565b600060208284031215612dce578081fd5b81356001600160401b03811115612de3578182fd5b6125f484828501612b47565b60008060408385031215612e01578182fd5b82356001600160401b0380821115612e17578384fd5b818501915085601f830112612e2a578384fd5b81356020612e3a612b6783613271565b8083825282820191508286018a848660051b8901011115612e59578889fd5b8896505b84871015612e8257612e6e81612c42565b835260019690960195918301918301612e5d565b5096505086013592505080821115612e98578283fd5b50612cf385828601612b47565b600060208284031215612eb6578081fd5b815161238181613455565b600060208284031215612ed2578081fd5b5035919050565b60008060408385031215612eeb578182fd5b82359150612efb60208401612ae2565b90509250929050565b60008060408385031215612f16578182fd5b50508035926020909101359150565b600060208284031215612f36578081fd5b81356001600160e01b031981168114612381578182fd5b600060208284031215612f5e578081fd5b5051919050565b600060208284031215612f76578081fd5b813560ff81168114612381578182fd5b60008151808452612f9e81602086016020860161332d565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6667656e6573697360c81b815260070190565b67706c6174696e756d60c01b815260080190565b6319dbdb1960e21b815260040190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161302b81601785016020880161332d565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161305c81602884016020880161332d565b01602801949350505050565b6539b4b63b32b960d11b815260060190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60018060a01b03841681528260208201526060604082015260006130ce6060830184612f86565b95945050505050565b6020815260006123816020830184612f86565b60208082526024908201527f4e6f206c6567696f6e6e6169726573206c65667420666f72207075626c69632060408201526373616c6560e01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526025908201527f4f70657261746f7261626c653a2043414c4c45525f4e4f5f4f50455241544f526040820152645f524f4c4560d81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b61ffff831681526040602082015260006125f46040830184612f86565b8281526040602082015260006125f46040830184612f86565b908152604060208201819052600b908201526a383630b1b2b437b63232b960a91b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156132695761326961343f565b604052919050565b60006001600160401b0382111561328a5761328a61343f565b5060051b60200190565b600061ffff8083168185168083038211156132b1576132b1613429565b01949350505050565b600082198211156132cd576132cd613429565b500190565b600060ff821660ff84168060ff038211156132ef576132ef613429565b019392505050565b600081600019048311821515161561331157613311613429565b500290565b60008282101561332857613328613429565b500390565b60005b83811015613348578181015183820152602001613330565b83811115613357576000848401525b50505050565b60008161336c5761336c613429565b506000190190565b600060ff82168061338757613387613429565b6000190192915050565b600181811c908216806133a557607f821691505b602082108114156133c657634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff808316818114156133e4576133e4613429565b6001019392505050565b600060001982141561340257613402613429565b5060010190565b60008261342457634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146108cf57600080fdfe7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a2646970667358221220577dd292643c659ce7ad0ab519ba06152a98e1eff0e93c5df4547a0c100914ac64736f6c63430008040033

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

000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f8000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f80000000000000000000000005041a99684d38e280e4b0b356185bf18c991f88b000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

-----Decoded View---------------
Arg [0] : _operator (address): 0x261a2FeaA8DdCBBb3347Fa4409A26D41DC1827f8
Arg [1] : _uriSetter (address): 0x261a2FeaA8DdCBBb3347Fa4409A26D41DC1827f8
Arg [2] : _legionnaire (address): 0x5041A99684D38e280e4B0B356185BF18c991F88B
Arg [3] : _vrfCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [4] : _link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [5] : _keyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [6] : _fee (uint256): 2000000000000000000

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f8
Arg [1] : 000000000000000000000000261a2feaa8ddcbbb3347fa4409a26d41dc1827f8
Arg [2] : 0000000000000000000000005041a99684d38e280e4b0b356185bf18c991f88b
Arg [3] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [4] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [5] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [6] : 0000000000000000000000000000000000000000000000001bc16d674ec80000


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  ]

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.